on 03-27-2009 4:32 AM
i have a problem that i want to do the looping and copy to the itab_shipmark
when read 1 line, then copy to itab_shipmark. (the field will change depend on number of looping as sy-tabix)
let say, there is 7 rows and loop 7 times
i want to execute when looping
clear itab_shipmark.
loop start...
1st time : move t_tline-tdline to itab_shipmark-row1.
2nd time: move t_tline-tdline to itab_shipmark-row2.
....
7th time: move t_tline-tdline to itab_shipmark-row7.
end loop.
append itab_shipmark.
see the following draft coding ***************
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = '002'
LANGUAGE = SY-LANGU
NAME = THE_TDNAME
OBJECT = 'VBBP'
TABLES
LINES = T_TLINE1
EXCEPTIONS
....
....
IF SY-SUBRC = 0.
CLEAR ITAB_SHIPMARK.
LOOP AT T_TLINE1.
tindex = sy-tabix.
concatenate 'itab_shipmark-row' tindex into tshipmark.
concatenate 'move t_tline-tdline to' tshipmark into tshipmark.
???? (how to execute move t_tline-tdline to itab_shipmark-row1.)
ENDLOOP.
APPEND ITAB_shipmark.
ENDIF.
ENDFORM. "GET_SHIP_MARK
Hi,
You can initialize a counter in the loop to 0 and increment each time and pass the same in the smartform conditions column.
This way u can control the data being appened in the rows.
Thanks
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you can use the command INSERT <workarea> INTO <table position>. You can use the Loop index (Number of Loop traversal) as the table index for determining the position at which the new line is to be inserted.
Follow the F1 help for the command.
Does that answer the question or I missed something here?
Regards
Barada
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do the following.
Data : temp(120).
loop at t_tline1.
concatenate temp t_tline1-tdline to temp.
endloop
Kashyap.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.