cancel
Showing results for 
Search instead for 
Did you mean: 

How to display RFC-Logon-Screen for non trusted connection in Web-Dynpro?

carsten_klatt
Explorer
0 Kudos

Dear Web-Dynpro-Specialists,

i got a issue while creation of an WebDynpro-Tool, which is using RFC connections for reading data.

In some cases the RFC connection is not a trusted one connection, so a login is nessessary, but in

this cases not a window is coming up for login....

Any idea how i can get this window for login, in order to collect the nessessary Data for my tool?

Additional Information concerning the RFC connection:

While running my Web-Dynpro i run this Method:

METHOD get_table_entries.

CLEAR rt_entries[].

CALL FUNCTION 'RFC_GET_TABLE_ENTRIES'

DESTINATION iv_destination

EXPORTING

gen_key = iv_table_key

table_name = iv_table_name

TABLES

entries = rt_entries

EXCEPTIONS

internal_error = 1

table_empty = 2

table_not_found = 3

OTHERS = 4.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE table_empty.

WHEN 3.

RAISE table_not_found.

WHEN 4.

RAISE unknown_error.

ENDCASE.

ENDMETHOD.

Thanks a lot in advance

Best regards

Carsten Klatt

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>this cases not a window is coming up for login....

It can't. A logon screen will only be produced upon RFC call if you are running a dynpro application.

carsten_klatt
Explorer
0 Kudos

So your concrete sugestion would be?

To create Trusted RFC connections for everything?

Edited by: Carsten Klatt on Sep 27, 2010 3:23 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> So your concrete sugestion would be?

Ues Trusted RFC is you need to run the connection under the current user id. If this is the scenario you must deal with you should question why Trusted RFC isn't available.

You could perhaps come up with some sort of workaround where you create a dialog in WDA to ask for user name and password (running under HTTPS only so as to be secure) and then create a temporary RFC destination. But in the end I can't really recommend that appraoch as it wouldn't be very secure.

Maybe someone else has an idea of a similar workaround. However be sure to study the security ramifications closely.

But in summary, you can't depend upon RFC destinations with no user/passord or without trusting relationship within WDA. You aren't going to get the popup logon query. The recommendation is that you need to have a fixed communication user in the destination or use Trusted RFC.

Answers (3)

Answers (3)

carsten_klatt
Explorer
0 Kudos

Thanks for all the input - i will work with trusted RFCs

Former Member
0 Kudos

Hi,

You can come up with some sort of design where you will create a dialog in Web Dynpro Application, prompting you for the user name and password and then create a RFC destination temporarily.

You have a function module to create a RFC connection,but i cant assure you how safe it will be.

carsten_klatt
Explorer
0 Kudos

Thanks a lot for this possible workaround - i guess we are talking about using an existing functionmodule?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Honestly I don't know if there are any public APIs to generate the RFC destination. There are some used within SAP applications, but I don't know if they are allowed for customer/partner usage. I want to stress that this approach wouldn't be secure. Even if you deleted this RFC destination after the application run, during the application lifetype anyone could impersonate the user by simplying using the temporary RFC destination. That's a pretty big risk.

Former Member
0 Kudos

Hi!

You can use the function module RFC_MODIFY_R3_DESTINATION to create, modify and delete RFC connections. You will need the system ID (e.g. ABC), client (e.g. 123), system number (e.g. 00) and the host name of the server. In this example the following code would create or modify the RFC destination ZRFC_DESTINATION.


    CALL FUNCTION 'RFC_MODIFY_R3_DESTINATION'
      EXPORTING
        destination                = 'ZRFC_DESTINATION'
        action                     = 'M'
        systemid                   = 'ABC'
        systemnr                   = '00'
        server                     = 'serverhostname'
        language                   = sy-langu
        client                     = '123'
        user                       = 'USERNAME'
        password                   = 'PASSWORD'
        description                = 'Dummy RFC Connection'
      EXCEPTIONS
        authority_not_available    = 1
        destination_already_exist  = 2
        destination_not_exist      = 3
        destination_enqueue_reject = 4
        information_failure        = 5
        trfc_entry_invalid         = 6
        internal_failure           = 7
        snc_information_failure    = 8
        snc_internal_failure       = 9
        destination_is_locked      = 10
        OTHERS                     = 11.

With the following code you can delete this connection:


    CALL FUNCTION 'RFC_MODIFY_R3_DESTINATION'
      EXPORTING
        destination                = 'ZRFC_DESTINATION'
        action                     = 'D'
      EXCEPTIONS
        authority_not_available    = 1
        destination_already_exist  = 2
        destination_not_exist      = 3
        destination_enqueue_reject = 4
        information_failure        = 5
        trfc_entry_invalid         = 6
        internal_failure           = 7
        snc_information_failure    = 8
        snc_internal_failure       = 9
        destination_is_locked      = 10
        OTHERS                     = 11.

Please keep in mind that deleting an RFC connection is usually noted in the system log.

If you want to reuse your connection for multiple servers, you could run into trouble since connection data is cached.

Sincerely,

Stefan