cancel
Showing results for 
Search instead for 
Did you mean: 

Determining operation mapping based on RFC lookup response

0 Kudos

Hello Experts,

Have the requirement where I need to call the RFC and get the response. And based on the RFC response need to decide whether operation mapping one will execute or second one. Sender and Receiver system remain same.

Regards,

Mahesh

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions.

Since you're asking a question here for the first time, I'd like to recommend you with the following steps so you can get the most out of your community membership:

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,
-Alex

Accepted Solutions (0)

Answers (5)

Answers (5)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Mahesh,

This cannot be achieved in a straightforward way. You are trying to call Operation mapping from one operation mapping depending on output provided by RFC. This is not allowed in PI.

However what you can do is this have only one operation mapping(OM) use multimapping with two target structures mt1 and mt2.

In mm, suppose you call the RFC with following parameters

  <ZRFC> <p1> order_owner short_name </p1> <p2>event_name parameters</p2></ZRFC> 

The response structure for RFC suppose is shown below

<ZRFC> <updateResult> success </updateResult></ZRFC> 

or the result may be as shown below depending on data present in ECC

<ZRFC> <nor>fail  </updateResult></ZRFC> 

Depending on response you chose to populate mt1 or mt2.

Details on multimapping can be found here.

Regards

Anupam

jagesh
Explorer
0 Kudos

Hi,

refer this forum, it will help you. there would be many similar threads like yours.

https://answers.sap.com/questions/723715/operation-mapping-determination-at-run-time.html

Regards,

Jagesh

0 Kudos

Hello Jagesh.

Thankyou for the answer.But i could not able to find the steps which we need to do in Receiver and Interface Determination on the forum you suggested.

Kindly help me with the steps required to perform at PI end to achieve the requirement.

Regards,

Mahesh

vinita_kasliwal
Active Contributor
0 Kudos

Hi Mahesh

I am still not clear why you are not able to do that?

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

infty = 'OM1'

IMPORTING

para= lv_temp

TABLES

infty_tab = lt_p0016

* Assuming your value comes in the para field

if lv_temp = OM1

Execute A ( Call your IDOC fm here )

else

execute b ( Call your IDOC fm here )

ENDIF.



Regards

Vinita

0 Kudos

Hello Vinita,

Thank you for the answer.But we will be calling custom FM in message mapping through RFC lookup right.Then how the response of that we will use in interface determination tab to give condition for Operation mappings.

Could you please describe the steps to followed in PI.as this is my first integration on RFC lookup.

I will be passing 3 parameters to RFC and based on the combination RFC will be sending one Response.and then based on the Response received i need to decide which operation mapping should get executed.

Structure of RFC will be like below order_owner short_name and event_name parameters i will be passing to custom RFC and parameter mappping as a response will be receiving from RFC.

Regards,

Mahesh

0 Kudos

Hello

My requirement is i am getting message through JMS channel in PI and I need to send it to SAP system through IDOC.

But before sending it to IDOC i need to call one RFC and based on the response from RFC i need to decide which operation mapping should get executed.

Example there are two operation mapping say OM1 and OM2. I will be sending 2 parameters to RFC as input and will be getting 1 parameter as response.Based on that response OM1 or OM2 should get called and generate idoc and then send to SAP system through IDOC adapter. Say for example if I am getting A in response from RFC then OM1 will get executed and for B OM2 should get executed.

Regards,

Mahesh

vinita_kasliwal
Active Contributor
0 Kudos

HI Mahesh

I am not sure if I understood the requirement fully. But you can just reference any standard code in the SAP system and should tell you how you call FM and reference its structure?

Here is a sample

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

pernr = im_pernr

infty = '0016'

begda = im_date

endda = im_date

IMPORTING

subrc = lv_subrc

TABLES

infty_tab = lt_p0016

EXCEPTIONS

infty_not_found = 1

OTHERS = 2.

* Read table results into the structure for processing

READ TABLE lt_p0016 INTO ls_p0016 INDEX 1.

* Assign the value from the inforead functions above

ls_pem87-cttyp = ls_p0016-cttyp.

Regards

Vinita

0 Kudos

Hi Vinita

My requirement is to call custom RFC from PI.Sender system is JMS and Receiver is Idoc.I will be getting message from JMS adapter to PI and then i need to call customer RFC to get the response.. Once I received the Response in PI from RFC , based on the response data received i need to call the operation mapping and post the Idocs to SAP system. There are 2 operation mapping say OM1 and OM2 if response data received is A then i need to call OM1 and if response data received as B then OM2 should get call.

Regards,

Mahesh