Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

adding data to a line

Former Member
0 Kudos

Dear All,

There is one internal table itab with fields matnr lgort.

the data is like this

matnr lgort

100 103

101 501

102 600

now i want to keep all the matnr in a variable say Line

Line = 100, 101, 102

how to get this.

Note: line is not an internal table.It is variable of type C with length 100.

after moving all the matnrs of itab then LINE = 100, 101, 102.

finally i need to dispaly message

'Materals' LINE 'sent on ' sy-datum.

Please let me know how to get this.

4 REPLIES 4

Former Member
0 Kudos

Hi,

try this:

LOOP AT itab INTO structure.

CONCATENATE line structure-matnr INTO line

SEPARATED BY SPACE.

ENDLOOP.

Arne

Former Member
0 Kudos

Hi Shoban,

You can use the following code,

LOOP at ITAB into LS_ITAB.

<b>if sy-tabix eq 1.</b>

MOVE LS_ITAB to LINE.

<b>ELSE.</b>

CONCATENATE LS_ITAB into LINE

SEPERATED BY 'comma' (comma would be a constant declared).

<b>ENDIF.</b>

ENDLOOP.

<b>Reward points for helpful answers</b>.

Best Regards,

Ram.

varma_narayana
Active Contributor
0 Kudos

hI..

CLEAR LINE.

LOOP AT itab INTO WA.

CONCATENATE WA-matnr LINE INTO LINE

SEPARATED BY ','.

ENDLOOP.

WRITE:/ 'Materials ' , LINE , 'Sent on' , Sy-datum.

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hello,

U can use CONCATENATE

<b>CONCATENATE f1 ... fn INTO g [ SEPARATED BY h ]</b>

It combines the fields f1 to fn (n >= 2) and places them in g.

Like all string processsing statements, you can only use character-type operands here.If the type of an operand is not STRING, the operand is treated like a type C field, regardless of its actual type, even though no actual conversion takes place.

regards,

LIJO JOHN