Reprint the processed order with BDC call transaction

Hi Mentors,
I have a problem with printing the order which is coming in a cockpit program.
for that i am using the bdc and call transaction 'ZVA31' which is exactly the standard program 'SD70AV1A'.
but after first processing i am not able to reprint the processed order.
Below is my bdc code and i am using processing mode 1 at the time of recording.
FORM ZSD70AV1A_PRINT_BA01 USING p_vbeln TYPE vbeln.
DATA: wa_ba01 TYPE nast-kschl VALUE 'BA01'.
perform bdc_dynpro      using 'SD70AV1A' '1000'.
perform bdc_field       using 'BDC_CURSOR'
'RG_KSCHL-LOW'.
perform bdc_field       using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field       using 'RG_KSCHL-LOW'
wa_ba01."wa_ba01."'ba01'.
perform bdc_field       using 'PM_NSORT'
'01'.
perform bdc_field       using 'PM_VERMO'
'1'.
perform bdc_field       using 'RG_VBELN-LOW'
p_vbeln."'513785'.
perform bdc_dynpro      using 'SAPMSSY0' '0120'.
perform bdc_field       using 'BDC_CURSOR'
'04/03'.
perform bdc_field       using 'BDC_OKCODE'
'=&ALL'.
perform bdc_dynpro      using 'SAPMSSY0' '0120'.
perform bdc_field       using 'BDC_CURSOR'
'04/03'.
perform bdc_field       using 'BDC_OKCODE'
'=PROC'.
CALL TRANSACTION 'ZVA31' USING BDCDATA
MODE   'A'
MESSAGES INTO MESSTAB.
CLEAR BDCDATA[].
ENDFORM.                    " ZSD70AV1A_PRINT_BA01
Br,
Surya

Solved myself.
DATA: wa_ba00 TYPE nast-kschl VALUE 'BA00'.
DATA: p_vermo TYPE kschl.
DATA: cur_vstat TYPE nast-vstat.
SELECT SINGLE vstat INTO cur_vstat FROM nast
WHERE objky = p_vbeln
AND   kschl = 'BA00'.
IF sy-subrc = 0 AND cur_vstat = 0.
p_vermo = '1'."wa_vstat.
ELSE.
p_vermo = '2'.
ENDIF.
p_vermo is processing status.
Br,
Surya

