cancel
Showing results for 
Search instead for 
Did you mean: 

Split Single IDoc in to Multiple files

manikandan_shanmugam3
Active Participant
0 Kudos

Hi All,

Scenario: IDoc to Flat File

(PO 7.4)

Scenario: We are getting a single IDoc which will have two segment mostly and single segment sometimes depends on functionality at ECC.

Requirement:Create two flat files one for each segment if IDoc has two segment( IDoc segment will have an identifier ) else if IDoc has a single segment, create a flat file for a particular segment and create one empty file and send it to a target system.

File name(As of now, below is still on discussion whether we should use static file name differentiating two files or dynamic from the data)

the Identifier has to be appended in the file name.

e,x.

Identifier is ABC, XYZ in two segments file name should be XXXX_ABC_XXXX.csv and XXXX_XYZ_XXXX.csv

Regards,

Mani

Accepted Solutions (0)

Answers (1)

Answers (1)

maheswarareddykonda
Active Contributor
0 Kudos

Hi Manikandan,

you can follow below steps,

sender:

1.use your idoc

Receiver:

1.create message type(this is for first seqment data)

2.create service interface(this is for first MT)

3.again create one more MT(this is for second seqment)

4.create another SI(this is for second MT)

mappings:

create one mapping , here you suppose to select idoc at sender side and at receiver side , you have to go signature tab and add those two MT which you had create ealier.

now go to Operational mapping, here also do same thing , add those two service interface in signature tab and sender side is just Idoc.

comming to configuration in ID:

here you have to create two receiver channels , and add in ICO .

you can just start development and let us know if you stuck.

manikandan_shanmugam3
Active Participant
0 Kudos

Hi Maheswara Reddy,

Any Idea on the requirement

else if IDoc has a single segment, create a flat file for a particular segment and create one empty file and send it to a target system.

the Identifier has to be appended in the file name.

e,x.

Identifier is ABC, XYZ in two segments file name should be XXXX_ABC_XXXX.csv and XXXX_XYZ_XXXX.csv

I can write UDF for file name but how it will work for two channel?

Regards,

Mani

Former Member
0 Kudos

Hi Manikandan,

Yes you can do this using variable substitution in communication channel level just follow the below link

SAPTechnical.COM - Enable Variable substitution in Receiver File adapter

maheswarareddykonda
Active Contributor
0 Kudos

Any Idea on the requirement

else if IDoc has a single segment, create a flat file for a particular segment and create one empty file and send it to a target system.

as i suggested you would be created two MT,

here you do mapping like below.

seqment1----root node of MT1

Seqment2---root node of MT2

if seqment data comes and Seqment2 data not comes then, first seqment data file will create and second seqment will create will empty file.


the Identifier has to be appended in the file name.

e,x.

Identifier is ABC, XYZ in two segments file name should be XXXX_ABC_XXXX.csv and XXXX_XYZ_XXXX.csv

here i think ABC id a data of one field in Seqment...then u can go for either varible substitution or UDF..

i would suggest DO IT BY UDF iteslf..just as give that field for udf and use in logic..

Note: you suppose to create two UDF's , one for first MT(map this udf for MT root node in mapping)

and another for second MT(map this udf for second MT root node in mapping).