cancel
Showing results for 
Search instead for 
Did you mean: 

BPM for Processing Multiple records in a file

Former Member
0 Kudos

Hello All:

I using BPM to process Goods issue using BAPI BAPI_GOODSMVT_CREATE. The BPM setps are as

Step 1 Receive Request from Asyn File Interface

Step 2 Transformation Map to Bapi request Structure

Step 3 Send Sync Request to Bapi

Step 4 Transformation Map Bapi Response to file

Step 5 Send Asyn Message to File

My input file is as fallows

H,20050613,20050613,9999,HEAD TXT,03,

P,000001000108,0001,COMMON,2,EA,1000,1011,261,ITM TXT,

H,20050613,20050613,9999,HEAD TXT,03,

P,000001000108,0001,COMMON,3,EA,1000,1011,261,ITM TXT,

The output file is as fallows

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

- <ns1:MT_SAP_RESPONSE_ITMS_DATA xmlns:ns1="http://testcompany.com/xi/ITMS">

- <BAPI_STR>

- <HEADER>

<MAT_DOC>4900000696</MAT_DOC>

</HEADER>

</BAPI_STR>

</ns1:MT_SAP_RESPONSE_ITMS_DATA>

The problem I am facing is although my file has 2 records of goods issue data (Header and Item data) , the BPM processes only one record (Header and Item) and creates a material doc in SAP and outputs a file with the material doc number as above. Ideally I would like the XI system to process both the records and produce 2 material docs as output .

Also my input file adapter has been picking up both the records as this is visible in the SXMB_MONITOR logs.

Do I need to introduce a loop in the BPM ?. If so can any can any body give me an example or point me in the right direction.

Many Thanks

TBH

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello All:

Thank you for all your inputs ...I finally solved my issue. My file adpater was missing a field, so although my recordsets per message was set to 1 . It did not use this info. I did not after all need a loop for what i was trying to achive.

Many Thanks

Thorsten

gautam_poddar2
Participant
0 Kudos

Hi Thorsten,

I also have a Case similar to urs...Kindly advice me how you did that.

I will be grateful for ur helping me.

Kind regards

Chakra and Somnath

udo_martens
Active Contributor
0 Kudos

Hi Thorsten,

you need a mapping splitting one message with multiple entries into multiple messages with one entry, which you put into a multiple line BPM container. Next you loop over that container and send for every line.

Regards,

Udo

Former Member
0 Kudos

Udo:

<b>you need a mapping splitting one message with multiple entries into multiple messages with one entry, which you put into a multiple line BPM container.</b>

Are you implying loop Step 1 Receive Request from Asyn File Interface and collect them into a multiline container ?. How does the loop know how many times to loop.

Would appreciate your comments

Thorsten

Former Member
0 Kudos

Hi,

Its better to implement a custom RFC which will take all inputs from XI and do the GI posting one by one inside the functional module and return all the GI numbers back to XI.

Thanks,

Sasi

udo_martens
Active Contributor
0 Kudos

Hi Thorsten,

>>Ideally I would like the XI system to process both the records and produce 2 material docs as output

I mean, that you, if you want to loop over the entries of one message, should split your message to be able to loop.

Regards,

Udo

MichalKrawczyk
Active Contributor
0 Kudos

Hi Thorsten,

Have you set "Recordsets per Message" parameter of the file adapter to 1 ?

if not try it

Regards,

michal

Former Member
0 Kudos

Michal:

Thank you for replying , Yes , i have set the Recordsets per Message parameter to 1.

Thorsten