cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Adapter at Sender Side

Former Member
0 Kudos

I have created a scenario using RFC adapter at sender side.

Now in order to trigger the message/interface from ECC Side, I have to call remote enabled FM from ECC.

My questions is How to call that Remote FM i.e what rfc destination should be used? i.e whether ABAP Connection(Type 3) or TCP/IP Connection (Type T) should be used as destination.

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Ankit,

Also you can check Michal Krawczyk's blog

Regards.

Former Member
0 Kudos

Hi Inaki,

Actually i am done with the configuration part and also tested the configuration in PI and it is working fine.

But my scenario is of type request-response i.e I am using RFC Adapter at Receiver side of request message and updating the database table, if sy-subrc is 0, I am calling the Remote enabled FM to trigger the response interface which i have configured in response Interface at Sender Side.

But the response interface in not triggering.

I hope the scenario is clear.

Heres my code of Request Interface( RFC at receiver side):-

FUNCTION ZRFC_PI_DOC.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(HEADER) TYPE  STRING

*"     VALUE(NAME) TYPE  STRING

*"     VALUE(ID) TYPE  INT2

*"----------------------------------------------------------------------

TABLES: ZPI_DOC.

DATA: wa_data TYPE ZPI_DOC.

wa_data-name = name.

wa_data-id   = id.

MODIFY ZPI_DOC FROM wa_data.

IF sy-subrc eq 0.

commit WORK.

data: stat TYPE c LENGTH 10 VALUE 'Updated'.

CALL FUNCTION 'ZRFC_PI_DOC_RESPONSE'

in BACKGROUND TASK DESTINATION 'LCRSAPRFC'

  IMPORTING

    STATUS        = stat

           .

ENDIF.

ENDFUNCTION.

iaki_vila
Active Contributor
0 Kudos

Hi Ankit,

I havent clear your scenarios, correct me if im wrong, you have the next scenarios:

1. ??? - RFC (ZRFC_PI_DOC)  (async?).

2. RFC - ??? (ZRFC_PI_DOC_RESPONSE) (sync?).

First of all, for the second scenario you should assure that you have synchronous service interfaces and later to check the monitoring (sxi_monitor or RWB) if there is an exception.

Regards.

Former Member
0 Kudos

Hi Inaki,

Your are absolutely correct about my scenarios.

My First Sceario i.e request is working perfectly and tables are being updated, but,

in case 2, I am using async comm (i.e in background task) as per your suggestion i have change it to sync (ie. removed in background task from Function Call). still the response interface is not triggering so unable to see any entry in sxi_monitor for response interface.

Regards,

Ankit

iaki_vila
Active Contributor
0 Kudos

Hi Ankit,

Have you checked for the second scenario that it is inside the PI, the service interfaces (both sender and receiver in the ESR) are set like synchronous and the operation mapping has been filled in the request and response directions?

Regards.

Former Member
0 Kudos

Hi Ankit,

As said by Inaki,you have to maintain synchronous inbound interface.

Then it will get the response message from ECC.

Regards

Raj

Former Member
0 Kudos

Hi ,

One last doubt, I have four SI in ESR

For scenario 1 (Request):      Outbound:      si_out

                                           Inbound:        si_in

For scenario 2 (Response):    Outbound:     si_out_resp

                                           Inbound:         si_in_resp

Now for which SI or SI's i need to make the Mode: sync.

Former Member
0 Kudos

Thanks Raja,

One last doubt, I have four SI in ESR

For scenario 1 (Request):      Outbound:      si_out   (Sender)

                                                      Inbound:        si_in     (Receiver)-ECC   

For scenario 2 (Response):   Outbound:     si_out_resp (Sender)-ECC

                                                     Inbound:         si_in_resp Receiver

Now for which SI or SI's i need to make the Mode: sync.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Ankit,

I guess this is your answer: SAP Note 730870 - RFC Adapter FAQ Q7:


Q 7: Can there be multiple function module calls within one

transaction for RFC sender channels?

A: RFC Adapter only supports one call within one transaction

(sometimes also called LUW). If an attempt is made to place a second

call within the same transaction, an exception is raised. This is done

because within XI there is no transactional context between messages

