Calling a transaction code

Dear Expert,
Is that possible to call a transaction code using a webdynpro for abap. I have a button in my program where when i click on the button, it need to all up the su01 screen.
My coding is as below
method ONACTIONEDIT_APPRAISAL .
LEAVE TO TRANSACTION 'SU01'.
endmethod.
However when i run this program, and click ont he button, the system return a short dump.
Any idea?
Thanks,
Regards,
Bryan

Dear Suman or anyone,
I have solve this using the navigate_absolute method, however the NAVIGATION_MODE seem that does not works.
Code begin*
method ONACTIONEDIT_APPRAISAL .
  data lr_componentcontroller type ref to ig_componentcontroller .
  data l_api_componentcontroller type ref to if_wd_component.
  data lr_port_manager type ref to if_wd_portal_integration.
  lr_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
  l_api_componentcontroller = lr_componentcontroller->wd_get_api( ).
  lr_port_manager = l_api_componentcontroller->get_portal_manager( ).
Data:
target type string.
Data:
nmode type string.
target = 'pcd:portal_content/mysap/Appraisal/PPPM_PAGE'.
nmode = 'INPLACE'.
  call method lr_port_manager->navigate_absolute
    exporting
      NAVIGATION_MODE = nmode
      navigation_target = target
endmethod.
*code end
I have tried to use the INPLACE navigation mode, but it still display it in a new portal page. Anyway to control it? Do i need to define a area so that the target will show in that particular area?
Please help me...
Thanks
Regards,
Bryan

