on 04-17-2014 6:36 AM
Hi Frndz,
i have a file structure below.
Header ( have identifier) --Ex:Record starts with AA we consider as Header
Detail (( without identifier)
Footer( have identifier) --Ex: Record starts with BB we consider as Footer
But in detail we dont have an identifier to read the record.
But my requirement is i wanna read the file and delete the header and footer and process in sap xi.how we can achieve this?
Regards,
Narendra
Hi Narendra
Create a generic data type like below for you sender structure
MT_xxxxxxxxxxxx
row---0 to unbound
Data....0 to 1
Use file content conversion to generate this structure.
Then in the mapping check the content of field 'Data' . if it starts with AA or AB then ignore it.
Else process the Data and generate your target structure based on data. You need to write an UDF
and split the whole line into target fields.
Let me know if you have any doubt.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I have already mentioned in my first reply how you can read details information without identifier.
You have to create a generic structure like below
MT_xxxxxxxxxxxx
row---0 to unbound
Data....0 to 1
So if you input file is like below
AA123bcdf5345 (header )
354556565656 (detail)
56546757676576 (detail )
BB465465464 (footer )
after content conversion the xml message will be like below in PI
MT_XXXXXXXXXXXXXX
<row >
<data>AA123bcdf5345</data>
<data>354556565656</data>
<data>56546757676576</data>
<data>BB465465464</data>
</row>
Then in the graphical mapping you need to write an UDF to read the whole line for exmaple
'35455abc65656' and split it into multiple values based on your target structure.
Hi Narendra,
You can filter in your mapping to not map rows with the idetifier to your target.
As in,
1. Read the file
2. In mapping have an UDF which reads only the rows which do not start with Header & Footer Identifier (like AA & BB, as you mentioned)
3. So now, your target will have only the records which do not have identifier i.e. Details record.
You can also have two mappings, one to filter header & footer records & another mappnig to map fields as per your functional requirement.
Thanks,
Vani Prathibha MNS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.