Skip to Content
author's profile photo
Former Member

adding data to a line

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:03 PM

    Hi,

    try this:

    LOOP AT itab INTO structure.

    CONCATENATE line structure-matnr INTO line

    SEPARATED BY SPACE.

    ENDLOOP.

    Arne

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:07 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 12:13 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:20 PM

    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

    Add comment
    10|10000 characters needed characters exceeded