Uploading entries into table using bdc

hi,
I have save the recording first in the bdc and i got the source code in program. i want to add more entries multiple into the same tabel "zmat". with different zmatcode & zmat-zdesp.
please help me how to write the code. or what changes i have to do.
report ZRAJESH_BDC_01
       no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro      using 'SAPLZMAT' '0002'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZMATCODE(01)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=NEWL'.
perform bdc_dynpro      using 'SAPLZMAT' '0003'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZDESP'.
perform bdc_field       using 'BDC_OKCODE'
                              '=SAVE'.
perform bdc_field       using 'ZMAT-ZMATCODE'
                              'rajeshswami'.
perform bdc_field       using 'ZMAT-ZDESP'
                              'test 1001'.
perform bdc_dynpro      using 'SAPLZMAT' '0003'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZDESP'.
perform bdc_field       using 'BDC_OKCODE'
                              '=NEXT'.
perform bdc_field       using 'ZMAT-ZDESP'
                              'TEST 1001'.
perform bdc_dynpro      using 'SAPLZMAT' '0003'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZDESP'.
perform bdc_field       using 'BDC_OKCODE'
                              '=SAVE'.
perform bdc_field       using 'ZMAT-ZMATCODE'
                              'ram 0001'.
perform bdc_field       using 'ZMAT-ZDESP'
                              'test 0001'.
perform bdc_dynpro      using 'SAPLZMAT' '0003'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZDESP'.
perform bdc_field       using 'BDC_OKCODE'
                              '=UEBE'.
perform bdc_field       using 'ZMAT-ZDESP'
                              'TEST 0001'.
perform bdc_dynpro      using 'SAPLZMAT' '0002'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZMATCODE(02)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=BACK'.
perform bdc_dynpro      using 'SAPLZMAT' '0002'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZMAT-ZMATCODE(02)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=BACK'.
perform bdc_transaction using 'ZMAT'.
perform close_group.

hi archana , first thanks for helping me.
well this the code which i wrote.
report ZRAJESH_07 &
       no standard page heading line-size 255. &
PARAMETERS: zcode type ZMAT-ZMATCODE, &
            zdesp type ZMAT-ZDESP. &
data: itab type table of zmat, &
      wa_itab like line of itab. &
include bdcrecx1. &
start-of-selection. &
perform open_group. &
perform bdc_dynpro      using 'SAPLZMAT' '0002'. &
perform bdc_field       using 'BDC_CURSOR' &
                              'VIM_POSITION_INFO'. &
perform bdc_field       using 'BDC_OKCODE' &
                              '=NEWL'. &
perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
perform bdc_field       using 'BDC_CURSOR' &
                              'ZMAT-ZDESP'. &
perform bdc_field       using 'BDC_OKCODE' &
                              '=SAVE'. &
perform bdc_field       using 'ZMAT-ZMATCODE' &
                              'raj1'. &
perform bdc_field       using 'ZMAT-ZDESP' &
                              'test raj'. &
perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
perform bdc_field       using 'BDC_CURSOR' &
                              'ZMAT-ZDESP'. &
perform update_nextdata using 'zcode' 'zdesp'. &
perform bdc_transaction using 'ZMAT1'. &
perform close_group. &
form update_nextdata using wa_itab-ZMATCODE wa_itab-ZMAT-ZDESP. &
  loop at itab into wa_itab. &
perform bdc_field       using 'BDC_OKCODE' &
                              '=NEXT'.
*perform bdc_field       using 'ZMAT-ZDESP' &
                             'TEST RAJ'.
perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
perform bdc_field       using 'BDC_CURSOR' &
                              'ZMAT-ZDESP'. &
perform bdc_field       using 'BDC_OKCODE' &
                              '=SAVE'. &
perform bdc_field       using 'ZMAT-ZMATCODE' &
                              wa_itab-ZMATCODE. &
perform bdc_field       using 'ZMAT-ZDESP' &
                              wa_itab-ZDESP. &
perform bdc_dynpro      using 'SAPLZMAT' '0003'. &
perform bdc_field       using 'BDC_CURSOR' &
                              'ZMAT-ZDESP'. &
perform bdc_field       using 'BDC_OKCODE' &
                              '=ENDE'. &
perform bdc_field       using 'ZMAT-ZDESP' &
                              'RAJ2 TEST'. &
endloop. &
endform. &
regards,
<<Email address removed>>
Edited by: Matt on Mar 4, 2010 3:41 PM

