1

How to get the name of the calling program from within an asynchronous remote function call (aRFC) ?

CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA' STARTING NEW TASK lv_taskname
  DESTINATION IN GROUP DEFAULT

The called BAPI triggers a user exit that I need to disable for this particular calling program. However, the local part of the stack is lost after the RFC and the name of the calling program on the local system is unknown.

The closest solution I could think of was disabling the user exit when the calling program is SAPMSSY1 (RFC calls), but that it not as accurate.

Cutter
  • 1,673
  • 7
  • 27
  • 43
  • 2
    Maybe the parameter `CALLER_PROGRAM` of the function module `RFC_GET_ATTRIBUTES`. I'm not sure it works in all kinds of RFC calls. – Sandra Rossi Apr 30 '21 at 06:34
  • 1
    It works, thanks Sandra! Could you post it as an answer so that I can accept it ? – Cutter Apr 30 '21 at 07:48
  • is it possible at all? I'm not sure. Any approach (including Sandra's) will not work if the call came from external middleware or by any other means – Suncatcher Apr 30 '21 at 07:52
  • 1
    @Suncatcher But that's not relevant in a case like this where you use aRFC solely for parallelization within the same system. – Philipp Apr 30 '21 at 12:26

1 Answers1

1

Maybe the parameter CALLER_PROGRAM of the function module RFC_GET_ATTRIBUTES. I'm not sure it works in all kinds of RFC calls.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48