Regarding the bdc

hi,
how to maintain the error log in bdc for the call transaction method.
thanks in advance

Hi
See the sample program in which the errors are handled using the fun module FORMAT_MESSAGE
REPORT ZMMBDC1_1 NO STANDARD PAGE HEADING MESSAGE-ID ZT.
      Declaration of internal tables
internal table for selecting data from flat file
DATA : BEGIN OF IT_DATA OCCURS 0,
         MBRSH,                    " Industry sector
         MTART(4),                 " Material type
         KZSEL,                    " Checkbox
         MAKTX(40),                " Material description
         MEINS(3),                 " Base unit of measure
         MATKL(9),                 " Material group
         BISMT(18),                " Old material number
       END OF IT_DATA.
internal table for bdcdata
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
internal table to handle messages
DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
Variables &  Flag declaration
variables declaration
DATA : V_MESG(50).
flag declaration
DATA : FG_BDC,
       FG_FLAG1 TYPE I.
selection screen
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
parameter
PARAMETERS : P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK BLK1.
initialization
INITIALIZATION.
peform to initialize parameter
  PERFORM INIT_PARM.
start of selection
start-of-selection.
perform to upload it_data
  PERFORM UP_LOAD_IT_DATA.
perform transfer data
  PERFORM TRANSFER_DATA.
end of selection
END-OF-SELECTION.
*&      Form  INIT_PARM
Initializing parameter
FORM INIT_PARM.
P_FILE = 'C:\'.
ENDFORM.                    " INIT_PARM
*&      Form  UP_LOAD_IT_DATA
Transfering data from file to internal table
FORM UP_LOAD_IT_DATA.
  CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
           FILENAME                = P_FILE
           FILETYPE                = 'ASC'
       TABLES
            DATA_TAB                = IT_DATA
       EXCEPTIONS
            CONVERSION_ERROR        = 1
            FILE_OPEN_ERROR         = 2
            FILE_READ_ERROR         = 3
            INVALID_TABLE_WIDTH     = 4
            INVALID_TYPE            = 5
            NO_BATCH                = 6
            UNKNOWN_ERROR           = 7
            GUI_REFUSE_FILETRANSFER = 8
            OTHERS                  = 9.
    IF SY-SUBRC = 2 .
       FG_FLAG1 = 1.
       MESSAGE I001.
    ENDIF.
ENDFORM.                    " UP_LOAD_IT_DATA
*&      Form  TRANSFER_DATA
   Processing the data
FORM TRANSFER_DATA.
FG_BDC = 'N'.
LOOP AT IT_DATA.
perform to fill it_bdcdata.
PERFORM FILL_IT_BDCDATA.
CALL TRANSACTION 'MM01' USING IT_BDCDATA MODE 'N' UPDATE 'S'
                                   MESSAGES INTO IT_MESSAGES.
   IF SY-SUBRC <> 0.
     FG_FLAG1 = 1.
if error occurs in transaction mode run bdc session for that data
     PERFORM BDC_PROCESS.
   ENDIF.
Handles error messages
      PERFORM ERROR_MESSAGES.
     CLEAR : IT_BDCDATA,IT_DATA,IT_MESSAGES.
     REFRESH : IT_BDCDATA,IT_MESSAGES.
ENDLOOP.
IF FG_FLAG1 = 0.
   MESSAGE I003.
ENDIF.
IF FG_BDC = 'O'.
close bdc if it is open
   PERFORM CLOSE_BDC.
ENDIF.
ENDFORM.                    " TRANSFER_DATA
*&      Form  FILL_IT_BDCDATA
Filling Bdcdata structure with it_data
Some fields have been commented for future updations
FORM FILL_IT_BDCDATA.
PERFORM BDC_DYNPRO USING : 'SAPLMGMM' '0060'.
PERFORM BDC_FIELD  USING : 'BDC_OKCODE' '/00',
                         : 'BDC_CURSOR' 'RMMG1_REF-MATNR',
                         : 'RMMG1-MBRSH' IT_DATA-MBRSH,
                         : 'RMMG1-MTART' IT_DATA-MTART.
PERFORM BDC_DYNPRO USING : 'SAPLMGMM' '0070'.
PERFORM BDC_FIELD  USING : 'BDC_OKCODE' '=RESA'.
PERFORM BDC_DYNPRO USING : 'SAPLMGMM' '0070'.
PERFORM BDC_FIELD  USING : 'BDC_OKCODE' '=ENTR',
                         : 'MSICHTAUSW-KZSEL(01)' IT_DATA-KZSEL.
