on 03-08-2009 12:58 AM
I have a flat file which has multiple header and detail lines. This flat file will later mapped to ACC_DOCUMENT03 IDOC and post it to SAP.
-doc1
-
header
-
cocode
-
docdate
-
postingdate
-
currencycode
-
detail
-
glaccount
-
itemno
-
costcenter
-
detail
-
glaccount
-
itemno
-
costcenter
I need to have a counter to track the number of detail lines in ACC_DOCUMENT03 IDOC target field in ITEM_TEXT.
for example this is the flat file
HDR,US00,20080102,20080102,USD
DTL,32456,1,CC0001
DTL,32456,2,CC0001
HDR,US00,20080102,20080102,USD
DTL,32458,1,CC0002
DTL,32458,2,CC0002
HDR,US00,20080102,20080102,USD
DTL,32459,1,CC0001
DTL,32459,2,CC0001
So every detail line in ITEM_TEXT, I need to put 1,2,3,4,5,6 and so on.
I tried to use global container to keep track the line counter but it doesn't work. Can anyone please help?
Edited by: Kam Weng Leong on Mar 8, 2009 1:58 AM
Edited by: Kam Weng Leong on Mar 8, 2009 2:00 AM
You can use Count function in the message mapping to populate.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kam,
I believe, u can use xslt mapping for this where u can use count function for each 'details', whenever it find details tag it will increment the counter for details field. which u can add in the output file. After that you can try message mapping if required.
I believe it will work.
regards
ram
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.