Skip to Content
avatar image
Former Member

Printing and formatting data in word

I am new to Abap and your help will be greatly appreciated.

I would like to dispaly data from my table in two columns in MS Word.

For example:

Net salary 500.

There should be a space before the amount. I cannot figure out how to do this. I only manage to output the info in one column. The information is stored in an internal table with one column. Evevn if I use a two column internal table, the resulting data in the Word document appears in one column. Also, how do I covert a number to string?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 21, 2008 at 10:02 PM

    Hi,

    Create an internal table with one field.

    Save teh two column values as a string but comma separated and use the gui_download functionality to save the file.

    Now when you open the file n excel it will be in two columns.

    In word and text also the same file will appear in two columns

    regards,

    Subramanian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Subramanian,

      I have done that but now facing difficultioes in saving a String type and Integer type into a string. I tried to cast the two using WRITE but that does not seem to work. The result is always the String part. I

      based my solution on the SAP help example:

      DATA: NAME(5) VALUE 'FIELD',

      FIELD(5) VALUE 'Harry',

      DEST(18) VALUE 'Robert James Smith',

      OFF TYPE I,

      LEN TYPE I.

      OFF = 7.

      LEN = 8.

      WRITE (NAME) TO DEST+OFF(LEN).

      Thanks in advance for your help.

  • avatar image
    Former Member
    Jul 23, 2008 at 07:18 PM

    Hi,

    Now it all seems to work excpet that I can not print more than 50 columns in the word document. The rest is truncated. What could be the problem?

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded