09-30-2008 5:04 PM
Hi, i need to create a table just with 10 lines of record.
I have this code in my program :
DATA: BEGIN OF it_lines occurs 10,
tdformat TYPE tline-tdformat,
tdline TYPE tline-tdline,
END OF it_lines.
DATA : str_lines like tline.
DATA: name type THEAD-TDNAME.
clear wa.
clear it_poste.
name = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER.
clear STXH.
clear it_lines.
clear str_lines.
select * from STXH into STXH
where TDOBJECT = 'VBBK'
and TDNAME = name
and tdid = 'Z008'.
Endselect.
if stxh-tdname = ''.
ELSE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'Z008'
language = SY-LANGU
name = name
object = 'VBBK'
tables
lines = it_lines.
.
loop at it_lines.
wa-designation = it_lines-tdline.
append wa to it_poste.
clear wa.
endloop.
endif.
But in the end, it_lines have 12 records. How can i do for limits the lines record at 10 please?
thanks for your help.
09-30-2008 5:08 PM
Hi,
Try
loop at it_lines from 1 to 10.
wa-designation = it_lines-tdline.
append wa to it_poste.
clear wa.
endloop.
Darren
09-30-2008 5:08 PM
Hi,
Try
loop at it_lines from 1 to 10.
wa-designation = it_lines-tdline.
append wa to it_poste.
clear wa.
endloop.
Darren
09-30-2008 5:09 PM
if you Define itab like this Doesn't mean that it limits the records to 10.
DATA: BEGIN OF it_lines occurs 10,
tdformat TYPE tline-tdformat,
tdline TYPE tline-tdline,
END OF it_lines.
if you don't want more than 10 lines then you have to Delete the extra lines from the internal table.
09-30-2008 5:13 PM