Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping issue

Status
Not open for further replies.

DSTXEAI

Technical User
Aug 1, 2006
15
IN
Hi all,

Is it possible to loop a functional map n+1 time.

For example:
I have a functional map F_Invoice(GL_account:ln1)
The occurence of GL_account is 2 times in the input file and I want the functional map to be looped 3 times.

Please advise on this.

Thanks
Suresh.k
 
Why would you want to do that. You don't have a third value for GL_account:In1.
 
Hi Janhes,

There is no third record for GL_account. We need to loop it for n+1 times.

Thanks
Suresh.k
 
The functional map can't run if you don't pass it data.
 
What you could do is run the functional map for each input and have a second output card to run it once with dummy data and append your output to card 1.
 
What do you expect as output for the 3rd run of the functional map, with no input data? What are you trying to create?


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Boca!!!!! Where ya been????

I guess you asked my question, Based on the objective there might be another way to skin the cat. (ooops, sorry animal lovers)
 
Hi,

For the 3rd run I have to map the values from the different tags to the same Output group and not from the GL_ACCOUNT group. But the Line number should be in serial.

The output I am expecting is as follows:

<E1BPACCR09 SEGMENT="1">
<ITEMNO_ACC>0000000001</ITEMNO_ACC>
.......
.......
</E1BPACCR09>
<E1BPACCR09 SEGMENT="1">
<ITEMNO_ACC>0000000002</ITEMNO_ACC>
.......
.......
</E1BPACCR09>
<E1BPACCR09 SEGMENT="1">
<ITEMNO_ACC>0000000003</ITEMNO_ACC>
.......
.......
</E1BPACCR09>

Janhes,

I tried taking a second output card and appended the results to the first card.But the output is getting appended at the end of the file. I am expecting it in the same GL_account group.


Thanks,
Suresh.k

 
Append in a second card would add to the end of the file. Without using a sort step you'll have problems with append.

There are several ways to knock this out. Assuming your input is grouped by account and you have a defined looping structure, your output could be created in groups.


GL_Account_Group (0:S) Pass all input related to group
--GL_account_norm (1:s) Pass all normal invoice input
--GL_account_last Pass input for last or +1 invoice

Based on your input the above may be hard to do...
 
You can force a functional map to run as many times as you want by providing an appropriate sequence of that cardinality. Simply add one more parameter

CLONE("X", <cardinanity>)

to the call of the map. Note, however, that you thanTo stop mercator from multiplying that sequence with the "real" input data (i.e. building the cartesian product), you have to provide the containing structure instead of the input series, e.g.

F_Invoice(ln1, CLONE("X", 3))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top