Runtime manipulation of external data-selection

adamodar

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 />
 
Arjun,

It might be simpler to use the original data selection that the use puts in and use a non printing section to return the data in PA8 order (section sequence). Then link a second printing section to to run when the PA8 changes (level break on PA8) to call and report on each PA8.
 
Hi peter,

I don't think I'll be able to use this method.. main reason being I have a page break on PA8 and section breaks on AN8 and KCO.. I also have many level breaks to get amount totals on AN8, KCO and PA8 changes.. So in this case, ie, inorder to avoid further complications, I'll need the etire query of the section to be formed in the initial section of the print section..
frown.gif
 
Back
Top