cancel
Showing results for 
Search instead for 
Did you mean: 

how to execute the hardcode line

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

You can do the following.

Data : temp(120).

loop at t_tline1.

concatenate temp t_tline1-tdline to temp.

endloop

Kashyap.

Former Member
0 Kudos

but .. i don't want to concatenate each line into 1 line.