Call bdc or call transaction in bapi

Hi,
i  create MAM sales order using  bapi BAPI_ADMGMTSO_CREATEFROMDATA .
But i want create genral business partner using t-code bug1 for that i use bdc.
how i should call that bdc in above bapi.
Please anybody suggest solution for this?

Hi,
I don't find BAPI_ADMGMTSO_CREATEFROMDATA, but what you can do is create a customize ZBAPI_ADMGMTSO_CREATEFROMDATA  and made a call function to BAPI_ADMGMTSO_CREATEFROMDATA and after commit you put your bdc code.

Similar Messages

  • Can i use call transaction in BAPI

    Can I use call transaction in a BAPI and create master record.

    There is no reason AS LONG AS this BAPI will not accessed from an external system.  BAPIs are intended to accessed by external systems... otherwise, creating a Func Module is just fine.
    I would be cautious with using BDCs.  SAP continually changes screens with each upgrade.  When you use BDCs, you are TOTALLY dependent on those screen fields.  And when an upgrade changes a screen, you have extra work to do to fix your BDC in the new version.
    By using a BAPI or a Func Mod, your impact from an upgrade is greatly reduced.
    Remember to reward points accordingly.
    Message was edited by: John Jakabcsin
    Message was edited by: John Jakabcsin

  • Call transaction Vs  BAPI

    why we go for BAPI instead of call transaction ?

    Hi,
    BAPI is a higher end usage for tranfering the data from SAP to non-SAP and vice-versa. for ex: if we are using VB application,where in that we want to connect to SAP and retireve the data,and then change and update the data in SAP for that purpose we can use that.Apart from that, we can also use it for
    Uploading/Downloading the data from SAP to Non-SAP like call transaction, provided we have an existing BAPI for that.BAPI function modules will also do all the checks required for data integrity like Transactions for call transaction.
    There is one more advantage using BAPI instead of call transaction. When we go for upgradation, there might be pozzibility to change the screen elements for transactions depending on the requirement. In that case,our call transaction pgm may or may not work (depending on the screen changes they have made). Unless and until we prepare new call transaction we cant use the old call transaction pgm. But in BAPI, SAP promises that they are going to keep the old BAPI and for new functionality they will provide an upgraded BAPI. Until we write a new BAPI pgm, we can use the exisitng BAPI pgm.
    ********please reward points if the information is helpful to you**********

  • Unlocking Call Transaction

    I am doing a call transaction (no bapi for modifying vendors in 4.6C) and I keep getting an error that I have the vendor locked when I try to do the next transaction (I am doing purchasing vendors and then financial vendors).  I added a 'commit work and wait' statement but it doesn't seem to always help.  Any suggestions?
    Thanks,
    Lisa

    Hello Lisa,
    I think that is the wrong forum for your question. Post it in the ABAP Programming Forum (ABAP Development) and you would have more response.
    Regards
    Gregor
    Message was edited by: Mark Finnern
    Hi Gregor,
    I moved the post and thanks for keeping an eye on things like that, Mark.

  • Improve performance of bdc call transaction

    Hi all,
    I am performing a batch update of tax codes in a BDC call transaction program. This particular code takes about 3 minutes to process 2,600 entries. I have tried almost everything but is there a way to improve / make it run faster?
    I have a feeling it has something to do with the form "do_transaction", but I really don't know anymore.
    Thank you in advance.
    Attached is the code:
    *& Report  ZFI_CHANGEWTAX
    *&  Description: Change Doctors Withholding Tax Code (EI)
    *&  Using BDC Call Transaction Method
    *&  Created by : mpena
    *&  Created on : 07/15/2009
    *&  Modification History
    *&  Seq  Changed on
    *&       Changed by
    *&  001   07/15/2009
    *&        mpena         Initial Development
    *&  002   07/20/2009
    *&        mpena         Logic modification
    *&                      Testing
    *&  003   07/20/2009
    *&        mpena         Call function parameter modification
    *&  004   07/22/2009
    *&        mpena         Report generation
    *&                      Performance improvements
    REPORT zfi_changewtax
           NO STANDARD PAGE HEADING
           MESSAGE-ID zfk02msg.
    TYPES: BEGIN OF t_tax,
           lifnr LIKE lfa1-lifnr,                "account number
           wt_withcd LIKE lfbw-wt_withcd,        "current tax code
           wt_withcd_new LIKE lfbw-wt_withcd,    "new tax code (left blank at default)
           END OF t_tax.
    DATA:  wa_tax TYPE t_tax,
           i_tax TYPE STANDARD TABLE OF t_tax,
           it_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,
           lin TYPE i.
    -------Selection Screen Design -
    SELECTION-SCREEN:
    SKIP 1,
    BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
    PARAMETERS: p_ktokk LIKE lfa1-ktokk DEFAULT 'DOCT' OBLIGATORY,
                p_bukrs LIKE lfbw-bukrs DEFAULT 'SL' OBLIGATORY,
                p_wtax LIKE lfbw-wt_withcd OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    INITIALIZATION.
      aaa = 'Change Tax Code to specified value'.
    TOP-OF-PAGE.
      WRITE:
      / 'Update of taxes successful on:', sy-datum, sy-uzeit,
      / 'Generated by:', sy-uname,
      / 'Company Code:', p_bukrs, 'Vendor Group:', p_ktokk.
      SKIP 1.
      ULINE.
      WRITE:
      / 'Account Number', 20 'Old Withholding Tax Code', 50 'New Withholding Tax Code'.
      ULINE.
    START-OF-SELECTION.
      SELECT lfa1~lifnr
             lfbw~wt_withcd
      INTO TABLE i_tax
      FROM lfa1 INNER JOIN lfbw
        ON lfa1lifnr = lfbwlifnr
        WHERE lfbw~bukrs EQ p_bukrs
        AND lfbw~witht EQ 'EI'.
      IF sy-subrc EQ 0.
        DESCRIBE TABLE i_tax LINES lin.
      ENDIF.
    Update i_tax with new value of wt_witchd, then display for comparison.
    After write: if old and new tax are the same, tax update was not successful for that specific account
    or inputted tax type is the same as the old one.
      LOOP AT i_tax INTO wa_tax.
        wa_tax-wt_withcd_new = p_wtax.
        MODIFY i_tax FROM wa_tax.
        WRITE:
        / wa_tax-lifnr,
        20 wa_tax-wt_withcd,
        50 wa_tax-wt_withcd_new.
        CLEAR wa_tax.
      ENDLOOP.
      PERFORM do_transaction USING p_bukrs p_wtax.
    *&      Form  do_transaction
         Extracted from ZFKO2 recording accessible in shdb.
    FORM do_transaction USING v_bukrs v_wtax.
      MESSAGE i000 WITH lin.
      LOOP AT i_tax INTO wa_tax.
        REFRESH it_bdcdata.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-D0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-LIFNR'
                                      wa_tax-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      v_bukrs.
        PERFORM bdc_field       USING 'RF02K-D0610'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBW-WT_WITHCD(01)'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        PERFORM bdc_field       USING 'LFBW-WT_WITHCD(01)'
                                      v_wtax.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0610'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=UPDA'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-QLAND'.
        PERFORM bdc_field       USING 'LFB1-QLAND'
                                      'PH'.
        CALL TRANSACTION 'FK02' USING it_bdcdata
                                MODE   'N'
                                UPDATE 'A'.
      ENDLOOP.
      MESSAGE i001.
    ENDFORM.                    "do_transaction
           form for bdc dynpro
    FORM bdc_dynpro USING program
                          dynpro.
      it_bdcdata-program = program.
      it_bdcdata-dynpro = dynpro.
      it_bdcdata-dynbegin = 'X'.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_dynpro
           form for bdc field
    FORM bdc_field  USING fnam
                          fval.
      it_bdcdata-fnam = fnam.
      it_bdcdata-fval = fval.
      APPEND it_bdcdata.
      CLEAR it_bdcdata.
    ENDFORM.                    "bdc_field

    You might want to try using a BAPI instead of a call transaction.   I believe "BAPI_VENDOR_SAVECHARVALREPLICA" will work for you.  Calling a BAPI is just like calling a function module.   After you call the bapi remember to commit it with the function module "BAPI_TRANSACTION_COMMIT".

  • I want in LSMW SAME CODING. THIS IS USING BDC CALL TRANSACTION

    REPORT  ZXX_BDC_PRA NO STANDARD PAGE HEADING LINE-COUNT 20
                                                LINE-SIZE 150 .
    Program Name  :ZXX_BDC_PRA                             *
    Object Id     :                                        *
    Develper Name : praveen                                *
    Start Date    : 25.06.07                               *
    Description   : uploading flat file to sap system      *
    *--structure for Data Uploading.
    DATA: BEGIN OF IT_STR ,
            VKORG LIKE RF02D-VKORG,
            VTWEG LIKE RF02D-VTWEG,
            SPART LIKE RF02D-SPART,
            KTOKD LIKE RF02D-KTOKD,
            NAME1 LIKE KNA1-NAME1,     
            SORTL LIKE  KNA1-SORTL,     
            ORT01 LIKE KNA1-ORT01,     
            PSTLZ     LIKE KNA1-PSTLZ,     
            LAND1 LIKE KNA1-LAND1,     
            SPRAS LIKE KNA1-SPRAS,
            END OF IT_STR.
    *--Internal Table for Data Uploading.
    DATA: ITAB  LIKE IT_STR OCCURS 0.
    *--Internal Table to sucessfull Records.
    DATA:   ITAB1 LIKE IT_STR OCCURS 0.
    *--Internal Table to Store Error Records.
    DATA:    ITAB2 LIKE STANDARD TABLE OF IT_STR WITH HEADER LINE.
    *--Internal Table for Storing the BDC data.
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *--Internal Table for storing the messages.
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA:   COUNT TYPE I VALUE 1,
            S VALUE 0, E VALUE 0.
    Selection screen *
    SELECTION-SCREEN BEGIN OF BLOCK b1
                     WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_FILE TYPE IBIPPARMS-PATH.
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *functionality to use drill down list
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_FILE.
    Start-of-selection *
    START-OF-SELECTION.
      DATA FILENAME TYPE STRING.
      FILENAME = P_FILE.
    *-- Form to upload flatfile data into the internal table.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = FILENAME
          FILETYPE                = 'ASC'
          HAS_FIELD_SEPARATOR     = 'X'
        TABLES
          DATA_TAB                = ITAB
        EXCEPTIONS
          FILE_OPEN_ERROR         = 1
          FILE_READ_ERROR         = 2
          NO_BATCH                = 3
          GUI_REFUSE_FILETRANSFER = 4
          INVALID_TYPE            = 5
          NO_AUTHORITY            = 6
          UNKNOWN_ERROR           = 7
          BAD_DATA_FORMAT         = 8
          HEADER_NOT_ALLOWED      = 9
          SEPARATOR_NOT_ALLOWED   = 10
          HEADER_TOO_LONG         = 11
          UNKNOWN_DP_ERROR        = 12
          ACCESS_DENIED           = 13
          DP_OUT_OF_MEMORY        = 14
          DISK_FULL               = 15
          DP_TIMEOUT              = 16
          OTHERS                  = 17.
    *--Generating the BDC table for the fields of the internal table.
      LOOP AT ITAB INTO IT_STR.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0107'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02D-KTOKD'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RF02D-VKORG'
                                      IT_STR-VKORG.
        PERFORM BDC_FIELD       USING 'RF02D-VTWEG'
                                       IT_STR-VTWEG.
        PERFORM BDC_FIELD       USING 'RF02D-SPART'
                                      IT_STR-SPART.
        PERFORM BDC_FIELD       USING 'RF02D-KTOKD'
                                        IT_STR-KTOKD.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0110'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-SPRAS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'KNA1-NAME1'
                                    IT_STR-NAME1.
        PERFORM BDC_FIELD       USING 'KNA1-SORTL'
                                        IT_STR-SORTL.
        PERFORM BDC_FIELD       USING 'KNA1-ORT01'
                                        IT_STR-ORT01.
        PERFORM BDC_FIELD       USING 'KNA1-PSTLZ'
                                      IT_STR-PSTLZ.
        PERFORM BDC_FIELD       USING 'KNA1-LAND1'
                                      IT_STR-LAND1.
        PERFORM BDC_FIELD       USING 'KNA1-SPRAS'
                                        IT_STR-SPRAS.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0120'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-TXJCD'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0125'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-NIELS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0360'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVK-NAMEV(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0310'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVV-BEGRU'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0324'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVP-PARVW(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
    *--Calling the transaction 'Vd01'.
        CALL TRANSACTION 'VD01' USING BDCDATA MODE 'N' UPDATE 'S'
        MESSAGES INTO MESSTAB.
        PERFORM MESSAGES.
        REFRESH : BDCDATA, MESSTAB.
      ENDLOOP.
    END-OF-SELECTION.
    *--Populating the Success records internal table.
      IF ITAB1[] IS NOT INITIAL.
    format color 5.
        WRITE: /'SUCCESSFUL RECORDS'.
        format color off.
        LOOP AT ITAB1 INTO IT_STR.
          WRITE:/ IT_STR-VKORG,IT_STR-VTWEG,
                  IT_STR-SPART,IT_STR-KTOKD,
                  IT_STR-NAME1,IT_STR-SORTL,     
                  IT_STR-ORT01,
                  IT_STR-PSTLZ,
                  IT_STR-LAND1,      
                  IT_STR-SPRAS.
          S = S + 1.
        ENDLOOP.
    REFRESH : ITAB1.
        WRITE:/ 'TOTAL RECORDS',S.
      ENDIF.
    *--Populating the error records internal table.
      IF ITAB2[] IS NOT INITIAL.
    FORMAT COLOR 3.
        WRITE :/ 'ERRORS RECORDS ARE'.
    FORMAT COLOR OFF.
        LOOP AT ITAB2.
          WRITE:/ ITAB2-VKORG,
                  ITAB2-VTWEG,
                  ITAB2-SPART,ITAB2-KTOKD,
                  ITAB2-NAME1,ITAB2-SORTL,     
                  ITAB2-ORT01,
                  ITAB2-PSTLZ,
                  ITAB2-LAND1,      
                  ITAB2-SPRAS.
            E = E + 1.
        ENDLOOP.
    REFRESH : ITAB2.
        WRITE: / 'TOTAL RECORDS',E.
    REFRESH : ITAB2.
      ENDIF.
    End of Selection *
    END-OF-SELECTION.
    TOP-OF-PAGE *
    TOP-OF-PAGE.
      WRITE:/ SY-ULINE.
      WRITE:/10 'REPORT ID',21 SY-REPID,35 'USERNAME',46 SY-UNAME,
      60 'SYSTEM DATE',70 SY-DATUM,80 'SYSTEM TIME',90 SY-UZEIT,
      100 'PAGE NO',108 SY-PAGNO.
      WRITE:/ SY-ULINE.
    FOrm to Populate the BDC table.
           Start new screen                                              *
    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.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    *&      Form  messages
    FORM MESSAGES .
      LOOP AT MESSTAB.
        IF MESSTAB-MSGTYP = 'I'.
         WRITE : / MESSTAB-MSGV1.
        ELSEIF
    MESSTAB-MSGTYP = 'S'.
          INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB1 .
          COUNT = COUNT + 1.
         WRITE : / MESSTAB-MSGV1.
        ELSEIF
        MESSTAB-MSGTYP = 'E'.
          INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB2.
          COUNT = COUNT + 1.
         WRITE : / MESSTAB-MSGV1.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " messages

    Hi
    Go through the doc and do the same using LSMW
    BDC is the way to transfer data by writing a batch input program which can use either session or call transaction method.
    LSMW used to transfer data without/less code.
    What type of data we transfer using LSMW?
    LSMW is best suited for transferring master data.
    Actually BDC and LSMW are not comparable at all.
    for example LSMW itself can use BDC as a way of mass data transfer.
    BDC is a mass data transfer technique via screen logic of existing SAP Data entry transactions. It behaves as if you are manually making thousand of entires into sap system as a background job. And that is probably the reason why BAPI's are preffered over BDC's.
    On the other hand LSMW is a tool to facilitate DATA migration from other legacy systems ... It contains step by step procedure for data migration.
    Like Managing Data Migration Projects , Creating Source Structures , Mapping Source structures wid Target structures , etc etc
    LSMW internally might well be using the following techniqes for data transfer..
    1. IDOX
    2. Direct Input / BDC
    4. BAPI's
    LSMW is an encapsulated data transfer tool. It can provide the same functionality as BDC infact much more but when coming to techinical perspective most the parameters are encapulated. To listout some of the differences :
    LSMW is basicaly designed for a fuctional consultant who do not do much coding but need to explore the fuctionality while BDC is designed for a technical consultant.
    LSMW offers different techinque for migrating data: Direct input ,BAPI,Idoc,Batch input recording. While bdc basically uses recording.
    LSMW mapping is done by SAP while in BDC we have to do it explicitly .
    LSMW is basically for standard SAP application while bdc basically for customized application.
    Coding can be done flexibly in BDC when compared to LSMW
    1. Maintain Attributes:
    Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
    2. Maintain Source structure:
    Create a structure name
    3. Maintain Source field:
    In this you have to create a structure same as that of the input file
    eg: name
    age
    4. Maintain structure relations:
    This will link the structure to the input file.
    5. Maintain field mapping and conversion rules:
    Here is the place where you can do coding, depending upon the code you have written or assignment you have done the values will get picked up from the file and get processed.
    6. Maintain field mapping and conversion rules:
    If you have any fixed values you can define here.
    7. Specify files:
    Specify the input file path and type.
    8. Assign files:
    This will assign ur file to the Input file
    9. Read Data:
    This will read ur data from teh file.
    10. Dispaly Read Data:
    You can see the uploaded data
    11. Convert Data
    This will convert the data to the corresponding format for processing
    12. Display Converted data:
    13. Create batch input session
    Here this will create a batch input session for processing
    14. Run Batch Input session:
    By clicking on the session and process the same you can do teh needfu.
    http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
    http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
    http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
    http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
    http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
    for Long texts Upload
    Please take a look at this..
    http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
    Reward points for useful Answers
    Regards
    Anji

  • Is BDC's CALL TRANSACTION 'VA01' is not equals to ONLINE(manual) creation?

    Hi Experts,
    Ours is IS-Oil.
    If the user do not enters/inputs OIC_MOT (Mode Of Transport) at ITEM level on the External Details popup, SAP will get it from Customar Master-KNA1 and populates on it, because its a mandatory field (OIC_MOT), but, do not throws an Error message and interupts the sales order creation process.
    We have a inbound IDOC posting function module for sales order (VA01), which posts the sales oreders by using BDC (CALL TRANSACTION 'VA01') in the system. In this function module, we are not populating the OIC_MOT field contained segment by hoping SAP will populate/default it while it hits CALL TRANSACTION 'VA01' of my BDC of my FM of IB IDOC. But, SAP is not defaulting/populating and throwing error message (saying 'OIC_MOT field is a mandatory input field' data is missing) and IDOC is failing, pls. let me know Wht its so? is the BDC's CALL TRANSACTION 'VA01' is not equals to ONLINE (manual ) creation of sales order?
    Thank you

    Hi
    Several transactions can ba a different behavior between online and bdc process, but if you simulate the trx by SM35 you should find out these gaps
    I don't know OIL vertical, but the main transactions have a bapi can be used insted of BDC program (BAPI_SALESORDER_CREATEFROMDAT2, but perhaps there's a particular BAPI for OIL).
    Max

  • How bapi different from session and call transaction?

    how bapi different from session and call transaction?
    thanks in advance.

    For one, Batch Data Communication (BDC) is older. Business Application Programming Interface (BAPI) came later, about 10 years ago (you can see this already from the name, which contains marketese like "business" ).
    More important though, they are different technologies. With BDC you build the "batch input transaction" yourself, with an ABAP program which creates the "batch input session" ("Batch-Input-Mappe" in german). You then take that session, like an object, and "run" it on a system (most of the time, this is done on a local system by the administrators, after it has been tested for correctness).
    With BAPI, a system (local or remote) exposes its interface to you through some kind of Remote Function Call (RFC). Practically, it tells you: "What do you want to do? Insert that data into Materials Management? Here is the function and the the parameters you have to use for each record". You only work with the Interface - the exposed function. How this function works does not have to interest you. You don't have sessions to "run", you fire your function calls filled with data, one after another and you're done.
    BAPI can be run remotely. With BDC, you probably have to call the administrators of the remote system and send them the session you created for them to run. With BDC you go through the whole transaction in one BDC session, with BAPI you may need more than one "BAPI calls" to do this.
    With BAPI you don't fill obcure field names with values, you just fill the parameters. You can use a BAPI from inside your ABAP program to let a "business object" do some clearly defined work for you, then you can continue with your code doing other things. You don't do this with BDC. With BDC you write a dedicated program that creates the "session", which is then executed separately.
    Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a
    typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is not bi-directional.
    BDC works on the principle of simulating user input for transactional screen, via an ABAP program. Typically the input comes in the form of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The transaction is then started using this internal table as the input and executed in the background.
    In Call Transaction, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.
    It can also be used for real-time interfaces and custom error handling & logging features. Whereas in Batch Input Sessions, the ABAP
    program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.
    Batch Input (BI) programs still use the classical BDC approach but doesnt require an ABAP program to be written to format the
    BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and
    invokes the transaction mentioned in the header record of the file.
    Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate
    fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are
    not available for all application areas.
    Business Add-In (BADI) are a new SAP enhancement technique based on ABAP Objects.
    They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.
    As with customer exits two different views are available:
    In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.
    In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.
    In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

  • RE-FX:call transaction using bdc-tab:No bdc_okcode for swapping table-entry

    Hello,
    I am trying to call transaction RERAOP (module RE-FX) to make an accounting transaction. There is 1 debit posting and 1 credit posting in a grid. Selecting the debit posting, a details scrren is shown, consisting of 2 registers.
    On the first register you have to fill different fields. At this point it isn't possible to select the second register. The second (credit) posting is diplayed when you hit the enter key. After the fields in the details screen of this (credit) postings have been filled, it is possible to swap back to the first (debit) posting with a double-click on the first entry of the postings-table.
    Finally I come to the point ...
    If I record these steps (batch-input recorder) and generate an report of this code there is no bdc_okcode for the above mentioned swap back to the debit posting. While executing this report I get a lot of error message because the swap back to the debit posting doesn't work (--> because of the missing bdc_okcode) and therefore the batch input tries to fill fields which are not on the active screen (because they are on the 2. register which is not displayed).
    Hope that there is someone out there who:
    1. Understands my miserable english   and
    2. has an advice for me.
    Thanks in advance!!!
      Stephan
    Edited by: Stephan Scholze on Apr 22, 2008 1:34 PM
    Edited by: Stephan Scholze on Apr 22, 2008 2:24 PM
    Edited by: Stephan Scholze on Apr 22, 2008 3:19 PM

    Not sure how much I can help as we don't run RE-FX (RERAOP - what's the program name btw?) at any sites I work at, but a couple of general BDC things you might try (based on problems I've had with BDCs to other Tcodes)...
    When you are in that transaction normally do a right click to see what function codes are defined as there might be one there that allows you to switch between these debit & credit data entry places (how are they rendered, btw - are they ALV grids or what?  If they are table controls then you should be able to position the cursor on row 1 and trigger an F2 double-click)... also look at the PF-STATUS carefully in case (once again) there is a function code that lets you swap from DR to CR & vice versa... and even browse the source code in the user-command for the screen might give a clue as to how to achieve this.  Of course it may not be possible if the data entry is control based i.e. the input areas are provided in the SAPGui not the application server (such as the text editor & ALV grids)... in which case you start hunting for BAPIs and function modules and the like, or end up having to pass data into the transaction via something like an "export" and catch it inside a user exit or enhancement via an "import"... all rather messy, but quite possible.
    Jonathan

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

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

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

  • D/W BAPI and sesssion ,call transaction

    Hi ,
    can any one help me in finding difference from BAPI and call transaction ,session method .
    If you can provide any URL that can be vary  useful .
    Thank u,
    Mahendra.

    Hi Mahendra,
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    BAPI stands for Business API(Application Program Interface).
    Please check these links which will give you step by step for learning BAPI.
    http://www.erpgenie.com/sap/abap/bapi/example.htm
    http://www.sap-img.com/bapi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/b46c1e53c111d395fa00a0c94260a5/content.htm
    http://www.sappoint.com/abap/bapiintro.pdf#search=%22BAPI(SAP)%22
    http://www.erpgenie.com/sap/abap/bapi/index.htm
    http://www.erpgenie.com/sap/abap/bapi/conventions.htm
    http://www.erpgenie.com/sapgenie/docs/BAPI%20Programming.doc
    http://64.233.167.104/custom?q=cache:eyMZ5qPOH-0J:www.erpgenie.com/sapgenie/docs/BAPI%2520Intro.doc+bapi&hl=en&ct=clnk&cd=6&ie=UTF-8&client=pub-2723892367221695
    http://64.233.167.104/custom?q=cache:c7cwsXMxq-UJ:www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf+bapi&hl=en&ct=clnk&cd=1&ie=UTF-8&client=pub-6389415953938571
    http://www.sapgenie.com/abap/bapi/example.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm

  • Light goes off or System crash During Upload data through BDC Call Transaction ..

    Hi Experts ,
                    How do I know how many records had been updated in database while uploading the  flat file through BDC call transaction  ,the system suddenly  crash or light  goes off ..............
    Thanks and Regards .
    Om prakash 

    Hi Prakash,
    i have already told toy to use bapi to get all the error and success messages, through which you don't need to do all the above stuffs, the first method you have shown is based on algorithm , which might not be correct each time, and the second method is handy.
    You can add these code lines in your BDC which will give you all error and success messages
    DATA : BEGIN OF options.
             INCLUDE STRUCTURE ctu_params.
    DATA : END OF options.
    DATA: i_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
           l_message LIKE bapiret2-message.
    DATA: p_mode TYPE c.
    DATA  BEGIN OF it_error OCCURS 1.
    DATA : text(100)  TYPE c.
    DATA  END   OF it_error.
    DATA  BEGIN OF it_success OCCURS 1.
    DATA:  text(100) TYPE c.
    DATA  END   OF it_success.
    START-OF-SELECTION.
      PERFORM upload_data.
    *   Report for success
       PERFORM  success_text.
    *   Report for Error
       PERFORM  error_text.
    END-OF-SELECTION.
    CALL TRANSACTION 'your transaction code' USING bdcdata
                                 OPTIONS FROM options
                                 MESSAGES INTO i_messtab.
         IF SY-SUBRC NE 0.
           CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
             EXPORTING
               id         = sy-msgid
               number     = sy-msgno
               language   = sy-langu
               textformat = 'ASC'
               message_v1 = sy-msgv1
               message_v2 = sy-msgv2
               message_v3 = sy-msgv3
               message_v4 = sy-msgv4
             IMPORTING
               message    = l_message.
           CONCATENATE l_message '-' wa_input-newko wa_input-wrbtr wa_input-budat INTO it_error-text
           SEPARATED BY ' '.
           APPEND it_error.
         ELSE.
           CONCATENATE 'DATA UPLOADED SUCCESSFULLY :' wa_input-newko  wa_input-wrbtr wa_input-budat
           INTO it_success-text SEPARATED BY ' '.
           APPEND it_success.
         ENDIF.
         REFRESH bdcdata.
         CLEAR: wa_input,l_message.
    ENDLOOP.
    ***ENDLOOP.
    endform.
                        " UPLOAD_DATA
    FORM success_text .
       LOOP AT it_success.
         AT FIRST.
           WRITE :/10  'Following records successfully uploaded'.
           ULINE.
         ENDAT.
         WRITE :/10  it_success-text.
       ENDLOOP.
    ENDFORM.
    FORM error_text .
       LOOP AT it_error.
         AT FIRST.
           WRITE :/10  'Following records  are not uploaded'.
           ULINE.
         ENDAT.
         WRITE :/10  it_error-text.
       ENDLOOP.
    ENDFORM.

  • BDC Call Transaction - Doc.No not getting generated in Message Internal tab

    Dear All,
    I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
    Kindly look into the matter and revert back for any further info.
    Regards
    Naresh

    Hi,
    Please try using the following kind of code in 'CALL TRANSACTION'
        opt-dismode = 'E'.     " Exclusive mode
        opt-defsize = 'X'.
        opt-updmode = 'S'.
        opt-nobinpt = ' '.
        CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
                                                                             MESSAGES INTO t_bdcmsgcoll .
    Hope this will work.
    Thanks,
    Leo

  • BDC Call Transaction : FS00(Create G/L Account)

    Hi,
    BDC of FS00 is running properly in Forground (A) Mode, with success messages and G/L account being created in SKB1 table.
    But when I run it in Background (N) Mode, it is not creating the G/L account. Although I am getting the success messages in the end of the execution but in the table, there is no G/L account.
    FORM fill_bdcdata .
    loop at i_output.
    clear i_bdcdata.
    refresh i_bdcdata.
    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-BUKRS'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                   i_output-SAKNR.                               "gl ac number
    perform bdc_field       using 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                   i_output-BUKRS.                               "company code
    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'.                  "ac grp
    *perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  i_output-cc.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   i_output-xplacct.                             "pl account
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XBILK'
                                   i_output-xbilk.                               "balance sheet
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TAB02'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-KTOKS'
                                  i_output-ktoks.                                 "ac grp
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                  i_output-xplacct.                               "pl account
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_COA-TXT50_ML'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                  i_output-txt20_ml.                               "short text
    perform bdc_field       using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                  i_output-txt50_ml.                               "long text
    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-MITKZ'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                  i_output-xsalh.                                "Only Balance in Local Currency
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                  i_output-mwskz.                                "Tax Category
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XMWNO'
                                  i_output-xmwno.                                "Posting without tax
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                  i_output-mitkz.                                "Reccon A/C
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                  i_output-xopvw.                                     "Open Item Management
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                  i_output-xkres.                                     "Line Item Display
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                  i_output-zuawa.                                     "Sort Key
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTER'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                  i_output-fstag.                                     "Field Stauts
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                  i_output-xintb.                                     "post automatically
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-XGKON'.
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XGKON'
                                  i_output-xgkon.                                     "relevent to cash A/c
    perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-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'
                                  i_output-fstag.                                       "Field Stauts
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                  i_output-xintb.                                       "post automatically
    perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XGKON'
                                  i_output-xgkon.                                        "relevent to cash A/c
    perform bdc_dynpro      using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EEXIT'.
      perform bdc_field       using 'BDC_CURSOR'
                                  'GLACCOUNT_SCREEN_CCODE-XGKON'.
    perform bdc_dynpro      using 'SAPLSPO1' '0100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform f_elog.
    endloop.
    FORM f_elog .
    data len type i.
    clear i_msgtab.
      call transaction 'FS00'
                          using i_bdcdata
                          mode g_v_mode              "N
                          messages into i_msgtab
                          update g_v_update .          "S
    write: i_output-saknr.
    I am not getting where I am going wrong in the code.
    Regards,
    Priyanka.

    Hi,
      Make the mode 'E' and see excatly, where the warning or errors or coming.
    If you are having an currency or UOM ,related fields, see that the values should not be empty. If they are enpty. Put an if condition there and Quit filling such fields.
    First keep in mode 'e' and debug. 100% you will see the warnings or errors, then tell me what is the error.
      <b>call transaction 'FS00'
    using i_bdcdata
    mode g_v_mode "E
    messages into i_msgtab</b>
    Thansk'
    Manju.

  • Get and Set Parameter ID in BDC Call transaction

    Hi all
    I have written this BDC program to run a transaction eg33  to install meter. After meter get installled System generates  Device location number. I need to use this device location number in calling another transaction il03.  but my data fetching using get and set parameter id is not giving accurate result. Kindly check my code and suggest where should I improve. Or whatelse can I do to fullfill this type of requirement other than GET and SET PARAMETER ID.
    REPORT  ZAC_EG33 NO STANDARD PAGE HEADING
                     LINE-SIZE 100.
    TABLES: EABL,
            BUT000,
            ZISUH0003.
    DATA :
          XYZ LIKE IFLO-TPLNR.
    DATA: IT_STATUS TYPE ZISUH0003.
    DATA: G_INDEX TYPE I,
          G_START_COL TYPE I VALUE '1',      "start column
          G_START_ROW TYPE I VALUE '14',      "start row
          G_END_COL   TYPE I VALUE '18',     "maximum column
          G_END_ROW   TYPE I VALUE '75',  "maximum row
          G_TEXT(20),                         "stores error messages
          G_PAGES        TYPE I,
          G_CURRENT_PAGE TYPE I,
          G_COUNT LIKE SY-DBCNT.
    data: l_file   type file_table,
          file1    type string,
          l_title  type string,
          LENGTH   TYPE I,
          FILES    type filetable,
          SUBRC    type i,
          STR_FILE type STRING,
          D_FILE   type RLGRAP-FILENAME,
          filename TYPE String,
          L_itab_date(10).
    FIELD-SYMBOLS : <FS>.
    DATA: IT_EXCEL LIKE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE,
          IT_MESS TYPE STANDARD TABLE OF BDCMSGCOLL WITH HEADER LINE.
    TYPES: BEGIN OF TY_OPEN,
            HAUS LIKE REG30-HAUS,
            EADAT(10),
            GERAETNEU LIKE REG30-GERAETNEU,
            MESSDRCK LIKE REG30-MESSDRCK,
            ZWSTANDCE LIKE REG30-ZWSTANDCE,
            END OF TY_OPEN.
    DATA : T_ANLAGE LIKE EANLD-ANLAGE,
           VSTELLE LIKE EVBS-VSTELLE,
           S_ANLAGE LIKE EANLD-ANLAGE,
           temp_c(7).
    DATA: IT_OPEN TYPE STANDARD TABLE OF TY_OPEN WITH HEADER LINE.
    DATA: BDCDATA TYPE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: P_FILE like RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN END OF BLOCK 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE  .
      PERFORM GET_FILE_NAME.
      MOVE FILENAME TO P_FILE.
    START-OF-SELECTION.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = p_file
        I_BEGIN_COL                   = 1  "VF_START_COL
        I_BEGIN_ROW                   = 2  "VF_START_ROW
        I_END_COL                     = 5  "VF_END_COL
        I_END_ROW                     = 10000  "VF_END_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.
    IF IT_EXCEL[] IS INITIAL.
      G_TEXT = 'No Data Uploaded'.
    ELSE.
      SORT IT_EXCEL BY ROW COL.
      LOOP AT IT_EXCEL.
        MOVE : IT_EXCEL-COL TO G_INDEX.
        ASSIGN COMPONENT G_INDEX OF STRUCTURE IT_OPEN TO <FS>.
        MOVE IT_EXCEL-VALUE TO <FS>.
        AT END OF ROW.
          IF NOT IT_OPEN IS INITIAL.
          APPEND IT_OPEN." TO IT_LINE.
          CLEAR IT_OPEN.
          CLEAR IT_EXCEL.
          ENDIF.
        ENDAT.
      ENDLOOP.
    ENDIF.
    REFRESH IT_EXCEL.
    ULINE.
    FORMAT COLOR 3 ON.
    WRITE: /1 sy-vline ,
           2 'Material No.' ,
           25 sy-vline,
            2 'Logs' ,
            100 sy-vline.
    uline.
    FORMAT COLOR OFF.
    PERFORM BDC_OPEN_READING.
    MESSAGE S013(ZPS).
    *&      Form  GET_FILE_NAME
          text
    -->  p1        text
    <--  p2        text
    FORM GET_FILE_NAME .
    REFRESH FILES.
    call method cl_gui_frontend_services=>file_open_dialog
                exporting
                  window_title            = l_title
                changing
                  file_table              = files
                  rc                      = subrc
                exceptions
                  file_open_dialog_failed = 1
                  cntl_error              = 2
                  error_no_gui            = 3
                  others                  = 4.
              check sy-subrc = 0.
              loop at files into l_file.
                str_file = l_file.
                move str_file to filename.
                exit.
              endloop.
    ENDFORM.                    " GET_FILE_NAME
    *&      Form  BDC_OPEN_READING
          text
    -->  p1        text
    <--  p2        text
    FORM BDC_OPEN_READING .
    LOOP AT IT_OPEN.
    REFRESH BDCDATA.
    clear : temp_c.
    move it_open-MESSDRCK to temp_c.
    condense : temp_c.
    PERFORM MAP1.
    CALL TRANSACTION 'EG33' USING BDCDATA MODE 'A' MESSAGES INTO IT_MESS.
    +***changes by added on 28/02/08 +
    get parameter id 'IFL' FIELD XYZ.
    PERFORM MAP2.
    set parameter id 'IFL' FIELD XYZ.
    ++*
    CALL TRANSACTION 'IL03' USING BDCDATA MODE 'A' MESSAGES INTO IT_MESS.
    +****end change added on 28.02.08+DATA: G_INSNO LIKE IT_OPEN-HAUS.
    IF NOT IT_MESS[] IS INITIAL.
      G_INSNO = IT_OPEN-HAUS.
      PERFORM GET_MESSAGES  TABLES IT_MESS USING G_INSNO." IT_LINE.
    ENDIF.
    READ TABLE IT_MESS WITH KEY MSGTYP = 'E'.
    IF SY-SUBRC NE 0.
    READ TABLE IT_MESS WITH KEY MSGTYP = 'S'  MSGNR = '622'.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE VSTELLE FROM EVBS INTO VSTELLE WHERE HAUS = IT_OPEN-HAUS.
    SELECT SINGLE ANLAGE FROM EANL INTO T_ANLAGE WHERE VSTELLE = VSTELLE.
    MOVE T_ANLAGE TO IT_STATUS-ANLAGE.
    MOVE 'X' TO IT_STATUS-RFC.
    *perform get_date_format using IT_OPEN-EADAT.
    MOVE IT_OPEN-EADAT TO IT_STATUS-ADATE.
    SELECT SINGLE ANLAGE FROM ZISUH0003 INTO  S_ANLAGE WHERE ANLAGE =
    T_ANLAGE.
      IF SY-SUBRC EQ 4.
        INSERT ZISUH0003 FROM IT_STATUS.
      ELSE.
        UPDATE ZISUH0003 FROM IT_STATUS.
      ENDIF.
      ENDIF.
      ENDIF.
      REFRESH IT_MESS.
      CLEAR   IT_MESS.
    ENDLOOP.
    ENDFORM.                    " BDC_OPEN_READING
           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 <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.
    *&      Form  MAP1
          text
    -->  p1        text
    <--  p2        text
    FORM MAP1 .
    perform bdc_dynpro      using 'SAPLE30D' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'REG30-GERAETNEU'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'REG30-HAUS'
                                  IT_OPEN-HAUS.  "'100000000033'.
    perform bdc_field       using 'REG30-EADAT'
                                  IT_OPEN-EADAT.  "'18.02.2006'.
    perform bdc_field       using 'REG30-GERAETNEU'
                                  IT_OPEN-GERAETNEU.  "'66a'.
    perform bdc_dynpro      using 'SAPLE30D' '0220'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'REG30-TEMP_AREA(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'REG30-MESSDRCK'
                                   temp_c. "IT_OPEN-MESSDRCK'0.0125'.
    perform bdc_field       using 'REG30-GERWECHS'
                                  '05'.
    perform bdc_field       using 'REG30-ANZDAYSOFPERIOD(01)'
                                  '30'.
    perform bdc_field       using 'REG30-ZWSTANDCE(01)'
                                  IT_OPEN-ZWSTANDCE.  "'10'.
    perform bdc_field       using 'REG30-ZWSTANDCE(02)'
                                  '0'.
    perform bdc_field       using 'REG30-PERVERBR(01)'
                                  '0'.
    perform bdc_field       using 'REG30-PERVERBR(02)'
                                  '0'.
    perform bdc_field       using 'REG30-TEMP_AREA(01)'
                                  '0001'.
    perform bdc_field       using 'REG30-TEMP_AREA(02)'
                                  '0001'.
    perform bdc_field       using 'REG30-PR_AREA_AI(01)'
                                  '0001'.
    perform bdc_field       using 'REG30-PR_AREA_AI(02)'
                                  '0001'.
    ENDFORM.                    " MAP1
    ****CHANGEs added BY ALKA 28.02.08
    *&      Form  MAP2
          text
    -->  p1        text
    <--  p2        text
    FORM MAP2 .
    perform bdc_dynpro      using 'SAPMILO0' '1110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'IFLO-TPLNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'IFLO-TPLNR'
                                  XYZ..
    perform bdc_field       using 'RILO0-TPLKZ'
                                  'AO_GP'.
    perform bdc_dynpro      using 'SAPMILO0' '2100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'IFLO-PLTXT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=T\04'.
    perform bdc_field       using 'IFLO-PLTXT'
                                  'DEVICE LOCATION'.
    perform bdc_dynpro      using 'SAPMILO0' '2100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'IFLO-PLTXT'
                                  'DEVICE LOCATION'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'ITOBATTR-EINZL'.
    perform bdc_field       using 'ITOBATTR-IEQUI'
                                  'X'.
    perform bdc_field       using 'ITOBATTR-EINZL'
                                  'X'.
    ENDFORM.                    " MAP2
    *****END CHANGE added on 28.02.08
    *&      Form  get_date_format
          text
         -->P_IT_ORDER_TABLE_C_DATE  text
    FORM get_date_format USING L_ITAB_DATE." LIKE SY-DATUM.
    data: d_temp(4),
          m_temp(2),
          y_temp(4).
    *move L_ITAB_DATE to L_ITAB_DATE.
    y_temp = L_ITAB_DATE(4).
    m_temp = L_ITAB_DATE+4(2).
    d_temp = L_ITAB_DATE+6(2).
    CONCATENATE d_temp '.' m_temp '.' y_temp into L_ITAB_DATE.
    ENDFORM.                    " get_date_format
    *&      Form  GET_MESSAGES
          text
         -->P_IT_MESS  text
         -->P_G_INSNO  text
    FORM GET_MESSAGES  TABLES IT_MESS STRUCTURE BDCMSGCOLL USING G_INSNO .TABLES T100.
    DATA: L_MSTRING(255).
    LOOP AT IT_MESS WHERE MSGTYP = 'E'   OR MSGTYP = 'S'.
          SELECT SINGLE * FROM T100 WHERE SPRSL = IT_MESS-MSGSPRA
                                    AND   ARBGB = IT_MESS-MSGID
                                    AND   MSGNR = IT_MESS-MSGNR.
          IF SY-SUBRC = 0.
            L_MSTRING = T100-TEXT.
            IF L_MSTRING CS '&1'.
              REPLACE '&1' WITH IT_MESS-MSGV1 INTO L_MSTRING.
              REPLACE '&2' WITH IT_MESS-MSGV2 INTO L_MSTRING.
              REPLACE '&3' WITH IT_MESS-MSGV3 INTO L_MSTRING.
              REPLACE '&4' WITH IT_MESS-MSGV4 INTO L_MSTRING.
            ELSE.
              REPLACE '&' WITH IT_MESS-MSGV1 INTO L_MSTRING.
              REPLACE '&' WITH IT_MESS-MSGV2 INTO L_MSTRING.
              REPLACE '&' WITH IT_MESS-MSGV3 INTO L_MSTRING.
              REPLACE '&' WITH IT_MESS-MSGV4 INTO L_MSTRING.
            ENDIF.
            CONDENSE L_MSTRING.
          ENDIF.
          CONDENSE G_INSNO.
          CONCATENATE 'For' ' ' G_INSNO ',' L_MSTRING INTO L_MSTRING SEPARATED BY SPACE.
    FORMAT COLOR 2 ON.
    *IF IT_MESS-MSGTYP = 'S' AND IT_MESS-MSGNR = '622'.
    *WRITE: 1 sy-vline,
            L_MSTRING    under 'Error Messages',
           100 sy-vline.
    *ULINE.
    *ELSEIF IT_MESS-MSGTYP = 'E'.
    WRITE: 1 sy-vline,
             L_MSTRING    under 'Logs',
            100 sy-vline.
    ULINE.
    *ENDIF.
    ENDLOOP.
    ENDFORM.                    " GET_MESSAGES

    i think there might be some time gap between CALL TRANSACTION and GET PARAMETER ID.....,that is to say,the new No. has not been generated and what you fetch is an old No..
    i think you should use the "CALL TRANSACTION" like the following one:
    CALL TRANSACTION 'EG33' USING BDCDATA MODE 'A'  UPDATE 'L'  MESSAGES INTO IT_MESS .
    then i think you can get the right value.
    P.S: the different update model(from SAP document)
           upd Effect
    "A"   Asynchronous update. Updates of called programs are executed in the same way as if in the             COMMIT WORK statement the AND WAIT addition was not specified.
    "S" Synchronous processing. Updates of the called programs are executed in the same way as if in the COMMIT WORK statement the AND WAIT addition had been specified.
    "L" Local update. Updates of the called program are executed in such a way as if the SET UPDATE TASK LOCAL statement had been executed in it.
    Other As for "A".

Maybe you are looking for