Bdc Difficulties

hi sap guru's,
what r all the Difficulties ,we will  found when we running bdc,
this is an interview question plz help me,
'difference between foreground and background'
plz forward a document if u have
thanks & regards
prasad

Hi kantu ,
No interview questions.
Regards,
Sravanthi

Similar Messages

  • BDC session error handling for IW41 transaction

    Hi,
    When the order confirmation is done by BDC session program, it is executed without any error. But if we do the same process manually, it is showing the error message as 'Posting period is Locked for 001 2012'. My question here is why this is not happening when it is executed through bdc session program.
    Anyone can help us?
    Thanks,
    Guna

    It is difficult to believe that you would get good results from background BDC process and error in foreground using same transaction and exactly the same data.  Beyond that, why is month 1 of the current year locked?    Are you absolutely sure that:
    BDC works correctly? maybe does NOT and the errors have been missed or ignored?
    Data is precisely the same for both BDC sessions?
    Same transaction is called?
    Sounds silly perhaps, but I have to believe that something is very different between the two sessions.

  • Doubt in BDC direct input method

    Hi experts
    I dont know how to upload data in SAP data base by using BDC direct input coding method. Can u people explain this with coding?
    Thanks in advance.
    Regards
    Antony

    Hi,
    DI is used when u r going upload large amount of data for single application.
    Better example where direct input method will be used is... uploading the data for material master.....it includes lot of views so its very much difficult to capture all the views and record the tcode and map the data in such conditions its better to go with DI methods
    advantages:
    in session method or CT method while uploading the data u do the validation by fallowing the screen sequence and field sequence where as in DI validations can be done set of code so this make the process very fast so its advantageous to upload large amout of data.
    you always use the standard sap provided program for this.
    Here in DI method very important thing is structure of flat file... so to know the structure first of all you have to download the data for one record into the internal table with the use of the same program then with the use of that structure u have to desing the flat file and upload the data.
    Re: re: direct input method
    Award points if useful.
    Thanks,
    Ravee...

  • How we can upload the data through BDC for transaction J1ID

    Hi guru
    How w can upload the data for Transaction J1ID.In this we want to upload the data for Customer Excise details. I want to upload the data on behalf of Customer (KUNNR) becasue customer is a primary KEY. Table name: J_1IMOCUST
    Fields. 11 Fields.plz provide some code logic.
    KUNNR     J_1IEXCD     J_1IEXRN     J_1IEXRG     J_1IEXDI     J_1IEXCO     J_1ICSTNO     J_1ILSTNO     J_1IPANNO     J_1IEXCICU     J_1ISERN

    Hi,
    I dont see any difficulties in doing BDC upload for J1ID, You have to record by giving the New Entries button and then enter all the details of customers using table control technique.
    SEARCH SCN for Table Control in BDC
    Regards
    Karthik D

  • BDC recording

    Hi ,
    There is a flat file in the application server containing some fields of header and the item of the sale order.
    Ex:
    VBELN, PO number, PO order type, Completed Delivery indicator  at header level.
    Vbeln, posnr, sales type, Partial delivery indicator at item level.
    I try to change PO number, PO order type at header level and Sales type and partial delivery indicator at the item level.
    I did the recording process and executed the program for SO change.
    The entries of flat file are settled in proper fields in the screen, but when i prress ok code to move to next screen, the values is changed back to the old value.
    So the new entries is not saved in the field.
    And i do checked it that, the recording process is working for the sale order with single line item, since recording is done with single line item sale order.
    How can i pass entries to the order with multiple line items?
    I tried with a recording consisting of maximum number of line items, but still its not working.
    Can anyone tell me the logic for doing changes in sale order entries of header and item, for mulitple line items through recording?
    Points for useful suggestions.
    Edited by: kumar t on Sep 15, 2008 3:32 PM

    Hi,
    For Enjoy transactions it is difficult to handle the BDC. BAPI is netter option.
    You have to handle this by using BDC TABLE CONTROL.
    In the recording itself index will be generated for each line in the line item.
    By handling that index in your program you can pass values for multiple line items.
    goto this thread.
    BDC Table control

  • BDC for transaction F-28

    Hi All,
    I need to use transaction F-28 to create an interface for automatic postings of customer payments.
    Is it possible to create BDC for F-28?
    Regards

    Hello,
    It is very difficult to make bdc for any FI transaction. My advice is to use RFBIBL00 program for this.
    See my answer to this thread
    Re: FB01 DATA UPLOAD USING POSTING_INTERFACE_DOCUMENT FUNCTION
    Regards,
    Naimesh

  • Problem in bdc for f-22

    Hi freinds iam doing upload program for f-22 open customer balances..iam stucked as iam new in abap, here is the problem ..
    when i try to run the program after 2 screens i get a pop up with costcenter ,profitcenter, and business area field...which in nomal t.code are not in the form of popup.....and when  i put valid data (account) which has profit center and cost center then it works ..but when i put data which had no profict center and costcenter it process but shows and errror
    "CURSOR FIELD 'COBL-KOSTL' DOESNOT EXITS.
    AND I TRIED TO COMPARE IT WITH SKB1 TABLES FIELD FSTAG...ALSO ...
    THE REQUIREMENT IS ITHOULD PROCESS THE ACCOUNT WHHICH HAS PROFIT CNETER AND COST CENTER IF ASSIGN FOR A ACCOUNT IOF NO THEN REST SHOULD BE PROCESSD,
    HERE IS MY CODE ..PLS CORRECT ME WITH MY CODE IF IAM WRONG SOMEHERE ..AND GIVE ME SUGGETSION FOR IT (URGENT)
    *Selecting fieldstatus from skb1 for comparision
        SELECT SINGLE fstag FROM skb1 INTO w_fstag WHERE
                       saknr =  i_final-newko2.
        IF sy-subrc = 0.
          PERFORM bdc_field       USING 'COBL-KOSTL'
                                        i_final-kostl2.
          PERFORM bdc_field       USING 'COBL-PRCTR'
                                        i_final-prctr2.
        ENDIF. "IF SY-SUBRC
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0330'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'BSEG-CCBTC'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
        PERFORM bdc_transaction USING 'F-22'.
      ENDLOOP.

    Using batch input to post financial transactions is always difficult. As said earlier, RFBIBL00 (or a BAPI) are the preferred method. However, if you must use BDC, you have to allow for the coding block in the popup (the COBL fields).
    This workds for FB01 for cost centers, fund centers and funds. You can adapt it to include the profit center in F-22:
          perform dynpro using:
    * Debit the central account the full amount
           'X' 'SAPMF05A'    '0300',         "second screen - 300
           ' ' 'BSEG-WRBTR'  ltcap_int-tot_inc,"DR amount
           ' ' 'BSEG-ZUONR'  zuonr,            "allocation
           ' ' 'BSEG-SGTXT'  sgtxt1,           "text
           ' ' 'RF05A-NEWBS' '50',             "post key = credit
           ' ' 'RF05A-NEWKO' p_acc,            "bofa clearing acct
           'X' 'SAPLKACB'    '0002',           "coding block
           ' ' 'COBL-KOSTL'  '11732',          "cost center
           ' ' 'COBL-FISTL'  '103387',         "fund center
    * Credit the fund the final amount
           'X' 'SAPMF05A'    '0300',           "CR screen
           ' ' 'BSEG-WRBTR'  ltcap_int-fin_inc,"CR amount
           ' ' 'BSEG-SGTXT'  sgtxt1,           "text
           'X' 'SAPLKACB'    '0002',           "coding block
           ' ' 'COBL-KOSTL'  '11733',          "cost center
           ' ' 'COBL-GEBER'  ltcap_int-fund,   "fund
           ' ' 'COBL-FISTL'  ltcap_int-cfc.    "fund center
    Rob

  • Standard BDC for t.code: FB01

    Hi,
    Is there any standard BDC available for T.code: FB01.
    Thanks and Regards,
    VK

    Hi,
    You can use standard program RFBIBL00 or BAPI BAPI_ACC_DOCUMENT_POST for this purpose.
    Creating BDC for FB01 mainly depends on your need. A generic one is difficult to be created due to multiple alternative screeens.
    Regards,
    Gaurav

  • BDC- material master

    Hi all,
    I have a set of data where few materials belong to some views and others belong to other views and sevaral sets like this.
    how can i handle them.
    is BDC the best solution? or any other ways?
    tx,
    kiran

    Hi,
    Better to use the BAPI BAPI_MATERIAL_SAVEDATA, you need to pass the mandatory fields here, anyways if you use the BDC also you need to pass the mandatory fields, Handiling BDC for MM02 is quite difficult, so better go for BAPI.
    if you still wants the BDC for MM02, just with this link ..
    http://sap.niraj.tripod.com/id12.html
    Regards
    Sudheer

  • BDC-Direct Input

    Please give an example for Direct Input method in BDC.When it is used? what is the advantage and disadvantage?

    Hi Khanna Renga ,
    Direct Input method is used for bulk transfer of data into SAP system.It results in faster execution since no screens are processed and the SAP database will be updated directly using the standard function modules.
    Better example where direct input method will be used is... uploading the data for material master.....it includes lot of views so its very much difficult to capture all the views and record the tcode and map the data in such conditions its better to go with DI methods
    Advantages:
    in session method or Call Transaction method while uploading the data u do the validation by fallowing the screen sequence and field sequence where as in Direct Input validations can be done set of code so this make the process very fast so its advantageous to upload large amout of data.
    you always use the standard sap provided program for this.
    Here in Direct Input method very important thing is structure of flat file... so to know the structure first of all you have to download the data for one record into the internal table with the use of the same program then with the use of that structure u have to desing the flat file and upload the data.
    Direct Input:
    With direct input, the SAP function modules execute the consistency checks. However with batch input, these consistency checks are executed with help of the screens. This means that direct input has considerable performance advantages. But there are a few programs for direct input, you can use them if it accomplishes your goal. Direct Input programs work like that they update database tables directly. As you know that it is forbidden to update SAP database tables directly, since consistency and security should be considered. Exceptions are these direct input programs. So you are not able to write custom ABAP direct input programs. But of course you can write ABAP programs to update custom database tables (Z tables), if you are sure all about consistency.
    SAP has created direct input programs because SAP wanted to enhance the batch input procedure, since batch input is slower. SAP offers the direct input technique, especially for transferring large amount of data. In contrast to batch input, this technique does not create sessions, but stores, updates, inserts data directly. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to able to activate the restart mechanism, direct input programs must be executed in the background only. To maintain and start these programs, use program RBMVSHOW or transaction BMV0.
    Examples for direct input programs are:
    RFBIBL00 - FI
    RMDATIND - MM
    RVAFSS00 - SD
    RAALTD11 - AM
    RKEVEXTO - CO-PA
    Also have a look on below thread..
    Re: re: direct input method
    Re: Give a BDC example by Direct Input Method
    In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. To enter the data into the corresponding database tables directly, the system calls a number of function modules that execute any necessary checks. In case of errors, the direct input technique provides a restart mechanism. However, to be able to activate the restart mechanism, direct input programs must be executed in the background only. Direct input checks the data thoroughly and then updates the database directly.
    Hope it will solve your doubts and problem..
    Reward points if useful..
    Thanks & Regards
    ilesh 24x7

  • Bdc messages in spool

    Hi all,
    I am using call transaction to run a bdc.
    here all the messages whether success/error are displayed as type "S". so its difficult to capture error messages.
    It executes fine in foreground and all the errors are displayed on the top of page but when i check the spool, only first message gets displayed.
    Can anyone plz help me.

    It should be in error in your code : you should put messages in an internal table to get them.
    You could also check your program in 'A' mode to know where there are errors.
    Christophe

  • Hi bdc

    hi
    i have uploaded data from flat file for VA01 successfully.
    now system generates sales order no automatically after uploading data.
    i want to show this sales order no in bdc report.
    the difficult is that sales order no vbeln itself is a primary key so how can i display
    in the bdc report the system generated sales order no.
    important vbeln itself is a primary key.
    since it is missing how can i display in the bdc report sales order no.
    we can not use select querry for this for sure.
    thanx
    rocky

    all the message will be saved in a message table in bdc...where ever message type is 'S' then it resembles that its posted catch that message to a itab and display...below is a prg that i used to catch the document no for prd posting...just look at that.
    it consists of a include file ...im displaying it below the main program
    the messages are caught in the main program after a call transaction is made...
    MAIN PROGRAM
    REPORT ZBDC_POSTING
           NO STANDARD PAGE HEADING LINE-SIZE 255
           MESSAGE-ID ZPP.
    INCLUDE BDCRECX1.
    *PARAMETERS: dataset(132) LOWER CASE.
    TYPE-POOLS  :SLIS.
    TABLES  : MAKT, MKAL.
    DATA:   WK_ELPRO TYPE MKAL-ALORT,
            WK_MAKT TYPE MAKT-MAKTX,
            WK_SUCCESS(5) TYPE C,
            WK_FAILURE(5) TYPE C,
            L_MSTRING(480),
            T_DATE TYPE ZSERVICE_DATE,
            WK_LINES(5) TYPE C,
            LINES(5) TYPE C,
            WK_LEN(150) TYPE C,
            WK_ALP TYPE I,
            LENT TYPE I,
            B(4).
    DATA:  ALVFLD TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
           V_EVENTS TYPE SLIS_T_EVENT WITH HEADER LINE,
           WK_EVENTS LIKE LINE OF V_EVENTS,
           IT_LIST_COMMENTS TYPE SLIS_T_LISTHEADER,
           WK_LIST_COMMENTS LIKE LINE OF IT_LIST_COMMENTS,
           WA_COLOR TYPE LVC_S_SCOL,
           WK_LAYOUT TYPE SLIS_LAYOUT_ALV.
    CONSTANTS: C_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME
                                   VALUE 'F_TOP_OF_PAGE'.
    --TO STORE FINAL DATA TO BE POSTED--
    Generated data section with specific formatting - DO NOT CHANGE  ***
    DATA: BEGIN OF RECORD OCCURS 0,
            BUDAT_002(010),
            BKTXT_004(025),
            MATNR_005(018),
            WERKS_006(004),
            ALORT_007(004),
            ERFMG_008(017),
          END OF RECORD.
    End generated data section ***
    DATA: BEGIN OF MESSAGES OCCURS 0,       "TO STORE FINAL STATUS DISPLAY
           BUDAT_002(010),
           BKTXT_004(025),
           MATNR_005(018),
           MAKTX TYPE MAKT-MAKTX,
           WERKS_006(004),
           ALORT_007(004),
           ERFMG_008(017),
           MSG_E(100),
           MSG_S(100),
           MSGTYP TYPE C,
           LINE_COLOR(4),
          END OF MESSAGES.
    DATA: BEGIN OF ST_RECORD1 ,
           MATNR_005(018),
           WERKS_006(004),
           BUDAT_002(010),
           BKTXT_004(025),
           ERFMG_007(017),
           ERFMG_008(017),
           ALORT_007(004),
          END OF ST_RECORD1.
    DATA : RECORD1 LIKE TABLE OF ST_RECORD1 WITH HEADER LINE,
           IT_EXCEL LIKE TABLE OF ALSMEX_TABLINE WITH HEADER LINE,
           MESSTAB1 LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE,
           IT_ACC LIKE TABLE OF RECORD WITH HEADER LINE,
           IT_REJ LIKE TABLE OF RECORD WITH HEADER LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
    PARAMETERS: P_FILE TYPE LOCALFILE OBLIGATORY .
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC    = 'X'
        CHANGING
          FILE_NAME = P_FILE.
    AT SELECTION-SCREEN ON P_FILE.
      WK_LEN = P_FILE.
      CONDENSE WK_LEN NO-GAPS.
      LENT = STRLEN( WK_LEN ).
      WK_ALP = LENT - 4.
      B = WK_LEN+WK_ALP(LENT).
      IF ( B NE '.txt' ) AND ( B NE '.xls' ).
        MESSAGE E939.
        CLEAR P_FILE.
        STOP.
      ENDIF.
    START-OF-SELECTION.
      PERFORM UPLOAD_FUN.
      PERFORM OPEN_GROUP.
      PERFORM FILL_BDC_TABLE.
      PERFORM CLOSE_GROUP.
      PERFORM ASSIGN_COLORS.
      PERFORM F_EVENT_BUILD.
      SORT MESSAGES BY MATNR_005 ASCENDING.
      PERFORM ASSIGN_COLUMNS.
      PERFORM COUNT.
      IF CTU = 'X'.
        PERFORM ALV.
      ENDIF.
    FREE:MESSAGES,MESSTAB1,RECORD1.
    END-OF-SELECTION.
    --FORM UPLOAD_FUN--
    FORM UPLOAD_FUN.
    REFRESH: RECORD1, IT_ACC, IT_REJ, RECORD, MESSAGES, MESSTAB1, IT_EXCEL.
    PERFORM FETCH_FROM_FLAT_FILE.
    CLEAR IT_EXCEL.
    DESCRIBE TABLE IT_EXCEL.
    IF SY-TFILL = 0.
        MESSAGE I937.
        STOP.
    ENDIF.
    LOOP AT IT_EXCEL.
        CASE IT_EXCEL-COL.
          WHEN '0001'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-MATNR_005.
          WHEN '0002'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-WERKS_006.
          WHEN '0003'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-BUDAT_002.
          WHEN '0004'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-BKTXT_004.
          WHEN '0005'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-ERFMG_007.
          WHEN '0006'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-ERFMG_008.
          WHEN '0007'.
            MOVE: IT_EXCEL-VALUE TO RECORD1-ALORT_007.
        ENDCASE.
        AT END OF ROW.
          APPEND RECORD1.
          CLEAR RECORD1.
        ENDAT.
    ENDLOOP.
    CLEAR RECORD1.
    DELETE RECORD1 WHERE MATNR_005 EQ ' '.
    --DO NOT UPLOAD WHERE PRD QTY = 0--
    DELETE RECORD1 WHERE ( ERFMG_007 = 0 OR ERFMG_007 = ' ' )
                     AND  ( ERFMG_008 = 0 OR ERFMG_008 = ' ' ).
    DESCRIBE TABLE RECORD1[].
      IF SY-TFILL > 0.
    --MOVE ACCEPTED QTY AND FETCH THE RESPECTIVE STGLOC-**
        LOOP AT RECORD1 WHERE ERFMG_007 NE 0 AND ERFMG_007 NE ' '.
          MOVE:    RECORD1-BUDAT_002 TO IT_ACC-BUDAT_002,
                   RECORD1-BKTXT_004 TO IT_ACC-BKTXT_004,
                   RECORD1-MATNR_005 TO IT_ACC-MATNR_005,
                   RECORD1-WERKS_006 TO IT_ACC-WERKS_006,
                   RECORD1-ERFMG_007 TO IT_ACC-ERFMG_008.
          APPEND IT_ACC.
          CLEAR: IT_ACC,RECORD1.
        ENDLOOP.
    --MOVE ELPRO FOR THE ACCEPTED ENTRIES--
        LOOP AT IT_ACC.
          SELECT SINGLE ELPRO INTO WK_ELPRO FROM MKAL CLIENT SPECIFIED
                                            WHERE MANDT = SY-MANDT
                                            AND MATNR = IT_ACC-MATNR_005
                                            AND WERKS = IT_ACC-WERKS_006.
          MOVE WK_ELPRO TO IT_ACC-ALORT_007.
          MODIFY IT_ACC.
          CLEAR: WK_ELPRO, IT_ACC.
        ENDLOOP.
    --MOVE PRD QTY FOR REJECTED QTY--
        LOOP AT RECORD1 WHERE ERFMG_008 NE 0 AND ERFMG_008 NE ' '.
          MOVE: RECORD1-BUDAT_002 TO IT_REJ-BUDAT_002,
                RECORD1-BKTXT_004 TO IT_REJ-BKTXT_004,
                RECORD1-MATNR_005 TO IT_REJ-MATNR_005,
                RECORD1-WERKS_006 TO IT_REJ-WERKS_006,
                RECORD1-ERFMG_008 TO IT_REJ-ERFMG_008,
                RECORD1-ALORT_007 TO IT_REJ-ALORT_007.
          APPEND IT_REJ.
          CLEAR: IT_REJ, RECORD1.
        ENDLOOP.
    --MOVE ACCEPTED AND REJECTED READINGS TO FINAL TABLE
        APPEND LINES OF IT_ACC TO RECORD.
        APPEND LINES OF IT_REJ TO RECORD.
        FREE : IT_REJ, IT_ACC, RECORD1.
      ELSE.
        MESSAGE I937.
        STOP.
      ENDIF.
    ENDFORM.                    " UPLOAD_FUN
    --FORM fill_bdc_table--
    FORM FILL_BDC_TABLE.
      IF NOT RECORD[] IS INITIAL.
        LOOP AT RECORD.
          PERFORM BDC_DYNPRO USING 'SAPLBARM' '0800'.
          PERFORM BDC_FIELD  USING 'BDC_CURSOR' 'RM61B-BKTXT'.
          PERFORM BDC_FIELD  USING 'BDC_OKCODE' '=ISTDA'.
          PERFORM BDC_FIELD  USING 'RM61B-BUDAT' RECORD-BUDAT_002.
          PERFORM BDC_FIELD  USING 'RM61B-BKTXT' RECORD-BKTXT_004.
          PERFORM BDC_FIELD  USING 'RM61B-MATNR' RECORD-MATNR_005.
          PERFORM BDC_FIELD  USING 'RM61B-WERKS' RECORD-WERKS_006.
          PERFORM BDC_FIELD  USING 'RM61B-ALORT' RECORD-ALORT_007.
          PERFORM BDC_FIELD  USING 'RM61B-ERFMG' RECORD-ERFMG_008.
          PERFORM BDC_DYNPRO USING 'SAPLCOWB' '0130'.
          PERFORM BDC_FIELD  USING 'BDC_OKCODE' '=WEIT'.
          PERFORM BDC_FIELD  USING 'BDC_CURSOR' 'G_COWB_HEADER-MNGTXT'.
          PERFORM BDC_TRANSACTION USING 'MFBF'.
       CLEAR MESSTAB.
       APPEND LINES OF MESSTAB TO MESSTAB1.
       CLEAR MESSTAB1.
       LOOP AT MESSTAB1 WHERE MSGTYP = 'S' OR MSGTYP = 'E' OR MSGTYP = 'W'.
            SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB1-MSGSPRA
                                      AND   ARBGB = MESSTAB1-MSGID
                                      AND   MSGNR = MESSTAB1-MSGNR.
            IF SY-SUBRC = 0.
              L_MSTRING = T100-TEXT.
              IF L_MSTRING CS '&1'.
                REPLACE '&1' WITH MESSTAB1-MSGV1 INTO L_MSTRING.
                REPLACE '&2' WITH MESSTAB1-MSGV2 INTO L_MSTRING.
                REPLACE '&3' WITH MESSTAB1-MSGV3 INTO L_MSTRING.
                REPLACE '&4' WITH MESSTAB1-MSGV4 INTO L_MSTRING.
              ELSE.
                REPLACE '&' WITH MESSTAB1-MSGV1 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB1-MSGV2 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB1-MSGV3 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB1-MSGV4 INTO L_MSTRING.
              ENDIF.
              CONDENSE L_MSTRING.
              IF MESSTAB1-MSGTYP = 'E'.
                MOVE L_MSTRING TO MESSAGES-MSG_E.
                MOVE 'E' TO MESSAGES-MSGTYP.
              ELSEIF MESSTAB1-MSGTYP = 'S'.
                MOVE L_MSTRING TO MESSAGES-MSG_S.
                MOVE 'S' TO MESSAGES-MSGTYP.
              ENDIF.
            ENDIF.
            CLEAR L_MSTRING.
        ENDLOOP.
        MOVE-CORRESPONDING RECORD TO MESSAGES.
        SELECT SINGLE MAKTX INTO WK_MAKT FROM MAKT CLIENT SPECIFIED
                                         WHERE MANDT = SY-MANDT
                                         AND MATNR = MESSAGES-MATNR_005.
        MOVE:WK_MAKT TO MESSAGES-MAKTX.
        APPEND MESSAGES.
        CLEAR: MESSAGES, WK_MAKT, MESSTAB1.
        REFRESH MESSTAB1.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "fill_bdc_table
    --FORM assign_columns--
    FORM ASSIGN_COLUMNS .
      REFRESH ALVFLD.
      MOVE :'1'         TO ALVFLD-COL_POS.
      MOVE :'MATNR_005' TO ALVFLD-FIELDNAME.
      MOVE :'PART NO'   TO ALVFLD-SELTEXT_M.
      MOVE :'X'         TO ALVFLD-FIX_COLUMN.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'2'           TO ALVFLD-COL_POS.
      MOVE :'MAKTX'       TO ALVFLD-FIELDNAME.
      MOVE :'DESCRIPTION' TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'3'         TO ALVFLD-COL_POS.
      MOVE :'WERKS_006' TO ALVFLD-FIELDNAME.
      MOVE :'PLANT'     TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'4'            TO ALVFLD-COL_POS.
      MOVE :'BUDAT_002'    TO ALVFLD-FIELDNAME.
      MOVE :'POSTING DATE' TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'5'         TO ALVFLD-COL_POS.
      MOVE :'BKTXT_004' TO ALVFLD-FIELDNAME.
      MOVE :'SHIFT'     TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'6'         TO ALVFLD-COL_POS.
      MOVE :'ERFMG_008' TO ALVFLD-FIELDNAME.
      MOVE :'QTY'       TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'7'         TO ALVFLD-COL_POS.
      MOVE :'ALORT_007' TO ALVFLD-FIELDNAME.
      MOVE :'STGLOC'    TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'8'      TO ALVFLD-COL_POS.
      MOVE :'MSG_E'  TO ALVFLD-FIELDNAME.
      MOVE :'ERRORS' TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
      MOVE :'9'        TO ALVFLD-COL_POS.
      MOVE :'MSG_S'    TO ALVFLD-FIELDNAME.
      MOVE :'STATUS' TO ALVFLD-SELTEXT_M.
      APPEND ALVFLD.CLEAR ALVFLD.
    ENDFORM.                    " assign_columns
    --FORM f_event_build--
    FORM F_EVENT_BUILD .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = V_EVENTS[].
      READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                                               INTO WK_EVENTS.
      WK_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
      WK_LAYOUT-COLWIDTH_OPTIMIZE    = 'X'.
      IF SY-SUBRC = 0.
        MOVE C_FORMNAME_TOP_OF_PAGE TO WK_EVENTS-FORM.
        MODIFY V_EVENTS FROM WK_EVENTS INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " f_event_build
    --FORM f_top_of_page--
    FORM F_TOP_OF_PAGE.
      WRITE SY-DATUM TO T_DATE.
      CLEAR: IT_LIST_COMMENTS[].
      WK_LIST_COMMENTS-TYP  = 'H'. "H=Header, S=Selection, A=Action
      WK_LIST_COMMENTS-KEY  = ''.
      WK_LIST_COMMENTS-INFO = 'UPLOAD STATUS FOR PRODUCTION POSTING'.
      APPEND WK_LIST_COMMENTS TO IT_LIST_COMMENTS.
      CLEAR WK_LIST_COMMENTS.
      WK_LIST_COMMENTS-TYP  = 'S'. "H=Header, S=Selection, A=Action
      WK_LIST_COMMENTS-KEY  = ''.
      CONCATENATE 'Uploaded Date:' T_DATE INTO WK_LIST_COMMENTS-INFO
                                                  SEPARATED BY SPACE.
      APPEND WK_LIST_COMMENTS TO IT_LIST_COMMENTS.
      CLEAR WK_LIST_COMMENTS.
      DESCRIBE TABLE MESSAGES LINES WK_LINES.
      LINES = WK_LINES.
      WK_LIST_COMMENTS-TYP  = 'S'. "H=Header, S=Selection, A=Action
      WK_LIST_COMMENTS-KEY  = ''.
      CONCATENATE 'Total No of records:' LINES INTO WK_LIST_COMMENTS-INFO
                                                       SEPARATED BY SPACE.
      APPEND WK_LIST_COMMENTS TO IT_LIST_COMMENTS.
      CLEAR WK_LIST_COMMENTS.
      WK_LIST_COMMENTS-TYP  = 'S'. "H=Header, S=Selection, A=Action
      WK_LIST_COMMENTS-KEY  = ''.
      CONCATENATE 'Successfull Entries:' WK_SUCCESS INTO
                WK_LIST_COMMENTS-INFO SEPARATED BY SPACE.
      APPEND WK_LIST_COMMENTS TO IT_LIST_COMMENTS.
      CLEAR WK_LIST_COMMENTS.
      WK_LIST_COMMENTS-TYP  = 'S'. "H=Header, S=Selection, A=Action
      WK_LIST_COMMENTS-KEY  = ''.
      CONCATENATE 'Failed Entries:' WK_FAILURE INTO WK_LIST_COMMENTS-INFO
                                                        SEPARATED BY SPACE.
      APPEND WK_LIST_COMMENTS TO IT_LIST_COMMENTS.
      CLEAR WK_LIST_COMMENTS.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          I_LOGO             = 'ENJOYSAP_LOGO'
          IT_LIST_COMMENTARY = IT_LIST_COMMENTS.
    ENDFORM.                    "F_TOP_OF_PAGE
    --FORM assign_colors--
    FORM ASSIGN_COLORS .
    LOOP AT MESSAGES.
      CASE MESSAGES-MSGTYP.
        WHEN 'E'.
          MESSAGES-LINE_COLOR = 'C601'.
        WHEN 'S'.
          MESSAGES-LINE_COLOR = 'C501'.
      ENDCASE.
      MODIFY MESSAGES.
    ENDLOOP.
    ENDFORM.                    " assign_colors
    --FORM COUNT--
    FORM COUNT .
      LOOP AT MESSAGES.
        CASE MESSAGES-MSGTYP.
          WHEN 'E'.
            ADD 1 TO WK_FAILURE.
          WHEN 'S'.
            ADD 1 TO WK_SUCCESS.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " COUNT
    --FORM ALV--
    FORM ALV .
          CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
           I_BACKGROUND_ID    = 'ALV_BACKGROUND'
            IS_LAYOUT          = WK_LAYOUT
            IT_FIELDCAT        = ALVFLD[]
            IT_EVENTS          = V_EVENTS[]
          TABLES
            T_OUTTAB           = MESSAGES
          EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.
    ENDFORM.                    " ALV
    --FETCH_FROM_FLAT_FILE--
    FORM FETCH_FROM_FLAT_FILE .
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME                = P_FILE
          I_BEGIN_COL             = 1 "From 1st Column
          I_BEGIN_ROW             = 2 "From 2nd row
          I_END_COL               = 7 "Till &th Column
          I_END_ROW               = 65000 "Till Row
        TABLES
          INTERN                  = IT_EXCEL
        EXCEPTIONS
          INCONSISTENT_PARAMETERS = 1
          UPLOAD_OLE              = 2
          OTHERS                  = 3.
      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.                    " FETCH_FROM_FLAT_FILE
    INCLUDE***************
    ***INCLUDE BDCRECX1.
    for programs doing a data transfer by creating a batch-input session
    and
    for programs doing a data transfer by CALL TRANSACTION USING
    SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS SESSION RADIOBUTTON GROUP CTU.  "create session
      SELECTION-SCREEN COMMENT 3(20) TEXT-S07 FOR FIELD SESSION.
      SELECTION-SCREEN POSITION 45.
      PARAMETERS CTU RADIOBUTTON GROUP  CTU.     "call transaction
      SELECTION-SCREEN COMMENT 48(20) TEXT-S08 FOR FIELD CTU.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S01 FOR FIELD GROUP.
      SELECTION-SCREEN POSITION 25.
      PARAMETERS GROUP(12).                      "group name of session
      SELECTION-SCREEN COMMENT 48(20) TEXT-S05 FOR FIELD CTUMODE.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS CTUMODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
                                          "A: show all dynpros
                                          "E: show dynpro on error only
                                          "N: do not display dynpro
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S02 FOR FIELD USER.
      SELECTION-SCREEN POSITION 25.
      PARAMETERS: USER(12) DEFAULT SY-UNAME.     "user for session in batch
      SELECTION-SCREEN COMMENT 48(20) TEXT-S06 FOR FIELD CUPDATE.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L'.
                                          "S: synchronously
                                          "A: asynchronously
                                          "L: local
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S03 FOR FIELD KEEP.
      SELECTION-SCREEN POSITION 25.
      PARAMETERS: KEEP AS CHECKBOX.       "' ' = delete session if finished
                                          "'X' = keep   session if finished
      SELECTION-SCREEN COMMENT 48(20) TEXT-S09 FOR FIELD E_GROUP.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS E_GROUP(12).             "group name of error-session
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S04 FOR FIELD HOLDDATE.
      SELECTION-SCREEN POSITION 25.
      PARAMETERS: HOLDDATE LIKE SY-DATUM.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S02 FOR FIELD E_USER.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS: E_USER(12) DEFAULT SY-UNAME.    "user for error-session
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S03 FOR FIELD E_KEEP.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS: E_KEEP AS CHECKBOX.     "' ' = delete session if finished
                                          "'X' = keep   session if finished
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S04 FOR FIELD E_HDATE.
      SELECTION-SCREEN POSITION 70.
      PARAMETERS: E_HDATE LIKE SY-DATUM.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 1(33) TEXT-S10 FOR FIELD NODATA.
      PARAMETERS: NODATA DEFAULT '/' LOWER CASE.          "nodata
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 1(33) FOR FIELD SMALLLOG.
      PARAMETERS: SMALLLOG AS CHECKBOX.  "' ' = log all transactions
                                         "'X' = no transaction logging
    SELECTION-SCREEN END OF LINE.
      data definition
          Batchinputdata of single transaction
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
          error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
          message texts
    TABLES: T100.
      at selection screen                                                *
    AT SELECTION-SCREEN.
    group and user must be filled for create session
      IF SESSION = 'X' AND
         GROUP = SPACE OR USER = SPACE.
        MESSAGE E613(MS).
      ENDIF.
      open dataset                                                       *
    FORM OPEN_DATASET USING P_DATASET.
      OPEN DATASET P_DATASET
                   FOR INPUT IN TEXT MODE
                   ENCODING DEFAULT.
      IF SY-SUBRC <> 0.
        WRITE: / TEXT-E00, SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
      close dataset                                                      *
    FORM CLOSE_DATASET USING P_DATASET.
      CLOSE DATASET P_DATASET.
    ENDFORM.
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM OPEN_GROUP.
      IF SESSION = 'X'.
        SKIP.
        WRITE: /(20) 'Create group'(I01), GROUP.
        SKIP.
      open batchinput group
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = GROUP
                        USER     = USER
                        KEEP     = KEEP
                        HOLDDATE = HOLDDATE.
        WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ENDIF.
    ENDFORM.
      end batchinput session                                             *
      (call transaction using...: error session)                         *
    FORM CLOSE_GROUP.
      IF SESSION = 'X'.
      close batchinput group
        CALL FUNCTION 'BDC_CLOSE_GROUP'.
        WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ELSE.
        IF E_GROUP_OPENED = 'X'.
          CALL FUNCTION 'BDC_CLOSE_GROUP'.
          WRITE: /.
          WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
          E_GROUP_OPENED = ' '.
        ENDIF.
      ENDIF.
    ENDFORM.
           Start new transaction according to parameters                 *
    FORM BDC_TRANSACTION USING TCODE.
      DATA: L_MSTRING(480).
      DATA: L_SUBRC LIKE SY-SUBRC.
    batch input session
      IF SESSION = 'X'.
        CALL FUNCTION 'BDC_INSERT'
             EXPORTING TCODE     = TCODE
             TABLES    DYNPROTAB = BDCDATA.
        IF SMALLLOG <> 'X'.
          WRITE: / 'BDC_INSERT'(I03),
                   TCODE,
                   'returncode:'(I05),
                   SY-SUBRC,
                   'RECORD:',
                   SY-INDEX.
        ENDIF.
    call transaction using
      ELSE.
        REFRESH MESSTAB.
        CALL TRANSACTION TCODE USING BDCDATA
                         MODE   CTUMODE
                         UPDATE CUPDATE
                         MESSAGES INTO MESSTAB.
        L_SUBRC = SY-SUBRC.
        IF SMALLLOG <> 'X'.
          WRITE: / 'CALL_TRANSACTION',
                   TCODE,
                   'returncode:'(I05),
                   L_SUBRC,
                   'RECORD:',
                   SY-INDEX.
          LOOP AT MESSTAB.
            SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                      AND   ARBGB = MESSTAB-MSGID
                                      AND   MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              L_MSTRING = T100-TEXT.
              IF L_MSTRING CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ENDIF.
              CONDENSE L_MSTRING.
              WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
          ENDLOOP.
          SKIP.
        ENDIF.
    Erzeugen fehlermappe ************************************************
        IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
          IF E_GROUP_OPENED = ' '.
            CALL FUNCTION 'BDC_OPEN_GROUP'
                 EXPORTING  CLIENT   = SY-MANDT
                            GROUP    = E_GROUP
                            USER     = E_USER
                            KEEP     = E_KEEP
                            HOLDDATE = E_HDATE.
             E_GROUP_OPENED = 'X'.
          ENDIF.
          CALL FUNCTION 'BDC_INSERT'
               EXPORTING TCODE     = TCODE
               TABLES    DYNPROTAB = BDCDATA.
        ENDIF.
      ENDIF.
      REFRESH BDCDATA.
    ENDFORM.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.

  • Problems using BDC and/or HR_INFOTYPE_OPERATION

    Hi Gurus.
    Our team is developing several inbound HR interfaces but in integrated test in QAS env something really strange is happening during the tests.
    We are using BDC data for data input in infotypes 0000 and 0001 through PA30 and for all the other infotypes we use HR_INFOTYPE_OPERATION.
    Sometimes data input for 0000 and 0001 works, sometimes no, our table log gives us that the data was processed but when we check on the infotypes there is no data there. The BDC mapping was checked several times and we did some tests in another enviroment, everything is ok, the data is processed but in QAS we are having this problems.
    With HR_INFOTYPE_OPERATION, when we run in background mode it give us strange error logs like "a complex application error occurs" but when i did a debug inside of that FM there is nothing missing or nothing wrong.
    The enviroment seems to be very instable but basis teams says that there is no log error, but i've never seems errors like these, sometimes works, sometimes no.
    The last info that i had is QAS instance that we are using was deleted 3 weeks ago and restored again.
    Any suggestions?
    Thanks a lot.

    Hi,
    If your BDC mapping is correct, check the return code after your BDC is excuted with - BDCMSG. Make sure that you give Refresh BDCDATA for every loop.
    Having said this, I have also had issues with BDC every there was no error at the end, however the infotype never got updated.
    Please double check all the relevant screens. I found that for a particular Inf that I was updating, the subtypes belonged to differnt screens. Can you test with the same data in your Dev or some other box? If that doesnt work, there might be a data issue.
    Generally the complex application error occurs when a screen have been modified to prohibit batch processing. It is very difficult to diagnose the error in such cases. Make sure that you are passing all the important data to the FM. You might be able to get more help by searching in this forums as well.
    Regards, Liz

  • FI Module Tcodes for BDC

    Hi SAP ABAP gurus,
    Can you please pass few transaction codes in FI (Finance) module for which we can write BDCs.
    Plz urgent.
    Thanks,
    Vinay

    Thank you very much.
    Yes though it is difficult to write BDCs , we can you Stnd BAPIs or we can try SHDB to write BDC.
    What i am trying to ask is where are the most chances for which transaction codes in FI we might need BDC or BAPI to create data.
    Like we ave GL master data, Cost center master data  or some transaction data
    we need either BAPI or BDC or some stnd prgs.
    My question is What are the transaction codes for which there might be a chance to upload or create doc using any BDC or BAPI or infact using any stnd procedure.
    Thanks in advance.
    Vinay.

  • Errors in BDC and LSMW

    Hi Guys,
    While transforming the data from the legacy to sap system using BDC or LSMW.
    Generally what r the errors we face while performing the process.
    POINTS WILL B ASSIGNED
    Thanks and regards
    KK

    HI,
    Error in LSMW getting return code 6 , after asign a file , in the read data step i am getting the error .
    I got an error while converting data in LSMW as
    'For type "C" , a maximum length specification of 65535 is allowed'.
    bdc:
    BDC errors are similar to what you get in online transaction. Suppose you enter an invalid material number in online ME21N ( create Po ) system will throw an error and you have to correct it by chnaging a valid material number . Same error you can get in BDC as well. It is very difficult to generalize types of error as errors will depend on the transacation you are doing.
    However some of the common BDC errors are ( Data for Screen Not Found, Field Not available in Screen ). These again are transaction specific and you have to analyze it by calling the transacion in display ALL mode.
    The errors you get depends upon the transaction you are
    running.
    PLS:AWARD POINTS IF USEFUL.
    SRI

Maybe you are looking for