cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in mapping-BAPI to file.

Former Member
0 Kudos

Hi all,

I am working on an bapi to file scenerio.My requirement is 2 files need to created in the target ,

First file has the payload and its name(filename) needs to hav message id.

Second file is a catalog file which only holds the name of the first file(Howmany ever file are reaching target,this file wil hav names of all those files.).

I have used multi mapping wherein for the first structure i hav done dynamic configuration to generate filename and its wrking fine.

For the second stucture (has only 1 field for passing filename)i wrote following UDF and mapped it

String constant;

java.util.Map map;

map = container.getTransformationParameters();

constant = (String) map.get(StreamTransformationConstants.MESSAGE_ID);

String fileName = constant + ".txt";

return constant;

but now output of the second file is empty ie the filenames of the first file is not present in it.

Please help as its very urget.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

heyy...thanks for that, but that was a typing mistake..problem is elsewhere, i had tested by mapping that field to a constant, even then no value was present in output.

My structure looks like below.

Messages

Message1

mt_abcd

.

Former Member
0 Kudos

heyy...thanks for that, but that was a typing mistake..problem is elsewhere, i had tested by mapping that field to a constant, even then no value was present in output.

My structure looks like below.

Messages

Message1

mt_abcd

. field1

field2

field3

Message2

mt_abcd2

filename

Message1 and message2 are 2 separate files in output.

Message1's output is correctly generated.But for message2 no output atall.

justin_santhanam
Active Contributor
0 Kudos

Shruti,

Are you getting two output files? The problem is you are not getting the file name in the second catalog file, am I right?

raj.

Former Member
0 Kudos

hi raj,

The second file has name abc.ctlg in which the name of the 1st file needs to be stored.

At output abc.ctlg is getting generated but no data inside it.

justin_santhanam
Active Contributor
0 Kudos

Shruti,

If possible coudl you show us the snapshot of your mapping program?

raj.

Former Member
0 Kudos

even if i map a constant-> filename

its not cuming at target.

justin_santhanam
Active Contributor
0 Kudos

Shruti,

It will be more easy if I see the mapping program. I hope u can understand!

raj.

Former Member
0 Kudos

as its a weekend snapshot is not possible til monday.

Former Member
0 Kudos

Hi Shruti,

Here you havent use the filename variable. I think you have to return file name. Just by adding .txt to string is it useful for converting file.