"Inconsistent BDC"

hi sap techies i'm mew to abap,
please help me out on one bdc query.
tell me how to define an internl table wrt to incoming file and how to get in to that into this internal table.
i do have two radio buttons in selection screen one for yes and one for no.
if radio button is yes
pgm to scan through the file ,pick up the consumer no go to FKKVKP table pick up the contract a/c no(VKONT) value where accnt in legacy field
(VKONa) is equal to consumer number extracted from the file.
if radio button is no, below  functionality should be done.
Program to pickup the records from the input file and update the same in Z table(ZIPG).
This table ZIPG will have  below fields
a. contract a/c number of 12 in length,
b.agency code of 6 in length,
c.company name of 4 in length ,
  d.activation flag ( length = 1)
1.If any entry for consumer already exists in the above table with the activation flag u201CYu201D then the same should  also be capture in the log as u201Cconsumer already registered with the details of the party where he is registered as per the tableu201D
2.Pgm to pickup contract a/c number as per the file and go to CA A2 transaction in payment / taxes tab,
Check the field incoming payment method if the fields is blank then populate it with u201CIu201D , if the field not blank but has some value other than u201CIu201D then PGM shouldnu2019t change payment method should be reported in log.
PGM to check whether the file has been uploaded previously or not if yes error message should be given that the file is already uploaded by referring custom table ZFIF
This table will have below fields
a.file name (18 in length).
b. Processed flag (1 in lenght).
Sample file will have below format
RY0901111005851620090281 (filename)
From above file contact a/c no would be 1110058516  , Send me the code.
Edited by: sush babu on Mar 14, 2009 5:05 PM

Welcome to SCN, but please do not post your requirements and ask the forum to do your work.
Rob

