cancel
Showing results for 
Search instead for 
Did you mean: 

File --> n times BAPI_REQUIREMENTS_CREATE

Former Member
0 Kudos

Hi,

I've got a file with the requirements in the following format for each line:

Material;Date;Quantity

That file has got thousands of lines. Now I have to map all the lines of the same material to one bapi and do that for each material because the bapi has got the following format:

BapiMessage:

- Input ID Material

- Input table with all the dates and quantity for that material

I'm not allowed to create a Z bapi to use the other bapi in the R3 system, so I think I must use a BPM with a loop that calls the BAPI for every material. But now my doubt is: How can I get all the lines of each material from the input message and map to every Bapi call?

Example scenario:

Source file:

MAT1;20081115;500

MAT2;20081117;400

MAT1;20081121;350

MAT2;20081122;400

Now I must call the BAPI 2 times, 1 for each material with that info:

BAPI Call for MAT1:

- ID Material = MAT1

- Table[1] = date:20081115 qty:500

- Table[2] = date:20081121 qty:350

BAPI Call for MAT2:

- ID Material = MAT2

- Table[1] = date:20081117 qty:400

- Table[2] = date:20081122 qty:400

I don't know how to read the lines of the source and map them to the corresponding Bapi call.

Sorry for the complicated thread

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

No need to use BPM. Just perform simple mapping. In sender side FCC, use the parameter "Recordset Per Message = 1". Thats it.

Regards,

Prateek

Former Member
0 Kudos

No need to use BPM. Just perform simple mapping. In sender side FCC, use the parameter "Recordset Per Message = 1". Thats it.

Then if I use that parameter, XI will call the BAPI all the times? Ok, but now how can I map all the lines of the source file of one material to each target call?

MichalKrawczyk
Active Contributor
0 Kudos

>>>>Then if I use that parameter, XI will call the BAPI all the times? Ok, but now how can I map all the lines of the source file of one material to each target call?

if you use this parameter - file adapter will send to integration engine

as many XI messages as lines in your file

so then you map 1 - 1

regards,

Michal Krawczyk

prateek
Active Contributor
0 Kudos

In this case, just perform simple message mapping as you do for one File record to one RFC call. XI will itself make multiple calls due to splitting of messages.

For Michal's case, u have to map the root node of source structure to root node of target structure.

Regards,

Prateek

Former Member
0 Kudos

Ok, I get it, but I don't want 1 call to RFC for each line. I have to group the lines (related because are from the same material) and call the BAPI one time for each material, not for each line.

Each material can have around 300 lines and if I call the BAPI 1 time for 1 line I think the performace will be very bad, and if I group the data of 1 material the performance will be improved. But I'm not sure if I can do that

prateek
Active Contributor
0 Kudos

Yes, ur performance concern is correct. Pass the entire data at receiver at once using abap proxy call. Then split the data based on the material no and call the RFC internally from there.

Regards,

Prateek

Former Member
0 Kudos

Yes, ur performance concern is correct. Pass the entire data at receiver at once using abap proxy call. Then split the data based on the material no and call the RFC internally from there.

Yes, that solution is in my mind from the beginning but my problem is that I can't do any developement at the receiver side (R3). Then I think I can only split by material in XI using BPM, but I don't know how to do that yet

Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos
MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>I'm not allowed to create a Z bapi to use the other bapi in the R3 system, so I think I must use a BPM with a loop that calls the BAPI for every material. But now my doubt is: How can I get all the lines of each material from the input message and map to every Bapi call?

no need for a BPM

just create an abap proxy in ECC that will call this standard bapi many times

(in a loop)

and send all the info in one abap proxy message

or if there's an IDOC for that you can set the IDOC occurance to unbounded

and send many IDOCs in one call (again no BPM necessary)

Regards,

Michal Krawczyk