PERFORM BDC_DYNPRO USING : 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD  USING : 'BDC_OKCODE' '=BU',
                         : 'BDC_SUBSCR' 'SAPLMGMM' & '  2000TABFRA1',
                         : 'BDC_SUBSCR' 'SAPLMGD1' & '  1002SUB1',
                         : 'BDC_CURSOR' 'MAKT-MAKTX',
                         : 'MAKT-MAKTX' IT_DATA-MAKTX,
                         : 'BDC_SUBSCR' 'SAPLMGD1' & '  2001SUB2',
                         : 'MARA-MEINS' IT_DATA-MEINS,
                         : 'MARA-MATKL' IT_DATA-MATKL,
                         : 'MARA-BISMT' IT_DATA-BISMT,
                         : 'BDC_OKCODE' '=BU'.
*perform bdc_field       using 'MARA-EXTWG'  ''.
*perform bdc_field       using 'MARA-LABOR' ''.
*perform bdc_field       using 'MARA-KOSCH' ''.
*perform bdc_field       using 'MARA-MSTAE' ''.
*perform bdc_field       using 'MARA-MSTDE' ''.
*perform bdc_field       using 'BDC_SUBSCR' 'SAPLMGD1' & '  2561SUB3'.
*perform bdc_field       using 'MARA-BEGRU' ''.
*perform bdc_field       using 'BDC_SUBSCR' 'SAPLMGD1' & '  2007SUB4'.
*perform bdc_field       using 'MARA-NTGEW' ''.
*perform bdc_field       using 'MARA-BRGEW' ''.
*perform bdc_field       using 'MARA-GEWEI' ''.
*perform bdc_field       using 'MARA-VOLUM' ''.
*perform bdc_field       using 'MARA-VOLEH' ''.
*PERFORM BDC_FIELD       USING 'MARA-GROES' ''.
*perform bdc_field       using 'MARA-EAN11' ''.
*perform bdc_field       using 'MARA-NUMTP' ''.
*PERFORM BDC_FIELD       USING 'BDC_SUBSCR' 'SAPLMGD1' & '  2005SUB5'.
*perform bdc_field       using 'BDC_SUBSCR' 'SAPLMGD1' & '  2011SUB6'.
*perform bdc_field       using 'MARA-MAGRV' ''.
ENDFORM.                    " FILL_IT_BDCDATA
*&      Form  BDC_DYNPRO
Filling the it_bdcdata table with program name & screen number
FORM BDC_DYNPRO USING    PROGRAM LIKE BDCDATA-PROGRAM
                         DYNPRO LIKE BDCDATA-DYNPRO.
  IT_BDCDATA-PROGRAM = PROGRAM.
  IT_BDCDATA-DYNPRO = DYNPRO.
  IT_BDCDATA-DYNBEGIN = 'X'.
  APPEND IT_BDCDATA.
  CLEAR IT_BDCDATA.
ENDFORM.                    " BDC_DYNPRO
*&      Form  BDC_FIELD
  Filling it_bdcdata with field name and field value
FORM BDC_FIELD USING FNAM LIKE BDCDATA-FNAM
                     FVAL.
  IT_BDCDATA-FNAM = FNAM.
  IT_BDCDATA-FVAL = FVAL.
  APPEND IT_BDCDATA.
  CLEAR IT_BDCDATA.
ENDFORM.                    " BDC_FIELD
<b>*&      Form  ERROR_MESSAGES
Displaying error messages
FORM ERROR_MESSAGES.
    CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
             ID        = SY-MSGID
             LANG      = '-D'
        IMPORTING
             MSG       = V_MESG
        EXCEPTIONS
             NOT_FOUND = 1
             OTHERS    = 2.
  LOOP AT IT_MESSAGES WHERE MSGTYP = 'E'.
    WRITE : / 'Message :'(I06) ,V_MESG.
    CLEAR IT_MESSAGES.
  ENDLOOP.
ENDFORM.                    " ERROR_MESSAGES</b>
*&      Form  BDC_PROCESS
Open bdc session if call transaction fails
FORM BDC_PROCESS.
  IF FG_BDC = 'N'.
open bdc session
   PERFORM OPEN_BDC.
   FG_BDC = 'O'.
  ENDIF.
  IF FG_BDC = 'O'.
insert data into bdc session
    PERFORM INSERT_BDC.
  ENDIF.
