BDC Recording for uploading data into Fi01

HI,
I need to upload date from a file into SAP Fi01 transaction
i used a sample program and added my bdc recording to it as per instrucrion
there is a error while uploading.
i believe it is at the place i am pointing in bold. it is at read dataset. could you advice me how to solve it.
CODE:
REPORT Z_BANK_DIRECTORY
NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 300.
*-- DATA DECLARATION--
*---Types
DATA : BEGIN OF t_upload,
data element: BANKS
        BANKS_001(003),
data element: BANKK
        BANKL_002(015),
data element: BANKA
        BANKA_003(060),
data element: REGIO
        PROVZ_004(003),
data element: STRAS_GP
        STRAS_005(035),
data element: ORT01_GP
        ORT01_006(035),
data element: BRNCH
        BRNCH_007(040),
data element: SWIFT
        SWIFT_008(011),
data element: BGRUP
        BGRUP_009(002),
data element: AD_TITLETX
        TITLE_MEDI_010(030),
data element: AD_NAME1
        NAME1_011(040),
data element: AD_STRSPP1
        STR_SUPPL1_012(040),
data element: AD_STRSPP2
        STR_SUPPL2_013(040),
data element: AD_STREET
        STREET_014(060),
data element: AD_CITY2
        CITY2_015(040),
data element: AD_CITY3
        HOME_CITY_016(040),
data element: AD_PSTCD1
        POST_CODE1_017(010),
data element: LAND1
        COUNTRY_018(003),
data element: AD_POBX
        PO_BOX_019(010),
data element: AD_PSTCD2
        POST_CODE2_020(010),
data element: SPRAS
        LANGU_021(002),
data element: AD_TLNMBR1
        TEL_NUMBER_022(030),
data element: AD_MBNMBR1
        MOB_NUMBER_023(030),
data element: AD_FXNMBR1
        FAX_NUMBER_024(030),
data element: AD_SMTPADR
        SMTP_ADDR_025(132),
data element: BANKA
        BANKA_026(060),
data element: REGIO
        PROVZ_027(003),
data element: STRAS_GP
        STRAS_028(035),
data element: ORT01_GP
        ORT01_029(035),
data element: BRNCH
        BRNCH_030(040),
data element: SWIFT
        SWIFT_031(011),
data element: BGRUP
        BGRUP_032(002),
END OF t_upload.
*--- Tables
DATA : BEGIN OF i_bdcdata OCCURS 0."to hold the transaction t_upload
INCLUDE STRUCTURE bdcdata.
DATA: END OF i_bdcdata.
DATA: i_upload LIKE STANDARD TABLE OF t_upload," to hold file data.
i_upload1 LIKE STANDARD TABLE OF t_upload." to hold file data.
*--- Work Areas
DATA: wa_upload2 LIKE t_upload,
wa_upload LIKE t_upload,
wa_upload1 LIKE t_upload.
*--- Variables
DATA: v_count1(4) TYPE n,
v_error TYPE c,
v_session(12),
v_field(21) TYPE c,
v_message(60) type C.
*--Constants
DATA: c_open TYPE c VALUE '(',
c_close TYPE c VALUE ')',
c_x TYPE c VALUE 'X'.
*---Initialisation
initialization.
refresh : i_upload , i_upload1 ,i_bdcdata.
-------Selection Screen Design -
*Selection screen for input of upload file address
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
---AT SELECTION SCREEN -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*--For popup to select file.
PERFORM give_help.
-----START OF SELECTION -
START-OF-SELECTION.
*--Data upload using WS_Upload.
PERFORM get_data.
*-- OPEN SESSION
PERFORM open_group.
*--Insert transactions using BDCDATA table in the session.
PERFORM do_transaction .
*-- Close the session.
PERFORM close_group.
END-OF-SELECTION.
*& Form f_get_data
For data upload from external file.
FORM get_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_upload
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
DELETE I_UPLOAD INDEX 1.
ENDIF.
ENDFORM. " f_get_data
*& Form F_open_group
To open session in session management.
FORM open_group.
v_session = 'FI01'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = v_session
user = sy-uname
keep = 'X'.
ENDFORM. " F_open_group
*& Form f_do_transaction
Insert transactions in session after passing values to BDCDATA
FORM do_transaction.
LOOP AT i_upload INTO wa_upload .
*---- insert your generated codes from recording at SHDB here
read dataset <b>wa_upload</b> into t_upload.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro      using 'SAPMF02B' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'BNKA-BANKL'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'BNKA-BANKS'
                              t_upload-BANKS_001.
perform bdc_field       using 'BNKA-BANKL'
                              t_upload-BANKL_002.
perform bdc_dynpro      using 'SAPMF02B' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              'BNKA-BGRUP'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ADDR'.
perform bdc_field       using 'BNKA-BANKA'
                              t_upload-BANKA_003.
perform bdc_field       using 'BNKA-PROVZ'
                              t_upload-PROVZ_004.
perform bdc_field       using 'BNKA-STRAS'
                              t_upload-STRAS_005.
perform bdc_field       using 'BNKA-ORT01'
                              t_upload-ORT01_006.
perform bdc_field       using 'BNKA-BRNCH'
                              t_upload-BRNCH_007.
perform bdc_field       using 'BNKA-SWIFT'
                              t_upload-SWIFT_008.
perform bdc_field       using 'BNKA-BGRUP'
                              t_upload-BGRUP_009.
perform bdc_dynpro      using 'SAPLSZA1' '0201'.
perform bdc_field       using 'BDC_CURSOR'
                              'SZA1_D0100-SMTP_ADDR'.
perform bdc_field       using 'BDC_OKCODE'
                              '=CONT'.
perform bdc_field       using 'SZA1_D0100-TITLE_MEDI'
                              t_upload-TITLE_MEDI_010.
perform bdc_field       using 'ADDR1_DATA-NAME1'
                              t_upload-NAME1_011.
perform bdc_field       using 'ADDR1_DATA-STR_SUPPL1'
                              t_upload-STR_SUPPL1_012.
perform bdc_field       using 'ADDR1_DATA-STR_SUPPL2'
                              t_upload-STR_SUPPL2_013.
perform bdc_field       using 'ADDR1_DATA-STREET'
                              t_upload-STREET_014.
perform bdc_field       using 'ADDR1_DATA-CITY2'
                              t_upload-CITY2_015.
perform bdc_field       using 'ADDR1_DATA-HOME_CITY'
                              t_upload-HOME_CITY_016.
perform bdc_field       using 'ADDR1_DATA-POST_CODE1'
                              t_upload-POST_CODE1_017.
perform bdc_field       using 'ADDR1_DATA-COUNTRY'
                              t_upload-COUNTRY_018.
perform bdc_field       using 'ADDR1_DATA-PO_BOX'
                              t_upload-PO_BOX_019.
perform bdc_field       using 'ADDR1_DATA-POST_CODE2'
                              t_upload-POST_CODE2_020.
perform bdc_field       using 'ADDR1_DATA-LANGU'
                              t_upload-LANGU_021.
perform bdc_field       using 'SZA1_D0100-TEL_NUMBER'
                              t_upload-TEL_NUMBER_022.
perform bdc_field       using 'SZA1_D0100-MOB_NUMBER'
                              t_upload-MOB_NUMBER_023.
