adamodar
Active Member
I have a very interesting requirement in hand:
User wants to run a report for the Parent Address Number (PA8) even when the user in inputing the Address Number (AN8) in the external data selection. ie in simple terms,
Lets assume for Address Number 1900001, the Address Number Parent is 1900002,
so, when user inputs:
<font class="small">Code:</font><hr /><pre>Where BC Address Number (F03012)(AN8) is equal to "1900001"
And BC Document Company (F03012)(KCO) is equal to "03012" </pre><hr />
JDE should interpret it as:
<font class="small">Code:</font><hr /><pre>Where BC Address Number (F03012)(AN8) is equal to "1900002"
And BC Document Company (F03012)(KCO) is equal to "03012" </pre><hr />
I was easily able to do this by adding a second section which runs on this external data selection, a work file to maintain relation between AN8, PA8 and KCO and running the original driver section (which is now conditional) with internal dataselection as shown below:
Lets assume F55208N9 holds the relation:
<font class="small">Code:</font><hr /><pre>Select from F55208N9 with UKID = "XXX"
fetch next
VA evt_TempAddress_AN8 <- TK Address Number - Parent
VA evt_TempDocComp_KCO <- TK Document Company
While SV File_IO_Status is equal to CO SUCCESS
Set User Selection(BC Address Number (F03012)(AN8), <Equal To>, VA evt_TempAddress_AN8, <And>)
Set User Selection(BC Document Company (F03012)(KCO), <Equal To>, VA evt_TempDocComp_KCO, <And>)
fetch next
VA evt_TempAddress_AN8 <- TK Address Number - Parent
VA evt_TempDocComp_KCO <- TK Document Company
End While </pre><hr />
But when we think of it, this would have been much faster and efficient if we were somehow to edit the external data selecton before the initialise section. Any idea on how to do it using C BSFN? to make it look like:
<font class="small">Code:</font><hr /><pre>select * from PRODDTA.F03B12
where AN8 in (select PA8 from PRODDTA.F03B12 where "external data selecton condition");</pre><hr />
User wants to run a report for the Parent Address Number (PA8) even when the user in inputing the Address Number (AN8) in the external data selection. ie in simple terms,
Lets assume for Address Number 1900001, the Address Number Parent is 1900002,
so, when user inputs:
<font class="small">Code:</font><hr /><pre>Where BC Address Number (F03012)(AN8) is equal to "1900001"
And BC Document Company (F03012)(KCO) is equal to "03012" </pre><hr />
JDE should interpret it as:
<font class="small">Code:</font><hr /><pre>Where BC Address Number (F03012)(AN8) is equal to "1900002"
And BC Document Company (F03012)(KCO) is equal to "03012" </pre><hr />
I was easily able to do this by adding a second section which runs on this external data selection, a work file to maintain relation between AN8, PA8 and KCO and running the original driver section (which is now conditional) with internal dataselection as shown below:
Lets assume F55208N9 holds the relation:
<font class="small">Code:</font><hr /><pre>Select from F55208N9 with UKID = "XXX"
fetch next
VA evt_TempAddress_AN8 <- TK Address Number - Parent
VA evt_TempDocComp_KCO <- TK Document Company
While SV File_IO_Status is equal to CO SUCCESS
Set User Selection(BC Address Number (F03012)(AN8), <Equal To>, VA evt_TempAddress_AN8, <And>)
Set User Selection(BC Document Company (F03012)(KCO), <Equal To>, VA evt_TempDocComp_KCO, <And>)
fetch next
VA evt_TempAddress_AN8 <- TK Address Number - Parent
VA evt_TempDocComp_KCO <- TK Document Company
End While </pre><hr />
But when we think of it, this would have been much faster and efficient if we were somehow to edit the external data selecton before the initialise section. Any idea on how to do it using C BSFN? to make it look like:
<font class="small">Code:</font><hr /><pre>select * from PRODDTA.F03B12
where AN8 in (select PA8 from PRODDTA.F03B12 where "external data selecton condition");</pre><hr />