cancel
Showing results for 
Search instead for 
Did you mean: 

XML file to BAPI RFC Scenario

Former Member
0 Kudos

Hi guys,

I am implementing an XI scenario where XI picks up an XML file with multiple records in it and for each record it should be calling a BAPI on SAP R/3 side. Therefore, I exported the RFC structure as an XSD file and changed the occurences attribute of the BAPI parent segment to "1 to unbounded". Then I imported the XSD file into XI as an external definiton. However, when I am using this external definition in message mapping, the multiple occurences attribute is not visible.

Any ideas ?

Best Regards,

Evaggelos Gkatzios

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> Therefore, I exported the RFC structure as an XSD file and changed the occurences attribute of the BAPI parent segment to "1 to unbounded". Then I imported the XSD file into XI as an external definition.

This works for IDocs, but not for BAPIs.

Use multimapping for this scenario.

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

Change the occurence directly in Message mappinga and then in Interface Mapping.

Former Member
0 Kudos

Thank you all for your replies.

Actually, I wanted to verify and be 100% sure that this does not work for BAPI's but only for IDocs. I am aware about changing the occurences directly in Message Mapping, but as you may already know this adds extra Messages segments, that will not be present in the XML file sent from the Sender Business System and therefore will not work.

I guess the only solution is to use a Proxy and call the BAPI directly in SAP R/3.

stefan_grube
Active Contributor
0 Kudos

> but as you may already know this adds extra Messages segments, that will not be present in the XML file sent from the Sender Business System and therefore will not work.

This extra tags will be added by PI runtime, so do not worry.

Former Member
0 Kudos

Hi,

I changed the occurences attribute to 0..unbounded under Messages Tab in both Message and Interface Mappings. However, when I am testing, I get the following error in RFC Communication Channel Monitoring:

"Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: functiontemplate from repository was <null>: com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: functiontemplate from repository was <null>"

In the Audit Log I can only see an empty payload message.

Any ideas ?

Former Member
0 Kudos

Do not change any thing in xsd. Change Message mapping and Interface mapping occurance to 0..unabounded.

Map source XML Sturucture(which is 1..unbunded)-> to target message 1 and maintain root node name,

now go to your message mapping pass some values with duplicate records and try to test the scenario..see duplicate records are coming mapping(Root node will repeat in target) (do not copy any pay loads..once structure generate in message map pass the values...and test..........)

now activate ......MESSAGE MAP and interface map...

it will send the multiple calls same time...................

Regards,

Venu.

Former Member
0 Kudos

Hi All,

These extra tags were not added by PI Runtime and therefore I get an empty payload after message mapping is executed.

Any ideas ?

stefan_grube
Active Contributor
0 Kudos

Before you continue wasting your time:

Forget the BAPI. You have an async scenario therefore you must use IDoc.

Check transaction code "BAPI" to figure out which IDoc is related to your BAPI.

Former Member
0 Kudos

Hi Stefan,

I am implementing this scenario synchronously. I am using Best Effort QoS in file sender Communication Channel Configuration, I am using a Synchronous Sender Message Interface, and I am mapping the return values from the RFC execution to another Message Type that will be visible in SXI_MONITOR.

stefan_grube
Active Contributor
0 Kudos

The file adapter will ignore the response. If an error occurs, you will not notice. Data loss is predictable.

I say this only once again: File to BAPI must not be used

Use corresponding IDoc

Former Member
0 Kudos

There is no corresponding IDoc for my BAPI.

But you know something, finally this works with multimapping. The point which I was missing and the scenario was not working is that I had to change the Interface Determination in ID and make it Enhanced. Once selecting the corresponding Interface Determination, the 0..unbounded occurences attribute appears.

Best Regards,

Evaggelos Gkatzios

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>Therefore, I exported the RFC structure as an XSD file and changed the occurences attribute of the BAPI parent segment to "1 to unbounded".

and where did you read that this might work ? it's not IDOC where you can do this

Regards,

Michal Krawczyk