cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a particular screen of a tcode from webdynpro

Former Member
0 Kudos

Hi friends,

Looking for some help on below:

I have a tcode whose selection screen comprises of multiple tabs (module pool program) with multiple screen fields. Now I have to call this tcode from webdynpro such that I can pass some default values to multiple parameters in tab (say second or third tab). How can we do this? How do we construct URL to directly populate screen-fields of different tabs? Any piece of code will be very useful.

Thanks and Regards,

Praveen

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sahai,

I guess you didn't get the issue I am facing. In tcode HUMO, there is a CONTENT tab. How to pass value to Material Number in Content Tab? The URL which you mentioned in the previous post will not pass value to Material Number of Content tab. Any idea how can we do this?

Thanks and Regards,

Praveen

former_member199125
Active Contributor
0 Kudos

Hi Praveen,

Hope you are calling HUMO tcode through some url, right?

in that url concatenate below field and its value.

For material, its field name is SELMATNR-LOW and value say 1000,

u have to pass like SELMATNR-LOW=1000

Let me know if you have any doubts

If the above idea is not working then first concatenate the okcode value for selecting 2nd tab and then SELMATNR-LOW=1000

Regards

Srinivas

Edited by: sanasrinivas on Jan 25, 2012 6:31 PM

Edited by: sanasrinivas on Jan 25, 2012 6:33 PM

Former Member
0 Kudos

Thanks for the code and info!! It works fine for normal tcode. However if I try the same with tcode HUMO which has multiple tab strips, it's not working. Any idea how can we do this for tcode HUMO?

I could call different tab by passing OKCODE, but was not able to populate the section screen. How can we pass screen number?

Thanks and Regards,

Praveen

sahai
Contributor
0 Kudos

Thanks for the code and info!! It works fine for normal tcode. However if I try the same with tcode HUMO which has multiple tab strips, it's not working. Any idea how can we do this for tcode HUMO?

>

> I could call different tab by passing OKCODE, but was not able to populate the section screen. How can we pass screen number?

>

> Thanks and Regards,

> Praveen

Hi,

In code i shared you can change the following part

*create URL
  CONCATENATE 'http'
  '://' HOST ':' PORT
  '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=HUMO
   INTO URL.
*get the window manager as we are opening t code in external window.
  LO_API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).
  LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
 
*  call the url which we created above
 
  LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW(
  EXPORTING
  URL = URL
  RECEIVING
  WINDOW = LO_WINDOW ).
  LO_WINDOW->OPEN( ).

Regards,

Sahai.S

Former Member
0 Kudos

or is it possible to call a tcode with a variant from webdynpro application? How?

Thanks...Praveen

sahai
Contributor
0 Kudos

or is it possible to call a tcode with a variant from webdynpro application? How?

>

> Thanks...Praveen

Hi,

I called once cv03n t-code from my wda screen in that i passed some parameters also have a look here is the code below.

DATA LO_ND_CTX_VN_DOC TYPE REF TO IF_WD_CONTEXT_NODE.
    DATA LO_EL_CTX_VN_DOC TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    DATA LS_CTX_VN_DOC TYPE WD_THIS->ELEMENT_CTX_VN_DOC.
DATA: URL TYPE STRING,
        HOST TYPE STRING,
        PORT TYPE STRING.
DATA: DOC_NO TYPE STRING,
       DOC_TYPE TYPE STRING,
       DOC_PART TYPE STRING,
       DOC_VER TYPE STRING.
  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.

*   navigate from <CONTEXT> to <CTX_VN_DOC> via lead selection
    LO_ND_CTX_VN_DOC = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_CTX_VN_DOC ).

CALL METHOD WDEVENT->GET_CONTEXT_ELEMENT
EXPORTING
  NAME = 'CONTEXT_ELEMENT'
  RECEIVING
  VALUE = LO_EL_CTX_VN_DOC.
*   @TODO handle not set lead selection
    IF LO_EL_CTX_VN_DOC IS INITIAL.
    ENDIF.

*   get all declared attributes
    LO_EL_CTX_VN_DOC->GET_STATIC_ATTRIBUTES(
      IMPORTING
        STATIC_ATTRIBUTES = LS_CTX_VN_DOC ).
*Call below method to get host and port
  CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
     IMPORTING HOST = HOST
            PORT = PORT ).
 DOC_NO = LS_CTX_VN_DOC-DOKNR.
       DOC_TYPE = LS_CTX_VN_DOC-DOKAR.
       DOC_PART = LS_CTX_VN_DOC-DOKTL.
       DOC_VER = LS_CTX_VN_DOC-DOKVR.
*create URL
  CONCATENATE 'http'
  '://' HOST ':' PORT
  '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=CV03N' '%20DRAW-DOKNR=' DOC_NO ';DRAW-DOKAR=' DOC_TYPE
  ';DRAW-DOKTL=' DOC_PART ';DRAW-DOKVR=' DOC_VER
   INTO URL.

*get the window manager as we are opening t code in external window.
  LO_API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).
  LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).

*  call the url which we created above

  LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW(
  EXPORTING
  URL = URL
  RECEIVING
  WINDOW = LO_WINDOW ).

  LO_WINDOW->OPEN( ).

hope this will help you

Thanks and regards,

Sahai.S