on 02-09-2010 9:24 AM
Hi,
In script, I have to print 3 materials in each line. For example, if I have 10 entries in an internal table GT_MARA. I need to print as below.
1. Material A 2. Material B 3. material C
4. Material D,,,,,,
10. Material K
At the moment I am printing one by one.
LOOP AT GT_MARA.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MATERIAL'
window = 'MAIN'.
ENDLOOP.
How to achieve this? Please suggest.
Anybody now???
I might have confused you all. Please forget the numbering. Can I get output as below.
Material-A Material-B Material-C
Material-D Material-E Material-F
Material-H Material-I Material-J
Material-K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Better create a new internal table with the following stucture
BEGIN OF ITAB,
matnr1 type matnr,
matnr2 type matnr,
matnr3 type matnr,
.............................
.............................
END OF ITAB,
then populate this itab from GT_MARA
data: l_flag.
loop at gt_mara.
if itab-matnr1 is initial.
clear flag.
itab-matnr1 = gt_mara-matnr.
exit.
endif.
if itab-matnr2is initial.
itab-matnr2 = gt_mara-matnr.
exit.
endif.
if itab-matnr3 is initial.
flag = 'X'.
itab-matnr3 = gt_mara-matnr.
append itab.
endif.
AT LAST.
IF flag <> 'X'.
append itab.
ENDIF.
ENDAT.
endloop.
Then use itab while calling ur script
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.