02-04-2010 12:21 PM
HI friends,
One quick question on ABAP file handling
Can you let me know the logic , When user writes 300 Records in a file and when he tries to write 301 records the select screen should through an error message saying "only 300 records can be downloaded in a file for one run'
I have added below loop in the code, but in the below loop i have given the values of "MATNR, TEXTID, TEXT_A, SPRA,cTEST_T" as some dummy values.....
but i dont want this dummy vaules , it shuld pick whatever user is given
wa_out-matnr = 'C100'.
wa_out-textid = '100'.
wa_out-text_A = 'sssssssssssssssssssssssssssss'.
wa_out-spras = 'RU'.
wa_out-text_t = 'ddddddddddddddddddddddddddddd'.
do 300 times.
wa_out-sno = sy-index + 1.
append wa_out to t_out.
enddo.
clear wa_out.
Can you help
02-04-2010 12:26 PM
Hi
When you are writing into a file based on the content of an internal table, you can use sy-tabix to check if its <= 300, then exit the loop and close the file.
For eg:
loop at itab.
if sy-tabix <= 300.
transfer itab to lf_file.
endif.
endloop.
close lf_file.
Regards
Raj