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

report

Former Member
0 Likes
476

ho to all my querry is as follows

i want the report output as follows

i have 3 fields in report output

custno

123 345 345 678 456 213

custname

suman kumar sunil sudhir suresh sudha

location

skl chennai pune mumbai hyd vsp

i mean i have 3 fields in my int table and total 6 records in int table how shold i handle get the output as above

pls send me the code

its urgent

4 REPLIES 4
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
449

Hi

Loop at itab.

Write:/ internal table fields.

endloop.

Regards,

Sreeram

Read only

Former Member
0 Likes
449

Hi, try this.

WRITE:/ 'CUSTNO'.

SKIP 1.

LOOP AT ITAB.

WRITE: ITAB-CUSTNO, ' '.

ENDLOOP.

SKIP 2.

WRITE:/ 'CUSTNAME'.

SKIP 1.

LOOP AT ITAB.

WRITE: ITAB-CUSTNAME, ' '.

ENDLOOP.

SKIP 2.

WRITE:/ 'LOCATION'.

SKIP 1.

LOOP AT ITAB.

WRITE: ITAB-LOCATION, ' '.

ENDLOOP.

This might help you.

Regards,

Hemant.

Read only

pradeep_nellore
Participant
0 Likes
449

Hi,

Try the follwing code.

loop at itab.

write : itab-custno.

give a new line.

endloop.

follow the above same lines for remaining fields.

Reward if helpful.

Bye.

Read only

Clemenss
Active Contributor
0 Likes
449

Hi sunil,

loop at table 3 times, speed-optimized

field-symbols:
  <line> type any,
  <field> type any.
do 3 times.
  loop at itab assigning <line>
    at first.
      case sy-index.
        when 1.
          write: 'custno', /.
        when 2.
          write: 'custname', /.
        when 3.
          write: 'location', /.
      endcase.
    endat.
    assign component sy-index of structure <line> to <field>.
    Write <field>.
  endloop.
enddo

Regards,

Clemens