Calling UBE interconnect inside a While Loop

ytseplayer

Member
Hello All and thanks for viewing my first post.

I’m having an issue with the UBE interconnect function that has me pulling my hair out a bit. Due to the limited SQL vocabulary in JDE, I have to create a report that generates a list of salesmen over multiple product lines. Once this is populated into a Workfile, I then use a WHILE loop to call the main report via Report Interconnect—populating my PO for the main report from the Workfile.

It works fine until the second report finishes for the first time and then dies when it tries to get the next salesman code from the Workfile. My question is this: can you call the RI function in a WHILE loop?

Here is the code to call the RI:

Listing of ER for Report: Sales Territory Status Report - All Sales Regions (R5642008B)

***********************************************************************
GLOBALS: Global Variable
***********************************************************************
rpt_FormingSalesman_AC10
rpt_PressSalesman_AC11
rpt_DryerSalesman_AC12
rpt_Jobnumber_JOBS
rpt_SalesmanCodeOrSomething

=======================================================================
SECTION: Sales Order Detail and Address Book File [GROUP SECTION] (S1)
=======================================================================
OBJECT: SECTION
EVENT: Initialize Section
-----------------------------------------------------------------------
0001 X0010 - Get Next Number
"00" -> szSystemCode
"4" -> mnNextNumberingIndexNo
"00000" -> szCompanyKey
"<Blank>" -> szDocumentType
"<Zero>" -> mnCentury
"<Zero>" -> mnFiscalYear1
"<Blank>" -> szSameAsDocumentType
VA rpt_Jobnumber_JOBS <- mnNextNumber001

-----------------------------------------------------------------------
EVENT: Do Section
-----------------------------------------------------------------------
0001 //
0002 Suppress Section Write
0003 //
0004 VA rpt_FormingSalesman_AC10 = ""
0005 VA rpt_PressSalesman_AC11 = ""
0006 VA rpt_DryerSalesman_AC12 = ""
0007 //
0008 F0101.Fetch Single
BC Address Number - Ship To = TK Address Number
VA rpt_FormingSalesman_AC10 <- TK Category Code - Address Book 10
VA rpt_PressSalesman_AC11 <- TK Sales Region
VA rpt_DryerSalesman_AC12 <- TK Category Code - Address Book 12
0009 //
0010 //
0011 If BC Line of Business (F4211) is equal to "BES,FOR"
0012 If VA rpt_FormingSalesman_AC10 is greater than <Blank>
0013 F5642009.Insert
VA rpt_FormingSalesman_AC10 -> TK Sales Region
VA rpt_Jobnumber_JOBS -> TK Job Number
0014 End If
0015 End If
0016 //
0017 If BC Line of Business (F4211) is equal to "PRE,SPL"
0018 If VA rpt_PressSalesman_AC11 is greater than <Blank>
0019 F5642009.Insert
VA rpt_PressSalesman_AC11 -> TK Sales Region
VA rpt_Jobnumber_JOBS -> TK Job Number
0020 End If
0021 End If
0022 //
0023 If BC Line of Business (F4211) is equal to "DRY"
0024 If VA rpt_DryerSalesman_AC12 is greater than <Blank>
0025 F5642009.Insert
VA rpt_DryerSalesman_AC12 -> TK Sales Region
VA rpt_Jobnumber_JOBS -> TK Job Number
0026 End If
0027 End If
0028 //
0029 //
0030 //

-----------------------------------------------------------------------
EVENT: End Section
-----------------------------------------------------------------------
0001 //
0002 F5642009.Select
VA rpt_Jobnumber_JOBS = TK Job Number
0003 F5642009.Fetch Next
VA rpt_SalesmanCodeOrSomething <- TK Sales Region
0004 While SV File_IO_Status is equal to CO SUCCESS
0005 CALL( UBE:R5642008A , Ver: PO VersionName )
VA rpt_SalesmanCodeOrSomething -> szReportCodeAddBook011
PO VersionName X Version
0006 F5642009.Fetch Next
VA rpt_SalesmanCodeOrSomething <- TK Sales Region
0007 End While
0008 //
0009 F5642009.Delete
VA rpt_Jobnumber_JOBS = TK Job Number
0010 //
0011 //
0012 //
0013 //
0014 //