Similar Messages

  • Problem to upload excel into table using sqlldr

    hi ,
    i'm using following code on 10g forms (when button pressed) to upload excel to oracle table i.e.
    --V_USERID_CS:=USER||'/'||PWD||'@'||CONNSTR ;
    V_USERID_CS:='saf_integ'||'/'||'saf_integ'||'@'||'ORCLREG'; ---connection string for AS on this machine, control files and .csv files are also on that machine--
    LOG_EVENTS('BEFORE HOST CALLING'); just to trace the message
    LOG_EVENTS('SQLLDR'||' '||RTRIM(V_USERID_CS)||' '||'control='||'c:\overtime.ctl'||' '||'log='||'C:\LOG_FILE.log'||';'); just to trace the command
    HOST('SQLLDR'||' '||RTRIM(V_USERID_CS)||' '||'control='||'c:\overtime.ctl'||' '||'log='||'C:\LOG_FILE.log'||';');
    LOG_EVENTS('AFTER HOST CALLING'); just to trace the message
    COMMIT;
    LOG_EVENTS IS PROCEDURE TO TRACE THE BUG; WHICH SHOWS THE DATA AS GIVEN BELOW:
    SYSDATE_1               ERROR_TEXT                                   ID
    5/14/2010 BEFORE HOST CALLING                                        8464274
    5/14/2010      SQLLDR saf_integ/saf_integ@ORCLREG control=c:\overtime.ctl log=C:\LOG_FILE.log;          8464275
    5/14/2010      AFTER HOST CALLING                                   8464276
    i'm not getting any error but even data is not uploaded into table.
    but when i get the same command from the log table run directly on that machine it's working fine.
    please suggest me where is the gap?
    Thanks
    kam

    i'm not getting any error but even data is not uploaded into table.
    but when i get the same command from the log table run directly on that machine it's working fine.
    please suggest me where is the gap?The SQLLDR.EXE file exists where. In the APPLICATION SERVER or in the CLIENT MACHINE. If it is in the client machine. Then you need to use CLIENT_HOST instead of HOST. CLIENT_HOST exists in webutil library.
    -Ammad

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • Reg: Modification of Master Tables using BDC/BAPI

    Dear All,
    Thanks for Support shown from all of you.
    I want the detailed procedure for Modifying the existing data in the Master Tables using BDC's / BAPI's and Dialog programming.
    Please send me one example code.
    Please Help me Out.
    Thanks In Advance.
    Regards,
    Adinarayana.B

    bapi example
    REPORT ZMMR_DELETEPO NO STANDARD PAGE HEADING MESSAGE-ID zisb.
    tables : zvtls_sap.
    *C-- Types Declarations
    TYPES : BEGIN OF tp_flatfile_vtls,
            ebeln(10),
            ebelp type ekpo-ebelp,
            END OF tp_flatfile_vtls.
    *=====================================================================
                      INTERNAL TABLES DECLARATION
    *=====================================================================
    DATA:  t_flatfile_vtls TYPE tp_flatfile_vtls OCCURS 0 WITH HEADER LINE.
    data : begin of t_sapdata occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_sapdata.
    data : begin of t_flatfile_vtls1 occurs 0,
           po(10),
           item like zvtls_sap-itemsap,
           end of t_flatfile_vtls1.
    data : begin of t_update occurs 0,
           mandt like zvtls_sap-mandt,
           povtls like zvtls_sap-povtls,
           itemvtls like zvtls_sap-itemvtls,
           posap like zvtls_sap-posap,
           itemsap like zvtls_sap-itemsap,
           aedat like zvtls_sap-aedat,
           paedt like zvtls_sap-paedt,
           loekz like zvtls_sap-loekz,
           end of t_update.
    data : begin of t_poheader occurs 0,
           po like zvtls_sap-posap,
           end of t_poheader.
    data : begin of t_poitem occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_poitem.
    DATA : BEGIN OF T_MESSAGE OCCURS 0,
           MSGTY,
           MSGID(2),
           MSGNO(3),
           MSGTX(100),
           PO like zvtls_sap-povtls,
           item like zvtls_sap-itemvtls,
           END OF T_MESSAGE.
    DATA : BEGIN OF t_bapi_poheader OCCURS 0.
            INCLUDE STRUCTURE bapimepoheader.
    DATA : END OF t_bapi_poheader.
    DATA : BEGIN OF t_bapi_poheaderx OCCURS 0.
            INCLUDE STRUCTURE bapimepoheaderx.
    DATA : END OF t_bapi_poheaderx.
    DATA : BEGIN OF t_bapi_poitem OCCURS 0.
            INCLUDE STRUCTURE bapimepoitem.
    DATA : END OF t_bapi_poitem.
    DATA : BEGIN OF t_bapi_poitemx OCCURS 0.
            INCLUDE STRUCTURE bapimepoitemx.
    DATA : END OF t_bapi_poitemx.
    DATA : BEGIN OF t_bapireturn OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA : END OF t_bapireturn.
    *=====================================================================
                      V A R I A B L E S
    *=====================================================================
    DATA: w_success(6)  TYPE n,
          w_bklas like t023-bklas,
          w_curryear(4),
          w_begda like sy-datum,
          w_endda like sy-datum,
          w_begyr(4),
          w_endyr(4),
          w_currmon(2),
          w_assetclass like ankt-anlkl,
          w_price type p,
          w_recordsap type i,
          w_povtls(10),
          w_count type i.
    DATA:  w_filepath TYPE rlgrap-filename,
           w_rc TYPE sy-subrc,
           w_sscrfields_ucomm1   TYPE sscrfields-ucomm,
           w_file1 TYPE string,
           w_file2 TYPE FILENAME-FILEINTERN.
    *=====================================================================
                      C O N S T A N T S
    *=====================================================================
    CONSTANTS: c_x              TYPE  c         VALUE 'X',
               c_hyp            TYPE  c         VALUE '-',
               c_err            TYPE  bdc_mart  VALUE 'E'.
    CONSTANTS:  c_slash(1)            TYPE c VALUE '/',
                c_hash(1)             TYPE c VALUE '#',
                c_pipe                TYPE c VALUE '|',
                c_1                   TYPE i VALUE 1,
                c_zero                TYPE n VALUE '0',
                c_rg1(3)              TYPE c VALUE 'rg1',
                c_gr3(3)              TYPE c VALUE 'GR3',
                c_gr2(3)              TYPE c VALUE 'GR2',
                c_e(1)                TYPE c VALUE 'E',
                c_filepath(8)         TYPE c VALUE '/interf/',
                c_filetype(10)        TYPE c VALUE 'ASC'.
    CONSTANTS : c_bapimepoheaderx   TYPE x030l-tabname
                                   VALUE 'bapimepoheaderx',
               c_bapimepoitem      TYPE  x030l-tabname
                                   VALUE 'bapimepoitem',
               c_bapimepoaccount   TYPE  x030l-tabname
                                   VALUE 'bapimepoaccount',
               c_t_bapi_poheader(15)        TYPE c
                                            VALUE 't_bapi_poheader',
               c_t_bapi_poitem(13)          TYPE c
                                            VALUE 't_bapi_poitem',
               c_t_bapi_poitemx(14)         TYPE c
                                            VALUE 't_bapi_poitemx',
               c_t_bapi_poheaderx(16)       TYPE c
                                            VALUE 't_bapi_poheaderx'.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    CONSTANTS:con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *======================================================================
                           SELECTION SCREEN
    *======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK inputpath WITH FRAME TITLE text-001.
    SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS : p_fore RADIOBUTTON GROUP rg1
                        USER-COMMAND pc,
                 p_back RADIOBUTTON GROUP rg1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF BLOCK blk2.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-003.
    PARAMETERS :  p_file1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr2.
    PARAMETERS :  p_afile1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr3.
    SELECTION-SCREEN : END OF BLOCK blk1.
    SELECTION-SCREEN END OF BLOCK inputpath.
    *C-- Initialization Event
    INITIALIZATION.
      CLEAR w_filepath.
      CONCATENATE c_filepath sy-sysid c_slash sy-mandt c_slash INTO
      w_filepath.
      CONDENSE w_filepath NO-GAPS.
      p_file1 = text-008.
      p_afile1 = text-009.
    *======================================================================
                           SELECTION SCREEN EVENTS
    *======================================================================
    *C-- Selection Screen Output
    AT SELECTION-SCREEN OUTPUT.
      IF p_fore = c_x.
        w_sscrfields_ucomm1 = space.
      ELSE.
        w_sscrfields_ucomm1 = c_rg1.
      ENDIF.
      LOOP AT SCREEN.
    *C--Modify selection screen if presentation
    *C--or application server radio button is chosen
        IF w_sscrfields_ucomm1 = space.
          IF screen-group1 = c_gr3.
            screen-active = c_zero.
          ENDIF.
        ELSE.
          IF screen-group1 = c_gr2.
            screen-active = c_zero.
          ENDIF.
        ENDIF.
        if screen-name = 'P_AFILE1'.
          screen-input = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    *C-- Selection Screen VALUE-REQUEST FOR File path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      IF p_fore EQ c_x.
        CALL FUNCTION 'F4_FILENAME'
          EXPORTING
            program_name  = syst-cprog
            dynpro_number = syst-dynnr
          IMPORTING
            file_name     = p_file1.
      ENDIF.
    *C-- At Start of the Selection Process
    START-OF-SELECTION.
      IF p_fore EQ c_x.
        w_file1 = p_file1.
      ELSE.
        w_file2 = p_afile1.
      ENDIF.
      IF p_fore EQ c_x. " Presentaion Server
    *C--Validations for the input files
        PERFORM validate_pre_file USING p_file1.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file TABLES t_flatfile_vtls
                            USING w_file1
                            CHANGING w_rc.
        IF w_rc <> 0.
          MESSAGE s006 DISPLAY LIKE c_e.
        ENDIF.
      ELSE. " Application Server
    *C--Validations for the input files
        PERFORM validate_app_file USING  w_file2.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file_app TABLES t_flatfile_vtls
                                USING w_file2
                                CHANGING w_rc.
      ENDIF.
      loop at t_flatfile_vtls.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebeln
          IMPORTING
            output = t_flatfile_vtls1-po.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebelp
          IMPORTING
            output = t_flatfile_vtls1-item.
        append t_flatfile_vtls1.
        clear t_flatfile_vtls1.
      endloop.
      perform get_podata.
      loop at t_poheader.
        perform move_to_bapi.
        perform call_bapi.
      endloop.
      PERFORM STORE_MESSAGES TABLES T_MESSAGE.
    *&      Form  validate_pre_file
        Routine to validate presentation server file path.
         -->fp_name  text
    FORM validate_pre_file USING fp_name TYPE rlgrap-filename.
      DATA : l_result,
             l_filename TYPE string.
      l_filename = fp_name.
      CLEAR l_result.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = l_filename
        RECEIVING
          result               = l_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc <> 0.
        MESSAGE s007 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ELSEIF l_result IS INITIAL.
        MESSAGE s008 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " validate_pre_file_hdr
    *&      Form  validate_app_file
          text - Checks if the path entered and filename is correct
    FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.
      data : l_fname(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
          MESSAGE s007 DISPLAY LIKE c_e.
        ELSE.
          CLOSE DATASET l_fname.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_app_file
    *&      Form  upload_file
          Routine to upload data from file to tables.
         -->P_fp_flatfile
         -->P_fp_file
         <--P_fp_rc
    FORM  upload_file TABLES   fp_flatfile
                      USING    fp_file TYPE string
                      CHANGING fp_rc TYPE sy-subrc.
      IF fp_flatfile[] IS INITIAL.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = fp_file
            filetype                = c_filetype
            has_field_separator     = c_x
          TABLES
            data_tab                = fp_flatfile
          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.
        MOVE sy-subrc TO fp_rc.
      ENDIF.
    ENDFORM.  " upload_file
    *&      Form  upload_file_app
          text
         -->FP_FLATFILEtext
         -->FP_FILE    text
         -->FP_RC      text
    FORM  upload_file_app TABLES   fp_flatfile
                          USING    fp_file TYPE FILENAME-FILEINTERN
    CHANGING fp_rc TYPE sy-subrc.
      DATA: l_string TYPE tedata-data.
      DATA: wa_data_file TYPE tp_flatfile_vtls,
            l_wllength TYPE i,
            FNAME(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = 0.
        OPEN DATASET  FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
    *C-- commented by Bikash
         MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.
          message e008.
        ELSE.
          DO.
            CLEAR: l_string.
            READ DATASET  FNAME INTO l_string LENGTH l_wllength.
            IF sy-subrc NE 0.
              EXIT.
            ELSE.
              SPLIT l_string AT con_tab INTO   wa_data_file-ebeln
                                               wa_data_file-ebelp.
              APPEND wa_data_file TO fp_flatfile.
            ENDIF.
          ENDDO.
          CLOSE DATASET  FNAME.
        ENDIF.
      ENDIF.
    ENDFORM.  " upload_file_app
    *&      Form  get_podata
          text
    form get_podata.
      select *
      into table t_update
      from zvtls_sap
      for all entries in t_flatfile_vtls1
       where itemvtls = t_flatfile_vtls1-item
      and povtls = t_flatfile_vtls1-po.
      sort t_update by posap itemsap.
      loop at t_update.
        at new posap.
          t_poheader-po = t_update-posap.
          append t_poheader.
          clear t_poheader.
        endat.
        t_poitem-po = t_update-posap.
        t_poitem-item = t_update-itemsap.
        append t_poitem.
        clear t_poitem.
        t_update-paedt = sy-datum.
        t_update-loekz = 'X'.
        modify t_update.
      endloop.
      modify zvtls_sap from table t_update.
    endform.                    "get_podata
    *&      Form  move_to_bapi
          text
    form move_to_bapi.
      t_bapi_poheader-po_number = t_poheader-po.
      CLEAR t_bapi_poheaderx.
      PERFORM fill_check_structure USING c_bapimepoheaderx
                                         c_t_bapi_poheader
                                         c_t_bapi_poheaderx
                                         c_x.
      refresh : t_bapi_poitem,t_bapi_poitemx.
      loop at t_poitem where po = t_poheader-po.
        clear t_bapi_poitem.
        t_bapi_poitem-po_item = t_poitem-item.
        t_bapi_poitem-delete_ind = 'X'.
        CLEAR t_bapi_poitemx.
        PERFORM fill_check_structure USING c_bapimepoitem
                                           c_t_bapi_poitem
                                           c_t_bapi_poitemx
                                           c_x.
        t_bapi_poitemx-po_item = t_poitem-item.
        t_bapi_poitemx-po_itemx = c_x.
        APPEND t_bapi_poitem.
        APPEND t_bapi_poitemx.
        clear t_bapi_poitem.
        clear t_bapi_poitemx.
      endloop.
    endform.                    "move_to_bapi
    *&      Form  call_bapi
          This form Routine is used to commit the data records
    FORM call_bapi .
      DATA : l_msgty      TYPE c,
             l_msgid(2)   TYPE c,
             l_msgno(3)   TYPE c,
             l_msgtx(100) TYPE c,
             l_errflag    TYPE c.
      CLEAR: t_bapireturn.
      REFRESH: t_bapireturn.
      CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          PURCHASEORDER = T_POHEADER-PO
          POHEADER      = T_BAPI_POHEADER
          POHEADERX     = T_BAPI_POHEADERX
        TABLES
          RETURN        = T_BAPIRETURN
          POITEM        = T_BAPI_POITEM
          POITEMX       = T_BAPI_POITEMX.
      READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
      IF sy-subrc NE 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_x.
      ENDIF.
    *C-- Write messages
      WRITE: / 'PO Number', t_poheader-po.
      clear : t_update,w_povtls.
      read table t_update with key posap = t_poheader-po.
      w_povtls = t_update-povtls.
      CLEAR l_errflag.
      LOOP AT t_bapireturn.
        CLEAR: l_msgty, l_msgid, l_msgno, l_msgtx.
        l_msgty = t_bapireturn-type.
        l_msgid = t_bapireturn-id.
        l_msgno = t_bapireturn-number.
        l_msgtx = t_bapireturn-message.
        WRITE: / l_msgty, l_msgid, l_msgno, l_msgtx.
        if l_msgtx cs t_poheader-po.
          w_count = w_count + 1.
          loop at t_update.
            if sy-tabix = w_count.
              t_message-item = t_update-itemvtls.
            endif.
          endloop.
        endif.
        t_message-msgty = l_msgty.
        t_message-msgid = l_msgid.
        t_message-msgno = l_msgno.
        t_message-msgtx = l_msgtx.
        t_message-po = w_povtls.
        append t_message.
        clear t_message.
        IF l_msgty EQ c_err.
          l_errflag = c_x.
        ENDIF.    " l_msgty EQ 'E'
      ENDLOOP.
      ULINE.
      IF l_errflag NE c_x.
        w_success = w_success + 1.
      ENDIF.    " l_errflag NE C_X
    endform.                    "call_bapi
    *&      Form  fill_check_structure
          This form Routine will check whether the specified structure
          exist/active
    FORM fill_check_structure  USING    fp_tabname TYPE any
                                        fp_orgtabname TYPE any
                                        fp_chktabname TYPE any
                                        fp_check TYPE c.
      FIELD-SYMBOLS : <fs_chk>, <fs_org>.
      DATA:    l_char1(61)  TYPE c,
               l_char2(61)  TYPE c.
      DATA:    BEGIN OF tl_nametab OCCURS 60.
              INCLUDE STRUCTURE x031l.
      DATA:    END OF tl_nametab.
      REFRESH tl_nametab.
      CALL FUNCTION 'RFC_GET_NAMETAB'
        EXPORTING
          tabname          = fp_tabname
        TABLES
          nametab          = tl_nametab
        EXCEPTIONS
          table_not_active = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        CLEAR tl_nametab.
      ENDIF.
      LOOP AT tl_nametab.
        CLEAR: l_char1, l_char2.
        CONCATENATE fp_chktabname c_hyp tl_nametab-fieldname INTO l_char1.
        ASSIGN (l_char1) TO <fs_chk>.
        CONCATENATE fp_orgtabname c_hyp tl_nametab-fieldname INTO l_char2.
        ASSIGN (l_char2) TO <fs_org>.
        IF <fs_org> IS NOT INITIAL.
          <fs_chk> = fp_check.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " fill_check_structure
    *&      Form  STORE_MESSAGES
          text
         -->FP_MESSAGEStext
    FORM STORE_MESSAGES TABLES FP_MESSAGES STRUCTURE T_MESSAGE.
      DATA: wl_output_data LIKE t_MESSAGE.
      DATA: l_catstr TYPE string.
      DATA: l_fieldvalue TYPE string.
      DATA: l_index TYPE i VALUE 1.
      DATA: L_FNAME(60).
      FIELD-SYMBOLS <fs>.
      CLEAR l_catstr.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = '/USR/SAP/VTLS/POCHANGE/LOG'
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        IF fp_messages[] IS NOT INITIAL.
          OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc NE 0.
            LEAVE LIST-PROCESSING.
          ELSE.
            LOOP AT fp_messages INTO wl_output_data.
              DO.
               ASSIGN COMPONENT l_index OF STRUCTURE wl_output_data TO <fs>.
                IF sy-subrc <> 0.
                  EXIT.
                ENDIF.
                MOVE <fs> TO l_fieldvalue.
                IF l_catstr IS NOT INITIAL.
                  CONCATENATE l_catstr l_fieldvalue INTO l_catstr SEPARATED
                  BY con_tab.
                ELSE.
                  MOVE l_fieldvalue TO l_catstr.
                ENDIF.
                l_index = l_index + c_1.
                CLEAR l_fieldvalue.
                CLEAR <fs>.
              ENDDO.
              l_index = c_1.
              TRANSFER l_catstr TO L_FNAME .
              CLEAR wl_output_data.
              CLEAR l_catstr.
            ENDLOOP.
            CLOSE  DATASET L_FNAME.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "STORE_MESSAGES

  • How to upload data into IT0000 using ABAP-HR program

    Hello,
    I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
    Thanks in advance.
    Regards
    Prabhakar.
    Message was edited by:
            Prabhakara Muthyal

    Example code for HR_MAINTAIN_MASTERDATA to COPY IT0002
    DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
    DATA: VALUES        LIKE PPROP OCCURS 10 WITH HEADER LINE,
    RETURN        LIKE BAPIRETURN1,.
    LOOP AT INT_0002_FINAL.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-PERNR'.
          VALUES-FVAL  = INT_0002_FINAL-PERNR.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-BEGDA'.
          VALUES-FVAL  = INT_0002_FINAL-BEGDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-ENDDA'.
          VALUES-FVAL  = INT_0002_FINAL-ENDDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-nachn'.
          VALUES-FVAL  = INT_0002_FINAL-NACHN.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gblnd'.
          VALUES-FVAL  = INT_0002_FINAL-GBLND.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-vorna'.
          VALUES-FVAL  = INT_0002_FINAL-VORNA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-rufnm'.
          VALUES-FVAL  = INT_0002_FINAL-RUFNM.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-name2'.
          VALUES-FVAL  = INT_0002_FINAL-NAME2.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-inits'.
          VALUES-FVAL  = INT_0002_FINAL-INITS.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-famst'.
          VALUES-FVAL  = INT_0002_FINAL-FAMST.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gbdat'.
          VALUES-FVAL  = INT_0002_FINAL-GBDAT.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-sprsl'.
          VALUES-FVAL  = INT_0002_FINAL-SPRSL.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-anzkd'.
          VALUES-FVAL  = INT_0002_FINAL-ANZKD.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-natio'.
          VALUES-FVAL  = INT_0002_FINAL-NATIO.
          APPEND VALUES.
    * maintain master data
          CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
            EXPORTING
              PERNR           = INT_0002_FINAL-PERNR
              ACTIO           = 'COP'
              BEGDA           = INT_0002_FINAL-BEGDA
    *         ENDDA           = INT_0002_FINAL-ENDDA
              SUBTY           = SPACE
              NO_ENQUEUE      = SPACE
              DIALOG_MODE        = '0'
              TCLAS              = 'A'
            IMPORTING
              RETURN1         = RETURN
            TABLES
              PROPOSED_VALUES = VALUES
    *         MODIFIED_KEYS   =
            EXCEPTIONS
              OTHERS          = 1.
          IF RETURN IS INITIAL.
            WRITE:/' Done....'.
          ELSE.
            WRITE:/   RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
          ENDIF.
          CLEAR VALUES.
          REFRESH VALUES.
        ENDLOOP.

  • At least one entry into table

    Hy!
      How can I find if there's  at least one entry into table ?
    Thanks

    Hi,
    Ok..Check the example for the database table..
    SELECT SINGLE * FROM MARA.
    For internal table..
    You can also use..
    READ TABLE ITAB TRANSPORTING NO FIELDS INDEX 1.
    IF SY-SUBRC = 0.
      WRITE: / 'ONE RECORD FOUND'.
    ELSE.
      WRITE: / 'NO RECORD FOUND'.
    ENDIF.
    Thanks
    Naren

  • Error While Inserting Data into table using OAF

    Hi Experts,
    I am learning OAF; i am trying into insert the data into table using OAF. I followed the below procedure.
    My table(OLF_TEST_TBL) Columns:
    EmpID (Number), Ename(VARCHAR2 100), Sal Number, and who columns.
    1. created Application Module (AM).
    package: oracle.apps.mfg.simplepg.server
    name: oaf_test_tbl_am
    2. created simple page
    name:EmployeePG
    package:oracle.apps.mfg.simplepg.webui
    3. Assigned the Application Module to Page
    4. Created Entity Object(EO)
    name:oaf_test_tbl_eo
    package:oracle.apps.mfg.simplepg.schema.server
    schema:apps
    table:OLF_TEST_TBL
    note:
    1. EMPID column is selected as primary key
    2. selected create method, remove method and validation method.
    3.checked generate default view object
    VO:
    name:olf_test_tbl_vo
    note: Entity Object was assigned to VO
    Coming To page:
    page main region:EmployeeMainRN
    1.under main region i created one more region using wizard
    selected AM and VO, region style-default single column
    2. under main region i created one more region
    region style- pagebuttonbar, ID:pagebutoonsRN
    3. under pagebuttonRN, created two submit buttons(ID:SUBMIT, ID:CANCEL).
    In AM java page:
    created a method to insert row and for commit.
    Insert Method:
    public void insertrow(){
    OAViewObject vo=(OAViewObject)getoaf_test_tbl_vo1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    Row row=vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Commit Method:
    public void savaDataTooaftesttable(){
    getDBTransaction().commit();
    In EmployeeMainRN, created a controller.
    In this controller process request method, 'insertrow' method was called.
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("insertrow");
    To commit the transaction when SUBMIT button pressed, commit method was called in process form request method.
    import oracle.apps.fnd.framework.OAViewObject;
    public void processformRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("SUBMIT") != null)
    am.invokemethod("savaDataTooaftesttable");
    Error After clicking the submit button_
    I ran the page, page was opened successfully. Once i enter data and click submit button, it's giving the following error.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object oaf_test_tbl_am.oaf_test_tbl_vo1700_oaf_test_tbl_vo1_practice_test_prc1_oracle_apps_mfg_simplepg_server_oaf_test_tbl_am.oaf_test_tbl_vo1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Experts, Kindly help me why i am getting this error.
    Awating your replies.
    Thanks in advance.

    If you dont want to create message. You can throw exception like below as well
              throw new OAException("Emp Id is "+empId+" and employee name is "+empName, OAException.CONFIRMATION);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with uploading data from excel using BDC for tcode f-02

    Hi All,
    I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
    With regards,
    Rosaline.

    Hi,
      in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
    suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
    Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
    LOOP at ITAB to WA.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'RM08M-EBELN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." pass the same value to repeated field
    APPEND bdcdata_wa TO bdcdata_tab.
    Endloop.
    Hope you can understand.
    Regards,
    Dhina..

  • How to store Multiple Ec\xcels into Table Using sql loder

    Plese guide me to store Multiple Ec\xcels into Table Using sql loder

    I am not clear with your question. Do you want to load multipel Excel Files into a table. If so you can follow this link.
    http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F
    Thanks,
    Karthick.

  • Usage of sequence for uploading data into tables(column store) using CSV

    How to make use of sequence when data is uploaded into table(column store) with the CSV file ?

    Hi Sharada,
    You may have to follow the below steps:
    1) To load the data from flat file to a Staging table using IMPORT command
    2) You have to call the procedure to load the data further into final Table.
    a) Have a look on this procedure to load data :
    SAP HANA: Generic Procedure using Arrays to Load delta data into Tables
    b) See my reply on the syntax on how to use "Sequence"
    Auto-Incrementor in stored procedure!
    You will have to ensure that you frame your insert query in such a way to have the sequence number in the target table.
    Regards,
    Krishna Tangudu

  • Xml data upload into tables using loader

    Hi,
    I have to load XML file data into multiple tables using sqlloader. i wrote a cotrol file to execute this ,but i was not able to load the data into multiple tables at the same time, first loading table in control file is able to load the data ,rest of the load is giving error,please refer the below control file and log. Help me with your great efforts.
    Have a great day!
    Control file:
    LOAD DATA
    TRUNCATE
    INTO TABLE Derivative_Security
    WHEN DERIVATIVESECURITYID != ' '
    FIELDS TERMINATED BY '</DerivativeSecurity>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler char(50000) Terminated by '<DerivativeSecurity ',
    DUMMY2 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157Level="' and '"',
    DUMMY3 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157MVAdjustable="' and '"',
    DUMMY4 filler char(200) Terminated by WHITESPACE enclosed by 'OriginalMV="' and '"',
    DUMMY5 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157MVDelta="' and '"',
    DUMMY6 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157AdjustedMV="' and '"',
    DUMMY7 filler char(200) Terminated by WHITESPACE enclosed by 'PLCurrency="' and '"',
    DERIVATIVESECURITYID Terminated by WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    METDERIVATIVEID Terminated by WHITESPACE enclosed by 'MetDerivativeID="' and '"',
    MUREXTRANSNUMBER Terminated by WHITESPACE enclosed by 'MurexTransactionNumber="' and '"',
    DUMMY8 filler char(200) Terminated by WHITESPACE enclosed by 'Trader="' and '"',
    DUMMY9 filler char(200) Terminated by WHITESPACE enclosed by 'BuySell="' and '"',
    DETAILTYPE Terminated by WHITESPACE enclosed by 'DetailType="' and '"',
    DERIVATIVETYPE Terminated by WHITESPACE enclosed by 'DerivativeType="' and '"',
    AL_MANAGEMENTSIDE Terminated by WHITESPACE enclosed by 'AL_ManagementSide="' and '"',
    COUNTERPARTYCODE Terminated by WHITESPACE enclosed by 'CounterpartyCode="' and '"',
    COUNTERPARTYNAME Terminated by WHITESPACE enclosed by 'CounterpartyName="' and '"',
    CURRENCYCODE Terminated by WHITESPACE enclosed by 'CurrencyCode="' and '"',
    DUMMY10 filler char(200) Terminated by WHITESPACE enclosed by 'Coupon="' and '"',
    DUMMY11 filler char(200) Terminated by WHITESPACE enclosed by 'FixedFloatingIndicator="' and '"',
    DUMMY12 filler char(200) Terminated by WHITESPACE enclosed by 'IndexMultiplier="' and '"',
    DUMMY13 filler char(200) Terminated by WHITESPACE enclosed by 'IndexName="' and '"',
    DUMMY42 filler char(200) Terminated by WHITESPACE enclosed by 'Margin="' and '"',
    DUMMY14 filler char(200) Terminated by WHITESPACE enclosed by 'Comment11="' and '"',
    DUMMY15 filler char(200) Terminated by WHITESPACE enclosed by 'Comment12="' and '"',
    DUMMY16 filler char(200) Terminated by WHITESPACE enclosed by 'Comment13="' and '"',
    DUMMY17 filler char(200) Terminated by WHITESPACE enclosed by 'Comment21="' and '"',
    DUMMY18 filler char(200) Terminated by WHITESPACE enclosed by 'Comment22="' and '"',
    DUMMY19 filler char(200) Terminated by WHITESPACE enclosed by 'Comment23="' and '"',
    DUMMY20 filler char(2000) Terminated by WHITESPACE enclosed by 'TradeComment="' and '"',
    DUMMY21 filler char(200) Terminated by WHITESPACE enclosed by 'OptionCallPut="' and '"',
    DUMMY22 filler char(200) Terminated by WHITESPACE enclosed by 'OptionType="' and '"',
    DUMMY23 filler char(200) Terminated by WHITESPACE enclosed by 'SettleType="' and '"',
    DUMMY24 filler char(200) Terminated by WHITESPACE enclosed by 'RefISIN="' and '"',
    DUMMY25 filler char(200) Terminated by WHITESPACE enclosed by 'RefObligation="' and '"',
    DUMMY26 filler char(200) Terminated by WHITESPACE enclosed by 'Sensitivity="' and '"',
    DUMMY27 filler char(200) Terminated by WHITESPACE enclosed by 'EffectiveConvexity="' and '"',
    DUMMY28 filler char(200) Terminated by WHITESPACE enclosed by 'Vega="' and '"',
    DUMMY29 filler char(200) Terminated by WHITESPACE enclosed by 'NextResetDate="' and '"',
    DUMMY30 filler char(200) Terminated by WHITESPACE enclosed by 'LastResetDate="' and '"',
    EFFECTIVEDURATION Terminated by WHITESPACE enclosed by 'EffectiveDuration="' and '"',
    DUMMY31 filler char(200) Terminated by WHITESPACE enclosed by 'Instrument="' and '"',
    DUMMY32 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerCode="' and '"',
    DUMMY33 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerName="' and '"',
    DUMMY34 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerREDCode="' and '"',
    DUMMY35 filler char(200) Terminated by WHITESPACE enclosed by 'Strategy="' and '"',
    DUMMY36 filler char(200) Terminated by WHITESPACE enclosed by 'StrikePrice="' and '"',
    MATURITYDATE Terminated by WHITESPACE enclosed by 'MaturityDate="' and '"',
    DUMMY37 filler char(200) Terminated by WHITESPACE enclosed by 'TickerSymbol="' and '"',
    DUMMY38 filler char(200) Terminated by WHITESPACE enclosed by 'MetPay="' and '"',
    DUMMY39 filler char(200) Terminated by WHITESPACE enclosed by 'MetRec="' and '"',
    DUMMY40 filler char(200) Terminated by WHITESPACE enclosed by 'Payrec="' and '"',
    DUMMY41 filler char(200) Terminated by WHITESPACE enclosed by 'RiskSection="' and '"',
    DUMMY54 filler char(200) Terminated by WHITESPACE enclosed by 'HedgedItem="' and '"',
    DUMMY43 filler char(200) Terminated by WHITESPACE enclosed by 'ResetFrequency="' and '"',
    DUMMY44 filler char(200) Terminated by WHITESPACE enclosed by 'ResetFrequencyNumber="' and '"',
    DUMMY45 filler char(200) Terminated by WHITESPACE enclosed by 'PaymentFrequency="' and '"',
    DUMMY46 filler char(200) Terminated by WHITESPACE enclosed by 'PaymentFrequencyNumber="' and '"',
    DUMMY47 filler char(200) Terminated by WHITESPACE enclosed by 'CapFloorCoupon="' and '"',
    DUMMY48 filler char(200) Terminated by WHITESPACE enclosed by 'RefIndexRate="' and '">',
    DUMMY50 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY51 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY52 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY53 filler char(1000) enclosed by "<Classification=" and "/>"
    INTO TABLE DERIVATIVE_POSITION
    WHEN PORTFOLIOCODE != ' '
    FIELDS TERMINATED BY '</NewDataSet>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler char(65000) terminated by '<DerivativePosition ',
    DERIVATIVESECURITYID TERMINATED BY WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    PORTFOLIOCODE TERMINATED BY WHITESPACE enclosed by 'PortfolioCode="' and '"',
    LONGSHORTINDICATOR TERMINATED BY WHITESPACE ENCLOSED BY 'LongShortIndicator="' and '"',
    FAS157Level filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157Level="' and '"',
    FAS157MVAdjustable filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157MVAdjustable="' and '"',
    OriginalMV filler char(100)TERMINATED BY WHITESPACE enclosed by 'OriginalMV="' and '"',
    FAS157MVDelta filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157MVDelta="' and '"',
    FAS157AdjustedMV filler char(100)TERMINATED BY WHITESPACE enclosed by 'FAS157AdjustedMV="' and '"',
    CURRENTNOTIONALLOCAL TERMINATED BY WHITESPACE enclosed by 'CurrentNotionalLocal="' and '"',
    CURRENTNOTIONALUSD TERMINATED BY WHITESPACE enclosed by 'CurrentNotionalUSD="' and '"',
    OPENQUANTITY TERMINATED BY WHITESPACE enclosed by 'OpenQuantity="' and '"',
    ORIGINALNOTIONALLOCAL TERMINATED BY WHITESPACE enclosed by 'OriginalNotionalLocal="' and '"',
    ORIGINALNOTIONALUSD TERMINATED BY WHITESPACE enclosed by 'OriginalNotionalUSD="' and '"',
    ORIGINALQUANTITY TERMINATED BY WHITESPACE enclosed by 'OriginalQuantity="' and '"',
    ACCRUEDINTERESTLOCAL TERMINATED BY WHITESPACE enclosed by 'AccruedInterestLocal="' and '"',
    ACCRUEDINTERESTUSD TERMINATED BY WHITESPACE enclosed by 'AccruedInterestUSD="' and '"',
    ACCRUEDINTERESTBASE TERMINATED BY WHITESPACE enclosed by 'AccruedInterestBase="' and '"',
    CLEANMARKETVALUEENDOFDAYLOCAL TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayLocal="' and '"',
    CLEANMARKETVALUEENDOFDAYUSD TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayUSD="' and '"',
    CLEANMARKETVALUEENDOFDAYBASE TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayBase="' and '"',
    DIRTYMARKETVALUEENDOFDAYLOCAL TERMINATED BY WHITESPACE enclosed by 'DirtyMarketValueEndOfDayLocal="' and '"',
    DIRTYMARKETVALUEENDOFDAYUSD TERMINATED BY WHITESPACE enclosed by 'DirtyMarketValueEndOfDayUSD="' and '"',
    PREMIUMLOCAL TERMINATED BY WHITESPACE enclosed by 'PremiumLocal="' and '"',
    PREMIUMUSD TERMINATED BY WHITESPACE enclosed by 'PremiumUSD="' and '"',
    PREMIUMBASE TERMINATED BY WHITESPACE enclosed by 'PremiumBase="' and '"',
    BIDDIES TERMINATED BY WHITESPACE enclosed by 'Biddies="' and '"',
    ADDONEXPOSUREUSD TERMINATED BY WHITESPACE enclosed by 'AddOnExposureUSD="' and '"',
    RegulatoryExposureUSD filler char(100) TERMINATED BY WHITESPACE enclosed by 'RegulatoryExposureUSD="' and '"',
    PARCR01 filler char(100) TERMINATED BY WHITESPACE enclosed by 'PARCR01="' and '"',
    FAS133DESIGNATIONGAAP TERMINATED BY WHITESPACE enclosed by 'FAS133DesignationGAAP="' and '"',
    FAS133DESIGNATIONSTAT TERMINATED BY WHITESPACE enclosed by 'FAS133DesignationSTAT="' and '"',
    TRADEDATE TERMINATED BY WHITESPACE enclosed by 'TradeDate="' and '"',
    EffectiveDate filler char(100) TERMINATED BY WHITESPACE enclosed by 'EffectiveDate="' and '"',
    ALLOCATION TERMINATED BY WHITESPACE enclosed by 'Allocation="' and '"' "round(:ALLOCATION,4)",
    DUMMY36 filler char(100) enclosed by '/' and '>'
    Log:
    Table DERIVATIVE_SECURITY:
    4079 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    28074 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Table DERIVATIVE_POSITION:
    0 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    32153 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 248196 bytes(26 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 32153
    Total logical records rejected: 0
    Total logical records discarded: 28074

    When there are multiple tables in a control file, SQL Loader assumes the data for the first file in the second table immediately follows the last field in the first table. You probably want SQL Loader to start looking for the first column of the second table at the start of the second table. You can do this by using the POSITION clause
    DUMMY51 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY52 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY53 filler char(1000) enclosed by "<Classification=" and "/>"
    INTO TABLE DERIVATIVE_POSITION
    WHEN PORTFOLIOCODE != ' '
    FIELDS TERMINATED BY '</NewDataSet>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler *position(1)* char(65000) terminated by '<DerivativePosition ',
    DERIVATIVESECURITYID TERMINATED BY WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    PORTFOLIOCODE TERMINATED BY WHITESPACE enclosed by 'PortfolioCode="' and '"',
    .

  • How to upload a excel file using BDC

    how should i upload a file using BDC
    i have downloaded a excel file containing the values of  table A006 a X server.
    now i hav to upload it into new server Y server using BDC , how do i do it?
    wat all things one shud consider ?

    Hi,
    This is very simple, follow the below mention steps to do so:
    1.Declare an internal table having same structure as db table, but take all the fields type as 'C' and length same as defined in the table.
    TYPES:BEGIN OF it,
      key(20) TYPE c,
      indicator(20) TYPE c,
      bldat(20) TYPE c,"bkpf-bldat
      budat(20) TYPE c,"bkpf-budat
      END OF it.
    DATA: itab TYPE STANDARD TABLE OF it,
          wa TYPE it.
    2.Include TRUX as type pool and declare a variable of type trux_t_text_data to be passed in the FM that actually reads data from excel sheet into above declared intrenal table.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    3. Call the FM 'TEXT_CONVERT_XLS_TO_SAP' and pass the file name and the internal table name into the parameter
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
    *    I_FIELD_SEPERATOR          = 'X'
         i_line_header              = 'X'
          i_tab_raw_data             = it_raw
          i_filename                 = p_file "name of the excel file
        TABLES
          i_tab_converted_data       = itab[] "internal table where data will be stored
       EXCEPTIONS
         conversion_failed          = 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.
    4. loop at internal table and modify the ztable/dbtable where data to be upload .
    Hope this solve your problem.
    Pooja

  • How to Extract data from a flat file and how to upload it into table

    Hi
    i want to extract the data from a web page, that data i want to keep in text file.
    from the text file i want to read it and i want to upload into table
    can any one help me its very urgent

    here is my 20min try without debugging (needs a rs232 and loopback connector )
    use the probe and highlight the dataflow to see how it works.
    as always:  there are many ways to solve your problem
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    read write file to RS232.vi ‏69 KB

  • Problem in uploading material master data using BDC?

    Hi all,
    I am using  BDC call transaction method to upload material data. Here i am facing a problem that a value in the flat file is going to the wrong screen field . But my recording done properly.
    In recording, after entering the data in the view BASIC DATA1 and trying to enter the text . For this i need to scroll down the scroll bar and after that i am clicking on basic data text and entering the text. Here i am not touching the languge field.
    But the problem is the text to be entered into the basic data text is storing in language and giving error.
    Please help me by specifying the reason and solution for this problem? Whether i did any mistake in recording in scrolling?
    Thanks,
    Vamshi.

    Hi
    Go with BAPI for such huge transactions and screens. Use BAPI: BAPI_MATERIAL_SAVEDATA.
    Regards,
    Vishwa.

  • Uploading info records by using BDC

    Hi all,
    Does any one having knowledge in uploading info records (ME11) by using BDC.
    Problem arises when going for multiple scales.
    Can any one let me know how proceed this BDC.
    Regards,
    Raj

    Goto transaction SHBD enter a recording name and specify the transaction code.
    Enter the test data and save it , it will actomatically create a bdc program.
    now select that recording name and click create program icon and specify the program name.
    This is the program which was created using transaction SHDB for XD01.
    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,
    data element: KUN16
    KUNNR_001(016),
    data element: BUKRS
    BUKRS_002(004),
    data element: VKORG
    VKORG_003(004),
    data element: VTWEG
    VTWEG_004(002),
    data element: SPART
    SPART_005(002),
    data element: KTOKD
    KTOKD_006(004),
    data element: ANRED
    ANRED_007(015),
    data element: NAME1_GP
    NAME1_008(035),
    data element: SORTL
    SORTL_009(010),
    data element: NAME2_GP
    NAME2_010(035),
    data element: STRAS_GP
    STRAS_011(035),
    data element: PFACH
    PFACH_012(010),
    data element: ORT01_GP
    ORT01_013(035),
    data element: PSTLZ
    PSTLZ_014(010),
    data element: ORT02_GP
    ORT02_015(035),
    data element: PFORT_GP
    PFORT_016(035),
    data element: PSTL2
    PSTL2_017(010),
    data element: LAND1_GP
    LAND1_018(003),
    data element: REGIO
    REGIO_019(003),
    data element: SPRAS
    SPRAS_020(002),
    data element: TELX1
    TELX1_021(030),
    data element: TELF1
    TELF1_022(016),
    data element: TELFX
    TELFX_023(031),
    data element: TELF2
    TELF2_024(016),
    data element: TELTX
    TELTX_025(030),
    data element: TELBX
    TELBX_026(015),
    data element: URL
    KNURL_027(132),
    data element: STCD1
    STCD1_028(016),
    data element: STCD2
    STCD2_029(011),
    data element: BBBNR
    BBBNR_030(007),
    data element: BBSNR
    BBSNR_031(005),
    data element: BUBKZ
    BUBKZ_032(001),
    data element: BRSCH
    BRSCH_033(004),
    data element: LZONE
    LZONE_034(010),
    data element: KUKLA
    KUKLA_035(002),
    data element: BRSCH
    BRSCH_036(004),
    data element: UMSA1
    UMSA1_037(020),
    data element: UWAER
    UWAER_038(005),
    data element: UMJAH
    UMJAH_039(004),
    data element: JMZAH
    JMZAH_040(006),
    data element: JMJAH
    JMJAH_041(004),
    data element: BANKS
    BANKS_01_042(003),
    data element: BANKK
    BANKL_01_043(015),
    data element: BANKN
    BANKN_01_044(018),
    data element: ABLAD
    ABLAD_01_045(025),
    data element: KNKAL
    KNFAK_01_046(002),
    data element: CIVVE
    CIVVE_047(001),
    data element: ANRED_AP
    ANRED_01_048(030),
    data element: ANRED_AP
    ANRED_02_049(030),
    data element: NAMEV_VP
    NAMEV_01_050(035),
    data element: NAMEV_VP
    NAMEV_02_051(035),
    data element: NAME1_GP
    NAME1_01_052(035),
    data element: NAME1_GP
    NAME1_02_053(035),
    data element: TELF1
    TELF1_01_054(016),
    data element: TELF1
    TELF1_02_055(016),
    data element: ABTNR_PA
    ABTNR_01_056(004),
    data element: ABTNR_PA
    ABTNR_02_057(004),
    data element: AKONT
    AKONT_058(010),
    data element: DZTERM
    ZTERM_059(004),
    data element: MAHNA
    MAHNA_060(004),
    data element: BZIRK
    BZIRK_061(006),
    data element: AWAHR
    AWAHR_062(003),
    data element: WAERS_V02D
    WAERS_063(005),
    data element: KALKS
    KALKS_064(001),
    data element: LPRIO
    LPRIO_065(002),
    data element: KZAZU_D
    KZAZU_066(001),
    data element: ANTLF
    ANTLF_067(001),
    data element: PERFK
    PERFK_068(002),
    end of record.
    End generated data section ***
    start-of-selection.
    perform open_dataset using dataset.
    perform open_group.
    do.
    read dataset dataset into record.
    if sy-subrc <> 0. exit. endif.
    perform bdc_dynpro using 'SAPMF02D' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02D-KTOKD'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02D-KUNNR'
    record-KUNNR_001.
    perform bdc_field using 'RF02D-BUKRS'
    record-BUKRS_002.
    perform bdc_field using 'RF02D-VKORG'
    record-VKORG_003.
    perform bdc_field using 'RF02D-VTWEG'
    record-VTWEG_004.
    perform bdc_field using 'RF02D-SPART'
    record-SPART_005.
    perform bdc_field using 'RF02D-KTOKD'
    record-KTOKD_006.
    perform bdc_dynpro using 'SAPMF02D' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-KNURL'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNA1-ANRED'
    record-ANRED_007.
    perform bdc_field using 'KNA1-NAME1'
    record-NAME1_008.
    perform bdc_field using 'KNA1-SORTL'
    record-SORTL_009.
    perform bdc_field using 'KNA1-NAME2'
    record-NAME2_010.
    perform bdc_field using 'KNA1-STRAS'
    record-STRAS_011.
    perform bdc_field using 'KNA1-PFACH'
    record-PFACH_012.
    perform bdc_field using 'KNA1-ORT01'
    record-ORT01_013.
    perform bdc_field using 'KNA1-PSTLZ'
    record-PSTLZ_014.
    perform bdc_field using 'KNA1-ORT02'
    record-ORT02_015.
    perform bdc_field using 'KNA1-PFORT'
    record-PFORT_016.
    perform bdc_field using 'KNA1-PSTL2'
    record-PSTL2_017.
    perform bdc_field using 'KNA1-LAND1'
    record-LAND1_018.
    perform bdc_field using 'KNA1-REGIO'
    record-REGIO_019.
    perform bdc_field using 'KNA1-SPRAS'
    record-SPRAS_020.
    perform bdc_field using 'KNA1-TELX1'
    record-TELX1_021.
    perform bdc_field using 'KNA1-TELF1'
    record-TELF1_022.
    perform bdc_field using 'KNA1-TELFX'
    record-TELFX_023.
    perform bdc_field using 'KNA1-TELF2'
    record-TELF2_024.
    perform bdc_field using 'KNA1-TELTX'
    record-TELTX_025.
    perform bdc_field using 'KNA1-TELBX'
    record-TELBX_026.
    perform bdc_field using 'KNA1-KNURL'
    record-KNURL_027.
    perform bdc_dynpro using 'SAPMF02D' '0120'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-LZONE'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNA1-STCD1'
    record-STCD1_028.
    perform bdc_field using 'KNA1-STCD2'
    record-STCD2_029.
    perform bdc_field using 'KNA1-BBBNR'
    record-BBBNR_030.
    perform bdc_field using 'KNA1-BBSNR'
    record-BBSNR_031.
    perform bdc_field using 'KNA1-BUBKZ'
    record-BUBKZ_032.
    perform bdc_field using 'KNA1-BRSCH'
    record-BRSCH_033.
    perform bdc_field using 'KNA1-LZONE'
    record-LZONE_034.
    perform bdc_dynpro using 'SAPMF02D' '0125'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-JMJAH'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNA1-KUKLA'
    record-KUKLA_035.
    perform bdc_field using 'KNA1-BRSCH'
    record-BRSCH_036.
    perform bdc_field using 'KNA1-UMSA1'
    record-UMSA1_037.
    perform bdc_field using 'KNA1-UWAER'
    record-UWAER_038.
    perform bdc_field using 'KNA1-UMJAH'
    record-UMJAH_039.
    perform bdc_field using 'KNA1-JMZAH'
    record-JMZAH_040.
    perform bdc_field using 'KNA1-JMJAH'
    record-JMJAH_041.
    perform bdc_dynpro using 'SAPMF02D' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'KNBK-BANKN(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'KNBK-BANKS(01)'
    record-BANKS_01_042.
    perform bdc_field using 'KNBK-BANKL(01)'
    record-BANKL_01_043.
    perform bdc_field using 'KNBK-BANKN(01)'
    record-BANKN_01_044.
    perform bdc_dynpro using 'SAPMF02D' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'KNBK-BANKS(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0340'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVA-KNFAK(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'KNVA-ABLAD(01)'
    record-ABLAD_01_045.
    perform bdc_field using 'KNVA-KNFAK(01)'
    record-KNFAK_01_046.
    perform bdc_dynpro using 'SAPMF02D' '0340'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02D-KUNNR'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0370'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-CIVVE'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'KNA1-CIVVE'
    record-CIVVE_047.
    perform bdc_dynpro using 'SAPMF02D' '0360'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVK-ABTNR(02)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'KNVK-ANRED(01)'
    record-ANRED_01_048.
    perform bdc_field using 'KNVK-ANRED(02)'
    record-ANRED_02_049.
    perform bdc_field using 'KNVK-NAMEV(01)'
    record-NAMEV_01_050.
    perform bdc_field using 'KNVK-NAMEV(02)'
    record-NAMEV_02_051.
    perform bdc_field using 'KNVK-NAME1(01)'
    record-NAME1_01_052.
    perform bdc_field using 'KNVK-NAME1(02)'
    record-NAME1_02_053.
    perform bdc_field using 'KNVK-TELF1(01)'
    record-TELF1_01_054.
    perform bdc_field using 'KNVK-TELF1(02)'
    record-TELF1_02_055.
    perform bdc_field using 'KNVK-ABTNR(01)'
    record-ABTNR_01_056.
    perform bdc_field using 'KNVK-ABTNR(02)'
    record-ABTNR_02_057.
    perform bdc_dynpro using 'SAPMF02D' '0360'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVK-NAMEV(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0210'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB1-AKONT'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNB1-AKONT'
    record-AKONT_058.
    perform bdc_dynpro using 'SAPMF02D' '0215'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB1-ZTERM'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNB1-ZTERM'
    record-ZTERM_059.
    perform bdc_dynpro using 'SAPMF02D' '0220'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB5-MAHNA'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNB5-MAHNA'
    record-MAHNA_060.
    perform bdc_dynpro using 'SAPMF02D' '0230'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB1-VRSNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02D' '0310'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVV-WAERS'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNVV-BZIRK'
    record-BZIRK_061.
    perform bdc_field using 'KNVV-AWAHR'
    record-AWAHR_062.
    perform bdc_field using 'KNVV-WAERS'
    record-WAERS_063.
    perform bdc_field using 'KNVV-KALKS'
    record-KALKS_064.
    perform bdc_dynpro using 'SAPMF02D' '0315'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVV-LPRIO'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNVV-LPRIO'
    record-LPRIO_065.
    perform bdc_field using 'KNVV-KZAZU'
    record-KZAZU_066.
    perform bdc_field using 'KNVV-ANTLF'
    record-ANTLF_067.
    perform bdc_dynpro using 'SAPMF02D' '0320'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVV-PERFK'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNVV-PERFK'
    record-PERFK_068.
    perform bdc_dynpro using 'SAPMF02D' '1350'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02D-KUNNR'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0324'.
    perform bdc_field using 'BDC_CURSOR'
    'KNVP-PARVW(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_transaction using 'XD01'.
    enddo.
    perform close_group.
    perform close_dataset using dataset.
    Reward if found helpful....
    Cheers,
    Chandra Sekhar.

Maybe you are looking for