2023 Feb 23 11:30 AM
Hi
I have a requirement that I have to upload Data in AL11 (CSV Format), which will come from an ALV Report. Suppose
If My ALV has 15000 records, then it should create three CSV file in AL11, each file contain 5000 records.
Need urgent help !
2023 Feb 23 1:49 PM
I don't see any problem in doing that. What is your issue? What don't you already know?
2023 Feb 23 3:31 PM
What were you unable to do, there are already many questions/blogs/wiki/sample on how to get the data of an ALV grid and how to convert to csv?
2023 Feb 24 8:08 AM
I have converted this and send to AL11, My ques is how to generate seperate file in AL11 like
file1 has 1 to 5000 records.
file 2 has 5001 to 10000 records
file 3 has 10001 to 15000 records.
in AL11. ?
please help.
2023 Feb 24 9:19 AM
Reusable code in the middle:
TYPES: BEGIN OF ty_package,
from TYPE i,
to TYPE i,
END OF ty_package,
ty_packages TYPE STANDARD TABLE OF ty_package WITH EMPTY KEY.
SELECT * FROM mara INTO TABLE @DATA(table).
DATA(number_of_items) = lines( table ).
DATA(package_size) = 5000.
DATA(packages) = REDUCE ty_packages(
LET number_of_packages = ( ( number_of_items - 1 ) DIV package_size ) + 1 IN
INIT itab = VALUE ty_packages( )
from = 1
FOR i = 1 WHILE i <= number_of_packages
NEXT itab = VALUE #( BASE itab
( from = from
to = nmin( val1 = number_of_items val2 = from + package_size - 1 ) ) )
from = from + package_size ).
LOOP AT packages REFERENCE INTO DATA(package).
OPEN DATASET ... FOR OUTPUT ...
LOOP AT table FROM package->from TO package->to REFERENCE INTO DATA(line).
TRANSFER line->* TO ...
ENDLOOP.
CLOSE DATASET ...
ENDLOOP.
2023 Aug 23 10:44 AM
2023 Aug 23 11:52 AM
arvindkr276 As far as I understand, based on the question asked (= how to split an internal table into packages; it's not about DATASET, it's not about batches, it's not about CSV format), the answer doesn't need to be completed. Ask your own question, and indicate what you are missing (if needed, you may insert a link to this thread).