call sap tcode using webdynpro for abap _ sap ignite

9
Categories ABAP Debugger ABAP Interview Guide Articles Certifications Code Inspector Coding Challenge Data Dictionary Downloads Enhancement & User Exit Featured Article Free Access to SAP IDES system GUI Home SAP ABAP SAP HANA SAP Teched ( Dcode ) Unicode Webdynpro For ABAP What people have to say about us!! Subscribe to our mailing list email address

Upload: kumar-krishna-kumar

Post on 07-Apr-2016

79 views

Category:

Documents


7 download

DESCRIPTION

DDDDD

TRANSCRIPT

Page 1: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 1/9

HomeABAPWelcomeRegister

ArticlesCertificationsDownloadsFeatured ArticleWhat People Have To Say About Us!!Forum

Call SAP Tcode using Webdynpro for ABAPMay 8th, in Articles, Home, Webdynpro For ABAP, by Raj

If you have a requirement to Call SAP standard Transaction code from Webbrowser in yourwebdynpro Application than check it out this article to know how can achive this.

Author : Raj

Author's Website | Articles from Raj

Raj (Raju Borda) is an Application Developer focusing on Custom Development particularly inthe areas of ABAP ,WD4A , JAVA , APO , Enterprise services , Mobile applications and PIDeveloper/consultant . He is also certified in ABAP , PI and insurance domain. Facebook

Problem Description

It will help to call SAP Tcode from the Webbrowser using webdynpro for ABAP.

Solution Description

SAP Internet Transaction Server (ITS) – The ITS is the interface between the Internet and R/3 andis the runtime engine that links Web server to the R/3 Application server. So to display a standardtcode in your webdynpro application you can use ITS.

Searchsearch site Go

ADVERTISE HERE

[email protected]

Categories

ABAP DebuggerABAP Interview GuideArticlesCertificationsCode InspectorCoding ChallengeData DictionaryDownloadsEnhancement & User ExitFeatured ArticleFree Access to SAP IDES systemGUIHomeSAP ABAPSAP HANASAP Teched ( Dcode )UnicodeWebdynpro For ABAPWhat people have to say about us!!

Subscribe to our mailing list

email address

Page 2: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 2/9

Setting needs to be Done.

Go to SE80 : In the top menu choose “Utilities(M)” –> “settings”. Rightclick on the tabarrow untilyou come to tab “Internet Transaction Server”.

Make sure that “Publish” tabe and check mark “Integrated ITS” is selected.

Start transaction “SE80″. Choose “Internet Service” from the first drop down box Enter“SYSTEM” in the input field. You will see the ITS service SYSTEM and its components in a treestructure. Right click on “SYSTEM” in the tree and select “Publish” –> “Complete Service” topublish the service. once the publishing is completed the system will issue a message “Objectpublished successfully; site INTERNAL”.

Repeat the previous step with “SHUFFLER” and “WEBGUI” instead of “SYSTEM” to publishboth, too.

How to test it::

Enter Tcode SICF.

Select the path as : /sap/bc/gui/sap/its/webgui

Right click on webgui and click on “test” to execute the servies.it will open the sap screen in webbrowser.

Now it’s time for some coding. create LINK to URL or LINK TO ACTION according torequirement. the code below is develop having scinario ::

Users are displyed creating link to userid coloumn. Whenever end user click on the any of the userid. on_click method will be called wih open the user details in SU01D Befor that get the path ofthe application server. you can find it in webdynpro application. doble clcik on webdynproapplication in that you can find the URL in Administrative data.

data: lr_node type ref to if_wd_context_node,

lt_event_properties type table of IF_MAIN=>element_event_properties,

ls_event_properties type IF_MAIN=>element_event_properties.

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.

data: ld_url type string.

DATA : FINAL_URL TYPE STRING.

fieldsymbols: <l_value> type any.

*fill internal table

ls_event_propertiesname = ‘COLUMN_ID’.

ls_event_propertiesvalue = r_param>column.

append ls_event_properties to lt_event_properties.

ls_event_propertiesname = ‘INDEX’.

ls_event_propertiesvalue = r_param>index.

append ls_event_properties to lt_event_properties.

ls_event_propertiesname = ‘ATTRIBUTE’.

ls_event_propertiesvalue = r_param>attribute.

append ls_event_properties to lt_event_properties.

assign r_param>value>* to <l_value>.

ls_event_propertiesname = ‘VALUE’.

Find us on Facebook

SAP Ignite

2,140 people like SAP Ignite.

Facebook social plugin

