on 04-30-2010 7:42 AM
Hi All,
I have a scenario where GL transactional data from a database is to be uploaded into SAP. Basically a file is being created at the receiver side which will be uploaded.
While mapping the source and the target fields I have to check that the line items for a particular document are not exceeding 999. If the number exceeds 999 then the document has to be split into two. While doing so I have to also check that the document amount for all the line items is netting to zero. If it does not comes out to be zero then I have to introduce a suspension line item which will net the amount to zero.
Can anyone suggest how to achive this? Do I need to create a advanced UDF and write a java code?
Thanks,
Aparna
> While mapping the source and the target fields I have to check that the line items for a particular document are not exceeding 999. If the number exceeds 999 then the document has to be split into two.
This is very complex to do this in mapping. You can do this with a combination of:
index - divide (999) - floor - splitbyvalue(eachvalue)
and other node functions like collapsecontext and fromatbyexample
As I assume that you want to use IDOC as target, I recommend using a two tier mappiing and create an intermediate structure to do only th split in first mapping.
Have you thought about splitting the incoming file in file adapter?
> While doing so I have to also check that the document amount for all the line items is netting to zero. If it does not comes out to be zero then I have to introduce a suspension line item which will net the amount to zero.
This is a bad idea. Mapping should not invent data, especially not in G/L accounts.
But if you really want this, you can add an additional line by clicking on target node and use "dublicate subtree" and use sum function to create the additional entry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please elaborate the java code for checking whether the number of line items are more than 999 as I dont know much of java. In the input parameter do we have to pass the array of document no?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aparna,
While mapping the source and the target fields I have to check that the line items for a particular document are not exceeding 999. If the number exceeds 999 then the document has to be split into two.
For this you write one Advanced UDF check for every 999 records, you create one message by splitting target node simply by
if(a<i>==999)
result.addvalue('"");
While doing so I have to also check that the document amount for all the line items is netting to zero. If it does not comes out to be zero then I have to introduce a suspension line item which will net the amount to zero.
For this you check sum of all that line items are zero or not by using arithimetic function if it is not comes to zero then use CREATEIF node to create one suspension line item.
thanks,
madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.