on 03-29-2010 9:08 AM
Hi Guys,
In script, I want to print text continuosly in a loop. I searched SCN, but I couldn't find anything related. Perhaps, I dont know what keyword to feed in the search.
For example, I have 10 materials in an internal table gt_mara. As of now, it is printing as below.
MAT 1
MAT 2
MAT 3
My code for the above is,
LOOP AT gt_mara INTO gwa_mara.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MATERIAL'
window = 'MAIN'.
ENDLOOP.
In script,
/E MATERIAL
P1 <HB>&GWA_MARA-MATNR& </>
But I need to print in a single line as below. How can I acheive this?
MAT 1 MAT 2 MAT 3
Please excuse me for posting in a wrong forum.
Edited by: P Yasin on Mar 29, 2010 11:12 AM
Hi
you can do this...
LOOP AT gt_mara INTO gwa_mara.
concatenate gwa_mara-matnr into matnr separated by space.
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MATERIAL'
window = 'MAIN'.
In script,
P1 <HB>&MATNR&
regards
Marco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is because in your interanls table gt_mara has material in different lines.For three loop pass you will get three differnet lines.
You need to change your logic to print. Since you want to print all material in onle line so I am assuming you don't have many materials to be printed as we can print 6 -7 materials in one line.
move all your material into another table as one record and print it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ANurag,
Sorry. You misunderstood my question. NOT in a SNGLE LINE but as a continuous text.
The number of materials can be more than 20. I need to print continuously as below.
MAT1 MATERIALLLLLLLLLLLLLLLLLLL2 MMMMMMATERIAL3
MATERIAL4 MAT5 MATERIALLLLLLLLLLLLLLLLLLLLLLLL6
@Marco,
I can not do the way you suggested because I have some other component along with the material to print. Actually this is not my requirement, it is something similar. Is there any way like 'APPEND' in WRITE_FORM or APPEND in Paragraph format??
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.