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
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