ENDFORM.                    " BDC_PROCESS
*&      Form  OPEN_BDC
  Calling function module to open bdc session
FORM OPEN_BDC.
  CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
      CLIENT              = SY-MANDT
      GROUP               = 'SMM1'
      KEEP                = 'X'
      USER                = SY-UNAME
    EXCEPTIONS
      CLIENT_INVALID      = 1
      DESTINATION_INVALID = 2
      GROUP_INVALID       = 3
      GROUP_IS_LOCKED     = 4
      HOLDDATE_INVALID    = 5
      INTERNAL_ERROR      = 6
      QUEUE_ERROR         = 7
      RUNNING             = 8
      SYSTEM_LOCK_ERROR   = 9
      USER_INVALID        = 10
     OTHERS              = 11.
ENDFORM.                    " OPEN_BDC
*&      Form  INSERT_BDC
  Insert it_bdcdata into bdc by calling function module bdc_insert
FORM INSERT_BDC.
  CALL FUNCTION 'BDC_INSERT'
    EXPORTING
      TCODE            = 'MM01'
    TABLES
      DYNPROTAB        =  IT_BDCDATA
    EXCEPTIONS
      INTERNAL_ERROR   = 1
      NOT_OPEN         = 2
      QUEUE_ERROR      = 3
      TCODE_INVALID    = 4
      PRINTING_INVALID = 5
      POSTING_INVALID  = 6
      OTHERS           = 7.
ENDFORM.                    " INSERT_BDC
*&      Form  CLOSE_BDC
Closing bdc session
FORM CLOSE_BDC.
  CALL FUNCTION 'BDC_CLOSE_GROUP'
     EXCEPTIONS
       NOT_OPEN    = 1
       QUEUE_ERROR = 2
       OTHERS      = 3.
