on 05-28-2012 4:57 PM
Hi
This is a file to SAP scenario.
I have a txt file with header,1,body,*,Footer,1
I understand that I can read this txt file using the keyfield concept....But what if the sender application is not ready to add the key field in the txt file..??
...what are my options ??
Hi,
Try using the record sequence as variable which points the unique number for each record set.
Like PO number is unique per one set of "header,1,body,*,Footer,1"- PO number repeats in 1 set. .
In the mapping consider the fist line as header, rest all body except the last one as footer.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hema,
Actually, here is what SAP Help says about the Key Field Name:
If you have entered a variable number of substructures under Recordset Structure, that is, you have entered the value * for at least one structure, specify a Key Field Name. [...] you must specify a key field, and the field name must occur in all substructures.
Based on this, it looks like Key Field is mandatory for FCC in case any structure has variable occurrence. If you still want to experiment (which might prove worth it, but I'm not sure), simply try omitting this field in configuration and see what happens - whether PI raises an error, or is still able to interpret the file content properly, as the "human logic" says: first line is header, last line is footer, the rest are items.
If this doesn't help, and the sender is really unable to send key field values, then you have one more option. Read the whole lines of the file into one single fields, then use some pre-mapping (Java one would be most suitable, I think) that will manually do the FCC for your scenario. You could also think of developing your own adapter module, but this might be the most difficult option of those that I mentioned.
Regards,
Greg
Hi,
I have a similar scenario FILE to SOAP, in which I need to map complete content of flat file into a single xml node in the target structure.
I have used sender File Adapter(FCC), and maintained FCC parameters as used by you above.
But i doesn't read whole file into one field, but rather each line to a separate node.
Can you please suggest possible ways to achieve this.
i.e.
My Source File is like
34100000 020261156501000156 00910 000000008051
34100011C2010000 261156501000156 00910 000000008051
34100011C2010000 261156501000157 00910 000000008051
And what i want is
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_conteudoTexto xmlns:ns=http://xi.sap.com/abc>
- <conteudoTexto>
<conteudoTexto>34100000 020261156501000156 00910 000000008051
34100011C2010000 261156501000156 00910 000000008051
34100011C2010000 261156501000157 00910 000000008051
</conteudoTexto>
But what i am getting is
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_conteudoTexto xmlns:ns=http://xi.sap.com/abc>
<conteudoTexto>
<conteudoTexto>34100000 020261156501000156 00910 000000008051</conteudoTexto>
<conteudoTexto>34100011C2010000 261156501000156 00910 000000008051</conteudoTexto>
<conteudoTexto>34100011C2010000 261156501000157 00910 000000008051</conteudoTexto>
</conteudoTexto>
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.