Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9193

calling me22n transaction in webdynpro with out portal

$
0
0

Hi Exprets,


I am facing some problem based on below program, plz suggested me, with correct code.


According to my code, it shows me the ME22N transaction but it opens up the last run PO in my system but not the one that I selected on the table.

 

Am I missing some thing? Please let me know.

 

 



DATA lo_el_context TYPE REF TO if_wd_context_element.
     DATA ls_context TYPE wd_this->element_context.
     DATA lv_text TYPE wd_this->element_context-text.

*   get element via lead selection
     lo_el_context = wd_context->get_element( ).

*   @TODO handle not set lead selection
     IF lo_el_context IS INITIAL.
     ENDIF.

*   @TODO fill attribute
*   lv_text = 1.

*  DATA lo_el_context TYPE REF TO if_wd_context_element.
*  DATA ls_context TYPE wd_this->element_context.
   DATA lv_ebeln TYPE wd_this->element_context-ebeln.

* get element via lead selection
   lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
   IF lo_el_context IS INITIAL.
   ENDIF.

* get single attribute
   lo_el_context->get_attribute(
     EXPORTING
       name `EBELN`
     IMPORTING
       value = lv_ebeln ).

   DATA :o_host TYPE string,
         o_port TYPE string,
         o_protocol TYPE string,
         v_string TYPE string value '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=',
         v_string1 type string,
         V_STRING2 TYPE STRING.
   " to get host,port,protocal details used this class and method.
   CALL METHOD cl_http_server=>if_http_server~get_location
     EXPORTING
*     protocol            =
*     application         =
*     for_domain          =
       server              = cl_wdr_task=>server
       use_ticket_protocol = abap_true
     IMPORTING
       host                = o_host
       port                = o_port
       out_protocol        = o_protocol.

   CONCATENATE o_protocol'://' o_host':' o_port V_STRING INTO v_string1.
   CONCATENATE v_STRING1 'ME22N' '&%20' lv_ebeln INTO V_STRING2.

*call transaction 'ME22N' and skip first screen.
*   set single attribute
     lo_el_context->set_attribute(
       name `text`
       value = V_STRING2 ).

thanks,

Swetha.


Viewing all articles
Browse latest Browse all 9193

Trending Articles