Similar Messages

  • How to do the job scheduling in BDC Call transaction

    Hi Experts,
    I've a Query like how to do the job scheduling in BDC Call transaction
      If anybody knows the answer please send me the reply.
      Thanks.
       Regards,
        Rekha

    Hi ,
    any progarm can be scheduled, wether it may be BDC or report thru SM36 Tcode.
    But do rememeber that if ur BDC is using GUI_UPLOAD function module, then it wont work , coz the function Gui_upload or GUI_DOWNLOAd wont work in back ground.
    If u r going to use OPEN_DATASET , READ dataset ....then it can be scheduled. i.e BDC can work if ur program retrievesz the data from Application server.
    Rvert back if any issues,
    Reward with poinst if helpful.
    Regards,
    Naveen

  • How can we update mk01 with BDC call transaction method

    can any one send the sample code for upload of MK01 using call transaction method.
    its urgent..

    Use the following code.
    *& Report  ZMK01_VA01                                                  *
    REPORT  Z_MK01                              .
    SOURCE INTERNAL TABLE
    DATA: BEGIN OF T_SOURCE OCCURS 0,
            LIFNR TYPE LIFNR,
            EKORG TYPE EKORG,
            KTOKK TYPE KTOKK,
            NAME1 TYPE NAME1,
            SORTL TYPE SORTL,
            LAND1 TYPE LAND1,
            WAERS TYPE WAERS,
          END OF T_SOURCE.
    *DATA: E_MESSAGE TYPE C.
    ERROR MESSAGE TABLE
    DATA: T_ERRORMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    TARGET TABLE LIKE BDCDATA
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    TO UPLOAD DATA FROM LEGACY SYSTEM
          CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
            CODEPAGE                      = ' '
             FILENAME                      = 'D:\MK01.TXT'
             FILETYPE                      = 'DAT'
          IMPORTING
            FILELENGTH                    =
            TABLES
              data_tab                      = T_SOURCE
           EXCEPTIONS
             CONVERSION_ERROR              = 1
             FILE_OPEN_ERROR               = 2
             FILE_READ_ERROR               = 3
             INVALID_TYPE                  = 4
             NO_BATCH                      = 5
             UNKNOWN_ERROR                 = 6
             INVALID_TABLE_WIDTH           = 7
             GUI_REFUSE_FILETRANSFER       = 8
             CUSTOMER_ERROR                = 9
             NO_AUTHORITY                  = 10
             OTHERS                        = 11
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    TRANSFERING DATA FROM INTERNAL SOURCE TABLE TO TARGET TABLE
    LOOP AT T_SOURCE.
    REFRESH BDCDATA.
    perform bdc_dynpro      using 'SAPMF02K' '0107'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  T_SOURCE-LIFNR.
    perform bdc_field       using 'RF02K-EKORG'
                                  T_SOURCE-EKORG.
    perform bdc_field       using 'RF02K-KTOKK'
                                  T_SOURCE-KTOKK.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-LAND1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                  T_SOURCE-NAME1.
    perform bdc_field       using 'LFA1-SORTL'
                                  T_SOURCE-SORTL.
    perform bdc_field       using 'LFA1-LAND1'
                                  T_SOURCE-LAND1.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                  T_SOURCE-WAERS.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    CALL TRANSACTION 'MK01' USING BDCDATA MODE 'A' MESSAGES INTO T_ERRORMSG.
    ENDLOOP.
    LOOP AT T_ERRORMSG.
    WRITE:/ 'MESSAGE TYPE',T_ERRORMSG-MSGTYP,
             'FIELDNAME WERE ERROR OCCURED', T_ERRORMSG-FLDNAME.
    *CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      ID              = T_ERRORMSG-MSGID
      LANG            = SY-LANGU
      NO              = T_ERRORMSG-MSGNR
      V1              = T_ERRORMSG-MSGV1
      V2              = T_ERRORMSG-MSGV2
      V3              = T_ERRORMSG-MSGV3
      V4              = T_ERRORMSG-MSGV4
    IMPORTING
      MSG             = E_MESSAGE
    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:/ E_MESSAGE.
    ENDLOOP.
           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.
    With Regards
    K Srinivas

  • Skip the selection screen using BDCTAB call transaction

    Hi experts,
    I am using BDCTAB for call transaction SWI1 I need to skip the selection screen. Can you please tell me how to skip the selection screen using BDC call transaction?
    Thank you in advance.....

    hi,
    the first step is to pass some values to the selection screen, at least Date From and Date To; otherwise, it´ll take a long time. The second step is to emulate the Execute button, which is done with '/08'.
    PERFORM fields USING 'BDC_OKCODE'   '/08'.
    Third step is to catch the programme and screen number.

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

  • OSSNOTES for releasing process orders with missing parts in background

    Hi All,
    The bapi 'BAPI_PROCORD_RELEASE' is not releasing the process orders
    with missing parts in background.
    Is there any OSSNotes for releasing these process orders in backgound through this bapi.
    Pls help.
    Thanks .

    Hi Suri - Thanks for your response. I tried both with blank(individual and collective) and 2 (collective req. only) but I still get the same result. I found one other setting that can solve this issue and that is checking the activate full confirmation logic at the the MRP group level in OPPR. I will test more and let you know if that works but we dont use MRP groups here at our client and that is why I was little hesistant to set up collective availability check parameters at the MRP group level. But looks like this is the only option that we can use to get this resolved.
    Thanks,
    Bharath

  • Link process order with PM Module

    Hy,
    I know it looks crazy but, is it possible to link the process order with the Measuring counter and counter reading.
    We are working with pharma compny and due to some of ragulatroy reasons it is required.
    if possible then pls guide?
    Regards,
    Dhaval

    Hy Rambabu,
    Thank u for the taking intrest.
    Actually we are using Filters which we have maintain as a Measuring Counter in PM. Our intention is just to track the which filter is used during the production process and also how much product is passed through that speciifc filer.I know my second point is covered through the measuring counter reading but I want to link it with PP module.
    Regads
    Dhaval
    Edited by: Dhaval Choksi on Jun 3, 2008 2:46 PM

  • How to set the BDC Call transaction Program in Background

    Hi All,
            I have a requirement. If i execute a BDC Call Transaction Program in Background it is showing 0 seconds means it is not executing. Normally it is working properly. If execute in background it is not executing. But my client wnats to execute in background. How can i overcome this could you please suggest me?
    Thanks in Advance

    hi
    To schedule the processing of session in backgroud you can use report RSBDCSUB.
    You can do in two ways -
    Ist Method
    Define a batch job in SM36 with two steps -
    First Step - Your Custom Program ( with a variant )
    Second Step - RSBDCSUB ( With a variant having
    the session name ).
    2nd Method
    In your program after BDC_CLOSE_GROUP add a line.
    SUBMIT RSBDCSUB WITH MAPPE EQ <SESSION_NAME>.
    Scedule you program as a batch job in SM36 ( Single Step ). ( You can also test the program by running in online mode . After your programs executes , go and see in SM35. You will see that your session created in being processed or has been processed in background).
    In Both ways the session created by BDC_OPEN_GROUP will be processed in background
    You would have to create a job on the fly to do this. This example shows how to kick off a background job via an ABAP program.
    report zrich_0004 .
    data:   sdate type sy-datum,
            stime type sy-uzeit,
            l_valid,
            ls_params like pri_params,
            l_jobcount like tbtcjob-jobcount,
            l_jobname  like tbtcjob-jobname.
    start-of-selection.
    Get Print Parameters
      call function 'GET_PRINT_PARAMETERS'
           exporting
                no_dialog      = 'X'
           importing
                valid          = l_valid
                out_parameters = ls_params.
    Open Job
      l_jobname = 'ZRICH_0005'.
      call function 'JOB_OPEN'
           exporting
                jobname  = l_jobname
           importing
                jobcount = l_jobcount.
    Submit report to job
      submit zrich_0005   
           via job     l_jobname
               number  l_jobcount
           to sap-spool without spool dynpro
               spool parameters ls_params
                  and return.
    Schedule and close job.
      call function 'JOB_CLOSE'
           exporting
                jobcount  = l_jobcount
                jobname   = l_jobname
                strtimmed = 'X.
    regards
    Satish

  • Plz tell me BDC  CALL TRANSACTION steps with simple example

    hi,
    plz tell me the steps
    BDC  CALL TRANSACTION steps with simple example

    Hi,
    BATCH DATA COMMUNICATION
    About Data Transfer In R/3 System
    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
    In the process of replacing current applications and transferring application data, two situations might occur:
    ? The first is when application data to be replaced is transferred at once, and only once.
    ? The second situation is to transfer data periodically from external systems to SAP and vice versa.
    ? There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called ?batch input? or ?batch data communication?.
    1. SESSION METHOD
    2. CALL TRANSACTION
    3. DIRECT INPUT
    Advantages offered by BATCH INPUT method:
    1. Can process large data volumes in batch.
    2. Can be planned and submitted in the background.
    3. No manual interaction is required when data is transferred.
    4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
    To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a ?data transfer? program must map the data from the external system into the data structure required by the SAP batch input program.
    The batch input program must build all of the input to execute the SAP transaction.
    Two main steps are required:
    ? To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
    ? To pass the table to SAP for processing.
    Prerequisite for Data Transfer Program
    Writing a Data Transfer Program involves following prerequisites:
    Analyzing data from local file
    Analyzing transaction
    Analyzing transaction involves following steps:
    ? The transaction code, if you do not already know it.
    ? Which fields require input i.e., mandatory.
    ? Which fields can you allow to default to standard values.
    ? The names, types, and lengths of the fields that are used by a transaction.
    ? Screen number and Name of module pool program behind a particular transaction.
    To analyze a transaction::
    ? Start the transaction by menu or by entering the transaction code in the command box.
    (You can determine the transaction name by choosing System ? Status.)
    ? Step through the transaction, entering the data will be required for processing your batch input data.
    ? On each screen, note the program name and screen (dynpro) number.
    (dynpro = dyn + pro. Dyn = screen, pro = number)
    ? Display these by choosing System ? Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
    The technical info pop-up shows not only the field information but also the program and screen.
    ? For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
    Note the following information:
    - The field name for batch input, which you?ll find in its own box.
    - The length and data type of the field. You can display this information by double clicking on the Data Element field.
    ? Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
    Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
    In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
    You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
    Once you have program name, screen number, field name (screen field name), you can start writing.
    DATA TRANSFER program.
    Declaring internal table
    First Integral Table similar to structure like local file.
    Declaring internal table like BDCDATA
    The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
    The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
    This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
    ? Create a BDCDATA structure
    ? Write the structure out to a session or process it with CALL TRANSACTION USING; and then
    ? Create a BDCDATA structure for the next transaction that is to be processed.
    Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
    The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
    ? Data that is entered into screen fields.
    ? Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
    The BDCDATA structure contains the following fields:
    ? PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
    ? DYNPRO: Screen Number. Set this field only in the first record for the screen.
    ? DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to ? ? (blank) for all other records.)
    ? FNAM: Field Name. The FNAM field is not case-sensitive.
    ? FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
    Transferring data from local file to internal table
    Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
    Population of BDCDATA
    For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
    All these five initial steps are necessary for any type of BDC interface.
    DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
    SESSION METHOD
    About Session method
    In this method you transfer data from internal table to database table through sessions.
    In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
    Unless session is processed, the data is not transferred to database table.
    BDC_OPEN_GROUP
    You create the session through program by BDC_OPEN_GROUP function.
    Parameters to this function are:
    ? User Name: User name
    ? Group: Name of the session
    ? Lock Date: The date on which you want to process the session.
    ? Keep: This parameter is passed as ?X? when you want to retain session after
    processing it or ? ? to delete it after processing.
    BDC_INSERT
    This function creates the session & data is transferred to Session.
    Parameters to this function are:
    ? Tcode: Transaction Name
    ? Dynprotab: BDC Data
    BDC_CLOSE_GROUP
    This function closes the BDC Group. No Parameters.
    Some additional information for session processing
    When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
    However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
    If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
    CALL TRANSACTION
    About CALL TRANSACTION
    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>
    Messages into <MSGTAB>.
    Parameter ? 1 is transaction code.
    Parameter ? 2 is name of BDCTAB table.
    Parameter ? 3 here you are specifying mode in which you execute transaction
    A is all screen mode. All the screen of transaction are displayed.
    N is no screen mode. No screen is displayed when you execute the transaction.
    E is error screen. Only those screens are displayed wherein you have error record.
    Parameter ? 4 here you are specifying update type by which database table is updated.
    S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
    A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
    Parameter ? 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
    1. Tcode: Transaction code
    2. Dyname: Batch point module name
    3. Dynumb: Batch input Dyn number
    4. Msgtyp: Batch input message type (A/E/W/I/S)
    5. Msgspra: Batch input Lang, id of message
    6. Msgid: Message id
    7. MsgvN: Message variables (N = 1 - 4)
    For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
    Steps for CALL TRANSACTION method
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
    4. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tcode> using <BDCTAB>
    Mode <A/N/E>
    Update <S/A>.
    Refresh BDCTAB.
    Endloop.
    (To populate BDCTAB, You need to transfer each and every field)
    The major differences between Session method and Call transaction are as follows:
    SESSION METHOD CALL TRANSACTION
    1. Data is not updated in database table unless Session is processed. Immediate updation in database table.
    2. No sy-subrc is returned. Sy-subrc is returned.
    3. Error log is created for error records. Errors need to be handled explicitly
    4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.
    Error Handling in CALL TRANSACTION
    When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
    Steps for the error handling in CALL TRANSACTION
    1. Internal table for the data (structure similar to your local file)
    2. BDCTAB like BDCDATA
    3. Internal table BDCMSG like BDCMSGCOLL
    4. Internal table similar to Ist internal table
    (Third and fourth steps are for error handling)
    5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
    6. Loop at itab.
    Populate BDCTAB table.
    Call transaction <tr.code> using <Bdctab>
    Mode <A/N/E>
    Update <S/A>
    Messages <BDCMSG>.
    Perform check.
    Refresh BDCTAB.
    Endloop.
    7 Form check.
    IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
    Call function Format_message.
    (This function is called to store the message given by system and to display it along with record)
    Append itab2.
    Display the record and message.
    DIRECT INPUT
    Thanks &regards,
    Sravani

  • Process Order does Confirmations and GR even after the Process order is CNF

    Not Sure why the Formatting is lost.
    Hi Gurus,                                                                               
    I am a beginner in this area and request your help.                                                                               
    We are implementing a project where the process order Confirmation in SAP ECC 5.0 in SAP PPPI module is done using xMII which call the BAPI_PROCORD_CREATE_TT     RFC.
    The customer wants to (certain times) do a final confirmation without actually completing the order e.g if the Order Qty is 100 then, they want to just manufacture 25 and then do a final confirmation, after which SAP GUI screen does not allow any Process order Confirmations against that process order.
    We are using the BAPI_PROCORDCONF_CREATE_TTRFC to do multiple PO Confirmations and GR for particular Process order. Below is a scenario
    Case 1:
    1. Order Qty =100  ( Unlimited Delivery is not checked and tolerance is Zero).
         Which means only 100 is accepted.
    2. 100 Quantities are produced and confirmed using the BAPI_PROCORDCONF_CREATE_TT (with Final confirmation value as 1 , which mean auto confirmation)
    3. Next when the BAPI confirms & GR's against the same order, the Complete qty is not visible in the COR3 status. And is visible only in the COGI transaction.
    That is expected behavior. and i am ok with that.
    Case 2: (The one with the problem)
    1.  Order Qty =100  ( Unlimited Delivery is not checked and tolerance is Zero).
         Which means only the 100 is accepted.
    2.  25 Quantities are produced and confirmed using BAPI_PROCORDCONF_CREATE_TT (with Final Confirmation value as X , which mean Final confirmation)
    3. The Confirmation and GR go through and the status of the process order now changed is CNF and the Deliverd qty is 25.
    At this point , if you logon to SAP GUI and try to make a process order confirmation you get an error messages which says the Process Order is already confirmed and no more confirmations or GR can be done against this Process order.
    4. But when you Again Run the BAPI_PROCORDCONF_CREATE_TT, it goes ahead and confirms and makes the GR for that Process order.
    The Expected Behavior should have been that this quantity is now in the COGI transaction.
    5. The Process order  allows any number of Further confirmations till the Ordered Qty and Delivered quantity are  same .
    so dear gurus I know i have written a very long doubt but would be very happy to get a response from you. I would ideally not like to enhance or change the BAPI and want to understand if I have missed some setting or parameter that I have to pass in the BAPI for the final confirmation so that once the Status of the Process order is CNF , no more Confirmations are allowed even from the BAPI.
    Thanks in Advance.
    Regards
    Suraj

    Hi Suraj,
    I am not positive, but I suspectt the problem lies in the BAPI.  It might be how you have the data set in MII, but it sounded like you are doing it correctly. 
    However there are a number of things you can do to troubleshoot your situation.
    First create a few process orders to test with. 
    Record the confirmation numbers and counters for each of the following:
    1) Do a final confirmation (for quantity of 25 instead of the 100) in CORK (or whichever transaction you are using). 
    2) Do a final confirmation (for quantitiy of 25 instead of the 100) in SE37 or BAPI in ERP using the BAPI_PROCORDCONF_CREATE_TT.
    3) Do a final confirmation (for quantitiy of 25 instead of the 100) from MII using your current transaction. 
    Review the confirmations in ERP to see if there are any differences.
    Review the confirmaitons in MII to see if there are any non visible differences (use a Tracer to retrieve the response segment from an execution of BAPI_PROCORDCONF_GETDETAIL using the recorded confirmation numbers and counters) 
    Case 1) If there are differences in the results, that should tell you how to modify your transaction to include or change the appropriate values in your inputs. 
    Case 2) If there are no differences, then it is most likely that there is something not working properly in the BAPI you are using.  It may not completely replicate the functionality in CORK (or whichever transaction you are using in ERP).  Then open a ticket, because the BAPI is not working as it should.
    Good luck,
    Mike
    Edited by: Michael Appleby on Aug 17, 2009 8:20 PM

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

  • Mass updation of Priority field in the process order header screen

    Hi Friends,
    Can any body knows on how to do mass update the Priority field in the process orders after release.(with out upload using BDC).
    or can we update the priority field in process order during mass release of process orders using  T- code: COHVPI?
    Is there any standard transaction? else please tell me the solution if there is any other way of doing this task.
    thanks&regards,
    Purna

    Purnachander,
    Your requirement can not be fullfilled with any standard transaction.
    BDC is best suitable option.
    Hope this helps you.
    SmanS

  • Error Records in BDC Call transaction

    Hi.....
         I am new to BDC concept... Can any of u tell me how to collect error records in BDC  Call transaction... I already collected error messages through BDCMSGCOL... but  i dont know how to collect those error records... here i am using two different flat files for header and line item...  and kindly tell me if there is an error in line item how to get it so with relevent header details...
    thanks,

    Hi,
          LOOP AT t_bdcmsgcoll INTO w_bdcmsgcoll.
            PERFORM f_format_msg USING w_bdcmsgcoll CHANGING w_return.
         ENDLOOP.
    Form format_msg 
      DATA : l_mstring(480).
      CALL FUNCTION 'FORMAT_MESSAGE'                          
        EXPORTING
          id        = w_bdcmsgcoll-msgid
          lang      = w_bdcmsgcoll-msgspra
          no        = w_bdcmsgcoll-msgnr
          v1        = w_bdcmsgcoll-msgv1
          v2        = w_bdcmsgcoll-msgv2
          v3        = w_bdcmsgcoll-msgv3
          v4        = w_bdcmsgcoll-msgv4
        IMPORTING
          msg       = l_mstring
        EXCEPTIONS
          not_found = 1
          OTHERS    = 2.
    End format_msg 
    you can use the l_mstring to process further and pass to the bapiret2 table
    Regards,
    Vijaya

  • Re: Bdc call transaction

    Hi all can any one give good code and entire process for BDC call transaction method.explain the entire process clearly.
    Thanks&regards
    Sashi

    Hi,
    Check the following code:
    *& Report  Z_BDCP_VENDCALLTRNS
    *& TITLE                 : Vendor Creation BDC Program (Call Transaction Method) *
    *& AUTHOR                : XXXXXXXXXX                               *
    *& DATE OF CREATION      : xx-xx-xxxx                                            *
    *& PROGRAM TYPE          : Executable Program                                    *
                             MODIFICATION LOG                                      *
    *& AUTHOR                :                                                       *
    *& DATE OF CHANGE        :                                                       *
    *& FUNCTIONAL SPECS      :                                                       *
    *& CORRECTIONS REQUEST   :                                                       *
    *& DESCRIPTION OF CHANGE :                                                       *
    REPORT  z14644sd_bdcp_vendcalltrns.
    TYPES: BEGIN OF t_vend,
            lifnr LIKE rf02k-lifnr,    "Vendor Account Number
            ktokk LIKE rf02k-ktokk,    "Vendor account group
            anred LIKE lfa1-anred,     "Title
            name1 LIKE lfa1-name1,     "Vendor Name
            sortl LIKE lfa1-sortl,     "Sort field
            land1 LIKE lfa1-land1,     "Country Key
            spras LIKE lfa1-spras,     "Language Key
            banks TYPE lfbk-banks,     "Bank country key
            bankl TYPE lfbk-bankl,     "bank key
            bankn TYPE lfbk-bankn,     "account number
            END OF t_vend.
    TYPES: BEGIN OF t_sucrec,
            vnum TYPE lfa1-lifnr,      "Vendor Account Number
            vnam TYPE lfa1-name1,      "Vendor Name
            END OF t_sucrec.
    TYPES: BEGIN OF t_errrec,
            err_rec TYPE string,       "Error Record
            lineno TYPE i,             "Line Number
            message TYPE string,       "Error Message
            END OF t_errrec.
    DATA: v_file TYPE string,                                      "Variable for storing flat file
          it_vend TYPE STANDARD TABLE OF t_vend,                   "Internal table of Vendor
          wa_vend LIKE LINE OF it_vend,                            "Workarea of Internal table it_vend
          it_sucrec TYPE STANDARD TABLE OF t_sucrec,               "Internal table of Success records
          wa_sucrec LIKE LINE OF it_sucrec,                        "Workarea of Internal table it_sucrec
          it_errrec TYPE STANDARD TABLE OF t_errrec,
          wa_errrec LIKE LINE OF it_errrec,
          it_bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE,        "Internal table structure of BDCDATA
          it_messagetab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE, "Tracing Error Messages
          v_date LIKE sy-datum,                                    "Controlling of session date
          v_index LIKE sy-index,                                   "Index Number
          v_totrec TYPE i,                                         "Total Records
          v_errrec TYPE i,                                         "Error Records
          v_sucrec TYPE i,                                         "Success Records
          v_sesschk TYPE c.                                        "Session maintenance
    *& SELECTION-SCREEN
    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001 NO INTERVALS.
    PARAMETERS: p_file TYPE rlgrap-filename.    "rlgrap-filename is a predefined structure
    SELECTION-SCREEN: END OF BLOCK blk1.
    SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002 NO INTERVALS.
    PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N',
                p_update LIKE ctu_params-updmode DEFAULT 'A'.
    SELECTION-SCREEN END OF BLOCK blk2.
    *& INITIALIZATION
    INITIALIZATION.
      v_date = sy-datum - 1.
    *& AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_file.
    *& START-OF-SELECTION
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = v_file
          filetype                = 'ASC'
          has_field_separator     = 'X'
        TABLES
          data_tab                = it_vend
        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.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *& END-OF-SELECTION
    END-OF-SELECTION.
      v_index = sy-index.
      LOOP AT it_vend INTO wa_vend.
        PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
        PERFORM bdc_field USING 'RF02K-LIFNR' wa_vend-lifnr.
        PERFORM bdc_field USING 'RF02K-KTOKK' wa_vend-ktokk.
        PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_dynpro USING 'sapmf02k' '0110'.
        PERFORM bdc_field USING 'lfa1-anred' wa_vend-anred.
        PERFORM bdc_field USING 'lfa1-name1' wa_vend-name1.
        PERFORM bdc_field USING 'lfa1-sortl' wa_vend-sortl.
        PERFORM bdc_field USING 'lfa1-land1' wa_vend-land1.
        PERFORM bdc_field USING 'lfa1-spras' wa_vend-spras.
        PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
        PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
        PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
        PERFORM bdc_field USING 'LFBK-BANKS(01)' wa_vend-banks.
        PERFORM bdc_field USING 'LFBK-BANKL(01)' wa_vend-bankl.
        PERFORM bdc_field USING 'LFBK-BANKN(01)' wa_vend-bankn.
        PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
        PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.
        PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field USING 'bdc_okcode' 'UPDA'.
        CALL TRANSACTION 'XK01' USING  it_bdctab
                                MODE   p_mode
                                UPDATE p_update
                                MESSAGES INTO it_messagetab.
        IF sy-subrc = 0.
    *& reading success records to corresponding internal table
          READ TABLE it_messagetab WITH KEY msgtyp = 'S'.
          IF sy-subrc = 0.
            wa_sucrec-vnum = it_messagetab-msgv1.
            wa_sucrec-vnam =  wa_vend-name1.
            APPEND wa_sucrec TO it_sucrec.
            CLEAR wa_sucrec.
          ENDIF.
        ELSE.
    *& reading error records to corresponding internal table
          READ TABLE  it_messagetab WITH KEY msgtyp =  'E'.
          IF sy-subrc = 0.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id  = sy-msgid
                no  = it_messagetab-msgnr
                v1  = it_messagetab-msgv1
                v2  = it_messagetab-msgv2
                v3  = it_messagetab-msgv3
                v4  = it_messagetab-msgv4
              IMPORTING
                msg = wa_errrec-message.
            wa_errrec-lineno = v_index.
            APPEND wa_errrec TO it_errrec.
            CLEAR wa_errrec.
          ENDIF.
        ENDIF.
        CLEAR : it_bdctab, it_messagetab.
        REFRESH: it_bdctab, it_messagetab.
      ENDLOOP.
      DESCRIBE TABLE it_vend LINES v_totrec.
      DESCRIBE TABLE it_errrec LINES v_errrec.
      DESCRIBE TABLE it_sucrec LINES v_sucrec.
      PERFORM disp_data.
      SKIP 2.
      IF v_sucrec > 0.
        PERFORM disp_success_data.
      ENDIF.
      SKIP 2.
      IF v_errrec > 0.
        PERFORM disp_error_data.
      ENDIF.
    *&      Form  bdc_dynpro
          text
         -->P_0104   text
         -->P_0105   text
    FORM bdc_dynpro  USING    program
                              dynpro.
      CLEAR it_bdctab.
      it_bdctab-program  = program.
      it_bdctab-dynpro   = dynpro.
      it_bdctab-dynbegin = 'X'.
      APPEND it_bdctab.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0109   text
         -->P_IT_VEND_LIFNR  text
    FORM bdc_field  USING    fnam
                             fval.
      CLEAR it_bdctab.
      it_bdctab-fnam = fnam.
      it_bdctab-fval = fval.
      APPEND it_bdctab.
    ENDFORM.                    " bdc_field
    *&      Form  disp_data
          text
    -->  p1        text
    <--  p2        text
    FORM disp_data .
      ULINE (45).
      WRITE : / sy-vline,
             18 'SUMMARY'(004) COLOR 1,
             45 sy-vline.
      ULINE /(45).
      WRITE : / sy-vline,
                'Total Records Processed'(007),
             28 '=',
             30 v_totrec,
             45 sy-vline,
              / sy-vline,
                'Error Records'(005),
             28 '=',
             30 v_errrec,
             45 sy-vline,
              / sy-vline,
                'Successful Records'(006),
             28 '=',
             30 v_sucrec,
             45 sy-vline.
      ULINE /(45).
    ENDFORM.                    " disp_data
    *&      Form  disp_success_data
          text
    -->  p1        text
    <--  p2        text
    FORM disp_success_data .
      ULINE (45).
      WRITE : / sy-vline,
             14 'Successful Records'(012) COLOR 1,
             45 sy-vline.
      ULINE /(45).
      WRITE : / sy-vline ,
                'Vendor Number'(010) COLOR 2,
             17 sy-vline,
             25 'Vendor Name'(011) COLOR 2,
             45 sy-vline.
      ULINE /(45).
      LOOP AT it_sucrec INTO wa_sucrec.
        WRITE: / sy-vline ,
                 wa_sucrec-vnum,
              17 sy-vline,
              19 wa_sucrec-vnam,
              45 sy-vline.
      ENDLOOP.
      ULINE /(45).
    ENDFORM.                    " disp_success_data
    *&      Form  disp_error_data
          text
    -->  p1        text
    <--  p2        text
    FORM disp_error_data .
      ULINE (85).
      WRITE : / sy-vline,
             35 'Error Records'(013) COLOR 1,
             85 sy-vline.
      ULINE /(85).
      WRITE : / sy-vline,
                'Record Number'(008) COLOR 2,
                sy-vline,
             37 'Reason for error'(009) COLOR 2,
             85 sy-vline.
      ULINE /(85).
      LOOP AT it_errrec INTO wa_errrec.
        WRITE : / sy-vline,
                  wa_errrec-lineno,
               17 sy-vline,
                  wa_errrec-message,
               85 sy-vline.
      ENDLOOP.
      ULINE /(85).
    ENDFORM.                    " disp_error_data
    Regards,
    Bhaskar

  • Error While Uploading Material Master Through Bdc Call Transaction

    Hi Sap Gurus,
    I am doing Bdc call Transaction for Material Master Uploading.
    But After Entering data for 4-5 screen i got a error_
    Field Mara-iprkz doesn,t exit in the screen saplmgmm 4000
    Field Mara-prctr doesn,t exit in the screen saplmgmm 4000
    Field Mbew-stprs doesn,t exit in the screen saplmgmm 4000
    Field Marc-mtvfe doesn,t exit in the screen saplmgmm 4000
    Enter Valuation class.
    This is my Programme....................................
    <removed by moderator>
    Thanks in advance.
    Arindam
    Moderator message: please post only relevant code parts, your post must be less than 5000 characters to preserve formatting.
    Edited by: Thomas Zloch on Apr 16, 2011 9:29 PM

    Sorry for my obvious answer, but you should ask a more precise question.
    Your errors are that you try to enter fields but they don't exist, so it sounds logic.
    And the error "Enter Valuation class." means that the field is mandatory. So you must enter it.
    Re-record the transaction using SHDB (eventually play with the http://wiki.sdn.sap.com/wiki/display/ABAP/Recordduringplay), run it in A display mode, and correct your program.
    Sandra
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MVKE-SKTOF'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MARC-PRCTR'
                                  wa_mara-prctr."'MUMBAI'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'MARA-IPRKZ'
                                  'D'.

Maybe you are looking for