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: 

ABAP RFC flag

Former Member
0 Kudos

Hi,

I have a RFC enabled Funciton Module and I want to write a code running depends on connection type (RFC or dialog). I found a flag SY-CALLD. But I'm not sure about it. Can I use this flag for to determine connection type?

best regards,

Altug Bayram

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Altug,

you can try to use the following statement:

CALL 'RFCControl' ID 'CODE' FIELD '?'.

The sy-subrc will give you an information, if you'*re connected via rfc, or not. But be aware, that this statement is for SAP internal use only (i.e. can be changed without information, no documentation, ...).

To check, if your connected via rfc, or if you're in a dialog mode, you can also try to get an information, if a GUI is available. I've used this in one of my function modules, that can be called from a web-application or from a SAP report.

Example: function module RFC_IS_GUI_ON (by the way- this function module is also using the CALL 'RFCControl' statement).

Best regards

Stephan

3 REPLIES 3

BalaMalvatu
Participant
0 Kudos

Hi,

Try using the FM RFC_READ_DESTINATION_TYPE

Regards

Bala.M

0 Kudos

Hi,

This FM is determine RFC destination type. I'm calling RFC from external program (.net) or abap. I want to determine where called this program (abap or .net connector).

best regards

Altug Bayram

Former Member
0 Kudos

Hello Altug,

you can try to use the following statement:

CALL 'RFCControl' ID 'CODE' FIELD '?'.

The sy-subrc will give you an information, if you'*re connected via rfc, or not. But be aware, that this statement is for SAP internal use only (i.e. can be changed without information, no documentation, ...).

To check, if your connected via rfc, or if you're in a dialog mode, you can also try to get an information, if a GUI is available. I've used this in one of my function modules, that can be called from a web-application or from a SAP report.

Example: function module RFC_IS_GUI_ON (by the way- this function module is also using the CALL 'RFCControl' statement).

Best regards

Stephan