ENDFORM.                    " CLOSE_BDC
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • RFC enabled function module is not runing the BDC code in it.

    Dear Experts,
    1. We have created a RFC enabled function module to change status of a activity and to save it we are using BDC code and we have also put the code in the RFC FM only.
    The RFC fm is runing fine and changing the data and also saving it by runing the BDC when run in the R/3 system only.
    But when i run the FM from portal its just chaning the status but not runing the BDC code in it.
    below i am puting the code of the FM.
    FUNCTION ZRFC_CRM_STATUS_CHANGE_EXTERN .
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(CHECK_ONLY) TYPE  XFELD DEFAULT ' '
    *"     VALUE(CLIENT) LIKE  SY-MANDT DEFAULT SY-MANDT
    *"     VALUE(OBJNR) TYPE  CRM_JSTO-OBJNR OPTIONAL
    *"     VALUE(USER_STATUS) LIKE  CRM_JEST-STAT
    *"     VALUE(SET_INACT) TYPE  XFELD DEFAULT ' '
    *"     VALUE(SET_CHGKZ) LIKE  CRM_JSTO-CHGKZ OPTIONAL
    *"     VALUE(XNOAUTO) LIKE  CRM_JSTO_UPD-XNOAUTO OPTIONAL
    *"     VALUE(NO_CHECK) TYPE  XFELD DEFAULT ' '
    *"     VALUE(ZOBJNR) TYPE  CHAR80
    *"     VALUE(OBJECT_ID) TYPE  CRMT_OBJECT_ID
    *"  EXPORTING
    *"     VALUE(STONR) LIKE  TJ30-STONR
    *"  EXCEPTIONS
    *"      OBJECT_NOT_FOUND
    *"      STATUS_INCONSISTENT
    *"      STATUS_NOT_ALLOWED
    *{   INSERT         D60K900707                                        1
      DATA: BEGIN OF JSTAT_TMP.
              INCLUDE STRUCTURE JSTAT.
      DATA: END OF JSTAT_TMP.
      data: bdcdata like bdcdata  occurs 0 with header line.
      data: dire type CRMD_ACTIVITY_H-direction.
      CLEAR: DIRE.
    OBJNR = ZOBJNR.
      MANDT = CLIENT.
      JSTAT_TMP-STAT  = USER_STATUS.
      JSTAT_TMP-INACT = SET_INACT.
      IF USER_STATUS+0(1) NE EXTERN.
        RAISE STATUS_NOT_ALLOWED.
      ENDIF.
    Statusobjekt ggf. einlesen
      PERFORM STATUS_READ USING OBJNR IOBTYP ISTSMA NOT_FOUND.
      CHECK NOT_FOUND = OFF.
    ggf. Änderungsbelege aktivieren
      IF SET_CHGKZ = 'X' AND JSTO_BUF-CHGKZ = SPACE AND CHECK_ONLY = SPACE.
        PERFORM SET_CHGKZ USING OBJNR.
      ENDIF.
    set XNOAUTO-flag if desired
      IF XNOAUTO = 'X' AND CHECK_ONLY = SPACE.
        PERFORM SET_XNOAUTO USING OBJNR.
      ENDIF.
      crm_jostd-OBJNR = OBJNR.
    Status-Puffer füllen
      REFRESH JEST_BUF_A.
      REFRESH JEST_BUF_E.
      CLEAR   JEST_BUF_A.
      CLEAR   JEST_BUF_E.
      CLEAR JEST_K.
      MOVE MANDT       TO JEST_K-MANDT.
      MOVE crm_jostd-OBJNR TO JEST_K-OBJNR.
      READ TABLE JEST_BUF WITH KEY JEST_K BINARY SEARCH.
      IF SY-SUBRC IS INITIAL.
        TABIX = SY-TABIX.
        MOVE-CORRESPONDING JEST_BUF TO JEST_BUF_E.
        APPEND JEST_BUF_E.
        MOVE-CORRESPONDING JEST_BUF TO JEST_BUF_A.
        MOVE MANDT TO JEST_BUF_A-MANDT.
        APPEND JEST_BUF_A.
        DO.
          ADD 1 TO TABIX.
          READ TABLE JEST_BUF INDEX TABIX.
          IF SY-SUBRC IS INITIAL AND JEST_BUF-OBJNR = crm_jostd-OBJNR.
            MOVE-CORRESPONDING JEST_BUF TO JEST_BUF_E.
            APPEND JEST_BUF_E.
            MOVE-CORRESPONDING JEST_BUF TO JEST_BUF_A.
            MOVE MANDT TO JEST_BUF_A-MANDT.
            APPEND JEST_BUF_A.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
      g_no_check = no_check.
      OBJNR = ZOBJNR.
      PERFORM STATUS_CHANGE_EXTERN USING CHECK_ONLY
                                         OBJNR
                                         JSTAT_TMP
                                         EXTERN.
      clear g_no_check.
    Zurückschreiben in Puffer
      PERFORM CHG_JEST_BUF_E.
    ggf. Statusordnungsnummer ermitteln
      IF STONR IS REQUESTED.
        CALL FUNCTION 'CRM_STATUS_READ'
             EXPORTING
                  OBJNR       = OBJNR
                  ONLY_ACTIVE = 'X'
             IMPORTING
                  STONR       = STONR.
      ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    IMPORTING
      RETURN        =
    *COMMIT WORK.
    wait up to 10 seconds.
      CLEAR bdcdata.
      bdcdata-program  = 'SAPLCRM_1O_MANAG_UI'.
      bdcdata-dynpro   = '0100'.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
       CLEAR bdcdata.
      bdcdata-fnam = 'BDC_OKCODE'.
      bdcdata-fval = '=READ'.
      APPEND bdcdata.
      CLEAR bdcdata.
      bdcdata-program  = 'SAPLCRM_1O_MANAG_UI'.
      bdcdata-dynpro   = '0510'.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
       CLEAR bdcdata.
      bdcdata-fnam = 'BDC_CURSOR'.
      bdcdata-fval = 'GV_OBJECT_ID'.
      APPEND bdcdata.
       CLEAR bdcdata.
      bdcdata-fnam = 'GV_OBJECT_ID'.
      bdcdata-fval = OBJECT_ID.
      APPEND bdcdata.
         CLEAR bdcdata.
      bdcdata-fnam = 'BDC_OKCODE'.
      bdcdata-fval = '=OKAY'.
      APPEND bdcdata.
      CLEAR bdcdata.
      bdcdata-program  = 'SAPLCRM_1O_MANAG_UI'.
      bdcdata-dynpro   = '0100'.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
      CLEAR bdcdata.
      bdcdata-fnam = 'BDC_OKCODE'.
      bdcdata-fval = '=1OMAIN_TT'.
      APPEND bdcdata.
      CLEAR bdcdata.
      bdcdata-program  = 'SAPLCRM_1O_MANAG_UI'.
      bdcdata-dynpro   = '0100'.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
       CLEAR bdcdata.
      bdcdata-fnam = 'BDC_CURSOR'.
      bdcdata-fval = 'CRMT_7010_ACTIVITY_UI-DIRECTION'.
      APPEND bdcdata.
    select single direction from CRMD_ACTIVITY_H into dire
                                  where  guid = objnr.
      if sy-subrc = 0.
        if dire = '0'.
          dire = '1'.
        elseif dire = '1'.
         dire = ''.
       elseif dire is initial.
         dire = '1'.
        endif.
    endif.
    CLEAR bdcdata.
      bdcdata-fnam = 'CRMT_7010_ACTIVITY_UI-DIRECTION'.
      bdcdata-fVAL = DIRE.
      APPEND bdcdata.
      CLEAR bdcdata.
      bdcdata-fnam = 'BDC_OKCODE'.
      bdcdata-fval = '=SAVE'.
      APPEND bdcdata.
    CALL TRANSACTION 'CRMD_BUS2000126'  using bdcdata mode 'N'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    IMPORTING
      RETURN        =
    *COMMIT WORK.
    wait up to 5 seconds.
    *}   INSERT
    ENDFUNCTION.
    Thanks and regards
    Neel

    Dear experts,
    Already the FM is RFC enabled other i won't be able to call it from portal
    and coming to using the BAPI_ACTIVITY CHANGE fm that acting very weird so we are using the CRM EXTERN CHANGE USER STATUS fm which is working fine but the only problem is even when we comit from BAPI_TRANSACTION_COMMIT its not getting the delta queue of BW updated eventhough its chaning the status.
    So for the above reasons we are using the BDC code in the FM for pressing the save button then its will update the changes to BW delta queue as well.
    its working fine when i run it from the system in tcode SE37 only the BDC code is not runing when i am doing it from portal apart from the fm is chaning the status .
    thanks and regards
    Neel

  • Restrict clicking enter key in the bdc program

    Hi all,
             There is one BDC program for Vendor Master creation. In the output it is waiting for the enter key for each vendor creation. Suppose we have 1000 vendors to be created. Then we need to click enter key 1000 times.
    Anybody please suggest me whether can I change the BDC code to stop entering the Enter Button each time a vendor is created.
    Thanks and Regards,
    Murali Krishna T

    Hi Raghava,
                        Thanks for your prompt reply. There are no information messages inside the loop.
    This is the code block inside the loop.
      Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    Edited by: Rob Burbank on Apr 23, 2010 10:26 AM

  • .can anybody explain the bdc with help of an example

    i am new to bdc .can anybody explain the bdc with help of an example

    Hi,
    BDC is method to transfer legacy data into R3 system.
    Data transfer can be done in any one method below:
    BDC
    LSMW
    Direct Input method
    BAPI
    Of these BDC is subdivided into 2 types,
    Call Transaction and Session method (TCode: SM35)
    Let me give the sample prg for Call Transaction method.
    tables ZMATMASTER.
    DATA : itab like TABLE OF  ZMATMASTER WITH KEY DESCRIPTION with header line.
    DATA : IT_BDC LIKE TABLE OF BDCDATA WITH HEADER LINE.
    DATA : IT_MSG LIKE TABLE OF BDCMSGCOLL WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\Material.txt'
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = '#'
      TABLES
        DATA_TAB                      = itab.
    LOOP AT ITAB.
        PERFORM BDC_HEADER USING 'ZFILE_DOWNLOAD' 9001.
        PERFORM BDC_DATA   USING 'BDC_OKCODE' 'SAVE'.
        PERFORM BDC_DATA   USING 'ZMATMASTER-MNO' ITAB-MNO.
        PERFORM BDC_DATA   USING 'ZMATMASTER-DESCRIPTION' ITAB-DESCRIPTION.
        PERFORM BDC_DATA   USING 'ZMATMASTER-PLANT' ITAB-PLANT.
        PERFORM BDC_DATA   USING 'ZMATMASTER-SLOC' ITAB-SLOC.
        PERFORM BDC_DATA   USING 'ZMATMASTER-ROL' ITAB-ROL.
        PERFORM BDC_DATA   USING 'ZMATMASTER-UOM' ITAB-UOM.
        PERFORM BDC_DATA   USING 'ZMATMASTER-PRICE' ITAB-PRICE.
        PERFORM BDC_DATA   USING 'ZMATMASTER-DDAYS' ITAB-DDAYS.
        PERFORM BDC_DATA   USING 'ZMATMASTER-FLOT' ITAB-FLOT.
    ENDLOOP.
    CALL TRANSACTION 'ZTRANSCODES'
                     USING IT_BDC
                     MODE 'A'
                     UPDATE 'S'
                     MESSAGES INTO IT_MSG.
    FORM BDC_HEADER USING PROGRAMNAME SCREENNO.
         IT_BDC-PROGRAM = PROGRAMNAME.
         IT_BDC-DYNPRO = SCREENNO.
         IT_BDC-DYNBEGIN = 'X'.
         APPEND IT_BDC.
    ENDFORM.
    FORM BDC_DATA USING FNAME FVALUE.
         CLEAR IT_BDC.
         IT_BDC-FNAM = FNAME.
         IT_BDC-FVAL = FVALUE.
         APPEND IT_BDC.
    ENDFORM.
    In session method, log file can be viewed.
    Foll. is the example for session method.
    REPORT ZBDC_BATCH1                                                 .
    TABLES: ZEMPREC.
    DATA : BEGIN OF STR1,
           EMPNO(3),
           EMPNAME(15),
           SALARY(9),
           DOJ(10),
           END OF STR1.
    DATA: FNAME(100) TYPE C VALUE 'C:\EMPLOYEE.TXT.,
    DATA : BDCITAB LIKE TABLE OF BDCDATA WITH  HEADER LINE,
           MSGITAB LIKE TABLE OF BDCMSGCOLL WITH HEADER LINE.
    OPEN DATASET: FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    perform open_group.
    DO .
      READ DATASET FNAME INTO  STR1.
      IF SY-SUBRC <> 0 .
        EXIT.
      ENDIF.
      perform bdc_dynpro      using 'ZBDC_BATCH' '9000'.
      perform bdc_field       using 'ZEMPREC-EMPNO'
                                    STR1-EMPNO.
      perform bdc_field       using 'ZEMPREC-EMPNAME'
                                    STR1-EMPNAME.
      perform bdc_field       using 'ZEMPREC-SALARY'
                                    STR1-SALARY.
      perform bdc_field       using 'ZEMPREC-DOJ'
                                    STR1-DOJ.
    ENDDO.
    CLOSE DATASET FNAME.
    perform bdc_transaction using 'ZTCODE'.
    perform close_group.
    CLOSE DATASET FNAME1.
    CALL TRANSACTION 'SM35'.
      FORM open_group
    FORM open_group .
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
          CLIENT   = SY-MANDT
          GROUP    = 'sample'
          HOLDDATE = SY-DATUM
          KEEP     = 'X'
          USER     = SY-UNAME.
    ENDFORM.                    "open_group
      FORM bdc_transaction
      -->  TCODE
    form bdc_transaction USING TCODE.
      CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          TCODE     = 'ZTCODE'
        TABLES
          DYNPROTAB = BDCITAB.
    ENDFORM.                    "bdc_transaction
      FORM close_group
    FORM close_group.
      CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDFORM.                    "close_group
      FORM BDC_DYNPRO
      -->  PROGRAM
      -->  SCREEN
    FORM BDC_DYNPRO USING PROGRAM SCREEN.
      CLEAR BDCITAB.
      BDCITAB-PROGRAM = PROGRAM.
      BDCITAB-DYNPRO = SCREEN.
      BDCITAB-DYNBEGIN = 'X'.
      APPEND BDCITAB.
    ENDFORM.                    "BDC_DYNPRO
      FORM BDC_FIELD
      -->  FNAM
      -->  FVAL
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR BDCITAB.
      BDCITAB-FNAM = FNAM.
      BDCITAB-FVAL = FVAL.
      APPEND BDCITAB.
    ENDFORM.                    "BDC_FIELD
    Hope now u get an idea abt BDC.
    Regards,
    Router

  • How can we execute the BDC session in error mode through se38 programme

    Dear Experts,
    How can we execute the BDC session in error mode through se38 programme....
    we can execute the session in the below 2 ways
    1) Through SM35 we can process the session manually in foreground/Error mode or Background also.
    2) through RSBDCSUB (standared Program) we can process the session in back ground.
    But i want to process the session in foreground or Error mode..Do we have any standared program for process the session in foreground or error mode.
    Please suggest.
    Regards,
    Bussa.

    Hi,
    SAP was smart enough to provide this little program: RSBDCCTU
    Sandra
    Edited by: Sandra Rossi, 15 minutes later
    Maybe the answer to your question is just to use CALL TRANSACTION ... USING ... (see the example in RSBDCCTU). You can also generate such a program using transaction SHDB

  • Please tell me the BDC for the VA01

    Hi,
      I have faced problem writing in BDC for  standard transaction code VA01. For one sales order creation two or more line items will be there. Then how to write code for the BDC for the VA01. Please help me.
    regards
    Mohan.

    imp. the foll. code to handle the multiple line items in sales order.
    declare 2 variables:
    data: lv_text(100) type c,
           lv_cnt(02) type n.
    loop at header .
    perofrm BDC...
    lv_cnt = lv_cnt + 1.
    loop at item where vbeln = header-vbeln.
    i am giving an ex. for one of the item field, menge i.e, quantity..
    u can use same for req. item fields
      CONCATENATE 'RV45A-KWMENG'   '('  cnt   ')'  INTO lv_text.
    PERFORM bdc_field       USING lv_text   '                100'.
    here the lv_text contains 'RV45A-KWMENG(01)'.
    CLEAR lv_text.
      cnt = cnt + 1.
      CONCATENATE 'RV45A-KWMENG'  '(' cnt  ')'   INTO lv_text.
      PERFORM bdc_field       USING lv_text     '                200'.
          here lv_text contains  'RV45A-KWMENG(02)'
    u can like this upto 99 line items...
    clear: lv_text, lv_cnt.
    endloop.
    call transaction VA02..........using...
    endloop.
    hope it willbe helpful for u...

  • What is the source file structure while doing the BDC of mm01

    What is the source file structure while doing the BDC of mm01

    Hi,
    first u create a meterial note the data u enterd in the screens.
    if u have created the material successfully then that data structure will be the source structure of the
    file.
    regards.
    Jagadeesh.

  • Need inputs regarding the dvd drive on primary ide channel.

    Specs:
    Motherboard: MSI P35 Neo3 (MS-7935 1.0)
    CPU: Intel Core2 Duo E6550
    Memory: Team Elite DDR2800 (2x1GB Dual Channel)
    Hard drive: Seagate Barracuda 7200.11 500GB 32MB Cache (SATA)
    Optical drive: LG GSA-H55L (IDE only) Firmware version 1.02
    Graphics card: Gecube HD3870
    Chipset: Intel P35/G33/G31 (Rev. A2)
    Southbridge: Intel 82801IB (ICH9)
    LPCIO: Fintek F71882F
    BIOS: AMI V1.1 (11/07/2007)
    Hello,
    Almost all new motherboards today only have a primary ide channel and the rest are SATA.
    I need inputs regarding the dvd drive which is shown in device manager as located on the primary ide channel while the hard drive is located on the secondary channel. Because I would like to update the dvd drive to the latest firmware (version 1.06; to be able to recognize more blank media) but the LG site recommends that the drive (dvd) be located on the secondary ide channel.
    I already tried to uninstall every channel from the device manager but all would still be the same after reboot, dvd drive on primary, hard drive on secondary.
    Current ide mode in BIOS is set to AHCI+IDE mode, DMA modes are fine (UDMA4 for dvd, UDMA5 for hard drive), boot sequence (1st=HD, 2nd=DVD, 3rd=Floppy drive)
    Tried switching to IDE mode only in BIOS but would not detect the optical drive. Never tried RAID+IDE mode since I only have a single hard drive.
    I'm not sure but if I try to update the firmware, it might instead try to update the hard drive's firmware instead of the optical drive and make the hard drive unusable.
    I would like to know if anybody with this same situation was able to successfully update the optical drive's firmware or is there some way to place the optical drive on the secondary ide channel and the hard drive on primary for me to follow and replicate the process.
    Thank you for any replies.

    Thanks sir NovJoe for the reply.
    Just received the solution from another forum where I posted the same problem.
    They said that the flash program for the firmware will detect the drive on its own and would not flash other devices except the optical drive itself. So its pretty safe, and I can confirm this since I just flashed my ODD a little over a while ago and everything went fine. No errors.
    Though I'm speaking for the brand of ODD I own and may be different for other brands so take precautions as well. It may be different for the others.

  • How can I select a radio button in a table regarding the data in the cells?

    Hi everyone
    This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
    This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
    Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
    So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
    Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
    Could you please help me with this problem?? I'm Kind of frustrated with this issue jejeje

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

  • Payroll issue regarding the Claims - /561 and /563

    Hi Payroll Experts,
    I have a payroll issue regarding the Claims - /561 and /563 (October PY Run)
    When i m runnning the Current month Payroll(October PY Run), Total Earning - total deductions are not matching with Net Pay. later i came to know that the system creates the WT /561 and deducts from the Net Pay.
    But as per the Employee Payment Details , there is no recovery required from the employee for the past one year. But even then the system creates the WT /561. and deducts the same from NET Pay.
    The followng are the WT details
    IN - Period
    OCT 2011
         /101 Total gross amount     118,897.00
         /110 Net payments/deductions     76,070.00-
         /550 Statutory net pay     95343
         /551 Stat.net recalc.diff.     37,692.00-
         /552 Stat.net subs.adjustment      37,692.00-
         /559 Bank transfer                                                   34,317.00
         /560 Net pay     37,218.00
         /563 Claim from previous month     5,609.00
    FOR Period
    Sept- Oct
         /101 Total gross amount     49,213.00
         /110 Net payments/deductions      31,721.00-
         /550 Statutory net pay     41,529.00
         /551 Stat.net recalc.diff.     14,591.00
         /552 Stat.net subs.adjustment     23,101.00-
         /553 Recalc.diff.to last payr.     37,692.00
         /559 Bank transfer                                                   14,591.00
         /560 Net pay     14,591.00
         /561 Claim     5,609.00
    I request  some body to  throw siome light on the same.

    Hi Experts,
    Thanks for everyone for replying to my query ,
    I have a doubt that If you check the WTs /551 and /552  in the IN PRD, the negative sign is coming for both the WTs
    Is it correct?
    And also, Assume that there may be a master data changes like Bank details and other deduction Wts happened in the month of Aug and now i m going to run the payroll for the month of Nov,
    some of the employees having differences in the Net Pay, Eventhough the employee is having sufficient balances.
    So how do i handle this issue
    IS ther any way to solve this differences?
    Please Let me know how to solve this issue.
    Thanks

  • Regarding the report for vendor stock

    Hello all,
    This is regarding the Subcontracting scenario. We have requirement of transferring the stock of material to Vendor by using 311 Q as the tye child material is in the project stock. In
    However the customer would like to have a report in which we can see the stock provided to vendor  ' Vendorwise or PO wise" .
    Kindly suggest the solution.
    Thanks & regards,
    Sudhir

    Hi
    The stock monitoring for SC stocks at vendor can be done uswing ME2O report.
    If you want to see the total stocks available at vendor then use report MBLB

  • Regarding the internet breech as seen on the news.  What advice is Apple giving to its computer, iPad, and phone users?

    Regarding the internet breech as seen on the news.  What advice is Apple giving to its computer, iPad, and phone users?

    That does not affect any OS X client or iOS, and there is no action for you or Apple to take.
    Ignore hyperventilating popular media outlets that thrive by promoting fear and discord with entertainment products arrogantly presented as "news". Learn what real threats actually exist and how to arm yourself against them:
    The most serious threat to your data security is phishing. To date, most of these attempts have been pathetic and are easily recognized, but that is likely to change in the future as criminals become more clever.
    OS X viruses do not exist, but intentionally malicious or poorly written code, created by either nefarious or inept individuals, is nothing new.
    Never install something without first knowing what it is, what it does, how it works, and how to get rid of it when you don’t want it any more.
    If you elect to use "anti-virus" software, familiarize yourself with its limitations and potential to cause adverse effects, and apply the principle immediately preceding this one.
    Most such utilities will only slow down and destabilize your Mac while they look for viruses that do not exist, conveying no benefit whatsoever - other than to make you "feel good" about security, when you should actually be exercising sound judgment, derived from accurate knowledge, based on verifiable facts.

  • Regarding the Belkin Audio Splitter (3.5mm-M/2x3.5mm-F).  Are both sides of this splitter simultaneously bidirectional?

    Regarding the Belkin Audio Splitter (3.5mm-M/2x3.5mm-F).  Are both sides of this splitter simultaneously bidirectional?

    Direct connections are always best, but if you insist:
    Get a Griffin iTrip or replace your radio with one that has AUX inputs and/or Bluetooth.

  • Regarding the product time capsule...is the modem the same as airport extreme and is the disk drive always running? I'm worried about it lasting for at least five years.

    Regarding the product Time Capsule... is the modem the same as the Airport extreme and is the disk drive always running??? I'm worried about it lasting at least five years.

    John,
    I'd pay good money to bet it wouldn't last 5 years... I don't rate the in built power supply and as for "server grade hard disk" - Hmmmm..... The failure rate of all HD's on the market after 3 year is 60%.
    Regards,
    Shawn

Maybe you are looking for