Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an inidcator, if a function was calling by RFC or in R3 backend?

Former Member
0 Kudos

Hi,

I have made a function called by a portal application over RFC and also called

by a report inside of R3. I need to differ something, if it is going to be called from

"outside" over RFC, or if it is going to be called from "inside" R3.

Is there a system indicator in SYST or something?

Arne

1 ACCEPTED SOLUTION

Former Member
0 Kudos

in the funcion bulder check the attibutes of function mdule in se37.if it is remote enabled or normal function ..

7 REPLIES 7

Former Member
0 Kudos

Hi Arne,

If you are passing destination, this means you are calling FM from outside R3.and if you are not passing destination this means you are calling FM inside R3.

CALL FUNCTION 'ZTEST_RFC' <b>DESTINATION 'RA_SA'</b>

EXPORTING

V_MATNR = P_MATNR

IMPORTING

V_MAKTX = G_MAKTX.

Regards,

Hemant

0 Kudos

Hi,

If you are running a report on the R/3 you will have the report name in SY-REPID, may be you can use this to differentiate if the Function module is called from a Report or RFC.

Try these fields SY-CPROG SY-REPID.

You can also try SY-TCODE if the report is run using the transaction.

One more option is to ADD an optional IMPORT paramter and pass it as X when called using RFC and pass it as space when called from report. But this creates a dependancy over this parameter.

Regards,

Sesh

Former Member
0 Kudos

in the funcion bulder check the attibutes of function mdule in se37.if it is remote enabled or normal function ..

0 Kudos

Hi,

thank you for the answers.

In my function, I´m calling a standard BAPI to create sales order. In this standard BAPI there is a user exit, whcih created popups in special cases. If you run the function from the portal, there can´t be popups. So I want to differ inside of the user exit, if the function has been called from the portal or the R3.

that´s why I can´t use a special flag in the importing interface of the function, because I´m inside a user exit later on, where I have to differ....

So I need to find a system field to check, if it´s RFC or not.

0 Kudos

Hi,

As far as I know, there is no system field that can give you this information.

May be you can see the fields that I have mentioned if they have different values when called from portal and when called from R/3.

Regards,

Sesh

0 Kudos

I have seen, that sy-tcode is initial, when calling the function from the portal. So I now have checked, if it´s initial, or filled and react then in a different way afterwards.

Thank you!

0 Kudos

Hi,

I am not sure if SY-TCODE will have some value when you execute the report from Se38. instead of executing the transaction. Anyway if you are sure that this report is executed only using Transaction then sy-tcode is good enough.

Regards,

Sesh