cancel
Showing results for 
Search instead for 
Did you mean: 

Reg calling Transaction code in Webdynpro ABAP

former_member186491
Contributor
0 Kudos

Hi All,

Can I call Transaction code in Webdynpro ABAP Portal Application. If so, how can this be possible? Can anybody give me a lead?

Thanks.

Kumar Saurav.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can you the below code to call a T code from webdynpro ABAP:

1: Call below method to get host, port and protocol

cl_http_server=>if_http_server~get_location

2: concatenate protocol '://' host ':' port '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction='your tcode name' into url

3: get the window manager as we are opening t code in external window.

DATA lo_window_manager TYPE REF TO if_wd_window_manager.

DATA lo_api_component TYPE REF TO if_wd_component.

DATA lo_window TYPE REF TO if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

4: Call the url which we created above

lo_window_manager->create_external_window(

EXPORTING

url = url

RECEIVING

window = lo_window ).

The T code will be executed using the integrated ITS

Thanks

Vishal kapoor

former_member211591
Contributor
0 Kudos

Hi...

is it required to have SAP GUI installed to make 'webgui/~transaction=XXX' work?

BR

ismail

ssharma28
Participant
0 Kudos

Hi Vishal,

We are calling a transaction through webdynpro using this URL which you mentioned in your comment.

we have passed the parameters to skip initial screen.

This was working fine before upgrade. Now we have upgraded system ehp7. here in new system, the same transaction is getting opened up with selection screen and prepopulated fields which we are passing from the webdynpro.  What could have changed or do we need to do some settings to skip initial screen?

Thanks,

Seema

ssharma28
Participant
0 Kudos

The problem is solved using OKCODE ONLI.

Thanks,

Seema

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

The most easy Way is here:

1) Test any Webdynpro Application from SE80 when the webdynpro Browser opens to display output

Copy its HTTP link, Suppose we get the below link

http://r3d01web1.Siemens.dk:8001/sap/bc/webdynpro/sap/z_dynamic_view?sap-client=002&sap-language=EN

2) Now replace some part of the above link ( webdynpro/sap/z_dynamic_view?sap-client=002&sap-language=EN )  with the new link part ( gui/sap/its/webgui?~transaction=PA30 )

So that the newly generated link is such that the below one:

http://r3d01web1.Siemens.dk:8001/sap/bc/gui/sap/its/webgui?~transaction=PA30

Note in place of PA30 you can put any of your desired tcode.

3) Now Just Make a webdynpro component and in its View layout put a LINK TO URL ui element

and in its property REFERENCE just past the http link ( http://r3d01web1.Siemens.dk:8001/sap/bc/gui/sap/its/webgui?~transaction=PA30 )

4) Activate and test your webdynpro Application.

former_member184154
Active Contributor
0 Kudos

Or maybe simply concatenate

/sap/bc/gui/sap/its/webgui?~TRANSACTION=

to your TCODE and use this string as a relative URL.

If the transaction you want to open is on the same WebAS where the WD App si running, this works greatly and allow you to avoid hard coding hostname/port or doing some other scripting to intercept them (you just use the same host/port which your WD App is using).

One thing worth mentioning is you need to enable basic SSO in RZ10 (accept sso tickets) in order to avoid double logon.

Cheers

Alex

Former Member
0 Kudos

hi ,

u can not call tcode directly from Web Dynpro Application.

As correctly pointed ,u need to create iview in the portal to call the tcode.

regards,

amit

arjun_thakur
Active Contributor
0 Kudos

Hi,

There are two ways to do it:

1) You can create a transaction iview in the portal to call the tcode. When you create a transaction iview, you'll have to provide the tcode which you want to call, then n URL will be created for that transaction iview. Use this URL with the link to url UI element in your component.

2) Refer the reply of Raju in this thread:

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi,

It can be possible.

SAP Internet Transaction Server (ITS) - The ITS is the interface between the Internet and R/3 which Gives HTML view of each and every SAP tcode....

So to display a standard tcode in your webdynpro application you can use ITS.

as a example here is the URL which can help you to open su01 Tcode..Call this URL using LINK TOACTION or Link to URL UI Elements...in ur webdynpro component...

http://<url>:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=SU01

<url>:portno = your application server (you can easily find it from your webdynpro application Properties)

If it is not working you need to do some setting let me know for that ....

Thanks & Regards.