cancel
Showing results for 
Search instead for 
Did you mean: 

Abap Mapping - Specify file name

Former Member
0 Kudos

Hi there

Is it possible to specify the flat file's filename in the abap mapping? I need to create several flat files with abap mapping and each file uses the same receiver adapter but have a different name..

Thanx,

Jan

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member192295
Active Contributor
0 Kudos

Hi,

We can do through variable substitution mechanism, configure accordingly

Former Member
0 Kudos

My scenario makes it some what more interesting, I can only get the filename one in the abap mapping. The variable mechanism only seems to work if you specify the filename before you execute the abap mapping. Is it possible to get a returning parameter and according to that determine the filename. Or in the abap mapping itself set the filename?

udo_martens
Active Contributor
0 Kudos

Hi Jan,

>The variable mechanism only seems to work if you specify the filename before you execute the abap mapping

aeh, no

>Or in the abap mapping itself set the filename

yes

You need a XML element like <filename> in your target message, there you store the filename (by ABAP mapping).

At adapter side you define the filename with %myVariable%

And finally you need to fill the variable, choose payload: myRootElement,1,filename,1 for example, if this is your structure. Have a look to Variable substituion at SAP help [Configuring the Receiver File/FTP Adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm]

Regards,

Udo

Former Member
0 Kudos

Hi again

My scenario is as follow, I pick up a flat file using the ftp adapter. The flat file contains an X amount of records. Each record has a header and body. So I must create 2 files, one for the body and one for the header. These 2 files have different names. Every record can have X amount of lines. So I have to dynamically look and see where a new record starts and the create the two files for each record. I tried content conversion but could not get it working so i'm creating the two file in abap mapping. Just not sure how I am supposed to allocate the filenames..

Regards,

Jan

udo_martens
Active Contributor
0 Kudos

Hi Jan,

you can use a variable for the file name which is filled by a field value from payload. So you need to fill a certain field in the ABAP mapping with the file name.

Regards,

Udo