Similar Messages

  • Call a transaction code in dynamic action

    Hi
    How can we call a transaction code in a dynamic action.
    TC XD01 is populated when changes is happen in IT0006 subtype 03.
    Regards
    WS

    Hi,
    Please find the below threads which may help you.
    Problem in calling dynamic actions in BDC
    Create Dynamic Action
    Triggering Dynamic actions when updating an Infotype using a FM
    Thanks & Regards,
    Sandip Biswas.

  • Calling a transaction code in between the program and use the output

    Hi frnds,
              i want to call a transaction code in between the program   and pass the input .After getting the output, use that output in the program

    Hi Navin,
                     Why don't you sit with ABAPer he can explain better.
    Regards,
    HAri.

  • Call MR21 Transaction code

    Hi Expert,
    i want to call MR21 transaction code from program with filling plant ,company code and material from the production order
    my first question is
    is it possible to call MR21 with filling material?
    if possible then how ?
    Thanks,
    Mahipal

    Hi,
    you just need to change the MODE.
    N
    Screens are not displayed. You must choose this mode when you run the BDC in a background job.
    A
    All screens are displayed. On each screen, a little popup is displayed with the next recorded function, the user has to press Enter to execute it.
    E
    By default, screens are not displayed, except if an error occurs, or if the end of BDC data is reached although the recorded transaction was not exited
    Do not forget to click on "Correct Answer", to close the topic.
    Rachid.

  • Calling a transaction code on click on alv

    how do i call a transaction on mouse double click on alv grid.
    thanks
    chinmaya

    Can u please explain wid reef. to this code thnx
    report ztst_chin_alv3.
    tables : lfb1.
       Declarations                                                     *
    selection-screen begin of block a with frame title text-001.
    select-options : bukrs for lfb1-bukrs.
    select-options : lifnr for lfb1-lifnr.
    selection-screen end of block a.
    data: r_container     type ref to cl_gui_custom_container.
    data: r_grid          type ref to cl_gui_alv_grid.
    data: g_fieldcat      type lvc_t_fcat.
    data: w_fieldcat      like line of g_fieldcat.
    data: g_layout        type lvc_s_layo.
    data: ok_code         like sy-ucomm.
    data: gs_variant      type disvariant.
    data: t_selected      type lvc_t_row.
    data  wa_selected     like line of t_selected.
    data: it_items        like eban occurs 0.
    data: it_sort type lvc_t_sort.
    data: s_sort type lvc_s_sort.
    data: h_test_alv type lvc_s_col.
    data: begin of it_lfb1 occurs 0,
    lifnr like lfb1-lifnr,
    bukrs like lfb1-bukrs,
    akont like lfb1-akont,
    fdgrv like lfb1-fdgrv,
    end of it_lfb1.
       Initialization                                                   *
    initialization.
    at selection-screen.
      ok_code = sy-ucomm.
      case ok_code.
        when 'BACK'.
          leave program.
        when 'CANCEL'.
          leave program.
        when 'EXIT'.
          leave program.
        when 'ONLI' or 'CRET'.
          call screen 100.
        when others.
      endcase.
        GetData                                                         *
    module getdata output.
      if sy-ucomm <> 'STOP'.
    *refresh control container_1 from screen scr.
        refresh it_lfb1.
        clear bukrs.
        clear lifnr.
        select lifnr bukrs akont fdgrv
          into corresponding fields of  table it_lfb1
          from lfb1
          where
          bukrs in bukrs
          and lifnr in lifnr.
      endif.
      refresh bukrs.
      refresh lifnr.
    endmodule.
          Create ALV                                                    *
    module create_alv output.
      gs_variant-report = sy-repid.
      if r_container is initial.
        create object r_container
                 exporting container_name = 'CONTAINER_1'.
        create object r_grid
              exporting i_parent = r_container.
      endif.
    *modify the headings in the field catalogue
      call function 'LVC_FIELDCATALOG_MERGE'
           exporting
                i_structure_name = 'ztest_alv'
           changing
                ct_fieldcat      = g_fieldcat[].
      loop at g_fieldcat into w_fieldcat.
        case w_fieldcat-fieldname.
          when 'ZCURSTAT'.
            w_fieldcat-scrtext_l = 'Prev.RelCode'.
            w_fieldcat-scrtext_m = 'Prev.RelCode'.
            w_fieldcat-scrtext_s = 'Prev.RelCode'.
            w_fieldcat-reptext   = 'Prev.RelCode'.
        endcase.
        modify g_fieldcat from w_fieldcat.
      endloop.
      call method r_grid->set_table_for_first_display
        exporting
       I_BYPASSING_BUFFER            =
       I_BUFFER_ACTIVE               =
       I_CONSISTENCY_CHECK           =
          i_structure_name              = 'ztest_alv'
          is_variant                    = gs_variant
          i_save                        = 'A'
       I_DEFAULT                     = 'X'
          is_layout                     = g_layout
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
        changing
          it_outtab                     = it_lfb1[]
          it_fieldcatalog               = g_fieldcat[]
          it_sort                       = it_sort[]
       IT_FILTER                     =
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
       call method r_grid->set_table_for_first_display
                           exporting i_structure_name     = 'ztest_alv'
                                     is_layout            = g_layout
                                     is_variant           = gs_variant
                                     i_save               = 'A'
                           changing it_outtab = it_lfb1[]
                                    it_fieldcatalog  = g_fieldcat[].
    *ELSE.
    CALL METHOD r_grid->refresh_table_display
    EXPORTING i_soft_refresh = ' '.
    endmodule.
       STATUS                                                           *
    module status output.
      set pf-status '0100'.
    endmodule.
         User Commands                                                  *
    module user_command input.
      ok_code = sy-ucomm.
      case ok_code.
        when 'BACK'.
          call screen '1000'.
        when 'CANCEL'.
          leave program.
        when 'EXIT'.
          leave program.
      endcase.
    endmodule.
         ALV Layout                                                     *
    module layout output.
      g_layout-zebra = 'X'.
      g_layout-sel_mode = 'A'.
      g_layout-grid_title = ''.
      g_layout-detailtitl = ''.
    endmodule.
          MODULE sort_itab                                              *
    module sort_itab output.
    *break-point.
    *data s_Sort type lvc_s_sort.
      perform sort_itab.
    endmodule.
          FORM sort_itab                                                *
    form sort_itab.
      s_sort-spos = '1'.
      s_sort-fieldname = 'FDGRV'.
      s_sort-up = 'X'.
      append s_sort to it_sort.
      clear s_sort.
    endform.
         Select Rows                                                    *
    form get_selected_rows.
      call method r_grid->get_selected_rows
      importing et_index_rows = t_selected.
      if t_selected is initial.
        call function 'WS_MSG'
             exporting
                  msg_type = 'E'
                  text     = 'Select Line'
                  titl     = 'Select Line'.
        sy-ucomm = 'STOP'.
      endif.
    endform.
    This is Test code.
    *class lcl_event_receiver definition.
    *public section.
       methods:
       handle_double_click
           for event double_click of cl_gui_alv_grid
               importing e_row e_column.
    private section.
    *endclass.
    *class lcl_event_receiver implementation.
    method handle_double_click.
    **endmethod.
    *endclass.

  • Problem with calling we02 transaction code from web dynpro

    Hello everyone,
    I want to skip the initial screen of we02 tcode for this i have created the URL, provided the idoc number and
    used the function code DYNP_CODE=ONLI for execute button.
    DATA : FINAL_URL TYPE STRING.
    CONCATENATE 'host' '.port' '/sap/bc/gui/sap/its/webgui?~transaction=we02 DOCNUM-LOW='
                ls_itab-docnum ';CREDAT-low=' ' ' ';DYNP_OKCODE=ONLI'
                 into FINAL_URL.
    I am trying to pass the idoc number internally and click on execute button...so that the end user can see the idoc display directly, rather than clicking the execute button manually. But, unfortunately the function code for execute buttong (ONLI) is not working. In WE02 tcode, provided input values are appeaing correctly but not triggering the execute button.
    Please help!
    Thanks in advance...

    Hi Rohit.,
    Did u tried my previous reply.,  Use., & ~OKCODE=ONLI .,
    http://host:8000/sap/bc/gui/sap/its/webgui?sap-system-login-basic_auth=X&sap-client=800&sap-language=EN&transaction=we02&okcode=ONLI
    tis will work.,
    Thanks & Regards
    Kiran

  • ALV Grid Calling Transaction Code

    Hello Everybody
    Can anyone help me about my problem in using ALV Grid calling a transaction code...?Here is the sample code below..
           IF rs_selfield-fieldname = 'BELNR'.
            SET PARAMETER ID 'BLN' FIELD  rs_selfield-value.
            CALL TRANSACTION 'FB03'  AND SKIP FIRST SCREEN.
          ENDIF.
    the main problem is how can I set my parameter id for company since
    my rs_field-value is for the column BELNR ( document # field only)
    it returns error when i set this code since i have no value to pass for rs_selfield for company code
            SET PARAMETER ID 'BUK' FIELD 
    Help
    thanks in advance
    aVaDuDz

    Hi,
    *"Table declarations...................................................
    TABLES:
      rbkp,                                " Document Header Invoice receipt
      rseg,                                " Document Item: Incoming Invoice
      eban,                                " Purchase Requisition
      t001w.                               " Plants/Branches
    *"Selection screen elements............................................
    PARAMETERS:
      p_gjahr LIKE rbkp-gjahr.             " Fiscal Year
    SELECT-OPTIONS:
      s_belnr FOR rbkp-belnr,              " Document number of an invoice
      s_bldat FOR rbkp-bldat,              " Document Date in Document
      s_budat FOR rbkp-budat,              " Posting Date in the Document
      s_werks FOR rseg-werks.              " Plant
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      w_flag1  TYPE c VALUE '0',           " Flag variable 1
      w_flag2  TYPE c VALUE '0',           " Flag variable 2
      w_index1 TYPE sy-tabix.              " Index variable
    Field String to hold Document Header Invoice receipt                *
    DATA:
      BEGIN OF fs_rbkp,
        belnr TYPE rbkp-belnr,             " Document number of an invoice
        gjahr TYPE rbkp-gjahr,             " Fiscal Year
        bldat TYPE rbkp-bldat,             " Posting Date in the Document
        budat TYPE rbkp-budat,             " Posting Date in the Document
        lifnr TYPE rbkp-lifnr,             " Different invoicing party
      END OF fs_rbkp,
    Internal table to hold Document Header Invoice receipt              *
      t_rbkp LIKE STANDARD TABLE OF fs_rbkp.
    Field String to hold Document Item: Incoming Invoice                *
    DATA:
      BEGIN OF fs_rseg,
        belnr TYPE rseg-belnr,             " Document number of an invoice
        ebeln TYPE rseg-ebeln,             " Purchasing Document Number
        wrbtr TYPE rseg-wrbtr,             " Amount in document currency
      END OF fs_rseg,
    Internal table to hold Document Item: Incoming Invoice              *
    t_rseg LIKE STANDARD TABLE OF fs_rseg.
    Field String to hold Purchase Requisition                           *
    DATA:
      BEGIN OF fs_eban,
        banfn TYPE eban-banfn,             " Purchase requisition number
        ernam TYPE eban-ernam,             " Person who Created the Object
        afnam TYPE eban-afnam,             " Name of requisitioner/requester
        badat TYPE eban-badat,             " Requisition (request) date
        ebeln TYPE eban-ebeln,             " Purchase order number
      END OF fs_eban,
    Internal table to hold Purchase Requisition                         *
      t_eban LIKE STANDARD TABLE OF fs_eban.
    Field String to hold Desired Data                                   *
    DATA:
      BEGIN OF fs_final,
        ebeln TYPE rseg-ebeln,             " Purchasing Document Number
        banfn TYPE eban-banfn,             " Purchase requisition number
        badat TYPE eban-badat,             " Requisition (request) date
        bldat TYPE rbkp-bldat,             " Posting Date in the Document
        lifnr TYPE rbkp-lifnr,             " Different invoicing party
        wrbtr TYPE rseg-wrbtr,             " Amount in document currency
        afnam TYPE eban-afnam,             " Name of requisitioner/requester
        ernam TYPE eban-ernam,             " Name of Person who Created the
                                           " Object
      END OF fs_final,
    Internal table to hold Desired Data                                 *
      t_final LIKE STANDARD TABLE OF fs_final.
                          INITIALIZATION                                *
    INITIALIZATION.
      p_gjahr = sy-datum+0(4).
                          AT SELECTION-SCREEN EVENT                     *
    AT SELECTION-SCREEN.
      IF s_belnr IS INITIAL OR s_bldat IS INITIAL OR s_budat IS INITIAL.
        MESSAGE ' (Invoice) Add Creation Date .' TYPE 'E'.
      ENDIF.                               " IF S_BELNR...
                          AT SELECTION-SCREEN ON FIELD EVENT            *
    AT SELECTION-SCREEN ON s_werks.
      SELECT SINGLE werks                  " Plant
        FROM t001w
        INTO t001w
       WHERE werks IN s_werks.
      IF sy-subrc NE 0.
        MESSAGE 'Invalid plant' TYPE 'E'.
      ENDIF.                               " IF SY-SUBRC NE 0.
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM get_purchaserequistion.
      LOOP AT t_rseg INTO fs_rseg.
        READ TABLE t_rbkp INTO fs_rbkp WITH KEY belnr = fs_rseg-belnr
                                                        BINARY SEARCH.
        IF sy-subrc EQ 0.
          READ TABLE t_eban INTO fs_eban WITH KEY ebeln = fs_rseg-ebeln
                                                        BINARY SEARCH.
          IF sy-subrc EQ 0.
            IF fs_rbkp-bldat LE fs_eban-badat.
              DELETE t_rseg INDEX sy-tabix.
            ENDIF.                         " IF FS_RBKP-BLDAT...
          ENDIF.                           " IF SY-SUBRC EQ 0
        ENDIF.                             " IF SY-SUBRC EQ 0
      ENDLOOP.                             " LOOP AT T_RSEG...
      LOOP AT t_rbkp INTO fs_rbkp.
        WHILE w_flag1 EQ '0'.
          READ TABLE t_rseg INTO fs_rseg WITH KEY belnr = fs_rbkp-belnr
                                                          BINARY SEARCH.
          w_index1 = sy-tabix.
          IF sy-subrc EQ 0.
            WHILE w_flag2 EQ '0'.
              READ TABLE t_eban INTO fs_eban WITH KEY ebeln = fs_rseg-ebeln
                                                              BINARY SEARCH.
              IF sy-subrc EQ 0.
                fs_final-bldat = fs_rbkp-bldat.
                fs_final-lifnr = fs_rbkp-lifnr.
                fs_final-ebeln = fs_rseg-ebeln.
                fs_final-wrbtr = fs_rseg-wrbtr.
                fs_final-banfn = fs_eban-banfn.
                fs_final-badat = fs_eban-badat.
                fs_final-afnam = fs_eban-afnam.
                fs_final-ernam = fs_eban-ernam.
                APPEND fs_final  TO t_final.
                CLEAR fs_final.
                DELETE t_eban INDEX sy-tabix .
              ELSE.
                w_flag2 = '1'.
                DELETE t_rseg INDEX w_index1.
              ENDIF.                       " IF SY-SUBRC EQ 0
            ENDWHILE.                      " WHILE W_FLAG2...
            w_flag2 = '0'.
          ELSE.
            w_flag1 = '1'.
          ENDIF.                           " IF SY-SUBRC EQ 0
        ENDWHILE.                          " WHILE W_FLAG1...
        w_flag1 = '0'.
      ENDLOOP.                             " LOOP AT T_RBKP...
      CLASS lcl_event_receiver DEFINITION DEFERRED.
    Declare reference variables to the ALV grid and the container
      DATA :
        cust_con TYPE scrfname VALUE 'BCALVC_TOOLBAR_D100_C1',
        cont_on_dialog TYPE scrfname VALUE 'BCALVC_TOOLBAR_D101_C1',
        ref1 TYPE REF TO cl_gui_custom_container,
        ref2 TYPE REF TO cl_gui_alv_grid,
        event_receiver TYPE REF TO lcl_event_receiver,
        fcat    TYPE lvc_t_fcat,
        wa      TYPE lvc_s_fcat,
        wa_layo TYPE lvc_s_layo.
      CALL SCREEN 200.
    class lcl_event_receiver: local class to define and handle own
    *functions......................................................
    Definition:
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    class lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA: ls_toolbar  TYPE stb_button.
    E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    append an icon to show booking table
        CLEAR ls_toolbar.
        MOVE 'PORDER' TO ls_toolbar-function.
        MOVE icon_employee TO ls_toolbar-icon.
        MOVE 'Show Bookings' TO ls_toolbar-quickinfo.
        MOVE 'PONUMBER' TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    append an icon to show booking table
        CLEAR ls_toolbar.
        MOVE 'PREQUISITION' TO ls_toolbar-function.
        MOVE icon_employee TO ls_toolbar-icon.
        MOVE 'Show Bookings' TO ls_toolbar-quickinfo.
        MOVE 'PRNUMBER' TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                           " handle_toolbar
      METHOD handle_user_command.
    *Event handler method for event USER_COMMAND:
        CASE e_ucomm.
          WHEN 'PORDER'.
            CALL TRANSACTION 'ME23N'.
          WHEN 'PREQUISITION'.
            CALL TRANSACTION 'ME53N'.
        ENDCASE.
      ENDMETHOD.                           " handle_user_command
    ENDCLASS.                              " lcl_event_receiver
    *& Module STATUS_0200 OUTPUT
    text
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'GUI'.
      SET TITLEBAR 'TITLE'.
      IF sy-ucomm = 'BACK'.
        LEAVE PROGRAM.
      ENDIF.
      PERFORM form_fcat.
      PERFORM form_layo.
      IF ref1 IS INITIAL.
        CREATE OBJECT ref1
        EXPORTING
    PARENT = ref1
        container_name = 'CUST_CON'
    STYLE =
    LIFETIME = lifetime_default
    REPID =
    DYNNR =
    NO_AUTODEF_PROGID_DYNNR =
        EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 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.
      ENDIF.
      IF ref2 IS INITIAL.
        CREATE OBJECT ref2
        EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
        i_parent = ref1
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
        EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init  = 2
        error_cntl_link  = 3
        error_dp_create  = 4
        OTHERS = 5
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CALL METHOD ref2->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = wa_layo
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
        CHANGING
        it_outtab = t_final
        it_fieldcatalog = fcat
    IT_SORT =
    IT_FILTER =
       EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       OTHERS                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR ref2.
        SET HANDLER event_receiver->handle_toolbar FOR ref2.
    *Call method 'set_toolbar_interactive' to raise event TOOLBAR.
        CALL METHOD ref2->set_toolbar_interactive.
      ENDIF.
    ENDMODULE.                             " STATUS_0200 OUTPUT
    Form FORM_FCAT                                                     *
    text                                                               *
    FORM form_fcat.
      CLEAR fcat.
      CLEAR wa.
      wa-fieldname = 'EBELN'.
      wa-col_pos = 1.
      wa-scrtext_l = ' PURCHASE ORDER NUMBER'.
      APPEND wa TO fcat.
      CLEAR wa.
      wa-fieldname = 'BANFN'.
      wa-col_pos = 2.
      wa-scrtext_l = 'PURCHASE REQUISITION NUMBER'.
      APPEND wa TO fcat.
      CLEAR wa.
      wa-fieldname = 'BADAT'.
      wa-col_pos = 3.
      wa-scrtext_l = 'PR CREATION DATE'.
      APPEND wa TO fcat.
      CLEAR wa.
      wa-fieldname = 'BLDAT'.
      wa-col_pos = 4.
      wa-scrtext_l = 'INVOICE DATE'.
      APPEND wa TO fcat.
      CLEAR wa.
      wa-fieldname = 'LIFNR'.
      wa-col_pos = 5.
      wa-scrtext_l = 'VENDOR NUMBER'.
      APPEND wa TO fcat.
      wa-fieldname = 'WRBTR'.
      wa-col_pos = 6.
      wa-do_sum  = 'X'.
      wa-scrtext_l = ' PO AMOUNT'.
      APPEND wa TO fcat.
      wa-fieldname = 'AFNAM'.
      wa-col_pos = 7.
      wa-scrtext_l = 'REQUISITIONER'.
      APPEND wa TO fcat.
      wa-fieldname = 'ERNAM'.
      wa-col_pos = 8.
      wa-scrtext_l = 'PR CREATOR'.
      APPEND wa TO fcat.
    ENDFORM.                               " FORM_FCAT
    Module USER_COMMAND_0200 INPUT                                      *
    text                                                                *
    MODULE user_command_0200 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0200 INPUT
         FORM FORM_LAYO                                                *
    There are no interface parameters to be passed to this subroutine.*
    FORM form_layo.
      CLEAR wa_layo.
      wa_layo-zebra = 'X'.
      wa_layo-grid_title = 'GRID TITLE'.
      wa_layo-no_toolbar = 'X'.
    ENDFORM.                               " FORM_LAYO
         FORM GET_PURCHASEREQUISITION                                   *
    This subroutine selects all the Purchase requisitions from table   *
    EBAN for all the selected Invoices based on the Purchase orders.   *
    There are no interface parameters to be passed to this subroutine. *
    FORM get_purchaserequistion.
      SELECT belnr                         " Document number of an invoice
             gjahr                         " Fiscal Year
             bldat                         " Posting Date in the Document
             budat                         " Posting Date in the Document
             lifnr                         " Different invoicing party
        FROM rbkp
        INTO TABLE t_rbkp
       WHERE belnr IN s_belnr
         AND gjahr EQ p_gjahr
         AND bldat IN s_bldat
         AND budat IN s_budat.
      IF NOT t_rbkp[] IS INITIAL.
        SELECT belnr                       " Document number of an invoice
               ebeln                       " Purchasing Document Number
               wrbtr                       " Amount in document currency
          FROM rseg
          INTO TABLE t_rseg
           FOR ALL ENTRIES IN t_rbkp
         WHERE belnr EQ t_rbkp-belnr
           AND werks IN s_werks.
      ENDIF.                               " IF NOT t_rbkp[] IS INITIAL...
      IF NOT t_rseg[] IS INITIAL.
        SELECT banfn
               ernam
               afnam
               badat
               ebeln
          FROM eban
          INTO CORRESPONDING FIELDS OF TABLE t_eban
           FOR ALL ENTRIES IN t_rseg
         WHERE ebeln EQ t_rseg-ebeln.
      ENDIF.                               " IF NOT t_rseg[] IS INITIAL...
    ENDFORM.                               " GET_PURCHASEREQUISITION
    reward points if helpful.
    regards,
    kiran kumar k.

  • Calling Transaction code & returning back to calling program

    Hi,
    I have requirement as below
    Write the report to call the transaction code say for example different tcode (1000 in number) need to be executed and after every tcode execution it should return back to calling report. I tried using "CALL TRANSACTION 'ABC' AND SKIP FIRST SCREEN"  it does execute the tcode but need the user interaction to return back to report, where here i want do this programatically.
    can someone please help me & what is possible ways this can be do able.
    Thanks,
    John.

    There are two method of BDC
    1- Call transaction method
    2- BDC Session method
    In this case you can use call tansaction method.
    Syntax- call tansaction abc using gt_bdcdata.
    Do the recording with t-code SHDB for that particular transaction and after the necessary modification use it in your program.
    Please check f1 help of call transaction for details.

  • Requirement: Open Transaction code in SAP GUI from WD ABAP application

    Hello All,
    I have a WD ABAP application which is accessed from SAP GUI and Portal. In SAP GUI, there is report which calls the application URL.
    In the WD application, I need to call a transaction code. At this juncture, I made use of the ITS url. But,, the SSO does not work in SAP GUI.It works only in portal.
    As a solution,we identified the entry point i.e. SAP GUI or portal. Then, based on entry from SAP GUI, we tried to call the transaction code using call transaction statement. But, that replaced the wd application. We instead wanted it as a popup or atleast another session.
    Now, how do we open a transaction from WD screen in another session?
    Also, can we setany configurations in the system to make sure the SSO works for all the transactions i.e. ITS used in SAP GUI.?
    Thank you.
    Regards,
    Sharath

    Hi,
    This question gets asked many times.
    Depending on the circumstances, this can be achieved with varying degree of success
    So here is some code that might help you.
    This can (does) load a Windows GUI.
    Some things to consider.
    1. Browser settings can get in the way a bit, asking the user if they want to open a ".sap" file
    2. The user may have a SAP session open so consider adding a "/o" to the system code.
    3. The Custom variable might want to contain a [Options] section for "Re-use"
    4. The SAPLogon_ID may be required if using SSO (SNC)
    I have modified the code below, but you will get the idea.
    JS
    * Create the shortcut contents
      call function 'SWN_CREATE_SHORTCUT'
        exporting
          i_system_command        = lv_com
          i_saplogon_id           = lv_logon_id
          i_sysid                 = sy-sysid
          i_client                = sy-mandt
          i_user                  = sy-uname
          i_custom                = lv_custom
        importing
          shortcut_string         = lv_string
        exceptions
          inconsistent_parameters = 1
          others                  = 2.
    * Convert to xstring to execute....
      call method cl_http_utility=>if_http_utility~encode_utf8
        exporting
          unencoded = lv_string
        receiving
          encoded   = lv_xstring
        exceptions
          others    = 1.
    * Now call to open the shortcut.
      lv_file_name =  'mytrans.sap'.
      lv_mime = 'application/x-sapshortcut'.
      call method cl_wd_runtime_services=>attach_file_to_response
        exporting
          i_filename      = lv_file_name
          i_content       = lv_xstring
          i_mime_type     = lv_mime
          i_in_new_window = abap_true.

  • Interaction with transaction codes with interactive reports

    hi..
    i want to call a transaction code from the report which i prepared.for example...if im displaying the list of order no.of a customer as output ,then when i want to make some changes in the order details ..instead of going to transcode VA02 ..i want the transcation has to open when i double click the order number.

    Hi,
    you have to do some thing like this ...
    REPORT  ZTETS_CURSOR                            .
    DATA: FIELD(20),
          VALUE(10).
    DATA: BEGIN OF ITAB OCCURS 0,
            VBELN LIKE VBAK-VBELN,
            POSNR LIKE VBAP-POSNR,
           END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 100 ROWS
           INTO TABLE ITAB.
    TOP-OF-PAGE.
      WRITE:(10) 'VBELN',
             (6) 'POSNR'.
    END-OF-SELECTION.
      LOOP AT ITAB.
        WRITE: /(10) ITAB-VBELN,
                 (6) ITAB-POSNR.
      ENDLOOP.
    AT LINE-SELECTION.
      GET CURSOR FIELD FIELD VALUE VALUE.
      IF FIELD = 'ITAB-VBELN'.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = VALUE
          IMPORTING
            OUTPUT = VALUE.
        SET PARAMETER ID 'AUN' FIELD VALUE.
        CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
      ENDIF.
    Regards
    vijay

  • Starting SQL-Trace Automatically - Transaction Code: ST05

    Good Morning Experts!
    I have got a problem with my "SAP - Business Warehouse (BW) System".
    We have very much Traffic on this System every night (between 03:00 and 04:00 a.m.).
    Because nobody is at work so early in the morning, I wanted to ask you, if there is a possibility to start the SQL-Trace (which you can call by transaction code: ST05) automatically.....?
    Is there a possibility to write a short ABAP Code to start the SQL-Trace automatically?
    Thank's and best regards.

    Hello Rob.
    Thank you for replying.
    I tried to create a job with the "Job Wizard" with SM36.
    Now i realized, that i have to wirte my own ABAP-Report (Programme), which uses the ST05 SQL-Trace function.
    I am not an ABAP-Professional, so would you be so kind and give me the code-lines of this programme?
    I can not imagine if you have to write only 5-10 lines or if the code is much longer...
    Thank you and best regards.

  • Reg calling Transaction code in Webdynpro ABAP

    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.

    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.

  • CALL TRANSACTION code in RFC

    Hi Experts,
    I've created RFC function module that make use of CALL TRANSACTION code. This function module is being called in CRM system. However I encountered a short dump CALL_FUNCTION_RECEIVE_ERROR. Kindly help to determine if CALL TRANSACTION code is possible in RFC function module?
    Thanks in advance!

    Hello,
    Here's the detailed error analysis found in ST22:
    Error analysis
        An error occurred when executing a Remote Function Call.
        "Exception condition "CNTL_ERROR" raised. "
        Status of connection.... " "
        Internal error code.... "RFC_GET3"
        Log error: No end marker in data container.
    Thanks!

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *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( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • How to call a transaction from ABAP code

    Hi everybody,
    How do I run a transaction from my ABAP code?
    For example, through my ABAP code, I want to call the ME24 transaction (Maintain Purchase Order).
    Thanks for the help,
    Roy

    CALL TRANSACTION
    Syntax
    CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
                        | [USING bdc_tab [bdc_options]] }.
    Extras:
    1. ... AND SKIP FIRST SCREEN
    2. ... USING bdc_tab [bdc_options]
    Effect
    The statement CALL TRANSACTION calls the transaction whose transaction code is contained in data object ta. The data object ta must be of character type and must contain the transaction code in uppercase letters. If the transaction specified in ta cannot be found, an untreatable exception is triggered. The additions suppress the display of the initial screen and allow you to execute the transaction using a batch input session.
    At CALL TRANSACTION the calling program and its data is kept, and after exiting the called transaction, processing is resumed in the calling program after the call.
    When the transaction is called, the ABAP program linked with the transaction code is loaded in a new internal session. The session of the calling program is kept. The called program runs in an SAP LUW of its own.
    If the called transaction is a dialog transaction, after loading the ABAP program the event LOAD-OF-PROGRAM is triggered and the dynpro defined as initial dynpro of the transaction is called. The initial dynpro is the first dynpro of a dynpro sequence. The transaction is finished when the dynpro sequence is ended by encountering the next dynpro with dynpro number 0 or when the program is exited with the LEAVE PROGRAM statement.
    If the called transaction is an OO transaction (as of release 6.10), when loading all programs except class pools the event LOAD-OF-PROGRAM is triggered and then the method linked with the transaction code is called. If the method is an instance method, implicitly an object of the corresponding class is generated and referenced by the runtime environment. The transaction is finished when the method is finished or when the program is exited using the LEAVE PROGRAM statement.
    After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.
    Note
    At the statement CALL TRANSACTION, the authorization of the current user to execute the called transaction is not checked automatically. If the calling program does not execute a check, the called program must check the authorization. To do this, the called program must call function module AUTHORITY_CHECK_TCODE.
    Addition 1
    ... AND SKIP FIRST SCREEN
    Effect
    This addition suppresses the display of a screen of the initial dynpro of a called dialog transaction. The addition AND SKIP FIRST SCREEN suppresses the first screen under these prerequisites:
    For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
    All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters
    If these prerequisites are met, that screen of the dynpro is displayed that is specified in the Screen Painter as the next dynpro of the initial dynpro.
    Example
    If the static next dynpro of the initial dynpro of the called dialog transaction FLIGHT_TA is not the initial dynpro itself, its screen is suppressed, because its input fields are filled using the SPA/GPA parameters CAR and CON.
    DATA: carrid TYPE spfli-carrid,
          connid TYPE spfli-connid.
    SET PARAMETER ID: 'CAR' FIELD carrid,
                      'CON' FIELD connid.
    CALL TRANSACTION 'FLIGHT_TA' AND SKIP FIRST SCREEN.
    Addition 2
    ... USING bdc_tab [bdc_options]
    Effect
    Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
    The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
    Component Description
    PROGRAM Name of the program of the called transaction
    DYNPRO Number of the dynpro to be processed
    DYNBEGIN Flag for the beginning of a new dynpro (possible values are "X" and " ")
    FNAM Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor
    FVAL Value to be passed to the dynpro field or to the control statement
    Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
    System Fields
    sy-subrc Description
    0 The batch input processing of the called transaction was successful.
    < 1000 Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES.
    1001 Error in batch input processing.
    Note
    Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
    Example
    Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
    DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
    DATA: bdcdata_wa  TYPE bdcdata,
          bdcdata_tab TYPE TABLE OF bdcdata.
    DATA opt TYPE ctu_params.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLSEOD'.
    bdcdata_wa-dynpro   = '1000'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
    bdcdata_wa-fval = class_name.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=CIDI'.
    APPEND bdcdata_wa TO bdcdata_tab.
    opt-dismode = 'E'.
    opt-defsize = 'X'.
    CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt.

Maybe you are looking for