on 03-04-2014 7:15 PM
Hi all,
I need help with java code please.
My source is a csv file and target is multiple idocs.
Source file structure is as follows:
Header (field 1, field 2, ........ field 10)
Item 1a (field 1, field 2, field 3, ......... field 180)
Item 1b (field 1, field 2, field 3, ......... field 180)
Item 2a (field 1, field 2, field 3, ......... field 180)
Item 2b (field 1, field 2, field 3, ......... field 180)
.
.
.
Item na (field 1, field 2, field 3, ......... field 180)
Item nb (field 1, field 2, field 3, ......... field 180)
First line is header. Second is VAT line. Third is Price line for that VAT. Now VAT and Price lines repeat. There need not be VAT line for non-European countries. So a VAT line may or may not preceed a Price line.
For example: the lines can be like:
Header
VAT1
Price1
VAT2
Price2
Price3
1) Now, it should produce 3 idocs like:
Header, VAT1, Price1
Header, VAT2, Price2
Header, Price3
2) One idoc should be created per a pair of VAT and Price lines and they will be identified by a co-relation of a particular field. So first I have to sort all the lines based on this field value. Then I have to read the lines in pairs. If no Vat line, I should just read the Price item and produce an idoc.
Can you please help me with the java code for this?
Many thanks in advance.
Ramesh.
Try to see if you get any clue on field value for priceline, VAT line, like say the text "FF" will always be there in VAT line, or price line.
Based on this you can segregate these lines and use XSLT, Java code to create the structure you want.
--Divyesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
You can go with normal message mapping for this requirement. Any reason for opting Java mapping in this scenario.
Read the VAT and Price line as Recordset (Use Variable in Recordset sequence in FCC)
Create IDoc for every record set. Map Price record fields and VAT record fields accordingly.
Regards,
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many thanks Ram.
The reason for thinking to go for java mapping is that there is no keyfield for price line. The source file is a pipe delimited csv file. There is a keyfield for VAT line. The same field will be empty for the Price line. I am trying to ask them to at least provide a space for that field between the pipes for price line so that I can use in FCC. It looks like they can't modify the source file.
Any inputs please?
Regards.
Ramesh.
did u try using recordset structure in the sender file adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
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.