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!

Similar Messages

  • 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.

  • 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.

  • Calling transaction codes.

    Hi Everyone,
    I have around 5 different programs, and have transaction codes for them. Now if I navigate from one screen to another say for until the 4 screen and then again if I press the back button, it has to come back to the previous screen until the last one.
    Can this be implemented through callstack if so, how can it be done, any suggestions.
    It would be of great help if anyone can help me.
    Thanks,
    Prabs.

    Hi
    If you use call transaction then you can go back only one step with leave program . There is no way to determine previuos steps. You can still achieve this -
    In Program for ( TRANSACTION Z1 )
         CALL TRANSACTION Z2 .
    In Program for ( TRANSACTION Z2 )
         CALL TRANSACTION Z3 .
         LEAVE PROGRAM.
    In Program for ( TRANSACTION Z3 )
         CALL TRANSACTION Z4 .
         LEAVE PROGRAM.
    If now you branch to Z4 and click a back button here it will goto ( internally ->Z3 -> Z2 ) to Z1 .  You have to place the "LEAVE PROGRAM" just after the call transaction.
    If you are using call screen ( within same program ) you can use SET SCREEN 0 . LEAVE SCREEN to branch to first screen in call sequence.
    You can also try function module SYSTEM_CALLSTACK in your code  . With every call transaction a new call stack is created.
    ( You can even check in debugging the call stack ).
    Cheers

  • Personas: how to call Transaction code using a Script Button?

    Hi,
    I want to use a script button to run to certain UI based on the given transaction code. I am thinking there might be some ways to do so:
    Option 1:
        Somehow one can let the script button call the T-code in script, say, IW21, but how to write such script?
    Option 2:
        In the script of the script button, use "Push" or "Click" to cause an action on the launch button which contains the T-code, say /nIW21.
    But on my PC, this does not work. Why?
    pls help asap!
    Thx a lot!
    Br,
    Dong

    Knowledge sharing:
    Hi,
    I have found exact answer to this question: in the script of a script button, one can first set the T-code to the /okdc component, then call "press Enter" action. By this way, any script button can be used to triggle an action for a T-code. One can set teh /okdc as "hidden". Hope this will help other newers.
    Br,
    Dong

  • How to get a message from call transaction in RFC call

    Hello :
    I would like to ask one favor i make a 2 call transaction in a RFC funtion when i make the first CALL TRANSACTION using te next statement.
        CALL TRANSACTION 'F-43'
          USING bdcdata MESSAGES INTO messtab2 OPTIONS FROM l_fromopt.
    I recive the number of the document in the field  sy-msgv1 from the message table messtab2 , then i make the second  CALL TRANSACTION  and i am waiting to get the other number of the document from the table messtab3  using the next statatement.
         CALL TRANSACTION 'FIBLFFP'
            USING bdcdata MESSAGES INTO messtab3 OPTIONS FROM l_fromopt. but now the table messtab3 don't send the number of document , and i need to get the number of this document for making a REFERENCE.
    thanks a lot for you help

    FORM bdc_transaction USING tcode TYPE tcode.
      DATA: l_mstring(480).
      DATA: l_subrc  TYPE sy-subrc,
            lwa_t100 TYPE t100.
      DATA : gv_ctumode TYPE ctu_params-dismode VALUE 'A'.
    call transaction using
    BREAK-POINT.
      REFRESH gt_messtab.
      CLEAR gwa_messtab.
      gv_ctumode = gc_ctumode.
      CALL TRANSACTION tcode USING gi_bdcdata                "#EC CI_CALLTA
                       MODE   gv_ctumode
                       UPDATE gc_cupdate
                       MESSAGES INTO gt_messtab.
      l_subrc = sy-subrc.
      IF sy-subrc <> 0.
        WRITE: / 'CALL_TRANSACTION',
                 tcode,
                 'returncode:',
                 l_subrc,
                 'RECORD:',
                 sy-index.
        LOOP AT gt_messtab INTO gwa_messtab.
          CLEAR lwa_t100.
          SELECT SINGLE * FROM t100 INTO lwa_t100  WHERE sprsl = gwa_messtab-msgspra
                                    AND            arbgb = gwa_messtab-msgid
                                    AND            msgnr = gwa_messtab-msgnr.
          IF sy-subrc = 0.
            l_mstring = lwa_t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH gwa_messtab-msgv1 INTO l_mstring.
              REPLACE '&2' WITH gwa_messtab-msgv2 INTO l_mstring.
              REPLACE '&3' WITH gwa_messtab-msgv3 INTO l_mstring.
              REPLACE '&4' WITH gwa_messtab-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH gwa_messtab-msgv1 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv2 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv3 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv4 INTO l_mstring.
            ENDIF.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id        = gwa_messtab-msgid
                lang      = sy-langu
                no        = gwa_messtab-msgnr
                v1        = gwa_messtab-msgv1
                v2        = gwa_messtab-msgv2
                v3        = gwa_messtab-msgv3
                v4        = gwa_messtab-msgv4
              IMPORTING
                msg       = l_mstring
              EXCEPTIONS
                not_found = 1
                OTHERS    = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CONDENSE l_mstring.
            IF NOT l_mstring IS INITIAL.
              WRITE: / gwa_messtab-msgtyp, l_mstring(250).
              MESSAGE l_mstring TYPE 'I'.
            ENDIF.
          ELSE.
            WRITE: / gwa_messtab.
          ENDIF.
        ENDLOOP.
        SKIP.
      ENDIF.

  • Hi guys please give me sample code for call transaction that handles error

    hi guys, please give me sample code for call transaction that handles error,
    please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.
    please do help me as it is urgent.
    thanks and regards.
    prasadnn.

    Hi Prasad,
    Check this code.
    Source Code for BDC using Call Transaction
    *Code used to create BDC
    *& Report  ZBDC_EXAMPLE                                                *
    *& Example BDC program, which updates net price of item 00010 of a     *
    *& particular Purchase order(EBELN).                                   *
    REPORT  ZBDC_EXAMPLE  NO STANDARD PAGE HEADING
                          LINE-SIZE 132.
    Data declaration
    TABLES: ekko, ekpo.
    TYPES: BEGIN OF t_ekko,
        ebeln TYPE ekko-ebeln,
        waers TYPE ekko-waers,
        netpr TYPE ekpo-netpr,
        err_msg(73) TYPE c,
    END OF t_ekko.
    DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko  TYPE t_ekko,
          it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_error TYPE t_ekko,
          it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_success TYPE t_ekko.
    DATA: w_textout            LIKE t100-text.
    DATA: gd_update TYPE i,
          gd_lines TYPE i.
    *Used to store BDC data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Used to stores error information from CALL TRANSACTION Function Module
    DATA: BEGIN OF messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    *Screen declaration
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                        TITLE text-001. "Purchase order Num
    SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
                                        TITLE text-002. "New NETPR value
    PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.
    SELECTION-SCREEN END OF BLOCK block2.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Retrieve data from Purchase order table(EKKO)
      SELECT ekkoebeln ekkowaers ekpo~netpr
        INTO TABLE it_ekko
        FROM ekko AS ekko INNER JOIN ekpo AS ekpo
          ON ekpoebeln EQ ekkoebeln
       WHERE ekko~ebeln IN so_ebeln AND
             ekpo~ebelp EQ '10'.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Check data has been retrieved ready for processing
      DESCRIBE TABLE it_ekko LINES gd_lines.
      IF gd_lines LE 0.
      Display message if no data has been retrieved
        MESSAGE i003(zp) WITH 'No Records Found'(001).
        LEAVE TO SCREEN 0.
      ELSE.
      Update Customer master data (instalment text)
        LOOP AT it_ekko INTO wa_ekko.
          PERFORM bdc_update.
        ENDLOOP.
      Display message confirming number of records updated
        IF gd_update GT 1.
          MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
        ELSE.
          MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
        ENDIF.
    Display Success Report
      Check Success table
        DESCRIBE TABLE it_success LINES gd_lines.
        IF gd_lines GT 0.
        Display result report column headings
          PERFORM display_column_headings.
        Display result report
          PERFORM display_report.
        ENDIF.
    Display Error Report
      Check errors table
        DESCRIBE TABLE it_error LINES gd_lines.
      If errors exist then display errors report
        IF gd_lines GT 0.
        Display errors report
          PERFORM display_error_headings.
          PERFORM display_error_report.
        ENDIF.
      ENDIF.
    *&      Form  DISPLAY_COLUMN_HEADINGS
          Display column headings
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records updated successfully:'(013).
      WRITE:/ sy-uline(42).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(004), sy-vline,
              (11) 'Old Netpr'(005), sy-vline,
              (11) 'New Netpr'(006), sy-vline.
      WRITE:/ sy-uline(42).
    ENDFORM.                    " DISPLAY_COLUMN_HEADINGS
    *&      Form  BDC_UPDATE
          Populate BDC table and call transaction ME22
    FORM bdc_update.
      PERFORM dynpro USING:
          'X'   'SAPMM06E'        '0105',
          ' '   'BDC_CURSOR'      'RM06E-BSTNR',
          ' '   'RM06E-BSTNR'     wa_ekko-ebeln,
          ' '   'BDC_OKCODE'      '/00',                      "OK code
          'X'   'SAPMM06E'        '0120',
          ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',
          ' '   'EKPO-NETPR(01)'  p_newpr,
          ' '   'BDC_OKCODE'      '=BU'.                      "OK code
    Call transaction to update customer instalment text
      CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
             MESSAGES INTO messtab.
    Check if update was succesful
      IF sy-subrc EQ 0.
        ADD 1 TO gd_update.
        APPEND wa_ekko TO it_success.
      ELSE.
      Retrieve error messages displayed during BDC update
        LOOP AT messtab WHERE msgtyp = 'E'.
        Builds actual message based on info returned from Call transaction
          CALL FUNCTION 'MESSAGE_TEXT_BUILD'
               EXPORTING
                    msgid               = messtab-msgid
                    msgnr               = messtab-msgnr
                    msgv1               = messtab-msgv1
                    msgv2               = messtab-msgv2
                    msgv3               = messtab-msgv3
                    msgv4               = messtab-msgv4
               IMPORTING
                    message_text_output = w_textout.
        ENDLOOP.
      Build error table ready for output
        wa_error = wa_ekko.
        wa_error-err_msg = w_textout.
        APPEND wa_error TO it_error.
        CLEAR: wa_error.
      ENDIF.
    Clear bdc date table
      CLEAR: bdc_tab.
      REFRESH: bdc_tab.
    ENDFORM.                    " BDC_UPDATE
          FORM DYNPRO                                                   *
          stores values to bdc table                                    *
    -->  DYNBEGIN                                                      *
    -->  NAME                                                          *
    -->  VALUE                                                         *
    FORM dynpro USING    dynbegin name value.
      IF dynbegin = 'X'.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-program,
               value TO bdc_tab-dynpro,
               'X'  TO bdc_tab-dynbegin.
        APPEND bdc_tab.
      ELSE.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-fnam,
               value TO bdc_tab-fval.
        APPEND bdc_tab.
      ENDIF.
    ENDFORM.                               " DYNPRO
    *&      Form  DISPLAY_REPORT
          Display Report
    FORM display_report.
      FORMAT COLOR COL_NORMAL.
    Loop at data table
      LOOP AT it_success INTO wa_success.
        WRITE:/      sy-vline,
                (10) wa_success-ebeln, sy-vline,
                (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
                (11) p_newpr, sy-vline.
        CLEAR: wa_success.
      ENDLOOP.
      WRITE:/ sy-uline(42).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  DISPLAY_ERROR_REPORT
          Display error report data
    FORM display_error_report.
      LOOP AT it_error INTO wa_error.
        WRITE:/      sy-vline,
                (10) wa_error-ebeln, sy-vline,
                (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
                (73) wa_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    ENDFORM.                    " DISPLAY_ERROR_REPORT
    *&      Form  DISPLAY_ERROR_HEADINGS
          Display error report headings
    FORM display_error_headings.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(009), sy-vline,
              (11) 'Netpr'(010), sy-vline,
              (73) 'Error Message'(012), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    " DISPLAY_ERROR_HEADINGS
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Need BDC code for Call Transaction of VL31N, which creates Inbound del.s,

    Hi Experts,
    Is any body does have the BDC (CALL TRANSACTION) code for VL31N transaction, where we can crete INBOUND deliveries from Purc Orders.
    Actually, currently am doing by using FM - GN_DELIVERY_CREATE, but, its not given me a chance to incorporate BATCH SPLIT functionality. So, decided to go with BDC
    1 - Is this VL31N is Okay for BDC, bcoz, some where I red that, since its a ENJOY tx, its NOT recommended?
    2 - Is there any other FM, BAPI to create INBOUND deliveries from POs, which can take care of BATCH SPLIT functionality?
    3 - BDC code for VL31N  tx.
    thanq
    Edited by: Srinivas on Jul 29, 2008 1:47 PM

    1 - Is this VL31N is Okay for BDC, bcoz, some where I red that, since its a ENJOY tx, its NOT recommended?
    yes you can do that .
    2 - Is there any other FM, BAPI to create INBOUND deliveries from POs, which can take care of BATCH SPLIT functionality?
    using BDC we can achieve the  Barch split functionality.
    3 - BDC code for VL31N tx.
    Record using SHDB it will give you.

  • Call Transaction in Background for IW52

    Hi All..
    When i execute my BDC (Call Transaction) in foreground, the code will update IW52 screens without any errors/warnings.
    But if we schedule this in background, the IW52 screens are not getting updated.
    Even there are no Errors observed.
    We have used the syntax as follows..
    CALL Transaction IW52 using it_bdcdata MODE 'N' messages into it_bdcmsg.
    Can anyone help me how to rectify it and make it to execute successfully in background mode..??
    Your Help will be highly appreciated..
    Regards
    Pavan

    Hello Friends...
    I am running a call Transaction code in Background mode.
    I am facing Error message..
    If i run the same in foreground, it is working fine...
    Error Message is "No Batch Input data for screen <SAPNV screen No>"
    Expecting your guidence in this case...
    Regards
    Pavan
    Message was edited by:
            Pavan Sanganal

  • RFC function module with call transaction  and Import memory ID

    Hi,
    I am calling RFC function module from R/3 which exists in BW.
    In BW stand alone function module works fine.
    When I am Calling from R/3 it is not working,
    Can you tell me is it because of the below code, And suggest if any corrections required.
    I am calling the call transaction and using EXPORT memory iD inside the program
    and IMPORT in after that.
    And populating RFC table's table  " p_i_tcode_user" finally.
    set parameter id 'TCD' field p_tcode.
    call transaction 'Z_BW_RSUSR002' AND SKIP FIRST SCREEN.
      ENDIF.
    get the final user data from submitted program
    import gt_users_complete from memory id tcode_userid.
    LOOP AT gt_users_complete.
          lwa_tcode_user-tcode =  p_tcode.
          lwa_tcode_user-uname = gt_users_complete-Bname.
          APPEND lwa_tcode_user TO p_i_tcode_user.
    ENDLOOP.
    Thanks,
    Veerendra.

    HI,
       Can you just exaplin it clearly plz..
    Thanks
    Mahesh

  • VALUES not getting passed in t.code 'FMY3' VIA call transaction 'FMY3'

    hi guru's,
    i have created a ALV report for funds precommitment,when i click the document number,the respective document is not opening
    i have coded like this
    IF selfield-value IS NOT INITIAL.
            READ TABLE final INDEX selfield-tabindex.
            SET PARAMETER ID: 'KBL' FIELD final-belnr,
                              'KBP' FIELD final-blpos.
            CALL TRANSACTION 'FMY3' AND SKIP FIRST SCREEN.
          ENDIF.
    the transaction is called,but with empty value in the field and the document is not opening....please help me with this regard...
        thanks in advance,
    regards,
    Balaji.S

    Hello Venkat.O,
    i have a similar problem with the overwrite of the memory ID, when calling transaction FMY3. In the code block you mentioned, the system gets the right value from the memory ID, that i've set before calling the transaction. But i found that after that the system runs in the include LFMFRO01, the code
    MODULE init_suppress OUTPUT.
      IF status2 = st2_app.                "/Genehmigen/Ablehnen
    Lesen aus Memory: wird in WF-Methode 'APPROVE' gefüllt
        IMPORT wfdata TO g_f_wfdata FROM MEMORY ID con_memid_wf.
        IF NOT g_f_wfdata-belnr IS INITIAL.
          IF g_f_wfdata-blpos = space.
            g_f_wfdata-blpos = con_initial_blpos.
          ENDIF.
          kbld-belnr = g_f_wfdata-belnr.
    and here the system gets the memory of the last document created and overwrites the selecion-screen field KBLD-BELNR with that value. And the value i had stored in the parameter ID 'MRV', and that the system gets it right in the code you show, is overwritten..
    This seems like a bug from SAP, don't you think?
    This way the system will always show the last doc. when calling transaction, after setting a parameter ID..

  • Code for Hot spot in ALV report to call transaction

    Hi,
    I  hv never use hot spot to link as a call transaction can u give the link or code how to make hot spot on a particular fields  i am working on a ALV report in that report in the belnr coloumn when user click on belnr i want to call FB03 transaction ref. to that belnr number and fisacl year.
    regards,
      zafar

    Hi,
    In the fieldcatalog you will have to write the hotspot as shown below,
       wa_fieldcat-hotspot   =  'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program       = sy-repid
            i_callback_user_command  = 'USER_COMMAND'"----> this is important
         i_callback_pf_status_set = 'PFSTATUS'
            it_fieldcat              = it_fieldcat
            is_layout                = it_layout
         it_event_exit            = it_eventexit
         i_screen_start_column    = 10
         i_screen_start_line      = 20
         i_screen_end_column      = 70
         i_screen_end_line        = 45
            i_grid_title             = 'Customer-Order Details'
          TABLES
            t_outtab                 = it_data.
    then you will have to catch the user command as follows,
    FORM user_command USING r_ucomm TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      DATA: alv_vbeln TYPE vbeln,
            mess_text(30) TYPE c,
            txt_vbeln(10) TYPE c.
    *User clicks a Order No. in ALV it passed to the following transaction.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE it_data INDEX rs_selfield-tabindex INTO wa_data.
          alv_vbeln  = wa_data-vbeln..
          IF sy-subrc = 0.
            CLEAR: mess_text, txt_vbeln.
            SUBMIT zprogram
             WITH pr_vbeln = alv_vbeln AND RETURN.
    put your call transaction logic here
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • RFC enabled function module using call transaction

    Hi,
    We have a scenario wherein we have a RFC enabled function module which inturn uses a call transaction to create a PM order & attaches the PM notification against it. Sometimes it so happens that the order does not get created for some reason or the other and there are no logs generated on the system to investigate. However we are capturing the messages produced via the BDCMSGCOLL. At present we are using the update parameter as 'L'.
    In some scenarios it states that the notification is locked by the same notification and comes out without creating the order, in this process we are losing out on the order & the notification number which if successful would have got updated in the database.
    I know this could be done via the BAPI, but there are innumerable steps within the BDC which can't be actually done using the BAPI and hence we could not use this procedure.
    Is there any other way by which we can ensure that there's always a successful order creation, I mean without losing out on the order/notification number?. Would changing the update mode to 'S' help?. Since this process is time bound, it can't actually take more time then what its taking with the current logic.
    Please let me know if you require further details on the same. Any help in this regard would be highly appreciated.
    Regards,
    Vidya

    Sorry for an unclear replay.
    In Simple terms; I have 2 scenarios;
    Launch a new tab (IW38 tcode), on click of a button in SAP screen of custom transaction in NWBC.
    Launch a new tab (IW38 tcode), on click of a button in a Non - SAP App opened (using URL) in NWBC.
    For 1st case, i have used
    CL_NWBC=>URL_CONSTRUCT
      EXPORTING
         CANVAS_WDA__CLIENT_TYPE       = 'nwbc'
         CANVAS_TRANSACTION            = 'IW38'
      RECEIVING
         URL                           = lv_URL.
    CALL METHOD CL_NWBC=>URL_LAUNCH
       EXPORTING
         URL    = lv_url
    But it gets open in NWBC HTML not in NWBC Desktop client.
    I tried all the Parameters you have mentioned in your response to this post earlier, but nothing worked. the last one is CANVAS__WINDOW which actually hides the top area and few buttons but still it is a HTML version.
    If i set the HTML_CLIENT = ABAP_FALSE, it launches a new window instead of the tab and asks for Login. If i login in can see the IW38 in NWBC desktop client. But the only problem is we have the restriction of single window/single login for users.
    I am on NWBC PL12 and also updated the GUI 7.3 to PL8.
    Simply the problem is URL_CONSTRUCT for any transaction is launching it in a new tab but in HTML Version.
    For 2nd case,
    It asks for the login details on click of a button on the 3rd party URL opened in NWBC. which means i am launching SAP from a 3rd party.
    Is there any way to achieve the launch of new tab in this case instead of the new window ?
    I hope its more clear now.
    Regards,
    Nik.

  • Can not call RFC contains "call transaction"  in webdynpro

    We use Webdynpro to develope a UI that can create service orders in CRM
    system. We create an RFC funciton "ZKLEE_CRM_ORDER_MODIFY" in CRM,which
    contain a statement of "CALL TRANSACTION 'CRMD_BUS2000120' USING T_BDC
    MODE 'N' MESSAGES INTO MESSTAB.".
    But as we exacute the RFC from WEB,we got 3 error messages in the
    output "MESSTAB":
    1.MESSAGE ID = "DC",MESSAGE NUMBER = "006", MESSAGE = "Control
    Framework: Fatal error - GUI cannot be reached".
    2.MESSAGE ID = "SY",MESSAGE NUMBER = "002", MESSAGE = "Exception
    condition CNTL_ERROR raised."
    3.MESSAGE ID = "00",MESSAGE NUMBER = "359",and it is a terminate
    message.
    The problem is that we can use webdynpro to call RFCs that do not
    contain "call transaction" freely. At first we suspect that it is our
    RFC function's fault, but we tried it in ABAP enviroment,and it works
    OK. We also tried to call this RFC in JSP through JCO,the same error
    occurs.
    Our system enviroment is CRM 4.0, J2EE 640, kernel 640 patch 109.

    HI,
    Thank you for your information.
    Maybe you are right that BAPI/RFC can not contain "call transaction" statement. But two weeks ago, one of my colleagues tried to use "call transaction" in RFC through JCO in our R/3 enviroment(not in CRM),and he successed.
    So I suspect the kernel release. The kernel of R/3 is 640,while CRM is 620(I said our CRM kernel release is 640 before,and it is a mistake.).I will confirm whether what my colleague said is right by myself, and will also told you the result.
    Message was edited by: Vincent zklee

Maybe you are looking for

  • RemoveChild and Garbage Collector

    I am still fuzzy on the Actionscript 3 framework. If I remove a child from a container, is the removed child automatically eligible for the garbage collection? If not – what should I do to make it eligible? If yes – what can be done to prevent it fro

  • Which is better, Raid 0 with two hdds or 1 ssd?

    Hi, I have a macbook pro Mid 2010 with two open hard drive bays (thanks to the mce optibay.) I was wondering if it would be better to put two caviar black hard drives in raid 0 on my macbook pro, or have one vertex 2 drive as a boot/applications driv

  • WDS Client Naming Policy with image unattend mode problem

    I have created a standard Windows 7 Pro 64-bit PC for my company with all our applications installed and configured.  I used SYSPREP to generalize it and then used PXEBoot to capture this image to our WDS Server (which is the PDC).  I used WAIK to cr

  • How to take image(screenshot) of first page of any file

    Hi all, I am doing a project work and I need to take the image(just as screenshot) of the first page of any file so that contents of that first page can be viewed by that image . And finally i want to set that image as an icon for that file. I have u

  • Invoice output must be sent to two fax numbers

    Hi, My client needs to send the Invoice to two different fax numbers. Is this possible if we maintain two condition records with two different partner functions that have these two fax numbers? Any ideas will be appreciated... Thanks, Sree.