perform bdc_field       using 'SZA1_D0100-FAX_NUMBER'
                              t_upload-FAX_NUMBER_024.
perform bdc_field       using 'SZA1_D0100-SMTP_ADDR'
                              t_upload-SMTP_ADDR_025.
perform bdc_dynpro      using 'SAPMF02B' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              'BNKA-BANKA'.
perform bdc_field       using 'BDC_OKCODE'
                              '=UPDA'.
perform bdc_field       using 'BNKA-BANKA'
                              t_upload-BANKA_026.
perform bdc_field       using 'BNKA-PROVZ'
                              t_upload-PROVZ_027.
perform bdc_field       using 'BNKA-STRAS'
                              t_upload-STRAS_028.
perform bdc_field       using 'BNKA-ORT01'
                              t_upload-ORT01_029.
perform bdc_field       using 'BNKA-BRNCH'
                              t_upload-BRNCH_030.
perform bdc_field       using 'BNKA-SWIFT'
                              t_upload-SWIFT_031.
perform bdc_field       using 'BNKA-BGRUP'
                              t_upload-BGRUP_032.
*----- insertion ends
perform bdc_transaction using 'FI01'.
REFRESH : I_BDCDATA.
CLEAR : WA_UPLOAD.
ENDIF.
ENDLOOP.
ENDFORM. " f_do_transaction
*& Form bdc_dynpro
For appending screen details to BDCDATA
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. "bdc_dynpro
*& Form bdc_field
For appending field details to bdcdata table
FORM bdc_field USING fnam fval.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. " bdc_field
*& Form bdc_transaction
For inserting Transaction in the session
FORM bdc_transaction USING tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'FI01'
TABLES
dynprotab = i_bdcdata.
ENDFORM. " bdc_transaction
*& Form F_close_group
For closing the session created in Session manager SM35
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
concatenate 'Session ' v_session 'successfully created' into v_field.
MESSAGE v_field type 'I'..
CALL TRANSACTION 'SM35'.
ENDFORM. "f_close_group
*& Form f_give_help
For user help to select file
FORM give_help.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',.,..'
mode = 'O'
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0 AND NOT sy-msgty IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f_give_help
---- End of Template -

Actually, there is no need for the dataset statemant at all.  Comment that out, and add a line that moves the data from wa_upload to t_upload,  or you could change the rest of the references to point to wa_upload and forget about t_upload.  Your choice.
LOOP AT i_upload INTO wa_upload .
*---- insert your generated codes from recording at SHDB here
*read dataset wa_upload into t_upload.
*f sy-subrc <> 0. exit. endif.
t_upload = wa_upload.
Regards,
RIch Heilman