Like

Page 3: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 3/9

ls_event_propertiesvalue = <l_value>.

append ls_event_properties to lt_event_properties.

* navigate to context node EVENT_PROPERTIES

lr_node = wd_context>get_child_node( ‘EVENT_PROPERTIES’ ).

* bind internal table to context node

lr_node>bind_table( lt_event_properties ).

FINAL_URL = ‘http://<url>:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=SU01D%20USR02BNAME=’.

CONCATENATE FINAL_URL ls_event_propertiesvalue INTO FINAL_URL.

CONCATENATE FINAL_URL ‘&~OKCODE=SHOW’ INTO FINAL_URL.

lo_api_component = wd_comp_controller>wd_get_api( ).

lo_window_manager = lo_api_component>get_window_manager( ).

ld_url = FINAL_URL.

CALL METHOD lo_window_manager>CREATE_EXTERNAL_WINDOW

EXPORTING URL = ld_url

RECEIVING WINDOW = lo_window.

lo_window>open( ).

Related Posts:

flash pie chart with webdynpro for abapMVC Architecture for Webdynpro for ABAPTutorial for interactive forms by Adobe using Webdynpro for ABAPFloor Plan Manager with WDACreating a Roadmap application in Webdynpro for ABAP – Tutorial

Related Posts

flash pie chart with webdynpro for abap

MVC Architecture for Webdynpro for ABAP

Tutorial for interactive forms by Adobe using Webdynpro for ABAP

Page 4: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 4/9

Floor Plan Manager with WDA

Creating a Roadmap application in Webdynpro for ABAP –

Tutorial

Like this post? Share it!

">

">

">

ADVERTISE HERE

User Comments

Nice One

RajuMay 11, 2010

REPLY

Good One. But you have not given where to implement this code.Can you provide any info on that ? Also in your scenario, you havenot provided any information on where are you providing link to theuser id ? is it on SAP GUI for HTML perticulatrly or in a webdynproapplication.thanks & Regards.Suchita

SuchitaSeptember 4, 2010

Page 5: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 5/9

REPLY

Hi Sucheta,

This code is implemented in Webdynpro for ABAP application.Assume that there is a Webdynpro for ABAP Application whichdisplays the list of users.Now make use of LINKTOACTION or LINKTOURL propertyand create a method which will trigger when youClick on the user ID column. The code which we have providedabove is put inside this method.

Kindly get back to use if i am not clear.Thanks,

RajSeptember 4, 2010

REPLY

Hello Raj,

Could you please tell me what is %20 after transaction code. Is there any specific reason for this.

Thanking you,

satyaMarch 10, 2011

REPLY

Hi,When you construct an URL it can’t put space inbetween.so %20 is used as a filler in simple word.let’s say :If you want to create URL like:http://www.sapignite.com/articles/list/webdynpro for abapIt’s not possible to call it.as it will give you an error.So we keep %20 in between the words.http://www.sapignite.com/articles/list/webdynpro%20for%20abap

it is nothing but : URLEncodedFormat of a blank space(hex 20 = dec. 32)

Thanks.

RajMarch 10, 2011

REPLY

Hello Raj, Thanks for the reply. I have a requirment like , I have to open WBSElement when user clicks a button. I have created a link for this , it is opening thetransaction. It is opening a popup , due to okcommandgiven in the link. Later I would like to fill field and give okcommand. I do not know how to fill field in the popup and giveone more okcommand. I have passed this url , but it is not filling the field inthe popup. Could you please help me.

Regards, satya satya

March 14, 2011

Page 6: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 6/9

Hi,I can display the SAP transacton in IFrame.Thanks

Serhiy MaryshchakSeptember 24, 2010

REPLY

how did you know the final URLhttp://&lt;url&gt;:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=SU01D%20USR02BNAME= How can i findthis path for my ssytems??

KrishanJune 15, 2011

REPLY

Hi Krishan,

ITS is located on the same path.Only thing will be changed is part. which u can see inapplication of webdynpro for abap component.

thanks

RajJune 15, 2011

REPLY

Hello, I have an WD application in which one of the column of a tableinherited the LinkToURL property. I am not finding an Actionattribute to create a method. I am on ECC6.0, EHP1 (Release 701) atSP7. Am I missing something or is there a different place for me tocreate the action method? Thanks,Kiran

KiranJune 22, 2011

REPLY

Can you call ME21N for a particular PO? I tried and did not work. I am looking for a solutions. Please help me. Thanks,Kiran

KiranJanuary 12, 2012

