cancel
Showing results for 
Search instead for 
Did you mean: 

Printing and formatting data in word

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.