and each RFC call is wrapped into one message.

So that is why the second function module is not called. Use a report to call the two function modules separately.

Regards,

Mark

Former Member
0 Kudos

Hi,

You can build a synchronous scenario between

(Request):  Outbound:   si_out and  (Response):  Inbound:    si_in_resp

Regards

Raj

Former Member
0 Kudos

Hi Mark,

I have created a report and created a transaction and called it from First FM as

function zrfc_pi_doc.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(HEADER) TYPE  STRING

*"     VALUE(NAME) TYPE  STRING

*"     VALUE(ID) TYPE  INT2

*"----------------------------------------------------------------------

tables: zpi_doc.

data: wa_data type zpi_doc.

wa_data-name = name.

wa_data-id   = id.

modify zpi_doc from wa_data.

if sy-subrc eq 0.

commit work.

call transaction 'ZRFC_DOC_RESPONSE'.

endif.

endfunction.

But still its not triggering the interface.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Ankit,

What I meant was that there are no other function or transaction calls inside your FM e.g


function zrfc_pi_doc.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(HEADER) TYPE  STRING

*"     VALUE(NAME) TYPE  STRING

*"     VALUE(ID) TYPE  INT2

*"----------------------------------------------------------------------

tables: zpi_doc.

data: wa_data type zpi_doc.

wa_data-name = name.

wa_data-id   = id.

modify zpi_doc from wa_data.

if sy-subrc eq 0.

commit work.

endif.

endfunction.

And in your report, use them separately

Call Function ZRFC_PI_DOC.....

Call Function ZRFC_PI_DOC_RESPONSE...


Hope this helps,

Mark

iaki_vila
Active Contributor
0 Kudos

Hi,

I didnt know the restriction pointed by Mark, thanks Mark.

Ankit, you can set  the two first service interfaces for the scenario 1 async and the two service interface for the scenario 2 sync (dont forget to do the mapping for the response in the operation mapping).

Also you can study the possibility of using an ABAP proxy instead a RFC adapter for the  ZRFC_PI_DOC_RESPONSE and you wont have that restriction.

Regards.

Former Member
0 Kudos

Hi Mark,

Ok.. i got your point... but in my scenario under what event can i call my response FM since i cannot call it from request FM.

Former Member
0 Kudos

Hi Inaki,

After investigation of ST22 in PI system i found that i was getting a dump

The function module "ZRFC_PI_DOC_RESPONSE" is called,

but cannot be found in the library.

But I have imported the FM in Imported Objects RFCs in ESR.

What can be the issue?

Also when i am running a report in ECC calling FM it is throwing a dump "JCO.Server could not find server function 'ZRFC_PI_DOC_RESPONSE"

Regards.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Ankit,

is right, you have to use ABAP proxy for this.

Regards,

Mark

iaki_vila
Active Contributor
0 Kudos

Hi Ankit,

If you want to follow with the RFC in the second scenario you should to check that the RFC metadata exists in PI, in other words you should import the RFC in PI like other RFC, a little trick is to create the RFC empty in the ECC system with the import and export parameter defined, in this way you can import the RFC directly in PI, obviously in the ECC you must call the PI interface and not the dummy ECC RFC.

Regards.

Answers (2)

Answers (2)

Former Member
0 Kudos

I think i came to conclusion that i cannot create such kind of scenario using RFC Adapter where different ESR Objects is created for request and response.

The probable solution as suggested are:

1) Using Outbound proxies to trigger response interface.

2) Create a sync scenario where request and response are both maintained in Service Interface (SI)

If in future any one reads this thread and found that it is possible to create such scenario, please mention the solution in the thread.

Thanks guys for ur help.

Regards,

Ankit Negi

gagandeep_batra
Active Contributor
0 Kudos

Hi Ankit:

'RFC_SENDER_DS' of type 'T' in the SAP R/3 system itself

Check below doc for more information

http://saptechnical.com/Tutorials/XI/RFC2JDBC/Index.htm

Regards

GB

Former Member
0 Kudos

Thanks Gagandeep,

I have mention my scenario in Inaka's reply.

Hope it would be clear, your help will be appreciated.

Regards,

Ankit