Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data to custom table dynamically

0 Kudos

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'?

3 REPLIES 3

Domi
Contributor
0 Kudos

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

0 Kudos

Bt i need to do it dynamically. Custom or the database table needs to be updated dynamically.