Similar Messages

  • BDC- Inconsistancy in table control for t-code MR21

    Hi all,
    We are facing inconsistency in the table control (number of line items) for t-code MR21 in normal transaction screen and BDC screen.
    In normal transaction run (MR21) we can see 12 line entries.
    But for the same t-code while processing of a session created by BDC recording we can see only 9 entries.
    Because of the mismatch in the lines, there will be a gap of 3 blank lines.
    Kindly provide any input to solve the issue.
    Thanks & Regards,
    Prabhu

    Hello,
    You will have to use the OPTIONS addition of CALL TRANSACTION to set the default screen size
    data: t_ctu type ctu_params.
    t_ctu-defsize = 'X'.
    t_ctu-dismode = 'N' .   " Mode
    t_ctu-upmode = 'S'  " Update
    call transaction 'MR21' using bdcdata options form t_ctu messages into t_messages.
    Vikranth

  • BDC for MIGO for GR OutBound Delivery( A01 & R05 ) from Movement Type 107 to 109

    Hi,
    I am stuck with a very typical situation need all your expertise and advices for a solution.
    We are basically trying to create change the movement type from 107 to 109 through MIGO.
    I have made a BDC recording for MIGO ( because we would like to track each delivery specifically under shipment , I know that there is a BAPI which is there to do this but it works fine if we do the shipment with Purchase Order as input which dont want in that manner )
    Process:
    1. Creating Production Order
    2. Creating Purchase Order
    3. Creating STO
    4. Deliveries
    5. PGI for Deliveries
    6. Shipment for group of outbound Deliveries
    I have created a z program where i am passing shipment number in the selection screen.
    Then it would take all the deliveries for that shipment and pass each delivery to MIGO and process it and change the status from 107 to 109.
    Interesting part here is, the code works absolutely perfect only from my ID. But when I test from other ID it is not executing, so to check where is the problem I have added mess_tab to the CALL TRANSACTION to capture what message is been populated for my ID comparing with others
    Message Captured on Others ID's:
    MSGID: 00
    MSGNR: 344
    MSGV1: SAPLMIGO
    MSGV2: 1300
    Message Captured on MY ID:
    MSGID: MIGO
    MSGNR: 012
    MSGV1: 5000005802
    MSGV2: (empty)
    This is the problem this program is executing only on MY ID, rest all ID's it is not processing.
    We have cross verified with security and basis regarding any authorization issues but nothing came up.
    Please help me what could be the issue ( WHY it is processing successfully for my and WHY NOT for other ID's)
    Below is the main code :
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'                     " Converting Date format to DD/MM/YYYY
         EXPORTING
           DATE_INTERNAL            = sy-datum
         IMPORTING
           DATE_EXTERNAL            = lv_date_external
         EXCEPTIONS
           DATE_INTERNAL_IS_INVALID = 1
           OTHERS                   = 2.
           IF SY-SUBRC <> 0.                                     "#EC NEEDED
    * Implement suitable error handling here
           ENDIF.
    *   Validating input shipment number with database table VTTP
           SELECT VTTP~TKNUM
                  VTTP~TPNUM
                  VTTP~VBELN
             FROM VTTP INNER JOIN VTTK
             ON VTTP~TKNUM = VTTK~TKNUM
             INTO TABLE IT_VTTP
             WHERE VTTK~TKNUM = P_TKNUM
               AND VTTK~STDIS = 'X'.
           IF sy-subrc = 0.
    *   Validating all deliveries having same Delivery type or not
             SELECT * FROM likp INTO TABLE it_likp FOR ALL ENTRIES IN it_vttp WHERE vbeln = it_vttp-vbeln
                                                                                AND vbtyp = 'J'.
             IF sy-subrc = 0.
               CLEAR lv_lines.
               LOOP AT it_likp INTO wa_likp.
                 REFRESH:it_vbfa,BDCDATA.
    *   Validating if Delivery Type = 109 (GR already done), or Delivery Type = 107 (must process for GR )
                 SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
    *                                                AND vbtyp_v = 'J'
                                                         AND bwart = '109'.
                 IF sy-subrc = 0.
                   lv_flag1 = 'X'.
                 ELSE.
                   SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
    *                                                  AND vbtyp_v = 'J'
                                                           AND bwart = '107'.
                   IF sy-subrc NE 0.
                     MESSAGE 'No Deliveries with Movement Type "107" ' TYPE 'I'.
                   ELSE.
                     lv_flag2 = 'X'.
                     lv_lines = lv_lines + 1.
    **  BDC for MIGO
                     perform bdc_dynpro      using 'SAPLMIGO' '0001'.
                     perform bdc_field       using 'BDC_OKCODE'
                                                   '=OK_GO'.
                     perform bdc_field       using 'GODYNPRO-ACTION'
                                                   'A01'.
                     perform bdc_field       using 'GODYNPRO-REFDOC'
                                                   'R05'.
                     perform bdc_field       using 'GODEFAULT_TV-BWART'
                                                   '109'.
                     perform bdc_field       using 'BDC_CURSOR'
                                                   'GODYNPRO-OUTBOUND_DELIVERY'.
                     perform bdc_field       using 'GODYNPRO-OUTBOUND_DELIVERY'
                                                   wa_likp-vbeln. "'80019574'.
                     perform bdc_field       using 'GOHEAD-BLDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-BUDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-WEVER'
                                                   '1'.
                     perform bdc_dynpro      using 'SAPLMIGO' '0001'.
                     perform bdc_field       using 'BDC_OKCODE'
                                                   '=OK_POST1'.
                     perform bdc_field       using 'GODEFAULT_TV-BWART'
                                                   '109'.
                     perform bdc_field       using 'GOHEAD-BLDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-LFSNR'
                                                   wa_likp-vbeln. "'0080019574'.
                     perform bdc_field       using 'GOHEAD-BUDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-WEVER'
                                                   '1'.
                     perform bdc_field       using 'GODYNPRO-DETAIL_ZEILE'
                                                   '   1'.
                     perform bdc_field       using 'GOITEM-ERFME'
                                                   'EA'.
                     perform bdc_field       using 'GOITEM-ERFMG'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-LSMNG'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-LSMEH'
                                                   'EA'.
                     perform bdc_field       using 'GOITEM-MIGO_ELIKZ'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-BWART'
                                                   '109'.
                     perform bdc_field       using 'GOITEM-LGOBE'
                                                   'RX Cross-docking'.
                     perform bdc_field       using 'BDC_CURSOR'
                                                   'GODYNPRO-DETAIL_TAKE'.
                     perform bdc_field       using 'GODYNPRO-DETAIL_TAKE'
                                                   'X'.
                     PERFORM bdc_dynpro      USING 'SAPLMIGO' '1300'.
                     PERFORM bdc_field       USING 'BDC_CURSOR'
                                                   'G_TIP_DONT_SHOW_AGAIN'.
                     PERFORM bdc_field       USING 'BDC_OKCODE'
                                                   '=OK_TIP_GO'.
                     PERFORM bdc_field       USING 'G_TIP_DONT_SHOW_AGAIN'
                                                   'X'.
    *& Avoid unncessary screens to populate while processing background.
                     LV_OPTIONS-DISMODE = 'N'.
                     LV_OPTIONS-UPDMODE = 'S'.
                     LV_OPTIONS-NOBINPT = 'X'.
                     CALL TRANSACTION 'MIGO' USING BDCDATA  OPTIONS FROM LV_OPTIONS MESSAGES INTO IT_MESSTAB1 .
                     WAIT UP TO 1 SECONDS.
                     DELETE IT_MESSTAB1 WHERE MSGTYP NE 'E'.
                     IF IT_MESSTAB1[] IS NOT INITIAL.
                       APPEND LINES OF IT_MESSTAB1 TO IT_MESSTAB.
                     ENDIF.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
             ENDIF.
           ELSE.
             MESSAGE 'Shipment Number does not exists Or not Planned' TYPE 'E'.
           ENDIF.
         ELSE.
           MESSAGE 'Please insert Shipment Number' TYPE 'E'.
         ENDIF.
         IF lv_flag1 = 'X' AND lv_flag2 = 'X'.
           MESSAGE 'This shipment is processed with an inconsistent goods receipt' TYPE 'I'.
         ELSEIF lv_flag1 = 'X'.
           MESSAGE 'Shipment already been processed for these deliveries' TYPE 'I'.
         ELSEIF lv_flag2 = 'X'.
           lv_lines1 = lv_lines.
           CONDENSE lv_lines1 NO-GAPS .
           CONCATENATE lv_lines1 'Goods Receipt are posted for the shipment '
                  INTO lv_message SEPARATED BY space.
           MESSAGE  lv_message TYPE 'I'.
         ENDIF.
    * Display Messages from Message TAB.
         DELETE ADJACENT DUPLICATES FROM IT_MESSTAB.
         DATA:lv_msg TYPE string.
         LOOP AT IT_MESSTAB INTO WA_MESSTAB.
           CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
               ID        = WA_MESSTAB-MSGID
               NO        = WA_MESSTAB-MSGNR
               V1        = WA_MESSTAB-MSGV1
               V2        = WA_MESSTAB-MSGV2
               V3        = WA_MESSTAB-MSGV3
               V4        = WA_MESSTAB-MSGV4
             IMPORTING
               MSG       = lv_msg
             EXCEPTIONS
               NOT_FOUND = 1
               OTHERS    = 2.
           IF sy-subrc <> 0.
    * Implement suitable error handling here
           ENDIF.
           WRITE:/ lv_msg.
         ENDLOOP.
    *        Start new screen                                              *
       FORM BDC_DYNPRO USING PROGRAM DYNPRO.                 "#EC PF_NO_TYPE
         CLEAR BDCDATA.
         BDCDATA-PROGRAM  = PROGRAM.
         BDCDATA-DYNPRO   = DYNPRO.
         BDCDATA-DYNBEGIN = 'X'.
         APPEND BDCDATA.
       ENDFORM.
    *        Insert field                                                  *
       FORM BDC_FIELD USING FNAM FVAL.                       "#EC PF_NO_TYPE
         CLEAR BDCDATA.
         BDCDATA-FNAM = FNAM.
         BDCDATA-FVAL = FVAL.
         APPEND BDCDATA.
       ENDFORM.
    Thanks,
    Srini

    Hi Rob,
    Thanks for quick reply.
    I have checked the NOTE : 304122
    But there in the NOTE it says ( " BAPI, BAPI_GOODSMVT_CANCEL, BAPI_GOODSMVT_CREATE, CNTL_ERROR" )
    These BAPI's work perfectly for (purchase order as input type), but here out type is ( A01 & R05 ) we are giving DELIVERY NUMBER as input to MIGO.
    So for this scenario we cannot use those BAPI's mentioned in the NOTE.
    Also as stated earlier in the message interesting part is
    "The code works absolutely perfect only from my ID. But when I test from other ID it is not executing. Code is working exactly as expected ONLY to my ID. When i try to execute the same code from another's ID it is not working"
    So what do you think might be the issue?

  • How to find the position of view in MM02 transaction for coding BDC?

    Hi Guys,
    Is there any FM or BAPI Available to find the position of the view in MM02 transaction. I tried FM SELECTION_VIEWS_FIND. But getting inconsistent results
    i.e Some materials it is giving correct positions but for others i am getting wrong position. So my BDC is getting failed.
    Thanks in advance.
    Vinod.

    Hi,
    data : i_t133a like t133a occurs 0 with header line,
          ch(1),
           viewno(2) type n.
    clear viewno.
      select * from t133a into corresponding fields of table i_t133a
                    where bilds = '21' and guifu like 'SP%'  .
      loop at i_t133a .
        ch = i_t133a-pstat.
        if mara-vpsta na ch .
          delete i_t133a     .
          continue .
        endif .
      endloop.
      sort i_t133a by guifu ascending .
      loop at i_t133a .
        viewno = viewno + 1 .
        if i_t133a-guifu = 'SP01'.  "FOR BASIC DATA1                CHANGES              ACCORDINGLY REFER TABLE T133A TO FIND VTHE VALUE
          exit .
        endif .
      endloop .
    reward if usefull

  • Inconsistent for some material in Material master

    During creation for some material I am facing an error "The material type  does not exist" Message no. M3104. It happens with all material type.
    However, I have already found the reason for that. The material was already created before (year 2011) with ZMAK material type (but no transaction yet) and now the material type is deleted from production server. I can see the material in MARA table. It shows the material type which already has been deleted.
    Also I can see the material into all table MARC, MARD, MBEW, MAKT, MARM.
    But the interesting thing is that, I can't see the material in MM60.
    I can realize there are some inconsistent. But the data is available in all tables, so why I can't see the material in MM60 ?
    I have an option to re-create the material type. But it is my last option. Is there any other option to make the material visible in MM60 (without creating the material type).

    Hi,
    For workaround, you can create new material type FERT and transfer to production system, create material code FESEN045* or FESEN045. Or FESEN045’ not same material code FESEN045 (which is not possible) with material type FERT. Once done, you can do material to material transfer with MB1B with 309 movement type. If quantum of materials is more, you can go for BDC with MB1B with 309 movement type.
    Later you can delete material number FESEN045 with material type ZMAK and once all done, change material code to FESEN045 from material code FESEN045* for material type FERT.
    Or else you can have a mini project; keep all material stock created with material type ZMAK.
    You can create new material type FERT and then transfer to production system. Create new material code with new material type FERT and then go for MMAM. Finally add stock to new material code.
    Regards,
    Biju K

  • BDC Error while executing in background

    Hello,
    I am run a BDC to upload Assessable value in J1ID transaction. When I am running the program in background it gives "Runtime error SAPSQL_ARRAY_INSERT_DUPREC has occurred" But when I am running the same in foreground mode it is running perfectly. Since the data volume is huge I cannot run the program in foreground. can anyone guide me how to correct the program to prevent background errors.
    Thanks,
    Anil N.

    Hi, ref SAP NOTE 668466
    When you load attributes or texts, data records are usually inserted in the master data tables of the characteristic using an array insert statement (P, Q, X, Y, T tables). This results in a SAPSQL_ARRAY_INSERT_DUPREC runtime error if data records that are to be inserted and that relate to the unique primary key of the relevant database table already exist in this table. The following possible reasons are currently known for the occurrence of the SAPSQL_ARRAY_INSERT_DUPREC runtime error:
    1. Data inconsistencies in the master data tables of the characteristic
    SAPSQL_ARRAY_INSERT_DUPREC runtime errors or RSDMD 199 may occur if the data appears in an inconsistent status in the master data tables of the characteristic before you load attributes or texts. Notes 323140, 566044, 592757 and 599269 describe this (among other things) in more detail.
    2. Parallel loading of nondisjunct data packages
    If master data attributes are loaded over several dialog processes that are running in parallel, you must guarantee that the data packages of the relevant request are strictly disjunct concerning the characteristic value. This means that all data records that belong to a certain characteristic value may only be contained in a single data package. If data records of a certain characteristic value are distributed over several data packages, this may cause conflicts during the parallel loading of these packages when the master data tables are accessed and this may result in SAPSQL_ARRAY_INSERT_DUPREC runtime errors.
    The same conditions that apply to loading attributes also apply to loading language-independent master data texts. If language-dependent texts are loaded in parallel, the data packages must be disjunct in relation to the combination of characteristic value and language indicator.
    Note 566044 also describes the problematic nature of nondisjunct data packages or duplicate or overlapping data records.
    3. Parallel loading of time-dependent attributes or texts
    When you load time-dependent attributes or texts, a data record that is to be loaded is assigned to a characteristic value and also specifically to a time interval within which the contained attribute values or texts are valid. For this reason, requests for loading time-dependent attributes or texts typically contain several data records for each characteristic value. If data records of a certain characteristic value or the combination of characteristic value and language indicator are distributed over several data packages, this may (as already explained) cause conflicts when the master data tables are accessed and may result in SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199.

  • Function module Vs BDC for master data upload

    Hi ,
    Please advice we should use the following function modules for master data upload or we should go for BDC.
    MP_RFC_SINGLE_CREATE
    MP_RFC_INACT_CHANGE
    MPLAN_CREATE
    MPLAN_CHANGE
    MPLAN_SET_DELETION_INDICATOR
    ASSET_MASTERRECORD_MAINTENANCE
    MPLAN_ITEM_CREATE
    MPLAN_ITEM_CHANGE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    Actually, we have already used these function modules in our upload program, but we are not sure if these function modules will create any data inconsistency.
    Please let me know, if we should continue using the FMs, or there is any risk using the FMs and we should replace them by BDC.
    Thanks in advance.

    HI Vikram,
    Better to serch for the BAPI for uploading the master data.Becuase we have problems with BDC and FM's.
    If you use FM's it does n't contain all the fields which you want.IF you go for BDC this is not maintainable for future releaseas.IF you upgrade then screen may change.
    IF don' have any BAPI then better go for BDC.
    Thanks

  • What is bdc

    can anyone tell me what is bdc

    Data Transfer 
    BDC
    Batch Data Communication
    It is used to transfer data from Sap to Sap or from Non Sap to sap system. It uses the normal transaction codes to transfer the data.
    Data Transfer Methods 
    You can use the following methods to transfer data:
    •        CALL TRANSACTION: Data consistency check with the help of screen logic.
    •        Batch input with batch input sessions: Data consistency check with the help of screen logic
    Difference between Batch Input and CALL TRANSACTION
    If the direct input cannot be used for your task, this makes creating a data transfer program easier since the underlying transactions ensure that the data consistency checks are executed.
    In the case of an error during the data transfer (if data records are inconsistent, for example), you can restart the transfer at the point in the program where the error occurred.
    Data Transfer Overview
    Batch input methods
    With the batch input method, an ABAP program reads the external data that is to be entered in the SAP system and stores the data in a “batch input session”. The session records the actions that are required to transfer data into the system using normal SAP transactions.
    When the program has generated the session, you can run the session to execute the SAP transactions in it. You can explicitly start and monitor a session with the batch input management function (by choosing System &#61614; Services &#61614; Batch input), or have the session run in the background processing system.
    CALL TRANSACTION methods
    In the second method, your program uses the ABAP statement CALL TRANSACTION USING to run an SAP transaction. External data does not have to be deposited in a session for later processing. Instead, the entire batch input process takes place inline in your program.
    Choosing Data Transfer Methods
    Selecting a Data Transfer Method  
    When you transfer data in ABAP, you have three options to submit the data for the data transfer. Only the first two methods can be recommended without reservation. The third method, by way of CALL DIALOG, is outmoded. CALL DIALOG is less comfortable than the other methods. You should use it only if you must.
    •     Use the CALL TRANSACTION USING statement
    Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
    Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
    The most important features of CALL TRANSACTION USING are:
    o     Synchronous processing
    o     Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
    o     You can update the database both synchronously and asynchronously
    The program specifies the update type
    o     Separate LUW (logical units of work) for the transaction
    The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
    o     No batch input processing log
    •     Create a session on the batch input queue.
    Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
    Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
    Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
    The most important aspects of the session interface are:
    o     Asynchronous processing
    o     Transfers data for multiple transactions
    o     Synchronous database update
    During processing, no transaction is started until the previous transaction has been written to the database.
    o     A batch input processing log is generated for each session
    o     Sessions cannot be generated in parallel
    The batch input program must not open a session until it has closed the preceding session.
    Executing Data Transfer Programs 
    Procedure
    If you are using an SAP data transfer program, follow the procedure specified in the program documentation.
    If you are using a generated data transfer program, proceed as follows:
    1.     Start the data transfer program.
    2.     Decide which batch input method you want to use for the data transfer.
    a) CALL TRANSACTION USING:
    You must specify the:
    – Processing mode: You use this parameter to specify whether processing should take place in the background or in dialog mode.
    Possible values are:
    A     Display all
    E     Display only errors
    N     No display
    – Update mode: This parameter determines how the data is to be updated:
    Possible values are:
    S     Synchronous
    A     Asynchronous
    L     Local update
    – Error session: Here you have the option to specify a session name for a batch input session in which data is to be written in the case of an error. You can use this to identify incorrect data records after the batch input program has run and to import the records into the R/3 System once you have corrected them.
    If you are creating an error session, you must also specify:
    – User: Specify the user with whose authorizations the sessions are processed.
    – Keep session: This specifies whether or not the session should be deleted once it has been processed.
    – Lock date: Specify the processing date for the error session.
    b) Generate session:
    – Session name: Specify a name for the batch input session to be generated.
    – User: Specify the user with whose authorizations the sessions are processed.
    – Keep session: This specifies whether or not the session should be deleted once it has been processed.
    – Lock date: Specify the processing date for the error session.
    3.     Specify a character that is to be used as the NODATA character.
    4.     Specify the path of the data file from which the data is to be imported into the R/3 System.
    5.     Execute the program.
    6.     If you have generated a session, or if errors occurred in CALL TRANSACTION USING mode, you must now edit the generated sessions. You can find information on this in BC - System services in  batch input sessions.
    Creating a Session with BDC_OPEN_GROUP  
    Use the BDC_OPEN_GROUP function module to create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT.
    You cannot re-open a session that already exists and has been closed. If you call BDC_OPEN_GROUP with the name of an existing session, then an additional session with the same name is created.
    A batch input program may have only one session open at a time. Before opening a session, make sure that any sessions that the program closes any sessions that it previously had opened.
    BDC_OPEN_GROUP takes the following EXPORTING parameters:
    •        CLIENT
    Client in which the session is to be processed.
    Default: If you don't provide a value for this parameter, the default is the client under which the batch input program runs when the session is created.
    •        GROUP
    Name of the session that is to be created. May be up to 12 characters long.
    Default: None. You must specify a session name.
    •        HOLDDATE
    Lock date. The session is locked and may not be processed until after the date that you specify.  Only a system administrator with the LOCK authorization for the authorization object Batch Input Authorizations can unlock and run a session before this date.
    Format: YYYYMMDD (8 digits).
    Default: No lock date, session can be processed immediately. A lock date is optional.
    •        KEEP
    Retain session after successful processing. Set this option to the value X to have a session kept after it has been successfully processed. A session that is kept remains in the input/output queue until an administrator deletes it.
    Sessions that contain errors in transactions are kept even if KEEP is not set.
    Default: If not set, then sessions that are successfully processed are deleted. Only the batch input log is kept.
    •        USER
    Authorizations user for background processing. This is the user name that is used for checking authorizations if a session is started in background processing. The user must be authorized for all of the transactions and functions that are to be executed in a session. Otherwise, transactions will be terminated with “no authorization” errors.
    The user can be of type dialog or background. Dialog users are normal interactive users in the SAP system. Background users are user master records that are specially defined for providing authorizations for background processing jobs.
    Advantages:
    Types of BDC :
    CLASSICAL BATCH INPUT (Session Method)
    CALL TRANSACTION
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically

  • OPEN_INTERFACE_REJECTS- INCONSISTENT SUPPL SITE

    Payables Open Interface Import program is throwing INCONSISTENT SUPPL SITE, when a third party vendor site code and third party vendor site id is passed along with matching PO number for creating an invoice for third party vendor site.
    Can any one let me know, how to resolve this issue.
    Thanks in advance

    Hi,
    this could be due to passing values which are not correct for the vendor_site_id field ....do compare this transaction with other transactions that are imported successfully past, so that we can narrow down on the data which is different ...
    Reference:
    Expense Report Export Rejects Expense Reports With 'Supplier Site Id And Supplier Site Code Do Not Match' [ID 1408830.1]
    Regards,
    Ivruksha

  • Error while running a BDC for the Transaction F-02

    Hi,
           I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
           When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
            How to solve this issue?.
            Waiting for ur replies.........
    Regards
    N.Senthil

    Hi,
    When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
    Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
        Refer below theard for sample bdc code for f-02.
    https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
    Regards

  • Unable to update the serial number through bdc in Sales Order

    Hi experts,
    I written the inboud FM for to update the 3rd party items serial number to the sales orders through BDC Call transaction Method.
    Here i am facing a problem when i have the 19 item Quan ,it is updating correct through idoc , when ever there is moe than 19 and at that if any serial number repeated for that if i am changing at that time it is loosing the control of the BDC and giving the control to the salesorder screen.
    how can i handle that control again has to come to BDC prgrm......
    Thnks,
    Regards,
    Bharani

    Hi,
    Can you please let me know the segment in ORDERS05 Idoc to process the Payment card information and if the standard Function Module can handle the creation of a Sales Order with data for Payment Card.
    We have a requirement to map the Tokenized Number of the Credit Card send from a store front end to ECC mapping via SAP-PI.
    Thanks in Advance,

  • MULTIPLE ITEM PROBLEM IN VL31N BDC

    hI FRIENDS ,
        I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
    CODE IS AS FOLLOWS:.........
    FUNCTION y_synie_bdcinbdly.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(CTU) LIKE  APQI-PUTACTIVE DEFAULT 'X'
    *"     VALUE(MODE) LIKE  APQI-PUTACTIVE DEFAULT 'N'
    *"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE DEFAULT 'L'
    *"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
    *"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
    *"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
    *"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
    *"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
    *"     VALUE(EXTNID) LIKE  MAKT-MAKTG
    *"     VALUE(VENDORNO) LIKE  LFA1-LIFNR
    *"     VALUE(PONUMBER) LIKE  EKKO-EBELN
    *"     VALUE(ITEMNUMBER) LIKE  LIPS-VGPOS
    *"     VALUE(MATERIAL) LIKE  MAKT-MAKTG
    *"     VALUE(DLYQTY) LIKE  LIPS-LFIMG
    *"     VALUE(BTCHNO) LIKE  LIPS-CHARG
    *"     VALUE(POSLR) LIKE  EKES-EBELP OPTIONAL
    *"  EXPORTING
    *"     VALUE(SUBRC) LIKE  SYST-SUBRC
    *"     VALUE(INDELYNO) LIKE  SY-MSGV2
    *"     VALUE(MSG1) LIKE  SY-MSGV1
    *"     VALUE(MSG2) LIKE  SY-MSGV2
    *"     VALUE(MSG3) LIKE  SY-MSGV3
    *"     VALUE(MSG4) LIKE  SY-MSGV4
    *"  TABLES
    *"      MESSTAB STRUCTURE  BDCMSGCOLL
    *"      ERRTAB STRUCTURE  YSYNERRMSGS
    *"      INDLYTAB STRUCTURE  YSYN_QTYTAB
    Updated by ANAND SYNISE 19.1.2007
      DATA: BEGIN OF bdctab OCCURS 0.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdctab.
      DATA: datenow(10) TYPE c,
            fldvar(30)  TYPE c,
            fldno       TYPE i,
            flditoc(6)  TYPE c,
            qty(13)     TYPE c.
      DATA maxposnr LIKE lips-posnr.
      DATA testposnr TYPE posnr.
      DATA itemnoint TYPE i.
      CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
      CLEAR bdctab.
      REFRESH bdctab.
      PERFORM open_group      USING group user keep holddate ctu.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '4007'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-VERUR_LA'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-LIFNR'.
           bdctab-fval = vendorno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LV50C-BSTNR'.
           bdctab-fval = ponumber.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-VERUR_LA'.
           bdctab-fval = extnid.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=MKAL_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIKP-BLDAT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POPO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '0111'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-PO_MATNR'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = 'WEIT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-PO_MATNR'.
           bdctab-fval = material.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POLO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
    *ADDED BY ANAND ON 22-01-2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  ITEMNUMBER .     "ITEMNUMBER = LIPS-VGPOS
           APPEND bdctab.
    ************ENDED***********************
    ADDED BY MILIND 19.01.2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  poslr .
           APPEND bdctab.
    *    ENDED * *
       CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
           bdctab-fval = ''.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-CHARG(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
          QTY = INDLYTAB-DLYQTY.
            qty = dlyqty.
           bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
           bdctab-fval = QTY.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIPS-CHARG(01)'.
    *     BDCTAB-FVAL = INDLYTAB-BTCHNO.
           bdctab-fval = btchno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=SICH_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-MATNR(02)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
      CALL TRANSACTION 'VL31N' USING bdctab MODE 'N'  MESSAGES INTO messtab.
      subrc = sy-subrc.
      PERFORM close_group USING     ctu.
      CLEAR bdctab.
      REFRESH bdctab.
      IF sy-subrc EQ 0.
        indelyno = sy-msgv2.
      ENDIF.
      LOOP AT messtab.
        MOVE: messtab-msgid TO errtab-msgid,
              messtab-msgnr TO errtab-msgnr,
              messtab-msgv1 TO errtab-msg1,
              messtab-msgv2 TO errtab-msg2,
              messtab-msgv3 TO errtab-msg3,
              messtab-msgv4 TO errtab-msg4.
        APPEND ERRtab.
      ENDLOOP.
      LOOP AT errtab.
        SELECT SINGLE text FROM t100
          INTO errtab-errmsg
          WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
          AND sprsl EQ sy-langu.
        MODIFY errtab.
      ENDLOOP.
    ENDFUNCTION.

    Hi,
    Check this code:
    REPORT Z_CUSTOMER_UPLOAD .
                  D A T A         D E C L A R A T I O N S                *
    DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_CUSTOMER.
    DATA:BEGIN OF IT_success OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_success.
    DATA:BEGIN OF IT_error OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_error.
    DATA: L_INDEX TYPE SY-TABIX.
    DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    ERROR MESSAGE TABLE
    DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : C_S TYPE C VALUE 'S',
            C_E TYPE C VALUE 'E'.
    *DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
         IT_ERROR LIKE IT_CUSTOMER  OCCURS 0.
    DATA : V_RECTOT TYPE I,
            V_RECERR TYPE I,
            V_RECSUC TYPE I.
                  S E L E C T I O N  -  S C R E E N                      *
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER        : P_FILE LIKE RLGRAP-FILENAME .
    SELECTION-SCREEN : END OF BLOCK B1.
               A T  S E L E C T I O N  -  S C R E E N                    *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    to get F4 help for p_file
      PERFORM F4_FILENAME USING P_FILE.
                S T A R T   O F   S E L E C T I O N                      *
    START-OF-SELECTION.
    Uploading data from flat file into it_tab
      PERFORM BDC_UPLOAD USING P_FILE.
      PERFORM PROCESS_DATA.
      PERFORM POPULATE_BDC.
                E N D  O F   S E L E C T I O N                           *
    *END-OF-SELECTION.
    PERFORM DISPLAY_REPORT.
    *&      Form  F4_FILENAME
          text
         -->P_P_FILE  text
    FORM F4_FILENAME USING    P_P_FILE.
    DATA:L_FILE TYPE IBIPPARMS-PATH.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = L_FILE .
       P_P_FILE = L_FILE.
    ENDFORM.                    " F4_FILENAME
    *&      Form  BDC_UPLOAD
          text
         -->P_P_FILE  text
    FORM BDC_UPLOAD USING    P_P_FILE.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = P_P_FILE
        I_BEGIN_COL                   = 1
        I_BEGIN_ROW                   = 1
        I_END_COL                     = 8
        I_END_ROW                     = 1000
      TABLES
        INTERN                        = IT_DATA
    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.                    " BDC_UPLOAD
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA.
    SORT IT_DATA BY ROW COL.
      LOOP AT IT_DATA.
    CASE IT_DATA-COL.
    WHEN 1.
    IT_CUSTOMER-KUNNR   = IT_DATA-VALUE.
    WHEN 2.
    IT_CUSTOMER-VKORG   = IT_DATA-VALUE.
    WHEN 3.
    IT_CUSTOMER-VTWEG   = IT_DATA-VALUE.
    WHEN 4.
    IT_CUSTOMER-MATNR   = IT_DATA-VALUE.
    WHEN 5.
    IT_CUSTOMER-KDMAT   = IT_DATA-VALUE.
    WHEN 6.
    IT_CUSTOMER-MEGRU   = IT_DATA-VALUE.
    WHEN 7.
    IT_CUSTOMER-LPRIO   = IT_DATA-VALUE.
    WHEN 8.
    IT_CUSTOMER-ANTLF   = IT_DATA-VALUE.
    APPEND IT_CUSTOMER.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  POPULATE_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_BDC.
    DATA:L_COUNTER TYPE N,
             L_STRING TYPE STRING.
    LOOP AT IT_CUSTOMER.
    AT NEW KUNNR.
    CLEAR L_COUNTER.
          L_INDEX = SY-TABIX.
          READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_dynpro      using 'SAPMV10A' '0100'.
    perform bdc_field       using 'MV10A-KUNNR'
                                  IT_CUSTOMER-KUNNR.
    perform bdc_field       using 'MV10A-VKORG'
                                  IT_CUSTOMER-VKORG.
    perform bdc_field       using 'MV10A-VTWEG'
                                  IT_CUSTOMER-VTWEG.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    ENDAT.
    L_COUNTER = L_COUNTER + 1.
        CLEAR L_STRING.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                            IT_CUSTOMER-MATNR.
    CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using     L_STRING
                                     IT_CUSTOMER-KDMAT.
    CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using   L_STRING
                                    IT_CUSTOMER-MEGRU.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *-- For Page down in Call Transaction Mode
        IF L_COUNTER = 14.
          CLEAR L_COUNTER.
          PERFORM BDC_DYNPRO      USING 'SAPMV45A' '4001'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=P+'.
        ENDIF.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                              IT_CUSTOMER-SELKZ.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SELE'.
    perform bdc_dynpro      using 'SAPMV10A' '0300'.
    perform bdc_field       using 'MV10A-KDMAT'
                                  IT_CUSTOMER-KDMAT.
    perform bdc_field       using 'MV10A-LPRIO'
                                  IT_CUSTOMER-LPRIO.
    perform bdc_field       using 'MV10A-ANTLF'
                                  IT_CUSTOMER-ANTLF.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/EBACK'.
    at end of kunnr.
    READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
          MESSAGES INTO IT_MESSAGES.
          CLEAR IT_BDC.
          REFRESH IT_BDC.
    ENDAT.
      IF NOT IT_MESSAGES[] IS INITIAL.
        PERFORM FORMAT_MESSAGE.
      ENDIF.
    ENDLOOP.
    ENDFORM.                    " POPULATE_BDC
    *&      Form  bdc_dynpro
          text
         -->P_0273   text
         -->P_0274   text
    FORM bdc_dynpro USING    VALUE(P_0273)
                             VALUE(P_0274).
    IT_BDC-PROGRAM = P_0273.
    IT_BDC-DYNPRO = P_0274.
    IT_BDC-DYNBEGIN = 'X'.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0278   text
         -->P_RECORD_KUNNR_001  text
    FORM bdc_field USING    VALUE(P_0278)
                           VALUE(P_0279).
    IT_BDC-FNAM = P_0278.
      IT_BDC-FVAL = P_0279.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_field
    *&      Form  FORMAT_MESSAGE
          text
    -->  p1        text
    <--  p2        text
    FORM FORMAT_MESSAGE.
    DATA: L_MSG(100).
      LOOP AT IT_MESSAGES.
      READ TABLE IT_CUSTOMER INDEX L_INDEX.
        CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
                  ID        = IT_MESSAGES-MSGID
                  LANG      = SY-LANGU
                  NO        = IT_MESSAGES-MSGNR
                  V1        = IT_MESSAGES-MSGV1
                  V2        = IT_MESSAGES-MSGV2
                  V3        = IT_MESSAGES-MSGV3
                  V4        = IT_MESSAGES-MSGV4
             IMPORTING
                  MSG       = L_MSG
             EXCEPTIONS
                  NOT_FOUND = 1
                  OTHERS    = 2.
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        write:/ l_msg.
      ENDLOOP.
    ENDFORM.                    " FORMAT_MESSAGE
    reward if helpful,
    keerthi

  • Creation of PGI using BDC for tc VL02N is not happening..

    Hi All,
    i need to do Post Goods Issue (PGI) thro' BDC and after that i need to update the flag in Ztable.
    its giving Success message and updating the database also.
    but its not issuing the PGI.and further i want to create billing doc.So its compulsory to me to post PGI.
    if i look into the BDCMSGCOLL structure its giving "NO BATCH INPUT DATA FOR SCREEN"? why this is happening?
    please let me know immediately....
    REFRESH: tt_bdcmsgcoll .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = wa_created-document_numb
        IMPORTING
          output = wa_created-document_numb.
      REFRESH tt_bdcdata.
      PERFORM bdc_dynpro      USING text-001 text-002.
      PERFORM bdc_field       USING text-008
                                   text-014.
      PERFORM bdc_field       USING text-009
                                    text-011.
      PERFORM bdc_field       USING text-014
                                    wa_created-document_numb.
      PERFORM bdc_dynpro      USING text-001 text-003.
      PERFORM bdc_field       USING text-009
                                    text-036.
      PERFORM bdc_field       USING text-025
                                    sy-datum.
      PERFORM bdc_field       USING text-008
                                    text-035.
      PERFORM bdc_field       USING text-037
                                    sy-datum.
      PERFORM bdc_field       USING text-038
                                    text-029.
      PERFORM bdc_field       USING text-016
                                    c_x.
      CALL TRANSACTION c_t_del USING tt_bdcdata
                                    MODE c_m
                                    UPDATE c_u
                                    MESSAGES INTO tt_bdcmsgcoll .
      SORT tt_bdcmsgcoll BY msgtyp.
      READ TABLE tt_bdcmsgcoll INTO wa_bdcmsgcoll WITH KEY msgtyp = c_e.
      IF sy-subrc EQ 0.
        LOOP AT tt_bdcmsgcoll INTO wa_bdcmsgcoll WHERE msgtyp = c_e.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              id        = wa_bdcmsgcoll-msgid
              lang      = text-010
              no        = wa_bdcmsgcoll-msgnr
              v1        = wa_bdcmsgcoll-msgv1
              v2        = wa_bdcmsgcoll-msgv2
              v3        = wa_bdcmsgcoll-msgv3
              v4        = wa_bdcmsgcoll-msgv4
            IMPORTING
              msg       = v_msg
            EXCEPTIONS
              not_found = 1
              OTHERS    = 2.
          IF sy-subrc <> 0.
          ENDIF.
          WRITE :/ v_msg.
        ENDLOOP.
      ELSE.
        MOVE : c_x TO wa_worklist-pgi_flag.
        READ TABLE tt_epit INTO wa_epit WITH KEY epi_id = wa_worklist-epi_id epi_sr = wa_worklist-epi_sr.
        IF sy-subrc EQ  0.
          MODIFY tt_epit FROM wa_worklist TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND epi_sr = wa_worklist-epi_sr.
        ELSE.
          APPEND wa_worklist TO tt_epit.
        ENDIF.
         wa_epit-pgi_flag = c_x.
         MODIFY   tt_epit FROM wa_epit TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
         UPDATE zsd_dt_epit SET pgi_flag = 'X' WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
         IF  sy-subrc EQ 0.
         ENDIF.
      ENDIF.

    HI,
    Please refer this
    To perform Post goods issue
        PERFORM OPEN_GROUP.
        PERFORM BDC_DYNPRO      USING 'SAPMV50A' '4004'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LIKP-VBELN'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=WABU_T'.
        PERFORM BDC_FIELD       USING 'LIKP-VBELN' DELIVERY.
                                 '84000064'.
        PERFORM BDC_TRANSACTION USING 'VL02N'.
        PERFORM CLOSE_GROUP.
        CLEAR : DELIVERY,
                T_BSITEM,
                T_BSICTL.
      ENDIF.
    ENDFORM.                    " DELIVERY

  • Problem in creation of BDC for transaction phap_create

    Hello Friends,
    I am trying to create BDC for PHAP_CREATE.
    When you run a transaction a pop up window appears to select the template id.
    And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
    I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
    How to go about it???
    Regards,
    Bhushan

    Hi,
    For selecting the id, while doing recording,
    record with
    CTRL + F ( Where u can give ur id) and proceed further.

  • Help needed in BDC

    Dear Experts,
    I have a module pool program and transaction for shipping advice, where I have given a option that if user enters Sales Order in the selection screen and in the next screen it shows all the related infromation of that order and if needed user can edit few fields in this screen and can take print.
    Now for the same report I dont want to show any screen to user after user enters the order and executes directly it should display the dialog box for 'Print' and 'Print Preview'.
    I did BDC recording for the transaction of shipping adive report and with that code I have developed other program and if run this program in foreground (Mode "A")it will show all screens with that dialog screen for 'Print' also but if I run in background (Mode "B") it will not show any screen and it will print the document directly.
    Now my requirement is I have to show only dialog screen for 'Print' & 'Print Preview'.
    Please give me your valuable Ideas on how to achieve this...
    Thanks in advance.
    Best Regards
    Venkat

    Hello,
    May be you are not using the full recording or might have some mistake(s) is going on in the completion of recording that is why it is creating problem. And also please check the call transaction code in the BDC program, whether you are performing the accurate t-code with that or not and also perform BDC functions also. If it is right than it would not might have any problem regarding the required output as you want.
    Thanks & Regards,
    Akg

Maybe you are looking for