Thanks in advance for any help!

-rg
 
Hi Ronald,

First of all, welcome aboard!

Some questions:

Q1.) Where are running your UBEs (on server or locally)?
Q2.) How you call 2nd UBE (sync, async)?

Maybe Transaction Processing cause the problem.

Try to clear the Transaction Processing Enabled check-mark on the Advanced tab of Report Properties.

Let us know, how does it work.

Good luck,

Zoltán
 
Ronald,

I would say Zoltan is probably on the right track as for why you are getting that strange behavior.

I have one observation...couldn't you change the RI structure to pass just the Job Number and then run the R5642008A once for all VA rpt_SalesmanCodeOrSomething values. Use a page break after if you need them separated. This would eliminate the while loop.

Good luck.
 
Hi Zoltan,

Thank you for responding to my problem. First of all...it's working =
now! I
did some troubleshooting that seemed to resolve the issue. I recreated =
my
versions on both reports, reassigned my PO variable, exited, deleted
dddict/gbltbl files, restarted jde and it worked. JDE is so flaky. I =
am
running locally on a fat client so we'll see how it stands up after a =
build.
It is running synchronously as well. I've only been developing in JDE =
for
about a year so there are still some things to learn. I was glad to =
come
across this forum; JDE resources are pretty tough to find. If I run =
into
more problems, I'll try your suggestion about Transaction Processing
settings.=20

Thanks again for your help; have a great weekend!

-rg=20

=20
 
Hi Zoltan,

Thank you for responding to my problem. First of all...it's working now! I did some troubleshooting that seemed to resolve the issue. I recreated my versions on both reports, reassigned my PO variable, exited, deleted dddict/gbltbl files, restarted jde and it worked. JDE is so flaky. I am running locally on a fat client so we'll see how it stands up after a build. It is running synchronously as well. I've only been developing in JDE for about a year so there are still some things to learn. I was glad to come across this forum; JDE resources are pretty tough to find. If I run into more problems, I'll try your suggestion about Transaction Processing settings.

Thanks again for your help; have a great weekend!

-rg
 
Ronald, Jeremy

Jeremy wrote:
"Use a page break after if you need them separated. This would eliminate the while loop."

I am not understand corrrectly, but also could be a solution to process custom table record without while loop, to run a conditional section based on a BSVW over the custom table.

Ronald,

Glad to hear that your problem has been solved.

I have a general rule for development in OW:

If something doesn't work as I planned, after some minutes of bug huntig, exit OW, delete the six spec file, sign-on again and check that does the problem still exist. This is basicly true for the following situation:

- Added new Form to an APPL
- modified FORM or UBE interconnect DSTR
- modified PO for an APPL or UBE
- BSFN adds and mods
- TBLE or BSVW changed
- etc.

Regards,

Zoltán
 
Hi Jeremy,

Thanks for the reply. I thought of that as a back up (about 5:00am this
morning) and will do exactly that if it blows up after it's built on the
server. At least there's an alternative.....=)

Off topic question...Have you attended any of the JDE/Peoplesoft classes?
I'm heading to Toronto for two weeks in March and would like to get a feel
for what to expect. I'll be taking Development Tools 8.0 Part I and the
Development Tools 8.0 Part II classes.

Thanks for the info--greatly appreciated.

-rg
 
Zoltan,

Sorry about my confusing statement. When I'm typing, I make perfect sense to myself :) What I meant to state was that by running his UBE by job# for ALL values of 'salesmanorsomething', he would not need the while loop.

I was also trying to convey that if the reason he was running the UBE once for every value of 'salesmanorsomething' was to have separate reports for each, then he could have a level break on this field and do a page break after each.
 
Back
Top