Similar Messages

  • BDC Recording for uploadind data in server proxy

    HI,
    I have a scenario where i m getting data from file and sending to SAP.
    Proxy is receiver
    i need to use BDC to upload the data.
    i am not good good in abap  and have no knowledge of using BDC(SHDB).
    could anyone guide me steps how to use BDC in proxy reciever to upload data to SAP.
    jeff

    Hi,
    Here is the sample code for BDC call transaction...
    all you need to do is replace the test values with the field names
    this example is for transaction MM12
           PERFORM bdc_dynpro      USING 'SAPLMGMM' '0060'.
    --> this is what you get in SHDB
           PERFORM bdc_field       USING 'BDC_CURSOR'
                                                           '05/07/2007'.
    > this is when we replace the value with internal table and field name
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RMMG1-AEDAT'.
    Please go though it...hope this will be helpful
    *&      Form  sub_call_transaction
          validating and uploading data to SAP using Call transaction
    FORM sub_call_transaction.
    local variable
      DATA l_check TYPE i.
    sort table t_material
      SORT t_material BY matnr.
    sort table t_mara
      SORT t_mara BY matnr.
    sort table t_twew
      SORT t_twew BY extwg.
    if table t_material contains data upload the data to SAP
      IF NOT t_material[] IS INITIAL.
    uploading only valid records
       LOOP AT t_material INTO w_material.
      reading table t_mara for material
        READ TABLE t_mara INTO w_mara WITH KEY matnr = w_material-matnr
        BINARY SEARCH.
      if material found setting the value of l_check to 2
        IF sy-subrc EQ 0.
          l_check = 2.
          ELSE.
        if material is not matching
          l_check = 1.
          ENDIF.
        if material is valid
          IF l_check = 2.
         reading extwg
           READ TABLE t_twew INTO w_twew WITH KEY extwg = w_material-extwg
           BINARY SEARCH.
         if extwg does not matches
           IF sy-subrc NE 0.
          l_check is set to 3
            l_check = 3.
            ELSE.
           if both material and extwg are valid then l_check is set to 4
             l_check = 4.
            ENDIF.
          ENDIF.
        now bases on the l_check value either uploading the record are
        generating an error value in the internal table
        if l_check value is 1 then material is invalid
        then the record is not update and a corresponding
        error entry is entered in t_report table
          IF l_check EQ 1.
            w_report-matnr = w_material-matnr.
            w_report-extwg = w_material-extwg.
            w_report-date = g_date1.
            w_report-message = c_inv_mat.        "'Error Invalid Material'.
            w_report-icon = icon_red_light.      "Green Light
            APPEND w_report TO t_report.
        if l_check value is 3 then external material group is invalid
        then the record is not update and a corresponding
        error entry is entered in t_report table
          ELSEIF l_check EQ 3.
            w_report-matnr = w_material-matnr.
            w_report-extwg = w_material-extwg.
            w_report-date = g_date1.
            w_report-icon = icon_red_light.   "Green Light
            w_report-message = c_inv_ext.     "'Error Invalid Extwg'.
            APPEND w_report TO t_report.
        if l_check value is 4 then record is valid
        and it will be updated
          ELSEIF l_check EQ 4.
            PERFORM bdc_dynpro      USING 'SAPLMGMM' '0060'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RMMG1-AEDAT'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=AUSW'.
            PERFORM bdc_field       USING 'RMMG1-MATNR'
                                           w_material-matnr.
            PERFORM bdc_field       USING 'RMMG1-AEDAT'
                                           g_date1.
            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)'
                                          'X'.
            PERFORM bdc_dynpro      USING 'SAPLMGMM' '4004'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=BU'.
            PERFORM bdc_field       USING 'MARA-EXTWG'
                                           w_material-extwg.
        calling transaction MM12
          PERFORM bdc_transaction USING c_tcode.              "'MM12'.
          ENDIF.
        clearing work area w_material
          CLEAR w_material.
        clearing work area w_mara
          CLEAR w_mara.
        clearing work area w_twew
          CLEAR w_twew.
        clearing the local variable
          CLEAR l_check.
        clearing all the records of t_bdcdata
        clearing all the records from t_bdcdata
          REFRESH t_bdcdata.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "sub_upload_data
    *&      Form  bdc_transaction
        This form is used to run call transaction method
    FORM bdc_transaction USING tcode.
    calling the transaction MM12 in mode 'N' background
      CALL TRANSACTION tcode USING t_bdcdata
                       MODE   g_ctumode
                       UPDATE g_cupdate
                       MESSAGES INTO t_bdcmsgcoll.
    checking for records in table t_bdcmsgcoll
      IF NOT t_bdcmsgcoll[] IS INITIAL.
      checking the status of each record success or failure
        READ TABLE t_bdcmsgcoll INTO w_bdcmsgcoll WITH KEY
        msgtyp = c_error.                                   "'E'.
      if error record update with error message
        IF sy-subrc EQ 0.
      if error then trap the message
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              id        = w_bdcmsgcoll-msgid
              lang      = sy-langu
              no        = w_bdcmsgcoll-msgnr
              v1        = w_bdcmsgcoll-msgv1
              v2        = w_bdcmsgcoll-msgv2
              v3        = w_bdcmsgcoll-msgv3
              v4        = w_bdcmsgcoll-msgv4
            IMPORTING
              msg       = w_report-message
            EXCEPTIONS
              not_found = 1
              OTHERS    = 2.
        appending t_report table with error message
          w_report-matnr = w_material-matnr.
          w_report-extwg = w_material-extwg.
          w_report-icon = icon_red_light.               "Red Light
        appending the record
          APPEND w_report TO t_report.
        ELSE.
        appending t_report with success message
          w_report-matnr = w_material-matnr.
          w_report-extwg = w_material-extwg.
          w_report-date = g_date1.
          w_report-message = c_success.
          w_report-icon = icon_green_light.             "Green Light
        appending the record
          APPEND w_report TO t_report.
        ENDIF.
      clearing the records from table
        REFRESH t_bdcmsgcoll.
      ENDIF.
    ENDFORM.                    "BDC_TRANSACTION
    Thank you
    Ajay

  • FM for uploading data into internal table from Excel sheet

    Hi,
    I have a slight problem in one of the function modules that I have created. Actually it has been copied from a standard SAP function module “KCD_EXCEL_OLE_TO_INT_CONVERT”. Now my created function module is throwing me a dump suggesting “Data objects in a Unicode program are not convertible”. Can anybody help me out in removing the error .
    Actually the need of copying the standard FM to a ZFM is to increase the length of the column which can be uploaded thru this FM. The standard FM has a restriction of being able to upload 32 characters whereas my requirement is to upload data having at least 150 characters. So in order to care the need I made a ZStructure ZAKHIL_CELLS taking the Value parameters as 150 characters instead of 32 characters.
    Well this is all done because I wanted to upload a excel sheet into an internal table and not use a tab delimited file. Can anybody help in this regard or suggest some other function module which can upload more than 150 characters from a excel sheet .
    ‘m also attaching structure of my ZStructure for ur reference .
    STRUCTURE ZAKHIL_CELLS1 .
    ROW KCD_EX_ROW_N NUMC 4 Flexible Excel upload: row number
    COL KCD_EX_COL_N NUMC 4 Column
    VALUE KCD_VALUE CHAR 150 External Data Transfer: Values of Parameters or Variables
    Thanks & Rgds,
    Akhil

    hi,
    sample excel sheet.
    coloumn 1 is name and column 2 is age
    name age
    A     8
    C     13
    D     55
    DATA : int_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    data : record like db_name_age occurs 0 with header line.
    DATA : v_start_col TYPE i VALUE '1', "starting col
           v_start_row TYPE i VALUE '1', " starting row
           v_end_col   TYPE i VALUE '2', " total columns
           v_end_row   TYPE i VALUE '10'. "total no of record
    FORM f_upload .
      CLEAR : int_excel, int_excel[].
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = wf_filename
          i_begin_col             = v_start_col
          i_begin_row             = v_start_row
          i_end_col               = v_end_col
          i_end_row               = v_end_row
        TABLES
          intern                  = int_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    *Message is 'Unable to upload data from  '  wf_filename.
        MESSAGE e169(zm050) WITH wf_filename.
      ELSE.
        SORT int_excel BY row col.
        REFRESH : record.
        CLEAR   : record.
        LOOP AT int_excel.
          CASE int_excel-col. "go thru each column.
            WHEN 1.
              record-name  = int_excel-value.
            WHEN 2.
              record-age = int_excel-value.     
          ENDCASE.
          AT END OF row.
            APPEND record.
            CLEAR record.
          ENDAT.
        ENDLOOP.
    *inserting into table
      ENDIF.
    if this helped pld rewrd points,
    rgrds
    anver

  • BDC Program for Uploading Data for Property Tree in cg02

    Hi,
        How to upload data for property tree ( standard Properties ) of CG02. I checked for BAPI or Function Module but most them supports for specification header and sub item. 
    Please Let me know if any function module or BAPI available for this process.  I tried with BDC Program, but it fails.
    Regards,
    Rajesh Kumar Murugesan

    Hallo Rajesh
    take a look here:
    http://help.sap.com/erp2005_ehp_06/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
    Chapter "Import and Export".
    1.)  Reads cross these further chapters:
    "Tools (EHS-BD-TLS)" => "IMport and Export" => "Import: Process" => "Specifying the Sequence of the External Data Structure "  => "External File Structure: Specification"
    Here you will learn how to prepare the data. In chapter:" Example: Transfer File for Specifications" you will find an example of an file whcih could be used to upload data in the property tree
    2.) Chapter:" Importing Specifications"  is explaining the steps whcih are need to populate the property with data using the file as prepared; read cross chapter "Specification Import Control"
    I hope this helps.
    C.B.
    Edited by: Christoph Bergemann on Feb 4, 2012 6:59 PM
    Edited by: Christoph Bergemann on Feb 4, 2012 6:59 PM

  • 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

  • Tcode to upload data into CATSDB table

    Hi All,
      Could anyone let me know what is the TCODE that we will record and upload data into CATSDB table in HR ABAP.
    Regards,
    Srinivas.

    Hi,
    I also need the same information...i.e i want to record overtime of Employees...Where to do this?
    I tried creating it in PA61. I am able to create it with attendance type. But its triggering the CREATED method of ATTENDANCE Bus. Object. But i have been asked to use CREATED method CATS Bus. Object.
      Can anyone help me in this??? Also tell me how make entries in CAT2 ....
    Thanks,
    Sivagami.R

  • BDC to upload data into FF67 Tables

    Hi,
    I like to upload data into FF67 Tables to process manual Bank Reconciliation.
    I wanted to know to upload data into FF67 Tables what are the related table.fields I have to consider.  (fields name and table names)
    My inputs are --  Posting Date, Assignment, Business Area, Profit Center, Amount, Tran key, Value Date, Bank Account, G/L Account, Co. Code, Currency
    Regards
    Rahkes

    Hi Divraj,
    As this is a regular posting like tranasction, I have to create BDC for this data posting.
    For this I like to know the table.fields that I need to update for FF67 Posting.
    If you can let me know the impacted table.fiedls for TCode: FF67 update then it will help me for creating BDC.
    Thanks & Regards
    Rahkes

  • BDC for Uploading data from XL sheet with unknown order of fields

    Hi SAP Gurus,
    My requirement is as follows,
    A BDC is to be developed for uploading data from an XL sheet, but the problem here is , the order of fileds in the sheet can be changed .
    ie,  for example the fields in the XL sheet are :-
      matnr    maktx   menge  amount
    but the user can give as
      matnr  amount  menge  maktx
      or
    maktx   matnr  amount  menge
    how i can solve this problem.
    Thanks and Regards,
    pavan.

    Hi Pavan,
    You need to handle it by your self, you can create a dynamic table based on the file value.
    The field name pass from file with the record as a header, and based on the header name create your dynamic table.
    afterward you can pass your value to BDC.
    for creating dynamic table you can use this method
    call method cl_alv_table_create=>create_dynamic_table
      exporting
       i_style_table             =
        it_fieldcatalog           = it_field[]
       i_length_in_byte          =
      importing
        ep_table                  = dyn_tab
       e_style_fname             =
      exceptions
        generate_subpool_dir_full = 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.
    -Dhirendra

  • Customized LSMW (Batch Input Recording) to upload data for Vendor

    Hello Fiends,
       can u help me on this object and how to upload in xk01.
            Customized LSMW (Batch Input Recording) to upload data for Vendor Master using Transaction code XK01
    With best wishes,
    Chandu.
    Point will be rewarded....

    Hi,
    Go through the following link, you will find your answer
    http://www.sapbrain.com
    Regards,
    Bhaskar

  • How to upload data into Classification-MM02 for each MATNR By using BAPI

    Hi all
          How to upload data into characterstic value in  classification- MM02 for each MATNR by using BAPI.

    Hi Siva,
    Please try BAPI BAPI_OBJCL_CHANGE.
    The object key should be material number and object table should be MARA.
    Regards
    Hiren K.Chitalia

  • Bdc recording for mek1

    hi
    i have been asked to do bdc recording for the transaction mek1 through the call transaction method.can u people plss tell me how to go abt it?

    Hi,
    You can Record using the Tcode SHDB and format the program and use.
    You can use VK11 tcode also which is similar to MEK1.
    see the sample code for VK11 ; You can change as per your requirement.
    report ZSDBDCP_PRICING no standard page heading
           line-size 255.
                               Includes
    include zbdcrecx1.
                              Internal Tables
    *--Internal Table To hold condition records data from flat file.
    Data: begin of it_pricing occurs 0,
           key(4),
           f1(4),
           f2(4),
           f3(2),
           f4(18),
           f5(16),
          end of it_pricing.
    *--Internal Table To hold condition records header  .
    data : begin of it_header occurs 0,
             key(4),
             f1(4),
             f2(4),
             f3(2),
           end of it_header.
    *--Internal Table To hold condition records details .
    data : begin of it_details occurs 0,
            key(4),
            f4(18),
            f5(16),
           end of it_details.
    data : v_sno(2),
           v_rows type i,
           v_fname(40).
    start-of-selection.
    refresh : it_pricing,it_header,it_details.
    clear  : it_pricing,it_header,it_details.
    CALL FUNCTION 'UPLOAD'
          EXPORTING
               FILENAME                = 'C:\WINDOWS\Desktop\pricing.txt'
               FILETYPE                = 'DAT'
          TABLES
               DATA_TAB                = it_pricing
          EXCEPTIONS
               CONVERSION_ERROR        = 1
               INVALID_TABLE_WIDTH     = 2
               INVALID_TYPE            = 3
               NO_BATCH                = 4
               UNKNOWN_ERROR           = 5
               GUI_REFUSE_FILETRANSFER = 6
               OTHERS                  = 7.
      WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.
      OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.
      if sy-subrc ne 0.
        write : / 'File could not be uploaded.. Check file name.'.
        stop.
      endif.
      CLEAR : it_pricing[], it_pricing.
      DO.
        READ DATASET P_FNAME INTO V_STR.
        IF SY-SUBRC NE 0.
          EXIT.
        ENDIF.
    write v_str.
    translate v_str using '#/'.
        SPLIT V_STR AT ',' INTO it_pricing-key
                                it_pricing-F1 it_pricing-F2 it_pricing-F3
                                it_pricing-F4 it_pricing-F5 .
        APPEND it_pricing.
        CLEAR it_pricing.
      ENDDO.
      IF it_pricing[] IS INITIAL.
        WRITE : / 'No data found to upload'.
        STOP.
      ENDIF.
      loop at it_pricing.
        At new key.
          read table it_pricing index sy-tabix.
          move-corresponding it_pricing to it_header.
          append it_header.
          clear it_header.
        endat.
        move-corresponding it_pricing to it_details.
        append it_details.
        clear it_details.
      endloop.
      perform open_group.
      v_rows = sy-srows - 8.
      loop at it_header.
        perform bdc_dynpro      using 'SAPMV13A' '0100'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'RV13A-KSCHL'
                                      it_header-f1.
        perform bdc_dynpro      using 'SAPMV13A' '1004'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'KONP-KBETR(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'KOMG-VKORG'
                                      it_header-f2.
        perform bdc_field       using 'KOMG-VTWEG'
                                       it_header-f3.
    **Table Control
        v_sno = 0.
        loop at it_details where key eq it_header-key.
          v_sno = v_sno + 1.
          clear v_fname.
          CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.
          perform bdc_field       using v_fname
                                        it_details-f4.
          clear v_fname.
          CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.
          perform bdc_field       using v_fname
                                        it_details-f5.
          if v_sno eq v_rows.
            v_sno = 0.
            perform bdc_dynpro      using 'SAPMV13A' '1004'.
            perform bdc_field       using 'BDC_OKCODE'
                                     '=P+'.
            perform bdc_dynpro      using 'SAPMV13A' '1004'.
            perform bdc_field       using 'BDC_OKCODE'
                                     '/00'.
          endif.
        endloop.
    *--Save
        perform bdc_dynpro      using 'SAPMV13A' '1004'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=SICH'.
        perform bdc_transaction using 'VK11'.
      endloop.
      perform close_group.
    Regards,
    Anji

  • Bdc recording for trancastion ME01

    Hi,
    Can u help me in BDC recording for transaction 'ME01' .
    I have no idea for transaction 'ME01'  & here i like to know how to handle table ctr during bdc recording?
    give sample code if possible.
    Thanks

    See the sample attached code for ME51 using table control.
    similarly record the same for ME01 and copy the TC logic from this.
    REPORT zmm_pr_upload_mat
    NO STANDARD PAGE HEADING
    LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_pr OCCURS 0,
    Header Screen
    sno(3), " SNo
    bsart(004), " PR Type
    epstp(001), " Item Category
    knttp(001), " Account Assignment
    eeind(010), " Delivery Date
    lpein(001), " Category of Del Date
    werks(004), " Plant
    lgort(004), " Storage Location
    ekgrp(003), " Purchasing Group
    matkl(009), " Material Group
    bednr(010), " Tracking No
    afnam(012), " Requisitioner
    Item Details
    matnr(018), " Material No
    menge(017), " Quantity
    badat(010),
    frgdt(010),
    preis(014), " Valuation Price
    waers(005), " Currency
    peinh(005),
    wepos(001),
    repos(001),
    sakto(010), " GL Account
    kostl(010), " Cost Center
    bnfpo(005),
    END OF i_pr.
    Internal Table for header Data
    DATA: BEGIN OF it_header OCCURS 0,
    sno(3), " SNo
    bsart(004), " PR Type
    epstp(001), " Item Category
    knttp(001), " Account Assignment
    eeind(010), " Delivery Date
    werks(004), " Plant
    lgort(004), " Storage Location
    ekgrp(003), " Purchasing Group
    matkl(009), " Material Group
    bednr(010), " Tracking No
    afnam(012), " Requisitioner
    END OF it_header.
    Internal Table for Item Data
    DATA: BEGIN OF it_item OCCURS 0,
    sno(3), " SNo
    matnr(018), " Material No
    menge(017), " Quantity
    preis(014), " Valuation Price
    sakto(010), " GL Account
    kostl(010), " Cost Center
    END OF it_item.
    Data Variables & Constants
    CONSTANTS : c_x VALUE 'X'. " Flag
    DATA : v_l(2), " Counter
    v_rowno(5), " Row No
    v_2(2), " Counter
    v_rows LIKE sy-srows, " Rows in TC
    v_field(45). " String
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path. " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
    PERFORM open_group.
    Upload the File into internal Table
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    filename = p_file
    filetype = 'DAT'
    TABLES
    data_tab = i_pr
    EXCEPTIONS
    conversion_error = 1
    invalid_table_width = 2
    invalid_type = 3
    no_batch = 4
    unknown_error = 5
    gui_refuse_filetransfer = 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.
    SORT i_pr BY sno.
    LOOP AT i_pr.
    MOVE-CORRESPONDING i_pr TO it_item.
    APPEND it_item.
    CLEAR it_item.
    AT END OF sno.
    READ TABLE i_pr INDEX sy-tabix.
    MOVE-CORRESPONDING i_pr TO it_header.
    APPEND it_header.
    CLEAR it_header.
    ENDAT.
    ENDLOOP.
    SORT it_header BY sno.
    SORT it_item BY sno.
    v_rows = sy-srows - 6.
    Upload the Data from Internal Table
    LOOP AT it_header.
    Header Data
    PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'EBAN-BEDNR'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'EBAN-BSART'
    it_header-bsart.
    PERFORM bdc_field USING 'RM06B-EPSTP'
    it_header-epstp.
    PERFORM bdc_field USING 'EBAN-KNTTP'
    it_header-knttp.
    PERFORM bdc_field USING 'RM06B-EEIND'
    it_header-eeind.
    PERFORM bdc_field USING 'RM06B-LPEIN'
    it_header-lpein.
    PERFORM bdc_field USING 'EBAN-WERKS'
    it_header-werks.
    PERFORM bdc_field USING 'EBAN-LGORT'
    it_header-lgort.
    PERFORM bdc_field USING 'EBAN-EKGRP'
    it_header-ekgrp.
    PERFORM bdc_field USING 'EBAN-MATKL'
    it_header-matkl.
    PERFORM bdc_field USING 'EBAN-BEDNR'
    it_header-bednr.
    PERFORM bdc_field USING 'EBAN-AFNAM'
    it_header-afnam.
    Item Details
    v_l = 0.
    To add no. of rows
    v_2 = 0 .
    As the screen is showing 13 rows defaulted to 130
    v_rowno = 130 .
    LOOP AT it_item WHERE sno = it_header-sno.
    v_l = v_l + 1.
    IF v_l = 14 .
    IF v_2 = 12 .
    v_2 = 12 .
    v_l = 2 .
    From second time onwards it is displaying 12 rows only
    v_rowno = v_rowno + 120 .
    PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RM06B-BNFPO'.
    PERFORM bdc_field USING 'RM06B-BNFPO'
    v_rowno.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    ELSE.
    V_2 initialized to 12 for second screen purpose
    v_2 = 12 .
    v_l = 2 .
    PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RM06B-BNFPO'.
    PERFORM bdc_field USING 'RM06B-BNFPO'
    v_rowno .
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    ENDIF.
    ENDIF.
    PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    CLEAR v_field.
    CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
    PERFORM bdc_field USING v_field it_item-matnr.
    CLEAR v_field.
    CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
    PERFORM bdc_field USING v_field it_item-menge.
    PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'EBAN-PREIS'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'EBAN-PREIS'
    it_item-preis.
    PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'EBKN-SAKTO'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTE'.
    PERFORM bdc_field USING 'EBKN-SAKTO'
    it_item-sakto.
    Cost Center
    PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'COBL-KOSTL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTE'.
    PERFORM bdc_field USING 'COBL-KOSTL'
    it_item-kostl.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTE'.
    ENDLOOP.
    PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RM06B-BNFPO'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=BU'.
    Call The Transaction
    PERFORM bdc_transaction USING 'ME51'.
    ENDLOOP.
    Close the BDC Session
    PERFORM close_group.
    reward if useful
    Regards
    Vasu

  • BDC recording for AS01

    hi all,
    how to do bdc recording for AS01.please send me step step by approach.

    Hi Satya,
    Welcome to SDN.
    Check this Sample program.
    REPORT ZASSET .
    INCLUDE ZASSET_INC .
    PARAMETERS: P_PCFILE LIKE RLGRAP-FILENAME.
    *PARAMETERS: P_FILE_S LIKE RLGRAP-FILENAME.
    PARAMETER : H_CHK AS CHECKBOX.
    "Proc Mode
    Include the BDC *
    **BDC DATA STUCTURE
    *DATA: BEGIN OF BDCDATA OCCURS 0.
    INCLUDE STRUCTURE BDCDATA.
    *DATA: END OF BDCDATA.
    messages of call transaction
    *DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    TYPE-POOLS
    TYPE-POOLS TRUXS.
    DATA IT_DATA1 TYPE TRUXS_T_TEXT_DATA.
    DATA : BEGIN OF IT_DATA OCCURS 0,
    INVZU(015),
    ANLKL(008),
    BUKRS(004),
    TXT50(100),
    SERNR(018),
    MENGE(018),
    INKEN(001),
    AKTIV(010),
    KOSTL(010),
    WERKS(004),
    STORT(010),
    ORD41(004),
    ORD42(004),
    EQANZ(001),
    LIFNR(010),
    AFASL(004),
    NDJAR(003),
    AFABG(010),
    ANLGR(012),
    ANLGR2(004),
    ANBTR01_01(016),
    ANBTR01_06(016),
    ANBTR01_16(016),
    TDATE(010),
    TCODE(004),
    TAMT(018),
    PERNR(012),
    KFZKF(015),
    SAP_ASSET(12),
    ERR_ASSET,
    END OF IT_DATA.
    DATA : BEGIN OF IT_DATA2 OCCURS 0,
    INVZU(015),
    TDATE(010),
    TCODE(004),
    TAMT(018),
    END OF IT_DATA2.
    DATA : BEGIN OF IT_DATA3 OCCURS 0,
    ITEM(003),
    INVZU(015),
    ANLKL(010),
    BUKRS(010),
    TXT50(050),
    SERNR(018),
    MENGE(018),
    INKEN(001),
    AKTIV(010),
    KOSTL(010),
    WERKS(004),
    STORT(010),
    ORD41(004),
    ORD42(004),
    EQANZ(001),
    LIFNR(010),
    AFASL(004),
    NDJAR(003),
    AFABG(010),
    ANLGR(012),
    ANLGR2(004),
    ANBTR01_01(016),
    ANBTR01_06(016),
    ANBTR01_16(016),
    TDATE(010),
    TCODE(004),
    TAMT(018),
    SAP_ASSET(12),
    ERR_ASSET,
    END OF IT_DATA3.
    SUB ASSET MASTER TABLE
    DATA : BEGIN OF IT_DATA_SUB OCCURS 0,
    INVZU_M(015),
    INVZU(015),
    BUKRS(004),
    TXT50(100),
    ANLHTXT(050),
    SERNR(018),
    MENGE(018),
    MEINS_007(003),
    XHIST_008(001),
    AKTIV(010),
    GSBER_011(004),
    KOSTL(010),
    STORT(010),
    ORD41(004),
    ORD42(004),
    EQANZ_016(001),
    LIFNR(010),
    LIEFE(030),
    NDJAR(003),
    NDPER(003),
    ANBTR01_01(016),
    ANBTR01_06(016),
    ANBTR01_16(016),
    BZDAT(010),
    BWASL(003),
    ANBTR01(016),
    ANLN1(012),
    ERR_SUB,
    SUB_CODE(012),
    ERR_SUB1,
    END OF IT_DATA_SUB.
    *& At selection-screen on value request for getting f4 help
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCFILE.
    PERFORM VALUE_REQUEST_P_FILE.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_S.
    PERFORM VALUE_REQUEST_P_FILE_S.
    START OF SELECTION *
    START-OF-SELECTION.
    To Upload the flat file datas *
    PERFORM GET_DATA.
    PERFORM UP_LOAD.
    PERFORM SUB_UPLOAD.
    WRITE :/ 'FOLLOWING ASSETS CREATED'.
    WRITE:/ 'OLD ASSET'.
    WRITE: 20 'COMPANY'.
    WRITE: 30 'SAP CODE'.
    LOOP AT IT_DATA WHERE ERR_ASSET NE 'X'.
    WRITE :/ IT_DATA-INVZU,
    20 IT_DATA-BUKRS, 30 IT_DATA-SAP_ASSET.
    ENDLOOP.
    SKIP 2.
    WRITE :/ 'FOLLOWING SUB ASSETS CREATED'.
    WRITE:/ 'OLD ASSET'.
    WRITE: 16 'OLD SUB ASSET'.
    WRITE: 35 'COMPANY'.
    WRITE: 45 'SAP CODE'.
    WRITE: 60 'SUB ASSET'.
    LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X' AND ERR_SUB1 NE 'X'.
    WRITE :/ IT_DATA_SUB-INVZU_M,
    16 IT_DATA_SUB-INVZU,
    35 IT_DATA_SUB-BUKRS, 45 IT_DATA_SUB-ANLN1, 60
    *IT_DATA_SUB-SUB_CODE.
    ENDLOOP.
    *& Form value_request_p_file
    FORM VALUE_REQUEST_P_FILE .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = 'x'
    IMPORTING
    FILE_NAME = P_PCFILE.
    ENDFORM. " value_request_p_file
    *& Form UP_LOAD
    text
    --> p1 text
    <-- p2 text
    FORM UP_LOAD .
    SORT IT_DATA BY INVZU.
    SORT IT_DATA2 BY INVZU.
    DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).
    perform open_dataset using dataset.
    PERFORM OPEN_GROUP.
    LOOP AT IT_DATA.
    CONDENSE IT_DATA-TXT50.
    V_LEN1 = STRLEN( IT_DATA-TXT50 ).
    IF V_LEN1 > 50.
    V_SUBSTR1 = IT_DATA-TXT50+0(50).
    V_LEN2 = V_LEN1 - 50.
    V_SUBSTR2 = IT_DATA-TXT50+50(50).
    ELSE.
    V_SUBSTR1 = IT_DATA-TXT50.
    V_SUBSTR2 = ''..
    ENDIF.
    REFRESH BDCDATA.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0105'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-BUKRS'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '/00'.
    PERFORM BDC_FIELD USING 'ANLA-ANLKL'
    IT_DATA-ANLKL.
    PERFORM BDC_FIELD USING 'ANLA-BUKRS'
    IT_DATA-BUKRS.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB02'.
    PERFORM BDC_FIELD USING 'ANLA-TXT50'
    V_SUBSTR1. "IT_DATA-TXT50.
    PERFORM BDC_FIELD USING 'ANLA-TXA50'
    V_SUBSTR2.
    PERFORM BDC_FIELD USING 'ANLA-SERNR'
    IT_DATA-SERNR.
    PERFORM BDC_FIELD USING 'ANLA-MENGE'
    IT_DATA-MENGE.
    *perform bdc_field using 'ANLA-INKEN'
    record-INKEN_006.
    PERFORM BDC_FIELD USING 'ANLA-INVZU'
    IT_DATA-INVZU.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-AKTIV'.
    PERFORM BDC_FIELD USING 'ANLA-AKTIV'
    IT_DATA-AKTIV.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB03'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLZ-PERNR'.
    PERFORM BDC_FIELD USING 'ANLZ-PERNR'
    IT_DATA-PERNR.
    PERFORM BDC_FIELD USING 'ANLZ-KOSTL'
    IT_DATA-KOSTL.
    PERFORM BDC_FIELD USING 'ANLZ-WERKS'
    IT_DATA-WERKS.
    PERFORM BDC_FIELD USING 'ANLZ-STORT'
    IT_DATA-STORT.
    IF IT_DATA-ANLKL = 'VHCL'.
    PERFORM BDC_FIELD USING 'ANLZ-KFZKZ'
    IT_DATA-KFZKF.
    ENDIF.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB04'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ORD42'.
    PERFORM BDC_FIELD USING 'ANLA-ORD41'
    IT_DATA-ORD41.
    PERFORM BDC_FIELD USING 'ANLA-ORD42'
    IT_DATA-ORD42.
    *perform bdc_field using 'RA02S-EQANZ'
    record-EQANZ_014.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB06'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-LIFNR'.
    PERFORM BDC_FIELD USING 'ANLA-LIFNR'
    IT_DATA-LIFNR.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB08'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLV-VSART'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=SELZ'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'RA02S-XAKPLA(02)'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLB-AFASL'.
    IF IT_DATA-TCODE IS INITIAL.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTD'.
    ELSE.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTB'.
    ENDIF.
    PERFORM BDC_FIELD USING 'ANLB-ANLGR'
    IT_DATA-ANLGR.
    PERFORM BDC_FIELD USING 'ANLB-ANLGR2'
    IT_DATA-ANLGR2.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
    IF IT_DATA-TCODE IS INITIAL.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=BUCH'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA-ANBTR01_01.
    IF H_CHK NE 'X'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
    IT_DATA-ANBTR01_06.
    ENDIF.
    ELSE.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTB'.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=BUCH'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
    IT_DATA-TDATE.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
    IT_DATA-TCODE.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA-TAMT.
    ENDIF.
    REFRESH MESSTAB.
    CALL TRANSACTION 'AS91' USING BDCDATA
    MODE H_MODE
    UPDATE 'S'
    MESSAGES INTO MESSTAB.
    PERFORM BDC_TRANSACTION USING 'AS91'.
    ENDLOOP..
    PERFORM CLOSE_GROUP.
    *perform close_dataset using dataset.
    ENDFORM. " UP_LOAD
    *& Form GET_DATA
    text
    --> p1 text
    <-- p2 text
    FORM GET_DATA .
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_TAB_RAW_DATA = IT_DATA1
    I_FILENAME = P_PCFILE
    TABLES
    I_TAB_CONVERTED_DATA = IT_DATA.
    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 IT_DATA3.
    IF IT_DATA3-ITEM = '1'.
    MOVE-CORRESPONDING IT_DATA3 TO IT_DATA.
    APPEND IT_DATA.
    ELSEIF IT_DATA3-ITEM = '2'.
    IT_DATA2-INVZU = IT_DATA3-INVZU.
    IT_DATA2-TDATE = IT_DATA3-ANLKL.
    IT_DATA2-TCODE = IT_DATA3-BUKRS.
    IT_DATA2-TAMT = IT_DATA3-TXT50.
    APPEND IT_DATA2.
    ENDIF.
    ENDLOOP.
    IF NOT P_FILE_S IS INITIAL.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_TAB_RAW_DATA = IT_DATA1
    I_FILENAME = P_FILE_S
    TABLES
    I_TAB_CONVERTED_DATA = IT_DATA_SUB.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDFORM. " GET_DATA
    FORM BDC_DYNPRO
    --> PROGRAM
    --> DYNPRO
    **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
    --> FNAM
    --> FVAL
    **FORM BDC_FIELD USING FNAM FVAL.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
    **ENDFORM. "BDC_FIELD
    ***& Form bdc_transaction
    text
    -->TCODE text
    **FORM BDC_TRANSACTION USING TCODE.
    REFRESH MESSTAB.
    CALL TRANSACTION TCODE USING BDCDATA
    MODE H_MODE
    UPDATE 'S'
    MESSAGES INTO MESSTAB.
    **ENDFORM. " bdc_transaction
    *& Form VALUE_REQUEST_P_FILE_S
    text
    --> p1 text
    <-- p2 text
    FORM VALUE_REQUEST_P_FILE_S .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = 'x'
    IMPORTING
    FILE_NAME = P_FILE_S.
    ENDFORM. " VALUE_REQUEST_P_FILE_S
    *& Form sUB_upload
    text
    --> p1 text
    <-- p2 text
    ***FORM SUB_UPLOAD .
    DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).
    LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.
    CONDENSE IT_DATA_SUB-TXT50.
    V_LEN1 = STRLEN( IT_DATA_SUB-TXT50 ).
    IF V_LEN1 > 50.
    V_SUBSTR1 = IT_DATA_SUB-TXT50+0(50).
    V_LEN2 = V_LEN1 - 50.
    V_SUBSTR2 = IT_DATA_SUB-TXT50+50(50).
    ELSE.
    V_SUBSTR1 = IT_DATA_SUB-TXT50.
    V_SUBSTR2 = ''..
    ENDIF.
    REFRESH BDCDATA.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=MAST'.
    PERFORM BDC_FIELD USING 'ANLA-ANLN1'
    IT_DATA_SUB-ANLN1.
    PERFORM BDC_FIELD USING 'ANLA-BUKRS'
    IT_DATA_SUB-BUKRS.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB02'.
    PERFORM BDC_FIELD USING 'ANLA-TXT50'
    V_SUBSTR1. "IT_DATA_SUB-TXT50.
    PERFORM BDC_FIELD USING 'ANLA-TXa50'
    V_SUBSTR2. "IT_DATA_SUB-TXT50.
    ****perform bdc_field using 'ANLH-ANLHTXT'
    it_data_sub-ANLHTXT_004.
    PERFORM BDC_FIELD USING 'ANLA-SERNR'
    IT_DATA_SUB-SERNR.
    PERFORM BDC_FIELD USING 'ANLA-MENGE'
    IT_DATA_SUB-MENGE.
    ****perform bdc_field using 'ANLA-MEINS'
    it_data_sub-MEINS_007.
    ****perform bdc_field using 'RA02S-XHIST'
    it_data_sub-XHIST_008.
    PERFORM BDC_FIELD USING 'ANLA-INVZU'
    IT_DATA_SUB-INVZU.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-AKTIV'.
    PERFORM BDC_FIELD USING 'ANLA-AKTIV'
    IT_DATA_SUB-AKTIV.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB03'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLZ-GSBER'.
    ****perform bdc_field using 'ANLZ-GSBER'
    it_data_sub-GSBER_011.
    ****perform bdc_field using 'ANLZ-KOSTL'
    it_data_sub-KOSTL_012.
    PERFORM BDC_FIELD USING 'ANLZ-STORT'
    IT_DATA_SUB-STORT.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB04'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ORD41'.
    PERFORM BDC_FIELD USING 'ANLA-ORD41'
    IT_DATA_SUB-ORD41.
    PERFORM BDC_FIELD USING 'ANLA-ORD42'
    IT_DATA_SUB-ORD42.
    ****perform bdc_field using 'RA02S-EQANZ'
    it_data_sub-EQANZ_016.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB07'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-LIFNR'.
    PERFORM BDC_FIELD USING 'ANLA-LIFNR'
    IT_DATA_SUB-LIFNR.
    ****perform bdc_field using 'ANLA-LIEFE'
    IT_DATA_SUB-LIEFE.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB08'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-LEART'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=SELZ'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'T093T-AFBKTX(01)'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLB-NDPER'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTD'.
    PERFORM BDC_FIELD USING 'ANLB-NDJAR'
    IT_DATA_SUB-NDJAR.
    PERFORM BDC_FIELD USING 'ANLB-NDPER'
    IT_DATA_SUB-NDPER.
    ****perform bdc_field using 'ANLB-AFABG'
    record-AFABG_029.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    IF IT_DATA_SUB-BWASL IS INITIAL.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=BUCH'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA_SUB-ANBTR01_01.
    Accu deprn automatically calculated by system changed on 6th Aug.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
    IT_DATA_SUB-ANBTR01_06.
    ELSE.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTB'.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '/00'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
    IT_DATA_SUB-BZDAT.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
    IT_DATA_SUB-BWASL.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA_SUB-ANBTR01.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=BUCH'.
    ****perform bdc_transaction using 'AS94'.
    ENDIF.
    REFRESH MESSTAB.
    CALL TRANSACTION 'AS94' USING BDCDATA
    MODE H_MODE
    UPDATE 'S'
    MESSAGES INTO MESSTAB.
    IF SY-SUBRC = 0.
    READ TABLE MESSTAB INDEX 1.
    IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.
    DATA AN1 TYPE ANLN1.
    DATA AN2 TYPE ANLN2.
    GET PARAMETER ID 'AN2' FIELD AN2.
    IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.
    MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.
    ELSE.
    IT_DATA_SUB-ERR_SUB1 = 'X'.
    MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.
    ENDIF.
    REFRESH BDCDATA.
    ENDLOOP.
    ***ENDFORM. " sUB_upload
    ****& Form SUB_UPLOAD1
    text
    ***FORM SUB_UPLOAD1 .
    LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=MAST'.
    PERFORM BDC_FIELD USING 'ANLA-ANLN1'
    IT_DATA_SUB-ANLN1.
    PERFORM BDC_FIELD USING 'ANLA-BUKRS'
    IT_DATA_SUB-BUKRS.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB02'.
    PERFORM BDC_FIELD USING 'ANLA-TXT50'
    IT_DATA_SUB-TXT50.
    ****perform bdc_field using 'ANLH-ANLHTXT'
    it_data_sub-ANLHTXT_004.
    PERFORM BDC_FIELD USING 'ANLA-SERNR'
    IT_DATA_SUB-SERNR.
    PERFORM BDC_FIELD USING 'ANLA-MENGE'
    IT_DATA_SUB-MENGE.
    ****perform bdc_field using 'ANLA-MEINS'
    it_data_sub-MEINS_007.
    ****perform bdc_field using 'RA02S-XHIST'
    it_data_sub-XHIST_008.
    PERFORM BDC_FIELD USING 'ANLA-INVZU'
    IT_DATA_SUB-INVZU.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-AKTIV'.
    PERFORM BDC_FIELD USING 'ANLA-AKTIV'
    IT_DATA_SUB-AKTIV.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB03'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLZ-GSBER'.
    ****perform bdc_field using 'ANLZ-GSBER'
    it_data_sub-GSBER_011.
    ****perform bdc_field using 'ANLZ-KOSTL'
    it_data_sub-KOSTL_012.
    PERFORM BDC_FIELD USING 'ANLZ-STORT'
    IT_DATA_SUB-STORT.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB04'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ORD41'.
    PERFORM BDC_FIELD USING 'ANLA-ORD41'
    IT_DATA_SUB-ORD41.
    PERFORM BDC_FIELD USING 'ANLA-ORD42'
    IT_DATA_SUB-ORD42.
    ****perform bdc_field using 'RA02S-EQANZ'
    it_data_sub-EQANZ_016.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB07'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-LIFNR'.
    PERFORM BDC_FIELD USING 'ANLA-LIFNR'
    IT_DATA_SUB-LIFNR.
    ****perform bdc_field using 'ANLA-LIEFE'
    IT_DATA_SUB-LIEFE.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=TAB08'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-LEART'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=SELZ'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'T093T-AFBKTX(01)'.
    PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLB-NDPER'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTD'.
    PERFORM BDC_FIELD USING 'ANLB-NDJAR'
    IT_DATA_SUB-NDJAR.
    PERFORM BDC_FIELD USING 'ANLB-NDPER'
    IT_DATA_SUB-NDPER.
    ****perform bdc_field using 'ANLB-AFABG'
    record-AFABG_029.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=ALTB'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA_SUB-ANBTR01_01.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
    IT_DATA_SUB-ANBTR01_06.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '/00'.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
    IT_DATA_SUB-BZDAT.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
    IT_DATA_SUB-BWASL.
    PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
    IT_DATA_SUB-ANBTR01.
    PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
    PERFORM BDC_FIELD USING 'BDC_CURSOR'
    'ANLA-ANLN1'.
    PERFORM BDC_FIELD USING 'BDC_OKCODE'
    '=BUCH'.
    ****perform bdc_transaction using 'AS94'.
    REFRESH MESSTAB.
    CALL TRANSACTION 'AS94' USING BDCDATA
    MODE H_MODE
    UPDATE 'S'
    MESSAGES INTO MESSTAB.
    IF SY-SUBRC = 0.
    READ TABLE MESSTAB INDEX 1.
    IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.
    DATA AN1 TYPE ANLN1.
    DATA AN2 TYPE ANLN2.
    GET PARAMETER ID 'AN2' FIELD AN2.
    IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.
    MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.
    ELSE.
    IT_DATA_SUB-ERR_SUB1 = 'X'.
    MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.
    ENDIF.
    REFRESH BDCDATA.
    ENDLOOP.
    ***ENDFORM. " sUB_upload
    and one more thing i face some issues when doing bdc for AS01, so i use AS91 and AS92 for uploading by using LSMW (direct input method and recording method) and it was successful.(if u have to do coding go for BDC/BAPI or there is no coding better to choose LSMW (it is the easiest way) as of my knowledge, so before starting just analyze once which method is best for ur requirement.
    Reward Points for Useful Answers
    Thanks
    Naveen khan
    Message was edited by:
            Pattan Naveen

  • Upload data into ztable

    Hi all,
    i need to upload data from notepad into ztables.  what is the best method of doing it?  do we use gui upload? when do we use BDC and when to go for LSMW?  Thanks in advance.

    Hi Lathika,
    For uploading data from notepad to ztable you can use GUI_UPLOAD function module. If you have to upload legacy data into some standard transaction such as MM02 then you can use a BDC or LSMW.
    LSMW is a ready  tool provided by SAP and you have to follow some 17 steps to migrate data. In batch input method ,you need to do recording for the transaction concerned.BDCs Session method is the better choice because of some advantages over call transaction. But call transaction useful to do immediate updation of small amount of data. (In call transaction developer has to handle errors).
    Thanks & Regards
    Subathra

  • Query on uploading data into infotype

    Hi,
    I am in search of a method to upload data into infotypes  IT0001,HRP1001.
    I have serached and found we can do it using BDC,LSMW and through Hr_INOFYTPE_OPERATION--fm.
    But in my flat file am having pernr ,begda,endda and supervisor..
    Some of my searches said if i had a pernr in flat file its impossible to do with HR_INFOTYPE_OPERATION.
    CAN ANYONE PLS SUGGEST ME THE BEST WAY TO DO?
    Thanks

    Hi Salini
    Using BDC or LSMW might lead to some inconsistencies.
    Uploading of various infotype data depends upon its volume.
    There is a FM: HR_MAINTAIN_MASTERDATA through which you can upload the data. But this does for one record at a time. So the performance gets affected at times. Before calling this FM each time, clear the buffer using the FM:  'HR_PSBUFFER_INITIALIZE'. This will be of great help.
    Incase you want to upload all your data at once, you can use BAPI_HRMASTER_SAVE_REPL_MULT.
    Let me know incase you need any help in any of these.
    Regards
    Harsh

Maybe you are looking for

  • Graphic Designer Pismo G3 Owner not sure what to do about upgrading...

    Ok. Here's the scenario. I'm running my Powerbook G3 Pismo(Firewire) 500 MHZ, 512MB ram, 20GB hard Drive. Dead Battery. Daystar Superdrive CD/DVD Burner. I also run OSX Panther 10.3.9. Most of my graphics programs are still on OS9, while I websurf an

  • System and performance slowing down even after Diskwarrior use?

    i own a G5 Powermac it seems to be getting slower. i have had it a year and a half. i have 2 G ram and it is a dual processor so i don't really understand why it should be going more slowly at all. I don' even burden it with heavy duty programs like

  • Need help with numbers

    I am writing a program that calculates different entries and then sends them to another script. The problem is that the number must be in the format xx.xx (cannot be changed). An example that is not working for me is 10 + 8.50 = 10.5 and I needs to e

  • Why my website is reloading continuously?

    Hello Mozilla Team. I'm the admin of DigitalBuzzy. My website is http://www.digitalbuzzy.com/ My problem is the website is continuously reloading in every 30 seconds. I'm running on the Firefox 22.0. There is no reloading issue on the other browsers?

  • Time Capsule - Time machine error "backup disk image could not be mounted"

    Recently I lost a folder and attempted to resore from my Time Capsule backup (which I started when it first shipped) not only did it fail, but know I get the message "backup disk image could not be mounted" when I try to backup. I have used Airport U