on 05-13-2022 10:58 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.