Application Development and Automation 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: 
Read only

write statement

Former Member
0 Likes
696

i want to create report using write statement as per format given below.

item name item code amount

____________________________________

capital 1 101 1000

capital 2 102 2000

capital 3 103 3000

____________________________________

Total 6000

How to create this report using write statement ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
679

Hi,

loop at itab.

write: / itab-name,

itab-number,

itab-sno,

itab-amount.

w_sum = w_sum + itab-amout.

endloop.

write: w_sum.

Plzz reward points if it helps.

5 REPLIES 5
Read only

Former Member
0 Likes
679

HI,

Use the following logic.

put the netries into the table itab.

Write 😕 'item name',

15 'item',

20 'code',

25 'amount'.

write : uline.

loop at itab.

write 😕 itab-itmname,

15 itab-item,

20 itab-code,

25 itab-amt.

endloop.

write :uline.

REward appropraite points

Regards,

MAnsi.

Read only

Former Member
0 Likes
679

Hi

after filling ur internal table,

write:/5item 8 name 10 item code 15 amount.

write:syuline.

loop at itab.

write:?

endloop.

at end of amount.

sum.

endat.

write:sy-uline.

Read only

Former Member
0 Likes
680

Hi,

loop at itab.

write: / itab-name,

itab-number,

itab-sno,

itab-amount.

w_sum = w_sum + itab-amout.

endloop.

write: w_sum.

Plzz reward points if it helps.

Read only

Former Member
0 Likes
679

Hi Santosh,

Its as simple as you need to WRITE statement before what you need. Is it not??

If you want create empty line use SKIP statement.

WRITE:/ 'item name item code amount'.

SKIP.

WRITE:/ '____________________________________'.

WRITE:/ 'capital 1 101 1000'.

WRITE:/ 'capital 2 102 2000'.

WRITE:/ 'capital 3 103 3000'.

WRITE:/ '____________________________________'.

SKIP.

WRITE:/ 'Total 6000'.

Thanks,

Vinay

Read only

Former Member
0 Likes
679

If U have all the data in an internal table ..

say Itab .. with 3 fields f1 f2 f3 ..

sort itab by f1.

write :/2 'item name',

15 'item code',

25 'amount'.

write 😕 sy-uline(80).

Loop at itab.

write :/2 itab-f1,

15 itab-f2,

25 itab-f3.

at last.

sum.

write :/2 itab-f3.

endat.

endloop.

write 😕 sy-uline(80).