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: 

Bex doesnu00B4t get Link from RFC

Former Member
0 Kudos

Hello everyone,

i have a problem with a RFC Call and BEX. Bex should open a Link which It get back from a RFC.

Following activity constellation.

Bex open a Connection to a RFC. The RFC call a defined Application (Webdynpro Applikation) and look for the Url of the Application. Then Bex get this Url back from RFC. Bex should open this URL. The Problem is it doesn´t works and I don´t know why. BEx say´s no error (The Programm run´s, but Bex get not back the Url from the RFC).

-

-


>The RFC has the 'remote status'.

VBA Code

SAP Connection

...........

If sapConnection.Logon(0, False) <> True Then

MsgBox "Keine Verbindung zum R/3!"

Else

Set theFunc = functionCtrl.Add("SS_RFC_URL_TEST")

objQueryTab = "200"

'theFunc.Exports("E_PAR") = objQueryTab

theFunc.Exports("I_PAR") = objQueryTab

sReturn = theFunc.call

If sReturn = True Then

objQueryTab = theFunc.Imports("E_PAR")

End If

sapConnection.logoff

End If

End Sub

-

-


Code of RFC

DATA:gv_url_string TYPE string,

gv_url_c(250) TYPE c.

CONSTANTS:gc_login_auth TYPE string VALUE '?sap-system-login-basic_auth=X',

gc_client TYPE string VALUE '&sap-client=',

gc_lang TYPE string VALUE '&sap-language='.

**Get the Url of Webdynpro Applicaion with HTTPS Protocol

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'ZESP_HELLOWORLD_VIEW'

in_protocol = 'HTTPS'

IMPORTING

out_absolute_url = gv_url_string.

**Build the URL

CONCATENATE gv_url_string

gc_login_auth

gc_client sy-mandt

gc_lang sy-langu

*INTO gv_url_c.

INTO E_PAR.

**Call the Browser

CALL FUNCTION 'Z_ESP_STSC_CBW'

EXPORTING

url = E_PAR

EXCEPTIONS

frontend_not_supported = 1

frontend_error = 2

prog_not_found = 3

no_batch = 4

unspecified_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFUNCTION.

--The Import and Exportparameters are defined. The connection to the RFC is correct.

What is wrong?

Thanks

1 REPLY 1

Former Member
0 Kudos

Hey Guys,

I have solved the Problem.

The Problem was the String was to short. The Url was longer than the String field. With 255 Characters it works.

Greez

Edited by: Schwarzenberger Stefan on May 18, 2011 2:37 PM