Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9008

Re: Uploading flat file into sap splitting it into header and lineitem data

$
0
0

Using GUI_upload i have captured the whole file as Sting.. then i wnat to split like header and Item.

 

below my cod Ref:

 

   CALL FUNCTION 'GUI_UPLOAD'
     EXPORTING
       filename        = v_file
       filetype        = 'ASC'
     TABLES
*      data_tab        = i_data
       data_tab        = it_input " itab
     EXCEPTIONS
       file_open_error = 1
       OTHERS          = 2.

   IF sy-subrc NE 0.
     WRITE: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
     SKIP.
   ENDIF.

**********************
   TYPES: ty_item TYPE STANDARD TABLE OF tt_data. "itemdata.

   TYPES: BEGIN OF ty_data,
           header TYPE tt_header,
           item   TYPE tt_data,
          END OF ty_data.

   DATA: i_data TYPE STANDARD TABLE OF ty_data.
   DATA: w_data TYPE ty_data.
   DATA: w_item TYPE tt_data.

   LOOP AT  it_input.
     IF it_input-line = 'H'.
       IF sy-tabix <> 1.
         APPEND w_data TO i_data.
       ENDIF.
Else.

 

 

 

     ENDIF.
   ENDLOOP.


Viewing all articles
Browse latest Browse all 9008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>