12-21-2018 4:12 PM
I have uploaded a excel file using CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'. The internal table obtained from the above function is stored in t_upload.
data: t_upload type table of ZZTEST.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
I_LINE_HEADER = 'X'
i_tab_raw_data = it_type
i_filename = file_nam
TABLES
i_tab_converted_data = t_upload[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
For each record in the t_upload i have to create 365 records dynamically(for 365 different days) .
How to store records dynamically in custom table 'ZZTEST'?
12-22-2018 3:20 PM
Hi
just
- loop over your t_upload table
- DO 365 TIMES
- build your "Date Key" and set the data fields
- append to ITab ( with ZZTEST structure)
- INSET/MODIFY ZZTEST from ITab
- clear Itab
Done!
Maybe there is some more complex "Date Key" calculation needed (eg leap-year,...) and you need to think about update/changes of existing records, but that's the basic coding structure
Regards
Domi
12-25-2018 8:20 AM
Bt i need to do it dynamically. Custom or the database table needs to be updated dynamically.
12-25-2018 9:07 AM