REPLY

Hi Kiran ,

Did you try URL construction like :http://:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=SU01D%20USR02BNAME=

where USR02BNAME is the field name .

Page 7: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 7/9

Let me know the URL which you are constructing it should work.

ThanksSAP IGniteRaj

RajJanuary 13, 2012

REPLY

Hi raj, Yes, I tried. I guess there is some problem with handling theenjoy transactions. Could you create a dummy application andsee if you were able to open the PO for the number beingpassed from the application? Please email me on [email protected] as am notreceiving any alerts from this portal when you respond. Thanks for your help. Best,Kiran

KiranJanuary 30, 2012

REPLY

Dear Raj, Your articles are very nice. I would like to know if you had anyebook for webdynpro. Otherwise plz suggest me some good books ofWebdynpro programming. I want those look like moreprogrammatical not more theoritical.

Thanks In Advance,Kiran

kiranJune 11, 2012

REPLY

Hello Kiran,

The best books for webdynpro are sap certification materialsbooksLike :NET310 : Fundamentals for webdynpro for abapIF you want to learn Floor plan manager you can tryNET313 : Floor plan manager.

Thanks & Regards,~RajSAP IGnite

RajJune 11, 2012

REPLY

Hi Raj,

This blog is just amazing. I tried the raw method of calling a URLwith CALL_BROWSER function module and I am unable to openthe URL.

I am trying to open a transaction (Transaction BBP_BID_DISP; URLis passed to CALL_BROWSER to achieve the same) with just oneparameter(~EVAL_GUID) in SRM Portal and the operation is juststuck showing the “SAP GUI for HTML”.

SindhuSeptember 10, 2012

Page 8: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 8/9

I am not sure what is wrong.

My URL is: http://server:portno/sap/bc/gui/sap/its/webgui?~transaction=bbp_bid_disp%20~EVAL_GUID=guid;DYNP_OKCODE=SHOW

Appriciate if you can help me get through this.

Regards,Sindhu S Swamy

REPLY

Hi Raj ,Your articles are very nice. I tried out and it works for me..Thanks forproviding this information.However i have a requirement like when i call a TCODE using itshow it as new new window.In this new window the standard backbutton doesnot take me back to my wd application .Is there a way through which it gets back to web dynpro applicationfrom where the TCODE is called . In my requirement i am usingradio button and each on radio button a tcode is called .

RegardsShrey

ShreyOctober 19, 2012

REPLY

Hi Shrey,

You want to close the opened window ( of Tcode) ??try close_window method

Thanks~RajSAP IGnite

RajOctober 19, 2012

REPLY

Hi Raj ,Thanks for your quick reply .My requirement is to to get back to the first web dynproapplication from which TCODE is being called.In first application , i have 4 radio buttons and on thereselection i am calling linktourl . This link to URL has tcodesbinded .Say when i click the first radio button it open the tcode(R/3) innew window .Here my requirement fails. i dont want to everytime to application to run different tcodes.IS there any way which u can suggest me ?ThanksShrey

ShreyOctober 19, 2012

REPLY

Hi Raj ,Is there a way to get R/3 icons standard GUI (like Back ,Execute)when calling a TCODE . I tried but i am getting only buttonsand not there icon.IS there any way which u can suggest me ?Thanks

ShreyNovember 9, 2012

Page 9: Call SAP Tcode Using Webdynpro for ABAP _ SAP Ignite

3/20/2015 Call SAP Tcode using Webdynpro for ABAP | SAP Ignite

http://sapignite.com/callsaptcodeusingwebdynproforabap/ 9/9

Shrey

REPLY

Leave a Reply

Name

Email

URL (optional)

Submit

Copyright Terms

SAP IGNITE @ 2012 All product names on thisweb site are trademarks of the companies thatown them. Sapignite.com is not affiliated withSAP AG in any way. SAP AG is the registeredtrademark holder of SAP, SAP R/3, mySAP,ABAP, xApps, NetWeaver, and otherproprietary terms. The technical information onthis site is verified to the greatest extentpossible, however, any information found onthis site is used at the site visitor's own risk.Sapignite.com reserves the right to correct anyerrors or omissions in any portion of this site atany time without obligation.

Recent Comments

Hi Ajay, I am trying to access web ui andtrying to access transactionBSP_WD_CMPWB but it seems by TedPudmanabadoo

:) :) :) :) :) :) :) superbby Name

Hallo Raj, don't undestand the 1. Pic.How can I generate classes from UML ?Do you have a descriptby Viktor