cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File adpter --File content conversion

Former Member
0 Kudos

Hi

I had a scenario File to proxy(target is 3 fields),

My input is flat file and i want to conver it into XML using FCC like

For example---my file is like below.comma seprated

01,021000021,G4886704,080919,0742,001,,,2

the data upto the first comma (01) must go to the field1,

the data from first comma to second comma( 021000021) must go the field2

and the remaining data (G4886704,080919,0742,001,,,2) must go to the field3

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_FILE_SENDER_ xmlns:ns0="http://loreal.com/fi/fi180.07">

<RECORD>

<ROW>

<field1>01</field1>

<field2>021000021</field2>

<field3>G4886704,080919,0742,001,,,2</field3>

</ROW>

</RECORD>

</ns0:MT_FILE_SENDER>

I had configured, IR and in ID I am not getting what to give in file content conversion tab to have output like above.

Can any body please suggest? Any help will be highly appriciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thaka for all your answers

vijay_b4
Active Contributor
0 Kudos

Hi Srinivas,

try this.....

I think your input format(comma sepearted file) is a CSV format.

In the ID:

select Message Protocol: File content conversion.

Specify this values in fcc:

Document name,namespace,recordset name,recordset structure(EG: Header,1,Item,*)and key field name.

Header.fieldNames - (specify all your header field names)

Header.fieldSeparator - ,

Header.keyFieldValue - H

Header.endSeparator - 'nl'

Item.fieldNames - (specify all your item field names)

Item.fieldSeparator - ,

Item.keyFieldValue - I

Item.endSeparator -'nl'

Thanks & Regards,

Pragathi.

Former Member
0 Kudos

Hi Pragathi,

I had variable number of fields in the file

01,021000021,G4886704,080919,0742,001,,,2

02,021000021,G4886704,080919,0742,001,,,2

03,000000135073477,,010,105303839,,,015,489113155,,,045,489039455,,,072,73700

i want to map 1 to 1 to target(proxy).

Let me know how can i do the FCC for this scenario.

Regards

Srinivas

Shabarish_Nair
Active Contributor
0 Kudos

your req. cannot be done in FCC

its better to write a java mapping with simple string functions in your case to achieve the result.

Former Member
0 Kudos

Hi Vijay,

sorry for misleading you.

My question is, how can i get the source payload like below

I had a scenario File(3 fields) to proxy(target is 3 fields),

My input is flat file and i want to conver it into XML using FCC like

For example---my input file is like below.comma seprated

01,021000021,G4886704,080919,0742,001,,,2

the data upto the first comma (01) must go to the field1,

the data from first comma to second comma( 021000021) must go the field2

and the remaining data (G4886704,080919,0742,001,,,2) must go to the field3

SENDER Payload must be as below

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_FILE_SENDER_ xmlns:ns0="http://loreal.com/fi/fi180.07">

<RECORD>

<ROW>

<field1>01</field1>

<field2>021000021</field2>

<field3>G4886704,080919,0742,001,,,2</field3>

</ROW>

</RECORD>

</ns0:MT_FILE_SENDER>

I had configured, IR and in ID I am not getting what to give in file content conversion tab.

Can any body please suggest? Any help will be highly appriciated.

Regards

Srinivas

Former Member
0 Kudos

Need to develop module for doing so.

no standard of way doing so with FCC

Rajesh

Shabarish_Nair
Active Contributor
0 Kudos

Hi Srinivas,

I did get your req.

Unfortunately FCC cannot handle what you need.

The easiest way for you to do is to write a java mapping as i had mentioned else a module.

Former Member
0 Kudos

Vijay/Rajesh

Thanks for your answers,

can you guide me how can i write the java mapping for this scenario,

Thanks

Srinivas

Former Member
0 Kudos

As a cheap trick you could use the data, that your FCC delivers like this:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_FILE_SENDER_ xmlns:ns0="http://loreal.com/fi/fi180.07">

<RECORD>

<ROW>

<field1>01</field1>

<field2>021000021</field2>

<field3a>G4886704</field3a>

<field3b>080919</field3b>

<field3c>0742</field3c>

<field3d>001</field3d>

<field3e></field3e>

<field3f></field3f>

<field3g>2</field3g>

</ROW>

</RECORD>

</ns0:MT_FILE_SENDER>

Then you do a message mapping from this message to your required message and you just concatenate the field3-entrys with "," as separator:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_FILE_SENDER_ xmlns:ns0="http://loreal.com/fi/fi180.07">

<RECORD>

<ROW>

<field1>01</field1>

<field2>021000021</field2>

<field3>G4886704,080919,0742,001,,,2</field3>

</ROW>

</RECORD>

</ns0:MT_FILE_SENDER>

Make sure that empty fields are produced in FCC.

Regards,

Heinrich

Former Member
0 Kudos

Hi!

you can also achive the above requirement without FCC in file adapter

just go through this blog its really nice one..

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13292] [original link is broken] [original link is broken] [original link is broken];

[http://help.sap.com/saphelp_nwpi71/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm]

Regards::

Amar Sriinivas Eli

Former Member
0 Kudos

Thanks for all your answers,there is change in my requirement.

My Scneario is File to Proxy

For example---my input file is like below.a comma seprated file.

01,021000021,G4886704,080919,0742,001,,,2

02,021000021,G4886704,080919,0742,001,,,2

Now i want to pass the file to the Proxy.one to one mapping.

In the proxy i will submit the file to the SAP standard program for further processing.

Now my issue, what will be the file content coversion for the sender file adapter.

I had configured, IR and in ID I am not getting what to give in file content conversion tab.

Can any body please suggest? Any help will be highly appriciated.