Using BAPI upload excel file for t-code AS02 in SAP

Using BAPI " BAPI_FIXEDASSET_CHANGE " create a zprogram to upload excel file for mass change fixed asset in SAP. REPORT  ZAS02_ASSET_CHANGE_UPLOAD . TYPE-POOLS :  truxs . " Structure for Excel data TYPES :  BEGIN  OF  ty_excel ,          anln1  TYPE  anln1 ,          bukrs  TYPE  bukrs ,          kostl  TYPE  kostl ,          werks  TYPE  werks ,          prctr  TYPE  prctr ,         END  OF  ty_excel . DATA :  lt_excel     TYPE  TABLE  OF  ty_excel ,       ls_excel     TYPE  ty_excel ,     ...

Create .csv file from ABAP report

 We can use like below:

types truxs_t_text_data(4096) type c occurs 0.
data: csv_converted_table type table of TRUXS_T_TEXT_DATA.

START-OF-SELECTION.

call function 'SAP_CONVERT_TO_CSV_FORMAT'
 exporting
   i_field_seperator          = ';'
*   I_LINE_HEADER              =
*   I_FILENAME                 = ''
*   I_APPL_KEEP                = ' '
  tables
    i_tab_sap_data             = internal_table
 changing
   i_tab_converted_data       = csv_converted_table
 exceptions
   conversion_failed          = 1
   others                     = 2
          .

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
filename                        = 'C:\example.csv'
  tables
    data_tab                        = csv_converted_table.

Comments

Popular posts from this blog

New commodity code create in SAP S/4 Hana

BAPI to Change STO PO/ PO Delivery date in SAP

Alpha IN/OUT to Handle Leading Zeros in SAP ABAP