Call transaction in a BDC program...

Hi,
I can see in one of the BDC program, the call transaction command is used. This BDC program updates the Vendor master table.
CALL TRANSACTION BLF00-TCODE USING  FT
                                 MODE   ANZ_MODE
                                 UPDATE UPDATE.
Now, I am trying to know what transaction code it is using in above call transaction to update vendor master.
Regards,
Rajesh.

Put a break point on that statement in that program and run your program using MODE 'A', step thru the screens, when you get to that statement in debug mode, simply click on the BLF00-TCODE and see the value. 
Regards,
Rich Heilman

Similar Messages

  • CALL TRANSACTION 'ME33K  from another program

    Hi,
    I ma trying to CALL TRANSACTION 'ME33K  from another program, but it is not working.  The transactions is opening, but it is not opening with the contract number (ls_ekpo-ebeln) i am passing.
    ls_ekpo-ebeln does have a valued when CALL TRANSACTION 'ME33K  is called.
    In debug, I noticed the "value" is blank when step into CALL TRANSACTION 'ME33K .
       WHEN 'EBELN'.  "Contract
          l_field = 'EVRTN'.
         IF ls_ekpo-ebeln <> ''.
            GET PARAMETER ID 'VRT' FIELD l_field.  "EVRTN.
           SET PARAMETER ID 'VRT' FIELD ls_ekpo-ebeln.
           CALL TRANSACTION 'ME33K AND SKIP FIRST SCREEN.
            SET PARAMETER ID 'VRT' FIELD ls_ekpo-ebeln.
          ENDIF.
    Any help or suggestions would be great.
    Thanks,
    Naing

    Dear Naing,
    I execute the same code
    IF ls_ekpo IS INITIAL.
    GET PARAMETER ID 'VRT' FIELD LS_EKPO.
    SET PARAMETER ID 'VRT' FIELD ls_ekpo.
    CALL TRANSACTION 'ME33K' AND SKIP FIRST SCREEN.
    SET PARAMETER ID 'VRT' FIELD ls_ekpo.
    ENDIF.
    And it is working.
    Try to do de simple sintax.
    A program with one pararmeter to introduce the contract number.
    The set parameter for this parameter and the call transaction.
    I´m waiting your comments.
    Regards.
    Antonio.

  • Call Transaction Method of BDC

    Hi All,
    How to read screen field values using Call Transaction method of BDC? The BDC recording for the transaction /SAPAPO/TSCOPY has been done and only values from 2 fields have to be read which deals with Keyfigures. GS_KFMAP-KEYF_FR & GS_KFMAP-KEYF_TO are the two screen fields.
    Thanks & Regards,
    Savitha

    Hi Savitha,
       Can you please clarify Whether you want read the values or Populate values to screen fileds using call transaction?.
    If you want to read the screen filed values.I think we do n't use BDC.Directly we can refer to the screen fields and try to find out what fileds(dictionary) they are reffering.

  • How to call transaction in an abap program

    how do we open a transaction thru an abap program and pass a parameter to it

    Use call transaction. You can fill up the parameters in the BDC internal table
    DATA:   bdc_tab LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
    DATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    CONSTANTS: c_tcode LIKE t130m-tcode VALUE 'FB01'. "Tcode you want to call
            CALL TRANSACTION c_tcode
                 USING  bdc_tab
                 MODE   'N'
                 UPDATE 'S'
                 MESSAGES INTO messtab.
    Error message will be captured in the messtab.
    You can goto the SAP help on Call transaction to see all the details and options.
    <b><REMOVED BY MODERATOR></b>
    Thanks.
    Message was edited by:
            Alvaro Tejada Galindo

  • How to rectify the errors through call transaction metod in bdc

    how to rectify the errors through call transaction metod in bdc

    Hi ,
    View the highlited part of the below code.
    REPORT ygfrivat1 NO STANDARD PAGE HEADING
                     LINE-SIZE 165
                     MESSAGE-ID yif_groc.
    Program     YGFRIVAT1
    Function    Report to Upload the VAT Adjustment File.
    Author      ARENAPU
    Date        11.05.2007
    PMTS        AM12810157
    Transport   G6DK937834
    Description:
    Modification log:
    1. Changed by  :
       Changed on  :
       PMTS        :
       Transport   :
       Tag         :
       Description :
           T A B L E S   D E C L A R A T I O N S
    TABLES: edidc,  "Control record (IDoc)
            edids,  "Status Record (IDoc)
            t001w.
    Internal Tables Declaration.
    Internal table to hold data from table EDIDS
    DATA: BEGIN OF t_edids OCCURS 0,
           docnum LIKE edids-docnum,
           logdat LIKE edids-logdat,
           logtim LIKE edids-logtim,
           countr LIKE edids-countr,
           credat LIKE edids-credat,
           uname  LIKE edids-uname,
          END OF t_edids,
    Internal table to hold data from table EDIDC
          BEGIN OF t_edidc OCCURS 0,
           docnum LIKE edidc-docnum,
           rcvprt LIKE edidc-rcvprt,
           rcvprn LIKE edidc-rcvprn,
           credat LIKE edidc-credat,
          END OF t_edidc,
    Internal table to hold data from upload file
          BEGIN OF t_tab OCCURS 0,
           cust(10),        "site/customer number
           date(10),        "transaction date
           currency(04),    "currency
           extnbr(15),      "external reference number
           pos-cont(05),    "POS controler
           pos-id(25),      "POS id
           cashier(10),     "cashier name
           qualif(04),      "qualifier of the article
           matnr(25),       "article number
           qty(10),         "quantity
           sale(16),        "sale value
           pos-tr(04),      "POS transfert type
           paymeth(04),     "payment method
           final(35),       "final price
           tarcur(04),      "target currency
           assign(35),      "assignment day
           error,
          END OF t_tab,
    Internal table for Report display.
          BEGIN OF t_tab1 OCCURS 0,
           cust(10),                    "site/customer number
           date(10),                    "transaction date
           currency(04),                "currency
           extnbr(15),                  "external reference number
           pos-cont(05),                "POS controler
           pos-id(25),                  "POS id
           cashier(10),                 "cashier name
           qualif(04),                  "qualifier of the article
           matnr(25),                   "article number
           qty(16)   TYPE p DECIMALS 2, "quantity
           sale(16)  TYPE p DECIMALS 2, "sale value
           pos-tr(04),                  "POS transfert type
           paymeth(04),                 "payment method
           final(16) TYPE p DECIMALS 2, "final price
           tarcur(04),                  "target currency
           assign(35),                  "assignment day
          END OF t_tab1,
          t_tab_temp LIKE t_tab OCCURS 0 WITH HEADER LINE,
    Internal table to Validate Customer no.
          BEGIN OF t_check OCCURS 0,
           werks LIKE t001w-werks,
           vkorg LIKE t001w-vkorg,
           value(40),
          END OF t_check,
          t_check_temp LIKE t_check OCCURS 0 WITH HEADER LINE.
    Internal table to hold data from table ZCS_PARAM.
    DATA: BEGIN OF t_zcs_param OCCURS 0.
            INCLUDE STRUCTURE zcs_param.
    DATA: vkorg LIKE t001w-vkorg,
          END OF t_zcs_param.
    *Internal table to hold Messages.
    DATA: BEGIN OF t_message OCCURS 0,
             msgnum TYPE msgnum,
             msgtyp TYPE msgtyp,
             msgtxt TYPE msgtext,
           END OF t_message.
    *Work area for table t_message
    DATA : w_message LIKE LINE OF t_message.
    Internal table to hold BDC data
    DATA: t_bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE,
    Internal table to collect error messages
          messtab   LIKE bdcmsgcoll OCCURS 0  WITH HEADER LINE.
    *Internal table to hold messages from call transaction
    DATA: BEGIN OF t_text OCCURS 0,
           desc(150),
           msgtxt(100),
          END OF t_text.
           D A T A   D E C L A R A T I O N S
    DATA: n TYPE i,
          gv_status(11) TYPE c, "Shows status, Production or Test
          gv_exit TYPE c,  "Exit Flag
          gv_qty(16)   TYPE p DECIMALS 2, "Variable to sum Quantity
          gv_sale(16)  TYPE p DECIMALS 2, "Variable to sum Amount
          gv_final(16) TYPE p DECIMALS 2. "Variable to sum Final Amount
    DATA: w_text(100),
          gv_mode TYPE c,
          error TYPE c.  "Flag to Indicate error.
    CONSTANSTS DECLARATION
    CONSTANTS : gc_fieldname LIKE dynpread-fieldname VALUE 'P_FNAME',
                gc_seq_no LIKE zcs_param-seq_no VALUE '00110',
                gc_object LIKE zcs_param-object VALUE 'YGFVAT',
                gc_paraname LIKE zcs_param-paraname VALUE 'VKORG',
                gc_back TYPE c VALUE 'N',
                gc_error TYPE c VALUE 'E',
                gc_all TYPE c VALUE 'A'.
               S E L E C T I O N   S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-002 FOR FIELD p_test.
    PARAMETERS : p_test AS CHECKBOX.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK a1.
    SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-006.
    PARAMETERS : rb_back RADIOBUTTON GROUP rb1 DEFAULT 'X',
                 rb_error RADIOBUTTON GROUP rb1,
                 rb_all RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF BLOCK a2.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    *Subroutine to provide F4 help for file name
      PERFORM fr_get_filename.
           I N I T I A L I Z A T I  O N
    INITIALIZATION.
    *Subroutine to check authorization.
    PERFORM fr_authority_check.
            T O P - O F - P A G E
    TOP-OF-PAGE.
    *Subroutine to diplay header
      PERFORM fr_display_header.
             S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
    *Subroutine to upload data from presentation server.
      PERFORM fr_upload_data.
    *Subroutine to validate records from uploaded file.
      PERFORM fr_validate_data.
    *Subroutine to build report internal table.
      PERFORM fr_build_rep.
             E N D - O F - S E L E C T I O N
    END-OF-SELECTION.
    *Subroutine to display report.
      PERFORM fr_write_report.
            F O R M   S U B R O U T I N E S
    *&      Form  fr_get_filename
          text
    FORM fr_get_filename.
      DATA : lv_repid LIKE sy-repid,         " Report id
             lv_file  LIKE ibipparms-path.   " File Path
      lv_repid = sy-repid.
    F4 help for file path.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = lv_repid
                dynpro_number = syst-dynnr
                field_name    = gc_fieldname                    " p_fname1
           IMPORTING
                file_name     = lv_file.
      IF NOT lv_file EQ space.
        p_fname = lv_file.
      ELSE.
        MESSAGE e999 WITH 'Invalid Path'(005).
      ENDIF.
    ENDFORM.                    " fr_get_filename
    *&      Form  fr_upload_data
          text
    FORM fr_upload_data.
      DATA: lv_fname TYPE string.
      CLEAR lv_fname.
      lv_fname = p_fname.
    Uploading file from PC or presentation server to internal table.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename            = lv_fname
                filetype            = 'ASC'
                has_field_separator = 'X'
           TABLES
                data_tab            = t_tab
           EXCEPTIONS
                file_open_error     = 1.
      IF sy-subrc <> 0.
        DESCRIBE TABLE t_message LINES n.
        w_message-msgnum = n + 1.
        w_message-msgtyp = 'E'.
        MOVE text-m01  TO w_message-msgtxt.
        APPEND w_message TO t_message.
    Subroutine for writing log.
        PERFORM fr_write_log.
      ENDIF.
    ENDFORM.                    " fr_upload_data
    *&      Form  fr_validate_data
          text
    FORM fr_validate_data.
      DATA : lv_lines1 TYPE i,
             lv_lines2 TYPE i.
    *Obtain Status depending on Check box selected.
      IF p_test IS INITIAL.
        gv_status = 'PRODUCTION'.
      ELSE.
        gv_status = 'TEST RUN'.
      ENDIF.
    *Batch Mode
      CLEAR gv_mode.
      IF rb_back EQ 'X'.          "No Display
        MOVE gc_back TO gv_mode.
      ELSEIF rb_error EQ 'X'.     "Error Only
        MOVE gc_error TO gv_mode.
      ELSEIF rb_all EQ 'X'.       "All Screens
        MOVE gc_all TO gv_mode.
      ENDIF.
      IF NOT t_tab[] IS INITIAL.
        SORT t_tab BY cust.
        REFRESH t_tab_temp.
        t_tab_temp[] = t_tab[].
        SORT t_tab_temp BY cust.
        DELETE ADJACENT DUPLICATES FROM t_tab_temp COMPARING cust.
        IF NOT t_tab_temp[] IS INITIAL.
          SELECT werks vkorg FROM t001w
                             INTO TABLE t_check
                             FOR ALL ENTRIES IN t_tab_temp
                             WHERE werks = t_tab_temp-cust+0(4).
          IF sy-subrc = 0.
            SORT t_check BY werks.
          ENDIF.
          LOOP AT t_check.
            IF t_check-vkorg <> ' '.
              MOVE t_check-vkorg TO t_check-value.
              MODIFY t_check TRANSPORTING value.
            ENDIF.
          ENDLOOP.
        ENDIF.
        FREE t_tab_temp.
      ENDIF.
      IF NOT t_check[] IS INITIAL.
        REFRESH t_check_temp.
        t_check_temp[] = t_check[].
        SORT t_check_temp BY value.
        DELETE ADJACENT DUPLICATES FROM t_check_temp COMPARING value.
        IF NOT t_check_temp[] IS INITIAL.
          SELECT * FROM zcs_param INTO TABLE t_zcs_param
                   FOR ALL ENTRIES IN t_check_temp
                   WHERE seq_no   EQ gc_seq_no
                     AND object   EQ gc_object
                     AND paraname EQ gc_paraname
                     AND value    EQ t_check_temp-value.
          IF sy-subrc = 0.
            SORT t_zcs_param BY value.
          ENDIF.
        ENDIF.
        FREE t_check_temp.
      ENDIF.
      IF NOT t_tab[] IS INITIAL.
        LOOP AT t_tab.
          READ TABLE t_check WITH KEY werks = t_tab-cust BINARY SEARCH.
          IF sy-subrc <> 0.
            MOVE 'X' TO t_tab-error.
            MODIFY t_tab TRANSPORTING error.
            DESCRIBE TABLE t_message LINES n.
            w_message-msgnum = n + 1.
            w_message-msgtyp = 'E'.
            CONCATENATE t_tab-cust text-030
            INTO w_message-msgtxt SEPARATED BY space.
            APPEND w_message TO t_message.
    Subroutine for writing log.
            PERFORM fr_write_log.
            EXIT.
          ELSE.
            READ TABLE t_zcs_param WITH KEY value = t_check-vkorg
                                                         BINARY SEARCH.
            IF sy-subrc <> 0.
              MOVE 'X' TO t_tab-error.
              MODIFY t_tab TRANSPORTING error.
              DESCRIBE TABLE t_message LINES n.
              w_message-msgnum = n + 1.
              w_message-msgtyp = 'E'.
              CONCATENATE text-003 t_tab-cust text-004 t_check-vkorg
              INTO w_message-msgtxt SEPARATED BY space.
              APPEND w_message TO t_message.
    Subroutine for writing log.
              PERFORM fr_write_log.
              EXIT.
            ELSE.
              PERFORM fr_format_tab.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
      DESCRIBE TABLE t_tab LINES lv_lines1.
      IF lv_lines1 <> 0.
        DELETE t_tab WHERE error EQ 'X'.
      ENDIF.
      DESCRIBE TABLE t_tab LINES lv_lines2.
      IF lv_lines2 <> 0.
        IF lv_lines2 <> lv_lines1.
          EXIT.
        ELSE.
          IF p_test IS INITIAL.
            LOOP AT t_tab.
    *Subroutine to build BDC table
              PERFORM fr_fill_bdctab.
    *Subroutine to Post Data into SAP.
              PERFORM fr_data_posting.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_validate_data
    *&      Form  fr_write_log
          text
    FORM fr_write_log.
      CLEAR error.
      error = 'X'.
      WRITE:/1 'Msg No'(027), 10 'Type'(028), 20 'Text'(029).
      ULINE:/1(120).
      FORMAT RESET.
      LOOP AT t_message.
        IF t_message-msgtyp = 'E'.
          FORMAT COLOR 6 INTENSIFIED .
        ELSEIF t_message-msgtyp = 'W'.
          FORMAT COLOR 3 INTENSIFIED .
        ELSEIF t_message-msgtyp = 'I'.
          FORMAT COLOR 5 INTENSIFIED .
        ENDIF.
        WRITE:/1 t_message-msgnum,
              10 t_message-msgtyp,
              20 t_message-msgtxt.
        FORMAT RESET.
      ENDLOOP.
      ULINE:/1(120).
    ENDFORM.                    " fr_write_log
    *&      Form  fr_write_report
          text
    FORM fr_write_report.
      CLEAR gv_exit.
      LOOP AT t_message.
        IF t_message-msgtyp = 'E'.
          gv_exit = 'X'.
          EXIT.
        ENDIF.
      ENDLOOP.
      IF NOT gv_exit IS INITIAL.
        EXIT.
      ELSE.
        PERFORM fr_display_report.
        IF NOT t_text[] IS INITIAL.
    Subroutine for Display Call Transaction messages.
          PERFORM fr_write_msg.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_write_report
    *&      Form  fr_display_report
          text
    FORM fr_display_report.
      IF NOT t_tab1[] IS INITIAL.
        CLEAR: gv_qty, gv_sale, gv_final.
        LOOP AT t_tab1.
          WRITE:/1(10) t_tab1-cust,
                13(10) t_tab1-date,
                25(05) t_tab1-currency,
                32(14) t_tab1-extnbr,
                48(09) t_tab1-pos-cont,
                60(18) t_tab1-matnr,
                80(16) t_tab1-qty RIGHT-JUSTIFIED ,
                98(16) t_tab1-sale RIGHT-JUSTIFIED ,
               116(07) t_tab1-paymeth,
               125(16) t_tab1-final RIGHT-JUSTIFIED,
               143(06) t_tab1-tarcur,
               152(12) t_tab1-assign.
          gv_qty   = t_tab1-qty   + gv_qty.
          gv_sale  = t_tab1-sale  + gv_sale.
          gv_final = t_tab1-final + gv_final.
        ENDLOOP.
        FORMAT COLOR 3.
        ULINE: /(164).
        WRITE:/ 'TOTALS',
          80(16) gv_qty RIGHT-JUSTIFIED,
          98(16) gv_sale RIGHT-JUSTIFIED,
         125(16) gv_final RIGHT-JUSTIFIED,
         182 ''.
        ULINE: /(164).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    " fr_display_report
    *&      Form  FR_DISPLAY_HEADER
          text
    FORM fr_display_header.
      IF error IS INITIAL.
        FORMAT COLOR 1.
        WRITE:/ 'Date upload           :'(007),   25 sy-datum,  38 ''.
        WRITE:/ 'Production or Test Run:'(008),   25 gv_status, 38 ''.
        WRITE:/ 'Upload User Logon     :'(009),   25 sy-uname,  38 ''.
        ULINE: /(164).
        WRITE:/1(04) 'Site'(010),
              13(10) 'Date'(011),
              25(05) 'Curr.'(012),
              32(14) 'Receipt'(013),
              48(09) 'Cashier'(014),
              60(18) 'Article'(015),
              92     'Qty'(016),
              102    'Item Amount'(017),
              116(7) 'M.o.P.'(018),
              128    'Tender Amount'(019),
              143(6) 'T.Curr'(020),
             152(12) 'Assignment'(021).
        ULINE:/(164).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    " FR_DISPLAY_HEADER
    *&      Form  fr_newdynpro
          text
    FORM fr_newdynpro USING program LIKE bdcdata-program
                            dynpro  LIKE bdcdata-dynpro.
      t_bdcdata-program = program .
      t_bdcdata-dynpro  = dynpro.
      t_bdcdata-dynbegin = 'X'.
      APPEND t_bdcdata.
      CLEAR t_bdcdata.
    ENDFORM.                    " fr_newdynpro
    *&      Form  fr_loadfield
          text
    FORM fr_loadfield USING field LIKE bdcdata-fnam
                            value.
      t_bdcdata-fnam = field.
      t_bdcdata-fval = value.
      APPEND t_bdcdata.
      CLEAR t_bdcdata.
    ENDFORM.                    " fr_loadfield
    *&      Form  fr_fill_bdctab
          text
    FORM fr_fill_bdctab.
      REFRESH t_bdcdata.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
      PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
      PERFORM fr_loadfield USING 'G_DATUM'   t_tab-date.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BON'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '500'.
      PERFORM fr_loadfield USING 'WPSCB01-POSKREIS'   t_tab-pos-cont.
      PERFORM fr_loadfield USING 'WPSCB01-KASSID'     t_tab-pos-id.
      PERFORM fr_loadfield USING 'WPSCB01-BELEGWAERS' t_tab-currency.
      PERFORM fr_loadfield USING 'WPSCB01-CSHNAME'    t_tab-cashier.
      PERFORM fr_loadfield USING 'WPSCB01-BONNUMMER'  t_tab-extnbr.
      PERFORM fr_loadfield USING 'E1WPB02-QUALARTNR(01)'  t_tab-qualif.
      PERFORM fr_loadfield USING 'E1WPB02-ARTNR(01)'      t_tab-matnr.
      PERFORM fr_loadfield USING 'E1WPB02-MENGE(01)'      t_tab-qty.
      PERFORM fr_loadfield USING 'WPSCB03-KONDVALUE(01)'  t_tab-sale.
      PERFORM fr_loadfield USING 'E1WPB02-VORGANGART(01)' t_tab-pos-tr.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'ZAHL'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
      PERFORM fr_loadfield USING 'WPSCB06-ZAHLART'  t_tab-paymeth.
      PERFORM fr_loadfield USING 'WPSCB06-SUMME'    t_tab-final.
      PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
      PERFORM fr_loadfield USING 'WPSCB06-ZUONR'    t_tab-assign.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'SAVE'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '530'.
      PERFORM fr_loadfield USING 'WPSCB06-ZAHLART'  t_tab-paymeth.
      PERFORM fr_loadfield USING 'WPSCB06-SUMME'    t_tab-final.
      PERFORM fr_loadfield USING 'WPSCB06-WAEHRUNG' t_tab-tarcur.
      PERFORM fr_loadfield USING 'WPSCB06-ZUONR'    t_tab-assign.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
      PERFORM fr_newdynpro USING 'SAPLSPO1' '0200'.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'YES'.
      PERFORM fr_newdynpro USING 'SAPMWPUK' '100'.
      PERFORM fr_loadfield USING 'G_FILIALE' t_tab-cust.
      PERFORM fr_loadfield USING 'G_DATUM'   t_tab-date.
      PERFORM fr_loadfield USING 'BDC_OKCODE' 'BACK'.
    ENDFORM.                    " fr_fill_bdctab
    *&      Form  fr_data_posting
          text
    FORM fr_data_posting.
      IF NOT t_bdcdata[] IS INITIAL.
        REFRESH messtab.
        CALL TRANSACTION 'WPUK' USING t_bdcdata
                                MODE gv_mode
                                UPDATE 'S'
                                MESSAGES INTO messtab.
        IF sy-subrc = 0 .
          CLEAR w_text.
          LOOP AT messtab.
            CALL FUNCTION 'FORMAT_MESSAGE'
                 EXPORTING
                      id        = messtab-msgid
                      lang      = sy-langu
                      no        = messtab-msgnr
                      v1        = messtab-msgv1
                      v2        = messtab-msgv2
                      v3        = messtab-msgv3
                      v4        = messtab-msgv4
                 IMPORTING
                      msg       = w_text
                 EXCEPTIONS
                      not_found = 1
                      OTHERS    = 2.
            MOVE w_text TO t_text-msgtxt.
            CONCATENATE 'Site:'(031)    t_tab-cust
                        'Article:'(024) t_tab-matnr
                        'Posted Sucessfully'(032)
              INTO t_text-desc SEPARATED BY space.
            APPEND t_text.
            CLEAR t_text.
          ENDLOOP.
        ELSE.
          CLEAR w_text.
          LOOP AT messtab.
            CALL FUNCTION 'FORMAT_MESSAGE'
                 EXPORTING
                      id        = messtab-msgid
                      lang      = sy-langu
                      no        = messtab-msgnr
                      v1        = messtab-msgv1
                      v2        = messtab-msgv2
                      v3        = messtab-msgv3
                      v4        = messtab-msgv4
                 IMPORTING
                      msg       = w_text
                 EXCEPTIONS
                      not_found = 1
                      OTHERS    = 2.
            MOVE w_text TO t_text-msgtxt.
            IF messtab-msgnr EQ '213'.
              CONCATENATE 'Site:'(031)    t_tab-cust
                          'Article:'(024) t_tab-matnr
                          'Posted Sucessfully'(032)
               INTO t_text-desc SEPARATED BY space.
              APPEND t_text.
              CLEAR t_text.
              EXIT.        ELSE.
              CONCATENATE 'Site:'(031)    t_tab-cust
                          'Article:'(024) t_tab-matnr
                          'Not Posted'(033)
               INTO t_text-desc SEPARATED BY space.
              APPEND t_text.
              CLEAR t_text.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_data_posting
    *&      Form  fr_authority_check
          text
    FORM fr_authority_check.
      AUTHORITY-CHECK OBJECT 'Y_VATADJ'
               ID 'VKORG' FIELD t001w-vkorg
               ID 'TCD'   FIELD 'YGFVAT'.
      IF sy-subrc NE 0.
        MESSAGE e999 WITH text-m02.
      ENDIF.
    ENDFORM.                    " fr_authority_check
    *&      Form  fr_write_msg
          text
    FORM fr_write_msg.
      SKIP.
      ULINE:/(164).
      WRITE:/
      'Messages encountered while Calling Transaction WPUK'(025),
          90 'Message Text'(026).
      ULINE:/1(164).
      LOOP AT t_text.
        WRITE:/1 t_text-desc,
              90 t_text-msgtxt,
              164 ''.
      ENDLOOP.
      ULINE:/1(164).
    ENDFORM.                    " fr_write_msg
    *&      Form  FR_BUILD_REP
          text
    FORM fr_build_rep.
      IF error IS INITIAL.
        IF NOT t_tab[] IS INITIAL.
          LOOP AT t_tab.
            MOVE:
              t_tab-cust     TO t_tab1-cust,        "site/customer number
              t_tab-date     TO t_tab1-date,        "transaction date
              t_tab-currency TO t_tab1-currency,    "currency
            t_tab-extnbr   TO t_tab1-extnbr,      "external reference number
              t_tab-pos-cont TO t_tab1-pos-cont,    "POS controler
              t_tab-pos-id   TO t_tab1-pos-id,      "POS id
              t_tab-cashier  TO t_tab1-cashier,     "cashier name
             t_tab-qualif   TO t_tab1-qualif,      "qualifier of the article
              t_tab-matnr    TO t_tab1-matnr,       "article number
              t_tab-pos-tr   TO t_tab1-pos-tr,      "POS transfert type
              t_tab-paymeth  TO t_tab1-paymeth,     "payment method
              t_tab-tarcur   TO t_tab1-tarcur,      "target currency
              t_tab-assign   TO t_tab1-assign.
            REPLACE ',' WITH '.' INTO t_tab-qty.
            CONDENSE t_tab-qty NO-GAPS.
            MOVE t_tab-qty TO t_tab1-qty.
            REPLACE ',' WITH '.' INTO t_tab-sale.
            CONDENSE t_tab-sale NO-GAPS.
            MOVE t_tab-sale TO t_tab1-sale.
            REPLACE ',' WITH '.' INTO t_tab-final.
            CONDENSE t_tab-final NO-GAPS.
            MOVE t_tab-final TO t_tab1-final.
            APPEND t_tab1.
            CLEAR t_tab1.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " FR_BUILD_REP
    *&      Form  fr_format_tab
          text
    FORM fr_format_tab.
      DATA : lv_qty TYPE string.
      IF NOT t_tab-qty IS INITIAL.
        IF t_tab-qty+0(1) EQ '-'.
          CLEAR lv_qty.
          MOVE t_tab-qty TO lv_qty.
          CLEAR t_tab-qty.
          SHIFT lv_qty LEFT CIRCULAR.
          CONDENSE lv_qty NO-GAPS.
          MOVE lv_qty TO t_tab-qty.
          MODIFY t_tab TRANSPORTING qty.
        ENDIF.
      ENDIF.
    ENDFORM.                    " fr_format_tab

  • Call transaction LM05 from Z program

    Hi,
    I need to call transaction LM05 from a Z program, and when LM05 finishes then continue with the process in Z program. But when i use CALL TRANSACTION 'LM05' the process does not return to program Z, when LM05 finishes,it returns to main screen of 'LM05' but not Z program.
    I change CALL TRANSACTION by SUBMIT zrlmob001 AND RETURN, but it happens the same, because transaction 'LM05' continuosly evaluates the system variable SY-TCODE, and therefore SY-TCODE contains code transaction 'ZXX'.
    it exists a way to call a LM05 transaction from Z program, and then continue in z program after LM05 finishes?
    can i create a user exit screen for transaction LM05 and use the user exit to continue with the process that i wish in Z program after call transaction 'LM05'?
    I'm in SAP version ECC 6.0.
    Thanks in advance
    Alejandro

    Hi,
    I want to share how i resolved this topic:
    I searched for user exit, badi and did'nt find a correct way to solved this issue. Also, i tried to create a screen exit for transaction LM05, but the dynpro 2100 of program SAPLLMOB is used for transaction LM02, LM03, LM05 and for each one show a diferent initial screen, this logic cannot be suplied with my custom screen.
    Finally, how the final option, i used a enhancement implementation to add code in SAP standard program RLMOB001, and the problem was resolved. i am in version SAP ECC6.0, in this version is posible to create enhancement implementation, and for support package and upgrade, SAP will not overwrite your custom code.
    Regards,
    Alejandro.

  • Call transaction MMBE from another program and press Back button

    Hello,
    I have program that is used as a 'launch pad' for some of our heavily used transactions. When I call the main 'launch pad' program, the user will select a button and a Call Transaction MMBE is initiated (USING the first screen). The user selects a material for display and presses the execute button (F8). The material overview is displayed correctly.  When the user presses the Back button (F12), transaction returns all the way back to the first called program and not to the first screen for transaction MMBE as expected.
    Does anyone know how I can change the screen flow and go back to the fist screen of MMBE and not the screen of the first called program?
    Regards,
    RC

    Rod,
    In your case i think it is not possible as it is standard functionality by SAP.
    Try work around, may be modification to the program will work.
    Regards,
    Amey

  • Call transaction spad-RSPO0067 bdc

    hi experts,
    I want to manage spad  ( RSPO0067- Assign new spool ) by using bdc.
    I wıll fıll the ınternal table with the data whıch are ' waiting '' in tps02 table and after filling internal tablle
    I wıll assign them with bdc to RSPO0067
    How can ı achıeve thıs, I havent done any bdc yet so I need some help with this?
    any help will be appreciate
    best regards

    Hi Savitha,
       Can you please clarify Whether you want read the values or Populate values to screen fileds using call transaction?.
    If you want to read the screen filed values.I think we do n't use BDC.Directly we can refer to the screen fields and try to find out what fileds(dictionary) they are reffering.

  • How to call mmpv TCODE through BDC program.

    Hi
    In my  requriment i have to create custom program through which i have to call mmpv TCODE, because mmpv closes period for indivisual company code and for large number of company code it is time cunsuming exercise. for that i that i have to creat custom program. it is having selection screen like below.
    company code                                   (marv-bukrs)
    fiscal year of current period                 (marv-lfgja)
    current posting period                         (marv-lfmon)
    fiscal year of previous period                (marv-vmgja)   
    month of previous period                      (marv-vmmon)
    fiscal year of last periodof previous year (marv-vjgja)
    last month of previoud year                  (marv-vjmon)
    allow posting to previous year           (marv-xruem)
    disallow dack posting after a change of period (marv-xruev)
    and  output should show : company codes affected,the periods closed and the current period open for posting .and also show wheather back posting allowed / disallowed for the company code.

    CALL FUNCTION 'BDC_INSERT'  "BDC_OBJECT_UPDATE
             EXPORTING
                  TCODE     = 'mmpv'
             TABLES
                  DYNPROTAB = BDC_TAB.
    hope this helps
    Warren

  • Remote another username to call transaction base of BDC

    Hi Expert,
    I have a requirement to call another username to run tcode base of BDC. for example : I using the BDC recording to create customer master XD01 then I need to confirm this customer code using the other user name and run tcode FD08. can't used same username who is created customer and run FD08. any body have idea to solve it? so far I am looking at the FM : TH_SAP_LOGIN. but don't know how to use it. Thank you
    Regards,
    Kohokoho

    Hi All,
    Case is close for used the BDC session, input the paramater username and used FM BDC_INSERT. and we will able to use other username to create the document cheers
    Regards,
    Kohokoho

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

  • Can we record two transactions and use for  a Call-transaction BDC?

    can we record two transactions and upload data using Call-transaction method in BDC ?IF not why?

    Hi Prakash,
    Here i used two transactions.
    REPORT zra_gl_cr NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    DATA:messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA:messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF i_mess OCCURS 0,
      l_mstring(480),
      msgnr(5),
      msgv1(15),
      END OF i_mess.
    DATA:i_mess1 LIKE i_mess OCCURS 0 WITH HEADER LINE.
    DATA: l_mstring(480),l_mstring1(480).
    DATA: BEGIN OF it_itab OCCURS 0,
          saknr(10),    "G/L a/c number.
          bukrs(4),     "Company Code.
          ktoks(4),     "G/L a/c group.
          xplacct(1),   "P&L statement account.
          xbilk(1),     "Balance sheet account.
          txt20_ml(20), "G/L a/c short text.
          txt50_ml(50), "G/L a/c long text.
          waers(5),     "Account currency.
          MWSKZ(2),
          mitkz(1),     "Reconciliation a/c for a/c type.
          xopvw(1),     "Open item management
          xkres(1),     "Line item display.
          zuawa(3),     "Sort Key.
          fstag(4),     "Field status group.
          xintb(1),     "Post automatically only.
          hbkid(5),     "House bank.
          hktid(5),     "Account id.
          vzskz(2),     "Interest indicator
          END OF it_itab.
    DATA: hdate LIKE sy-datum.
                          Selection Screen                       *****
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(15) text-103. " FOR FIELD P_FILE1.
    SELECTION-SCREEN POSITION 25.
    PARAMETERS : p_file1 LIKE rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
                          Initialization                         *****
    INITIALIZATION.
                       At Selection Screen                       *****
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
    Perform file_selection will help to select the location of the file
      PERFORM file_selection.
                       Start-Of-Selection                        *****
    START-OF-SELECTION.
    Perform data_upload will help to upload the data from the flat file
    to the internal table.
      PERFORM data_upload.
    PERFORM open_group.
       Peform bdc_upload will help to upload the data from the internal
       table into its respective fields.
    PERFORM bdc_fspo.
      PERFORM bdc_upload.
      PERFORM exp_log.
    PERFORM close_group.
       Perform display_log will prepare a log for the data that has been
       uploaded
       PERFORM display_log.
                        End-Of-Selection                           ****
    END-OF-SELECTION.
    *&      Form  file_selection
          To select the location of the file
    FORM file_selection .
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ' '
          def_path         = 'C:\'
          mask             = ',.txt,.xls.'
          mode             = 'O'
          title            = 'Open a excel file'
        IMPORTING
          filename         = p_file1
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
    ENDFORM.                    " file_selection
    *&      Form  data_upload
         To upload the data from the file location to the internal table.
    FORM data_upload .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw
          i_filename               =  p_file1
        TABLES
          i_tab_converted_data     = it_itab
       EXCEPTIONS
          conversion_failed        = 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.
    ENDFORM.                    " data_upload
    *&      Form  bdc_upload
    To upload the data from the internal table into its respective fields.
    FORM bdc_upload .
      LOOP AT it_itab.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ACC_CRE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_KEY-SAKNR'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                  it_itab-SAKNR.
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                  it_itab-BUKRS.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=2102_GROUP'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                  it_itab-XPLACCT.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=2102_BS_PL'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-XBILK'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                 it_itab-XPLACCT.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                  it_itab-XBILK.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                  it_itab-XBILK.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                  it_itab-TXT20_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                 it_itab-TXT50_ML.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-BILKT'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                  it_itab-saknr.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TAB02'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-KTOKS'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                       it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                       it_itab-txt20_ml.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                       it_itab-txt50_ml.
        perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-BILKT'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                  it_itab-saknr.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB02'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                     it_itab-KTOKS.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-KTOKS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  it_itab-KTOKS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                 it_itab-XBILK.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                  it_itab-TXT20_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                  it_itab-TXT50_ML.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-BILKT'
                                 it_itab-saknr.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                  it_itab-waers.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                  it_itab-MWSKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-mitkz.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-XOPVW'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                  it_itab-XOPVW.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                  it_itab-XKRES.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                 it_itab-ZUAWA.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                       it_itab-xbilk.
           IF it_itab-xbilk = 'X'.
       PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=TAB03'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'GLACCOUNT_SCREEN_CCODE-WAERS'.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                      it_itab-waers.
         PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                  it_itab-xopvw.
         PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-mitkz.
       ENDIF.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                      it_itab-xkres.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                      it_itab-zuawa.
       PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=SAVE'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'GLACCOUNT_SCREEN_CCODE-FSTAG'.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                      it_itab-fstag.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                      it_itab-xintb.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-HBKID'
                                      it_itab-hbkid.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-HKTID'
                                      it_itab-hktid.
       PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_CCODE-VZSKZ'
                                      it_itab-vzskz.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB03'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-WAERS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                  it_itab-WAERS.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                  it_itab-MWSKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  it_itab-MITKZ.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                 it_itab-ZUAWA.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-FSTAG'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                 it_itab-FSTAG.
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-FSTAG'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                  it_itab-FSTAG.
       PERFORM bdc_transaction USING 'FS00'.
        CALL TRANSACTION 'FS00' USING bdcdata MODE 'A'
                                              UPDATE 'S'
                                             MESSAGES  INTO messtab1.
        PERFORM mess1.
        REFRESH bdcdata[].
      ENDLOOP.
    ENDFORM.                    " bdc_upload
    *&      Form  bdc_fspo
          text
    FORM bdc_fspo .
      LOOP AT it_itab.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ACC_CRE'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_KEY-SAKNR'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                      it_itab-saknr.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-KTOPL'
                                      '1000'.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=2102_GROUP'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-KTOKS'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                      it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                      it_itab-xbilk.
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                       it_itab-ktoks.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                       it_itab-xplacct.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_COA-TXT50_ML'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                       it_itab-txt20_ml.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                       it_itab-txt50_ml.
    *perform bdc_transaction using 'FSP0'.
        CALL TRANSACTION 'FSP0' USING bdcdata MODE 'A'
                                              UPDATE 'S'
                                             MESSAGES  INTO messtab.
        PERFORM mess.
        REFRESH bdcdata[].
      ENDLOOP.
    ENDFORM.                    " bdc_fspo
    *&      Form  mess
          text
    -->  p1        text
    <--  p2        text
    FORM mess .                                                 "fsp0
      LOOP AT messtab.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = messtab-msgid
            lang      = messtab-msgspra
            no        = messtab-msgnr
            v1        = messtab-msgv1
            v2        = messtab-msgv2
            v3        = messtab-msgv3
            v4        = messtab-msgv4
          IMPORTING
            msg       = l_mstring
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        CONDENSE l_mstring.
        i_mess1-l_mstring = l_mstring(250).
        i_mess1-msgnr = messtab1-msgnr.
        i_mess1-msgv1 = messtab1-msgv1.
        APPEND i_mess1.
      ENDLOOP.
    ENDFORM.                    " mess
    *&      Form  mess1
          text
    -->  p1        text
    <--  p2        text
    FORM mess1 .                                                "fs00
      LOOP AT messtab1.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = messtab1-msgid
            lang      = messtab1-msgspra
            no        = messtab1-msgnr
            v1        = messtab1-msgv1
            v2        = messtab1-msgv2
            v3        = messtab1-msgv3
            v4        = messtab1-msgv4
          IMPORTING
            msg       = l_mstring1
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        CONDENSE l_mstring1.
        i_mess-l_mstring = l_mstring1(250).
        i_mess-msgnr = messtab1-msgnr.
        i_mess-msgv1 = messtab1-msgv1.
        APPEND i_mess.
      ENDLOOP.
    ENDFORM.                                                    " mess1
    *&      Form  exp_log
          text
    -->  p1        text
    <--  p2        text
    FORM exp_log .
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'c:\temp\error_fsp0.txt'
          filetype = 'DAT'
        TABLES
          data_tab = i_mess1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'c:\temp\error_fs00.txt'
          filetype = 'DAT'
        TABLES
          data_tab = i_mess.
    ENDFORM.                    " exp_log
    *&      Form  bdc_dynpro
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_Field
    ********Rewards some points.

  • Probelm in BDC call transaction

    Hi Experts,
    I have a program in which I am calling transaction MI31. This program is having a seelction screen. Now I am facing a problem.
    That is If I am using the statement
    include BDCRECX1
    perform bdc_transaction using 'MI31'.
    This is working fine..I am getting the correct result.But it's showing selection screen of inlcude BDCRECX1.
    But I do not want that screen to display. I always want to execute bdc in MODE N.
    Also I tried with
    CALL TRANSACTION 'MI31' USING BDCDATA
    MODE 'N'.
    But Using this I am not getting the result.
    Is there any way to hide the selction screen of inlcude BDCRECX1 so that I can just pass mode N by default.
    Please help as It's very urgent.
    Helpful answers will be highly rewared.
    Thanks,
    Krishan
    Edited by: Krishan Kumar on Jul 6, 2008 3:32 AM

    Hi,
    Please check the program in the link given below and follow the same procedure.  This should solve your problem.  NO-DISPLAY is the word to be used as given the program.
    Reward points if useful.
    Best Regards,
    Sekhar

  • Call Transaction 'PA40'  ALWAYS returns with error code

    Hi,
    I'm having issues with updating personnel actions using CALL TRANSACTION 'PA40'. The call always ends with an error code.
    I checked the message table and there are no error messages, only warnings and status messages. Warning and information messages are usually skipped in the BDC...I've coded an 'ENTER' to past the warning but this does not work either as the subsequent infotype screen fields are then not filled correctly.
    The following values for addition OPTIONS are used:
    data: opt like ctu_params.
      opt-dismode = 'N'.
      opt-updmode = 'A'. ('S' makes no difference)
      opt-defsize = 'X'.
      opt-nobinpt = 'X'. ( ' ' makes no difference)
    I've tried using 'PA30' for the same actions but I get the same problem. I've used call transaction 'PA30' in many programs and I've never come across this problem.
    Is there perhaps a config setting somewhere to fix this? I've tried hiring employees using HR_MAINTAIN_MASTERDATA with the employee existance check off but there's a couple of problems there as well - sample code for hiring an employee would be very helpful...
    I need your help urgently and would appreciate your assitance immensely. (I'm working on 4.6C.)
    Thank you.
    LM

    The easiest way to resolve this is to set
    opt-dismode = 'E'.
    this way it will run in background and jump out when it hits an error, and it's much easier to see what the real issue is.
    I'm assuming you used SHDB first to get the recording?

  • Execute CALL TRANSACTION in the background....

    Hi,
    I want to use CALL TRANSACTION in a report program and execute this report in the background.
    There is not GUI_UPLOAD / GUI_DOWNLOAD used anywhere.
    Can someone suggest me what precaution I need to take in my code for CALL TRANSACTION?
    Is there any additional code for background processing?
    Thanks.

    hi,
    this is the sample code:
    Precations need to take :
    1. see that u r transfer tha data in correct field, on correct screen, and of correct format.
    2. capture the error logs in bdcmsgcoll - error logs have to be handle.
    3. ensure correct recording.
    in selection screen you can mention in which mode u want :
    A     Display all screens
    E     Display errors
    N     Background processing
    P     Background processing; debugging possible
    This is the sample code:
    & Report  ZKO01_BDC                                                       &
    & Object Id       :                                                       &
    & Object Name     : ZKO01_BDC                                             &
    & Program Name    : ZKO01_BDC                                             &
    & Transaction Code: ZKO01_BDC                                             &
    & Module Name     : FI / CO                                               &
    & Program Type    : BDC Program      Create Date     : 23.06.2008         &
    & SAP Release     : 6.0              Transport No    :                    &
    & Description     : BDC to upload internal order with indernal assignment &
    & Version         : 1.0.                                                  &
    & Changed on      :                                                       &
    report zko01_bdc
           no standard page heading line-size 255.
    types: begin of record,
            auart_001(004),
            ktext_002(040),
            bukrs_003(004),
            werks_004(004),      " ADDED NEW - RAHUL SHINDE
            scope_005(010),
            prctr_006(004),      " ADDED NEW - RAHUL SHINDE
            waers_007(005),
            astkz_008(001),
            plint_009(001),
          end of record.
    types: begin of ty_stats,
           mess(72) type c,
           auart_001(004),
           text(18) type c,
           end of ty_stats.
    data : it_record type table of record,
            wa_record like line of it_record.
    data: bdcdata type table of bdcdata,
          mestab type table of bdcmsgcoll.
    data : stats type table of ty_stats.
    data: opt type ctu_params.
    data: m(72) type c.
    data : fl_name type string.
    data :  wa_bdcdata like line of bdcdata,
            wa_mestab like line of mestab.
    data :  wa_stats like line of stats.
    data:   ctumode like ctu_params-dismode.
    data:   cupdate like ctu_params-updmode.
    data: file type  rlgrap-filename.
    data: xcel type table of alsmex_tabline with header line.
    data: mod1(1) type c.
    initialization.
    opt-dismode = 'A'.
    opt-updmode = 'S'.
    opt-nobinpt = 'X'.   "No batch input mode
                        Selection Screen
    selection-screen begin of block bk1 with frame.
    selection-screen skip 1.
    parameters p_file type localfile. " default 'D:\Common\PWC\Asset BDC\Book2.xls'.
    parameters p_mode like ctu_params-dismode obligatory.
    selection-screen skip 1.
    selection-screen end of block bk1.
    file = p_file.
    mod1 = p_mode.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
                        Selection Screen
    start-of-selection.
    file = p_file.
    ctumode = mod1.
    cupdate = 'L'.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = file
                i_begin_col             = '1'
                i_begin_row             = '1'
                i_end_col               = '100'
                i_end_row               = '5000'
           tables
                intern                  = xcel
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
    loop at xcel.
      case xcel-col.
        when '0001'.
            wa_record-auart_001 = xcel-value.      "ok
        when '0002'.
            wa_record-ktext_002 = xcel-value.      "ok
        when '0003'.
            wa_record-bukrs_003 = xcel-value.      "ok
        when '0004'.
            wa_record-werks_004 = xcel-value.      "ok
        when '0005'.
            wa_record-scope_005 = xcel-value.      "ok
       when '0005'.
           wa_record-KTEXT_005 = xcel-value.    "ok
        when '0006'.
            wa_record-prctr_006 = xcel-value.      "ok
        when '0007'.
            wa_record-waers_007 = xcel-value.      "ok
        when '0008'.
            wa_record-astkz_008 = xcel-value.      "ok
        when '0009'.
            wa_record-plint_009 = xcel-value.      "ok
      endcase.
      at end of row.
        append wa_record to it_record.
        clear wa_record.
      endat.
    endloop.
    loop at it_record into wa_record.
    perform bdc_dynpro      using 'SAPMKAUF' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COAS-AUART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'COAS-AUART'
                                  wa_record-auart_001.
    perform bdc_dynpro      using 'SAPMKAUF' '0600'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BUT2'.
    perform bdc_field       using 'COAS-KTEXT'
                                  wa_record-ktext_002.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COAS-SCOPE'.
    perform bdc_field       using 'COAS-BUKRS'
                                  wa_record-bukrs_003.
    perform bdc_field       using 'COAS-WERKS'
                                  wa_record-werks_004.
    perform bdc_field       using 'COAS-SCOPE'
                                  wa_record-scope_005.
    perform bdc_field       using 'COAS-PRCTR'
                                  wa_record-prctr_006.
    perform bdc_dynpro      using 'SAPMKAUF' '0600'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    *perform bdc_field       using 'COAS-KTEXT'
                                 wa_record-KTEXT_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COAS-PLINT'.
    perform bdc_field       using 'COAS-WAERS'
                                  wa_record-waers_007.
    perform bdc_field       using 'COAS-ASTKZ'
                                  wa_record-astkz_008.
    perform bdc_field       using 'COAS-PLINT'
                                  wa_record-plint_009.
    call transaction 'KO01' using bdcdata
                            options from opt
                            messages into mestab.
    *PERFORM loggs.
    clear wa_record.
    refresh bdcdata.
    endloop.
    end-of-selection.
    clear : wa_stats.
    if stats is initial.
        write :/ text-001.
    else.
      loop at stats into wa_stats.                         "displays runtime messages
        write:/ 'MESSAGE  :',wa_stats-auart_001.
        if wa_stats-auart_001 is not initial.
        write:/ wa_stats-auart_001,  wa_stats-text.
        endif.
        skip 1.
      endloop.
    endif.
    *&  FORMS BDC_DYNPRO
    form bdc_dynpro using program dynpro.
      clear wa_bdcdata.
      wa_bdcdata-program  = program.
      wa_bdcdata-dynpro   = dynpro.
      wa_bdcdata-dynbegin = 'X'.
      append wa_bdcdata to bdcdata..
    endform.
      FORM BDC_FIELD                                                 *
    form bdc_field using fnam fval.
        clear wa_bdcdata.
        wa_bdcdata-fnam = fnam.
        wa_bdcdata-fval = fval.
        append wa_bdcdata to bdcdata..
    endform.
    *&      Form  loggs
          text
    -->  p1        text
    <--  p2        text
    form loggs .
    loop at mestab into wa_mestab.
        if wa_mestab-msgtyp = 'E'.
          call function 'FORMAT_MESSAGE'
            exporting
              id        = wa_mestab-msgid
              lang      = 'E'
              no        = wa_mestab-msgnr
              v1        = wa_mestab-msgv1
              v2        = wa_mestab-msgv2
              v3        = wa_mestab-msgv3
              v4        = wa_mestab-msgv4
            importing
              msg       = m
            exceptions
              not_found = 1
              others    = 2.
          wa_stats-mess = m.
          wa_stats-text = text-001.            "'Not Created'.
          wa_stats-auart_001 = wa_record-auart_001.
          "wa_stats-sernr = wa_flat-sernr.
          append wa_stats to stats.
        elseif wa_mestab-msgtyp = 'S'.
          call function 'FORMAT_MESSAGE'
            exporting
              id        = wa_mestab-msgid
              lang      = 'E'
              no        = wa_mestab-msgnr
              v1        = wa_mestab-msgv1
              v2        = wa_mestab-msgv2
              v3        = wa_mestab-msgv3
              v4        = wa_mestab-msgv4
            importing
              msg       = m
            exceptions
              not_found = 1
              others    = 2.
          if wa_mestab-dyname = 'SAPMIEQ0'
                                    and wa_mestab-dynumb = '0101'
                                    and wa_mestab-msgspra = 'E'
                                    and wa_mestab-msgid = 'IS'
                                    and wa_mestab-msgnr = '144'.
            loop at stats into wa_stats where auart_001 = wa_record-auart_001.
                                          "and sernr = wa_flat-sernr.
                 delete stats.
            endloop.
                clear : wa_stats.
                wa_stats-mess = m.
                append wa_stats to stats.
          endif.
        endif.
        clear : wa_stats.
      endloop.
    endform.                    " loggs
    Edited by: Naseeruddin on Nov 26, 2008 8:57 AM

Maybe you are looking for

  • Field status as mandatory while creation of RE-FX Lease Out Contract

    Hi SAP Real Estate Friends, I have a requirement wherein we need to make the field status of some specific fields as mandatory for data input in RE-FX Lease Out Contract. The fields are mentioned below: 1. Profit Centre in Organizational Assignment T

  • Print Module templates layouts do not update on the fly

    Print layouts do not update on the fly when attempting to choose between various Print Module>Template Browser> Lightroom or User templates. This occurs in all three Layout Styles. The very first layout chosen in Single Image/Contact Sheet, Picture P

  • Timeline question

    I am using iMovie HD 5.0.2 (111). The story in my Timeline is complete. Yet the playhead keeps playing for about two extra minutes despite the fact that there are no more clips or audio. It's supposed to stop at the end of the sequence, correct? I th

  • How to enter second short text description language in task list header

    Hi, I can't find how to maintain second description language in task list header, Does some know how to do it (I have searched in Go TO menu - but haven't found anything useful there). Daniel Gontar

  • FIREFOX OPENS RAR FILES INSTEAD OF DOWNLOAD

    I'm using Firefox 21. When I try to click in a rar file link, firefox opens the file instead of download. I've tried to change in "Tools->Options-> Aplications" the actions taken by the browser depending of file types, but there is no case for rar fi