Parameter ID to store OK code for call transaction

Hi All,
Does anybody know which parameter ID is used to store last OK code value for call tansaction VD02? In a customize program I use statement CALL TRANSACTION 'XD02'. Now I have to send an email notification if user click the save button and customers is chnaged successfully. In all other cases like back, exit there should not be any email notififcation. Any solution.
Regards,
Seema

Hi,
There is not specific parameter id to store last OK code.
But since you have a the BDCDATA internal table in the program you can get the last entry and check if it save or not and do further processing based on it.
Regards
Sudhir Alturu

Similar Messages

  • Hi guys please give me sample code for call transaction that handles error

    hi guys, please give me sample code for call transaction that handles error,
    please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.
    please do help me as it is urgent.
    thanks and regards.
    prasadnn.

    Hi Prasad,
    Check this code.
    Source Code for BDC using Call Transaction
    *Code used to create BDC
    *& Report  ZBDC_EXAMPLE                                                *
    *& Example BDC program, which updates net price of item 00010 of a     *
    *& particular Purchase order(EBELN).                                   *
    REPORT  ZBDC_EXAMPLE  NO STANDARD PAGE HEADING
                          LINE-SIZE 132.
    Data declaration
    TABLES: ekko, ekpo.
    TYPES: BEGIN OF t_ekko,
        ebeln TYPE ekko-ebeln,
        waers TYPE ekko-waers,
        netpr TYPE ekpo-netpr,
        err_msg(73) TYPE c,
    END OF t_ekko.
    DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko  TYPE t_ekko,
          it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_error TYPE t_ekko,
          it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_success TYPE t_ekko.
    DATA: w_textout            LIKE t100-text.
    DATA: gd_update TYPE i,
          gd_lines TYPE i.
    *Used to store BDC data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Used to stores error information from CALL TRANSACTION Function Module
    DATA: BEGIN OF messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    *Screen declaration
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                        TITLE text-001. "Purchase order Num
    SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
                                        TITLE text-002. "New NETPR value
    PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.
    SELECTION-SCREEN END OF BLOCK block2.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Retrieve data from Purchase order table(EKKO)
      SELECT ekkoebeln ekkowaers ekpo~netpr
        INTO TABLE it_ekko
        FROM ekko AS ekko INNER JOIN ekpo AS ekpo
          ON ekpoebeln EQ ekkoebeln
       WHERE ekko~ebeln IN so_ebeln AND
             ekpo~ebelp EQ '10'.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Check data has been retrieved ready for processing
      DESCRIBE TABLE it_ekko LINES gd_lines.
      IF gd_lines LE 0.
      Display message if no data has been retrieved
        MESSAGE i003(zp) WITH 'No Records Found'(001).
        LEAVE TO SCREEN 0.
      ELSE.
      Update Customer master data (instalment text)
        LOOP AT it_ekko INTO wa_ekko.
          PERFORM bdc_update.
        ENDLOOP.
      Display message confirming number of records updated
        IF gd_update GT 1.
          MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
        ELSE.
          MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
        ENDIF.
    Display Success Report
      Check Success table
        DESCRIBE TABLE it_success LINES gd_lines.
        IF gd_lines GT 0.
        Display result report column headings
          PERFORM display_column_headings.
        Display result report
          PERFORM display_report.
        ENDIF.
    Display Error Report
      Check errors table
        DESCRIBE TABLE it_error LINES gd_lines.
      If errors exist then display errors report
        IF gd_lines GT 0.
        Display errors report
          PERFORM display_error_headings.
          PERFORM display_error_report.
        ENDIF.
      ENDIF.
    *&      Form  DISPLAY_COLUMN_HEADINGS
          Display column headings
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records updated successfully:'(013).
      WRITE:/ sy-uline(42).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(004), sy-vline,
              (11) 'Old Netpr'(005), sy-vline,
              (11) 'New Netpr'(006), sy-vline.
      WRITE:/ sy-uline(42).
    ENDFORM.                    " DISPLAY_COLUMN_HEADINGS
    *&      Form  BDC_UPDATE
          Populate BDC table and call transaction ME22
    FORM bdc_update.
      PERFORM dynpro USING:
          'X'   'SAPMM06E'        '0105',
          ' '   'BDC_CURSOR'      'RM06E-BSTNR',
          ' '   'RM06E-BSTNR'     wa_ekko-ebeln,
          ' '   'BDC_OKCODE'      '/00',                      "OK code
          'X'   'SAPMM06E'        '0120',
          ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',
          ' '   'EKPO-NETPR(01)'  p_newpr,
          ' '   'BDC_OKCODE'      '=BU'.                      "OK code
    Call transaction to update customer instalment text
      CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
             MESSAGES INTO messtab.
    Check if update was succesful
      IF sy-subrc EQ 0.
        ADD 1 TO gd_update.
        APPEND wa_ekko TO it_success.
      ELSE.
      Retrieve error messages displayed during BDC update
        LOOP AT messtab WHERE msgtyp = 'E'.
        Builds actual message based on info returned from Call transaction
          CALL FUNCTION 'MESSAGE_TEXT_BUILD'
               EXPORTING
                    msgid               = messtab-msgid
                    msgnr               = messtab-msgnr
                    msgv1               = messtab-msgv1
                    msgv2               = messtab-msgv2
                    msgv3               = messtab-msgv3
                    msgv4               = messtab-msgv4
               IMPORTING
                    message_text_output = w_textout.
        ENDLOOP.
      Build error table ready for output
        wa_error = wa_ekko.
        wa_error-err_msg = w_textout.
        APPEND wa_error TO it_error.
        CLEAR: wa_error.
      ENDIF.
    Clear bdc date table
      CLEAR: bdc_tab.
      REFRESH: bdc_tab.
    ENDFORM.                    " BDC_UPDATE
          FORM DYNPRO                                                   *
          stores values to bdc table                                    *
    -->  DYNBEGIN                                                      *
    -->  NAME                                                          *
    -->  VALUE                                                         *
    FORM dynpro USING    dynbegin name value.
      IF dynbegin = 'X'.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-program,
               value TO bdc_tab-dynpro,
               'X'  TO bdc_tab-dynbegin.
        APPEND bdc_tab.
      ELSE.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-fnam,
               value TO bdc_tab-fval.
        APPEND bdc_tab.
      ENDIF.
    ENDFORM.                               " DYNPRO
    *&      Form  DISPLAY_REPORT
          Display Report
    FORM display_report.
      FORMAT COLOR COL_NORMAL.
    Loop at data table
      LOOP AT it_success INTO wa_success.
        WRITE:/      sy-vline,
                (10) wa_success-ebeln, sy-vline,
                (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
                (11) p_newpr, sy-vline.
        CLEAR: wa_success.
      ENDLOOP.
      WRITE:/ sy-uline(42).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  DISPLAY_ERROR_REPORT
          Display error report data
    FORM display_error_report.
      LOOP AT it_error INTO wa_error.
        WRITE:/      sy-vline,
                (10) wa_error-ebeln, sy-vline,
                (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
                (73) wa_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    ENDFORM.                    " DISPLAY_ERROR_REPORT
    *&      Form  DISPLAY_ERROR_HEADINGS
          Display error report headings
    FORM display_error_headings.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(009), sy-vline,
              (11) 'Netpr'(010), sy-vline,
              (73) 'Error Message'(012), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    " DISPLAY_ERROR_HEADINGS
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

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

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

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

  • Want to code for call transaction and session method

    my requriment is i upload a data by call tran. but i want to error handling through  session method pls give the code and i want to flat file also. 
    asap.
    a.k

    I suggest you try fulfilling your requirements yourself and come back with specific problems along the way.

  • When we have to go for session method, when we have to go for call transact

    when we have to go for session method, when we have to go for call transaction method if i have a 3000 records in flat file. which is better? why

    Data Transfer
    During the process of data transfer, data is transferred into the SAP R/3 System. This transfer is from an external system to SAP R/3 system. Whenever you transfer data from an external system into an R/3 System, you can use data transfer because it is installed and regularly transfers data from an external system into an R/3 System.
    As discussed, with the help of BDC, you can transfer the required data from a non-SAP system to an SAP system. For this kind of data transfer you are required to write an ABAP program. This ABAP program would help to export the concerned data to a sequential dataset file. The data in this file has to be stored. This should be stored in a format, which is acceptable to SAP batch input program. But, to transfer data from a SAP system to another SAP system, you can take the aid of RFC or CPI-C.
    SAP application supports the data transfer of numerous SAP business objects. The said data transfer program specifies the data format definition, which is necessary to import the data into the R/3 System. There are three methods available for transferring data:
    Direct Input:
    In this method the SAP function modules execute the consistency checks. However, there are other means of checking with the help of screens. The Direct Input Method has considerable performance advantages.
    Call Transaction:
    In this method you can check the data consistency with the help of screen logic.
    Batch Input Session:
    In this method data consistency is checked with the help of screen logic.
    Direct Input Method
    Among the methods of data transfer through BDC, direct input method is the one that is used, especially in case of transferring large amount of data. In order to enhance the batch input procedure, the system offers you with the direct input technique.
    There is a distinction between the batch input technique and this technique. Unlike batch input technique, this technique does not create sessions. Instead, it stores the data directly. Moreover, it does not process screens. The data has to be entered directly into the corresponding database tables. The system calls a number of function modules which execute necessary checks, if any required. In the case of errors, the direct input technique has a facility to restart the entire mechanism. However, if you want to restart the entire mechanism in case you faced an error, then direct input programs must be executed in the background only. One has to use program RBMVSHOW or Transaction BMV0 to maintain and start these programs.
    Call Transaction Method
    Call Transaction method is another method used for Data Transfer. In this type of method your program will use the ABAP statement CALL TRANSACTION USING in order to run a SAP transaction. In this type external data need not be deposited in a session for being processed later on. Instead, the entire batch input process takes place inline in your program.
    Here, the data transfer program must convert the data that has to be transferred into the SAP system. This is as per requirement by the SAP data structure or the transaction which is using it. It is to be remembered that a conversion of the data types may be necessary at different times during the process.
    Suppose there is a data type mismatch then you have to convert the data types to type C. In this regard the data transfer program should be capable of exporting the data in SAP format to the sequential file. At the time of uploading the data into the SAP system, the BDC program reads the data from the abovementioned sequential file.
    Batch Input Session Method
    This is the third method for data transfer. If you use the batch input method to transfer data, then you should remember that an ABAP program has to read the external data which is to be entered in the R/3 System. Subsequently, it stores the concerned data a "batch input session." The batch Input session records the actions which are required in the process of transferring data into the system. This can be done by using normal SAP transactions.
    As soon as the program generates the said session, you will be able to run the session in order to execute the SAP transactions in it. Moreover, you can start the session, and at the same time, can monitor a session with the help of batch input management function. For this you have to choose:
    System à Services à Batch input. Moreover, you can have the session run in the background processing.
    Writing a Data Transfer Program
    If you want to write a data transfer program, you have to follow the steps mentioned below.
    Firstly, you will analyze the structure of the existing data. Subsequently, your job is to specify the conversions, which are essential to fill the SAP data structures.
    Secondly, you have to generate the SAP data structure. In case the program is written in ABAP, you will require only the required tables in the concerned program with the help of TABLES statement.
    Thirdly, you will have to initialize the SAP data structure.
    Fourthly, fill the structure with data, performing any conversions and error checking that are required.
    Finally, you will write the sequential file. In the SAP system this sequential file is typically required for making the data available to the batch input program.
    Batch Input Method
    Batch input method is a type of data transfer method. It is used for bulk data transfer; it is one of the primary ways by which data can transferred into the R/3 System. This method is not for near real-time data transfers.
    There are various typical uses of batch input. One of the ways includes the one-time import of data. This import of data is from a legacy system into a newly installed R/3 System. In addition to it, another typical use is for periodic (i.e. hourly, daily..., and so on) transfers of data. These transfers are from external systems or legacy systems which are still in use into R/3 system where all enterprise data is consolidated.
    The R/3 applications deliver different programs for batch input, which are ready to be used. However, in some cases a customer has to write his or her own batch input program. This is required in order to convert the concerned data from a legacy System or from a proprietary format into an R/3 data format.
    The process flows for a batch input are discussed below.
    Data Transfer Decision-Making: It is with a decision to transfer data from an external source into R/3 that the process of batch input begins. It is probable that the external source may be a legacy system that is being replaced. A one-time bulk data transfer is foreseen in this regard. Alternatively, the external source may be an external system that is to remain in use. In this case, a regularly recurring bulk data transfer is foreseen.
    Setting up Batch-Input for Data Transfers: If R/3 standard one-time or regular data transfers are required, then by means of customizing settings in the R/3 Customizing System in SAP ASAP set up will occur. You must set up custom batch input procedures by hand, which means the system administrator must schedule the data conversion program that creates the batch input session. The system administrator and the batch input programmer must determine the following: how frequently data is made available from the external system, how frequently the conversion program should run, and whether the conversion program runs in R/3 (ABAP program) or in a host system (external program).
    Processing Batch Input Sessions: When a batch input session is processed, then the actual transfer of data into R/3 takes place. Little attention is required in processing of batch input sessions by the system administrator. Usually, the starting of batch input sessions is automated by the system administrator. If necessary, the administrators can also start batch input session explicitly from transaction SM35.
    Checking Batch Input Sessions: For a system administrator the routine activity is to check daily or more frequently in transaction SM35 whether all batch input sessions have been completed successfully. It is the schedule for running batch input sessions on which the schedule for checking sessions depends upon. For doing this check the R/3 System provides easy-to-use batch input management tools.
    Analyzing Errors: It is the duty of the system administrator to analyze the problem if one or more transactions in a session end in errors. Usually, the assistance of the affected data entry specialist or department for this analysis will be needed by the system administrator. In the situation where the problem was caused by incorrect data conversion or incorrect generation of the batch input session then the programmer who wrote the data conversion program may also need to be involved.
    Error Handling in Batch Input Method
    It is found that most problems usually fall into one of the following two categories discussed below.
    In this case either required data is missing from the batch-input session or invalid data has been included in the session. Errors in the data conversion program or the presence of unexpected types of data or incorrect data in the legacy database are the possible external causes of this type of problem. Within R/3, the causes for this type of problem include incorrect or incomplete customizing in an application. For example, a legacy data type may not have been foreseen in the check table entries made in application customizing.
    This case mainly includes technical/programming problems. The data is entered by a batch input session by running R/3 transactions non-interactively. Therefore, a typical technical or programming problem is the incorrect identification of one of the data fields in a transaction. Thus, the conversion program may not fill a required data field or may have provided invalid values.
    Conclusion
    I have gone through the details of batch data communication and various methods used to transfer data. One can make use of BDC to transfer data from a SAP to SAP system. In addition, it can transfer data from a non SAP system to SAP system too. I have discussed the various methods of BDC and the error handling in the respective methods.
    Thanks,
    Shankar

  • BDC code for MM01 Transaction

    Hi All,,
                 Please give Entire BDC code for MM01 Transaction.
    i will change as per my requirement.
    I think this is already done by some ABAP Consultants.
    plz dont give answers like do recording for that transaction MM01. I know recording...
    For time constraiint, I have to complete soon.....
    Thanks in Advance
    BestRegards,
    Anil

    Hi,
    The below code is using the Session Method
    report ZDS_BDC_MM01
           no standard page heading line-size 255.
    include bdcrecx1.
    *parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record OCCURS 0,
    * data element: MATNR
            MATNR_001(018),
    * data element: MBRSH
            MBRSH_002(001),
    * data element: MTART
            MTART_003(004),
    * data element: XFELD
            KZSEL_01_004(001),
    * data element: XFELD
            KZSEL_02_005(001),
    * data element: MAKTX
            MAKTX_006(040),
    * data element: MEINS
            MEINS_007(003),
    * data element: MAKTX
            MAKTX_008(040),
          end of record.
    *** End generated data section ***
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      ='C:\DHRUV.TXT'
       FILETYPE                      = 'DAT'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = RECORD
    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.
    *do.
    LOOP AT record.
    *read dataset dataset into record.
    if sy-subrc <> 0. exit. endif.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_004.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(02)'
                                  record-KZSEL_02_005.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_006.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_007.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_008.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'MM01'.
    *enddo.
    ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    *Text elements
    * E00 Error opening dataset, return code:
    * I01 Session name
    * I02 Open session
    * I03 Insert transaction
    * I04 Close Session
    * I05 Return code =
    * I06 Error session created
    * S01 Session name
    * S02 User
    * S03 Keep session
    * S04 Lock date
    * S05 Processing Mode
    * S06 Update Mode
    * S07 Generate session
    * S08 Call transaction
    * S09 Error sessn
    * S10 Nodata indicator
    * S11 Short log
    *Messages
    * Message class: MS
    *613   Please enter a session name and user name
    The Below is the coding for the Call Transaction...
    report ZDS_BDC_MM01_2
           no standard page heading line-size 255.
    *include bdcrecx1.
    *parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record OCCURS 0,
    * data element: MATNR
            MATNR_001(018),
    * data element: MBRSH
            MBRSH_002(001),
    * data element: MTART
            MTART_003(004),
    * data element: XFELD
            KZSEL_01_004(001),
    * data element: MAKTX
            MAKTX_005(040),
    * data element: MEINS
            MEINS_006(003),
    * data element: MTPOS_MARA
            MTPOS_MARA_007(004),
          end of record.
    DATA: FLNAME TYPE STRING.
    *** End generated data section ***
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
    *** MESSAGE******
    DATA: BEGIN OF MESSTAB OCCURS 0.
            INCLUDE STRUCTURE BDCMSGCOLL.
            DATA: MATNR TYPE MARA-MATNR,
          END OF MESSTAB.
    ****END OF MESSAGE****
    PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
      CALL FUNCTION 'F4_FILENAME'
       IMPORTING
         FILE_NAME           = FILENAME.
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    FLNAME = FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FLNAME
        FILETYPE                      = 'DAT'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = record
    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.
    LOOP AT record.
      DATA:
        CNT TYPE I.
        CNT = CNT + 1.
        REFRESH BDCDATA.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MTART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_006.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-MTPOS_MARA_007.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    *perform bdc_transaction using 'MM01'.
    CALL TRANSACTION 'MM01' USING BDCDATA
                            MODE 'N'
                            UPDATE 'A'
                            MESSAGES INTO MESSTAB.
    READ TABLE MESSTAB INTO MESSTAB INDEX CNT.
       IF MESSTAB-MSGTYP = 'E'.
         MESSTAB-MATNR = RECORD-MATNR_001.
         MODIFY MESSTAB INDEX CNT FROM MESSTAB. " TRANSPORTING MATNR.
       ENDIF.
    ENDLOOP.
    FORM OPEN_GROUP.
      CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = 'MM01'
                        USER     = SY-UNAME
                        KEEP     = 'X'.
    ENDFORM.
    FORM BDC_INSERT.
      CALL FUNCTION 'BDC_INSERT'
       EXPORTING
         TCODE                  = 'MM01'
    *     POST_LOCAL             = NOVBLOCAL
    *     PRINTING               = NOPRINT
    *     SIMUBATCH              = ' '
    *     CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = BDCDATA
       EXCEPTIONS
         INTERNAL_ERROR         = 1
         NOT_OPEN               = 2
         QUEUE_ERROR            = 3
         TCODE_INVALID          = 4
         PRINTING_INVALID       = 5
         POSTING_INVALID        = 6
         OTHERS                 = 7
      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.
    END-OF-SELECTION.
    LOOP AT MESSTAB.
        IF MESSTAB-MSGTYP = 'E'.
          WRITE:/ 'ERROR OCCURED ON MATNR = ',MESSTAB-MATNR , 'MESSAGE : MATNR ALREADY EXISTS IN MARA!!!'.
        ENDIF.
      ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    *&      Form  close_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
       NOT_OPEN          = 1
       QUEUE_ERROR       = 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.                    " close_group
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0270   text
    *      -->P_0271   text
    FORM bdc_dynpro  USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    *      -->P_0275   text
    *      -->P_0276   text
    FORM bdc_field  USING  FNAM FVAL.
      IF FVAL <> ' '.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    " bdc_field
    *Text elements
    * E00 Error opening dataset, return code:
    * I01 Session name
    * I02 Open session
    * I03 Insert transaction
    * I04 Close Session
    * I05 Return code =
    * I06 Error session created
    * S01 Session name
    * S02 User
    * S03 Keep session
    * S04 Lock date
    * S05 Processing Mode
    * S06 Update Mode
    * S07 Generate session
    * S08 Call transaction
    * S09 Error sessn
    * S10 Nodata indicator
    * S11 Short log
    HTH
    Regards,
    Dhruv Shah

  • Program for call transaction method

    can any body  help  me , how to write a  call transaction method . how to create error logs for call transaction method

    hi
    REPORT  ZCALL.
    TYPES : BEGIN OF itab,
    lifnr TYPE rf02k-lifnr,
    ktokk TYPE rf02k-ktokk,
    END OF itab.
    DATA : i_tab TYPE TABLE OF itab INITIAL SIZE 0,
    wa_tab TYPE itab.
    DATA : i_bdc TYPE TABLE OF bdcdata INITIAL SIZE 0,
    wa_bdc TYPE bdcdata.
    DATA : i_message LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
    wa_message TYPE bdcmsgcoll.
    DATA : fname TYPE string VALUE 'd:\manish.txt'.
    DATA: p_text(100) TYPE c.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = fname
    filetype = 'ASC'
    has_field_separator = 'X'
    TABLES
    data_tab = i_tab.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT i_tab INTO wa_tab.
    PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
    PERFORM bdc_field USING 'RF02K-LIFNR' wa_tab-lifnr.
    PERFORM bdc_field USING 'RF02K-KTOKK' wa_tab-ktokk.
    PERFORM bdc_field USING 'BDC_OKCODE' '= AUSW'.
    CALL TRANSACTION 'XK01' USING i_bdc MODE 'N'. " UPDATE 'S' MESSAGES
    "INTO i_message.
    REFRESH i_bdc.
    ENDLOOP.
    IF sy-subrc NE 0.
    READ TABLE i_message WITH KEY msgtyp = 'E'.
    IF sy-subrc = 0.
    LOOP AT i_message INTO wa_message.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = i_message-msgid
    lang = 'EN'
    no = i_message-msgnr
    v1 = i_message-msgv1
    v2 = i_message-msgv2
    v3 = i_message-msgv3
    v4 = i_message-msgv4
    IMPORTING
    msg = p_text
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    WRITE:/ p_text.
    ENDLOOP.
    ENDIF.
    ENDIF.
    *& Form bdc_dynpro
    text
    -->PROGRAM text
    -->DYNPRO text
    FORM bdc_dynpro USING program dynpro.
    CLEAR wa_bdc.
    wa_bdc-program = program.
    wa_bdc-dynpro = dynpro.
    wa_bdc-dynbegin = 'X'.
    APPEND wa_bdc TO i_bdc.
    ENDFORM. "bdc_dynpro
    *& Form bdc_field
    text
    -->FNAM text
    -->FVAL text
    reward if u find useful
    regards
    Nagesh.Paruchuri

  • How to create a background job for call transaction

    hi gurus
    can any one suggest me
    how to create the background job for call transaction.
    thank you
    regards
    kals.

    Hi,
       Refer
    https://forums.sdn.sap.com/click.jspa?searchID=10926107&messageID=889652
    Regards
    Kiran Sure

  • OTL: Timecard Audit Template require reason code for all transaction.

    We are currently using OTL with CLA template with interface time entry from external system.
    When monthly time entry interfaced into OTL each employee have to review and update their time and submit to manager, but when process to audit template they has been forced to update reason code for all transactions.
    We suppose to update the reason code only for the modified transactions. Please help me.
    Nonny.

    nondhasid,
    If you are not modifying those records which are asking for a reason field to be filled, then it should be coming from the Late setup. Check the CLA setup.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                       

  • Blocking a company code for all transactions.

    A compnay code is having two plants assigned. No open documents in that company code.
    How to block the company code for any transactions including purchase document creation?
    However all the past data to be available for viewing and reference.
    Thanks in advance.
    Narasimharao

    Dear Narasimharao ,
    You can remove authorization from user profile to use this company code.
    And when someone try to save any documents , error message will be send.
    hope this could help you.
    best regards,
    Carlos Moçatto

  • How look the  flat  file for CALL Transaction

    Hi  ABAPERS
    i am new for BDC i want to know how the flat file format for call transaction execution.
    if any one have sample flat file data for any transaction please send me.

    Hi,
    The file format differ for different transaction. Basically you can have the field in any order. It matters how you upload into SAP. Use the function module GUI_UPLOAD to upload the flat file.
    Please see this sites for more info.
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    Help with BDCs and flat files.....
    Cheers
    Vinod
    Message was edited by: Vinod C

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • Issue in background job for call transaction

    Dear All,
    I am facing a strange issue with call transaction. I need to add some Purchase requisitons in the APO using Call transactionmethod. It is working fine In All screen mode and No Screen Mode. But when I schedule the program in BAckground processing it is not wokring fine. It is not creating any Purchase requisitioins. When I debug the background Job it is creating Purchase requisitions.
    Please find the code below
        DATA: l_wa_params TYPE ctu_params.
        l_wa_params-dismode = l_c_mode.
        l_wa_params-updmode = 'A'.
        l_wa_params-defsize = 'X'.
        l_wa_params-racommit = 'X'.
        CALL TRANSACTION '/SAPAPO/RRP3' USING fp_i_bdcdata OPTIONS FROM l_wa_params
                                            MESSAGES INTO l_i_bdcmsgcoll.

    Hi,
    I have exactly the same problem with transaction /SAPAPO/RRP5.
    Thanks in advance for your help,
    Yannick CAREL

  • Added code for VA01 transaction ----in the include MV45AFZZ

    Hi All,
    I have added the code for pop-up
    if the quantity is greter than 20000 then we need to give the confirm pop-up.
    for that i have added code like this.
    When we clik on YES it will save the order.
    suppose if i clik on NO then i need to change the quantiy value.
    Whats needs to be doing for this.
    Please help me on this.
    IF ( vbak-vkorg = 'CA01' OR vbak-vkorg = 'CA02' OR
           vbak-vkorg = 'CA03' ).
        IF vbak-netwr > '50000.00'.  "Comparing quatity value
          w_txt = 'Order Quantity exceeded 50000 CAD. Please confirm'.
          w_txt1 = 'Order Quantity Check'.
           MESSAGE w901(zmsg1) WITH '50,000.00 CAD'.
          CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
               EXPORTING
                   defaultoption  = 'Y'
                    textline1      = w_txt
                    TEXTLINE2      = ' '
                    titel          = w_txt1
                    START_COLUMN   = 25
                    START_ROW      = 6
                   cancel_display = ' '
              IMPORTING
                   answer         = w_ans.
          CASE w_ans.
            WHEN 'J'.  "<b>This is for COnfirm means Yes</b>
               CONTINUE.
            WHEN 'N'.  "<b>This is for NO</b>
                SET SCREEN 4008.
               CALL SCREEN  4008.
                LEAVE TO SCREEN 4008.
    Thanks
    Sriman.

    Hi,
    I assume that you are writing this code in "<b>USEREXIT_SAVE_DOCUMENT_PREPARE</b>". If not that first thing you do is move your code here.
    The next thing is modify your code like this
    IF ( vbak-vkorg = 'CA01' OR vbak-vkorg = 'CA02' OR
         vbak-vkorg = 'CA03' ).
      DATA: lv_screenno TYPE syst-dynnr.
      IF vbak-netwr > '50000.00'.
        w_txt  = 'Order Quantity exceeded 50000 CAD. Please confirm'.
        w_txt1 = 'Order Quantity Check'.
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  defaultoption  = 'Y'
                  textline1      = w_txt
                  titel          = w_txt1
                  cancel_display = ' '
             IMPORTING
                  answer         = w_ans.
        CASE w_ans.
          WHEN 'J'. "This is for COnfirm means Yes
          WHEN 'N'. "This is for NO
    *        SET SCREEN 4008.        "Remove this line
    *        LEAVE TO SCREEN 4008.   "Remove this line
    *" No need to define variable FCODE again,
    *" it is alreay define in MV45ACOM
            fcode = 'ENT1'.   "sy-ucomm.  Add this line
            lv_screenno = sy-dynnr.       "Add this line
            LEAVE TO SCREEN lv_screenno.  "Add this line
        ENDCASE.
      ENDIF.
    ENDIF.
    Let me know if you have any question.
    Regards,
    RS

  • Setting up paying co codes for payment transactions

    When i try to set up another co code as the paying co code for my main co code, it says co code 3740 is not permitted as the paying co code. Please advise. thanks.

    Hello
    Are you using two different company codes i.e. the paying company code and the sending company code. And if so are they in different countries. If thats the case then the error would appear. As in FBZP, when two company codes are involved they are to be in one country.
    Is the error code F3063.
    There is one note which is 121615
    Moreover if it is more than 2 countries you want to bring in to the scenario would be better to seek SAP help by raising an OSS.
    Rgds

Maybe you are looking for

  • Edit Multiple Frames

    I am working on a flash intro for a customer, and i've noticed a spelling error that continues through approx. 200 frames. Is there a way I can edit all of the frames at the same time and just correct the spelling error once? I tried selecting all of

  • Database Adapter calling stored procedure with xmlDOM.DOMNODE input problem

    Hi all, I have been asked to do a POC on using SOA suite to generate a web-service for several database stored procedure. A few of them can be done without a fuss. But I am now stuck with a stored procedure that has input and output as xmlDOM.DOMNODE

  • Profit center group wise

    my client requirment is to view the profit center group wise balance sheet  .please suggest me how to configu  with report writer

  • Multiple FDM users processing in one location, period, year, scenario

    Can more than one user go through a process flow for the same location, period, year, scenario with separate data files (i.e. different entities for different locations)? How does FDM handle the queue process? Any best practice suggestions for the pr

  • Transform wont work

    Not sure why this is happening. I am working on my first home movie for my mom and all seems fairly straightforward at this point, save on issue. For whatever reason, I can't transform one clip. I have been transforming (zoomin in, motion keys, etc)