cancel
Showing results for 
Search instead for 
Did you mean: 

How XI will read the .txt file

Former Member
0 Kudos

Experts,

i AM WORKING ON A FILE BAPI synchrounous scenario.

Sender will drop the required file on XI directory and XI will pull the file and map it with the BAPI u2013 and crate services entries in SAP SCM. If errors are encountered during the process they are returned to the client in a report or as erroneous file.

*I have a .txt file( tab delimitted file) in the folowing structure

H NAME date sex data_txt 676869*

C a b c

C d e f

H name Account brat abcc 12333

C a b c

C d e f hjhdkf

like this multiple entries, ll be getting .

Based on H ( indicator), Have to get the data. How will I do in XI file adapter? Please help me how should I design the file adapter so that It can read the .txt file.

I have created the sender data type similarly to the structure of BAPI.

Note; H indicates teh Header and D indicates teh sublines. Together it is called one service entry. Aagain Next 'H' indicates the strat of next service entry.

Thanks

Veeru

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Viru,

You have to use FCC parameters of File Adapter. It will be helpful if you will provide the structure in which you want to form the XML.Then we can help you out with the FCC parameters.

Thanks

Nutan

Former Member
0 Kudos

Nutan,

Thanks for ur reply. Shall I Send teh structure via email then u can look at it properly. Can I have ur email id.

Thanks

Veeru

Former Member
0 Kudos

Hi Viru,

As per the structure it seems

Recordset Structure Header,1,Detail,*

Key Field Name Name of the field such as Key(That is H,D,A)

Key Field Type String

Header.fieldName Key,TCL,Begin,End

Header.keyFieldValue H

Header.keyFieldlnStucture ignore

Detail.fieldName Key,TCL,Begin,End

DEtail.keyFieldValue D

I believe something like this.....let me know for further help.

Kindly go through this link this is an example of similar issue:

http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/

This below link will guide you a lot.......

http://help.sap.com/saphelp_srm40/helpdata/ru/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Thanks

Nutan

Former Member
0 Kudos

Nutan,

I want the flat file data in teh following xml format

<Records>

<Header>

<Item>

<data1>1</data1>

<data2>2</data2>

</item>

</header>

<Header1>

<Item>

<data1>1</data1>

<data2>2</data2>

</item>

</header1>

</Records>

Records-- o to unbounded

Header--- 0 to 1

header1-- 0 to 1

Item--- 0 to unbounded

My input .txt file , fields are separated by a tab. I mean its a tab delimitted file.

The main tag Records is 0 to unbounded.

How to do the content conversion for the same.

Thanks

Veeru

Edited by: viru srivastava on Dec 20, 2009 2:56 AM

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

http://www.riyaz.net/blog/xipi-file-content-conversion-for-simple-structure/'

refer above link,it explained clearly,apply the same.

Regards,

Raj

Former Member
0 Kudos

Thanks Raj shekhar,

It helped me a lot. Let me know one thing, In my scenario have to use node functions while mapping the source data to BAPI data. Its not a straight mapping, ( one to one mapping). I mean, in many cases, have to hardcode a value, have to use if else condition etccc.

My question is , Do I need to do all this rigrous mapping, becoz am under the impression when we are using BAPI, it s all one to one mapping?

Please confirm/help.

Thanks

Veeru

Former Member
0 Kudos

Thanks Raj shekhar,

It helped me a lot. Let me know one thing, In my scenario have to use node functions while mapping the source data to BAPI data. Its not a straight mapping, ( one to one mapping). I mean, in many cases, have to hardcode a value, have to use if else condition etccc.

My question is , Do I need to do all this rigrous mapping, becoz am under the impression when we are using BAPI, it s all one to one mapping?

Please confirm/help.

Thanks

Veeru

Former Member
0 Kudos

Raj shekhar,

Thanks for your answer. It helped me a lot. Let me know one thing, In my scenario have to use node functions while mapping the source data to BAPI data. Its not a straight mapping, ( one to one mapping). I mean, in many cases, have to hardcode a value, have to use if else condition etccc.

My question is , Do I need to do all this rigrous mapping, becoz am under the impression when we are using BAPI, it s all one to one mapping?

Please confirm/help.

Thanks

Veeru

Former Member
0 Kudos

Raj shekhar,

Thanks for your answer. It helped me a lot. Let me know one thing, In my scenario have to use node functions while mapping the source data to BAPI data. Its not a straight mapping, ( one to one mapping). I mean, in many cases, have to hardcode a value, have to use if else condition etccc.

My question is , Do I need to do all this rigrous mapping, becoz am under the impression when we are using BAPI, it s all one to one mapping?

Please confirm/help.

Thanks

Veeru

former_member194786
Active Contributor
0 Kudos

Hi Veeru,

It depends on the requirement that you have. If the target system expects the data in the same format as it is coming in, you do not have to do any mapping.

Regards,

Sanjeev.

Former Member
0 Kudos

Thanks a lot for your Reply Nutan. I really appreciate your answer.

Former Member
0 Kudos

Thanks a lot for your Reply Nutan. I really appreciate your answer.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Viiru,

You can use the content coversion parameter .