Application Development 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: 

how to display the data of a structure in a report

Former Member
0 Kudos

i want to display the data of a structure resbd.

i know it does not have data.

but it contains data at runtime

plz help

thanx

9 REPLIES 9

former_member189059
Active Contributor
0 Kudos

write:/ resbd-field1, resbd-field2...

0 Kudos

Hi,

In case you have data in Resbd at run time, you can directly write the various fields of resbd on the report

write:/ resbd-field1, resbd-field2, resbd-field 3.

Regards,

Suruchi

0 Kudos

but surichi

how can i find the one particular record for a particular aufnr

0 Kudos

Hi,

in your select query you can put that aufnr in the where clause.

Thanks,

Gunjan

0 Kudos

<b>@gunjan</b>

it is not showing the output

Former Member
0 Kudos

Hello,

try this i hope it solves your problem.

Types: begin of ty_tab.

include structure resbd.

types: end of ty_tab.

data: it_tab type standard table of ty_tab.

data: wa_tab like line of it_tab.

loop at it_tab into wa_tab.

write:/ wa_tab-rsnum, wa_tab-rspos.

endloop.

Reward points for useful answer.

Thanks,

Gunjan

Former Member
0 Kudos

Hi,

For displaying the data of a structure you can use the write statement.

WRITE : structurename - fieldname.

eg : write : resbd-rsnum.

Before that you need to declare the structure name inside the report.

Please refer the following code for your querry

REPORT ZSTRUCTDATA .

  • Table Declaration

  • --------------------

tables : resbd.

  • Assigning Values to Structure Fields

  • ------------------------------------

resbd-rsnum = 1234.

resbd-rspos = 12.

  • Displaying Values

  • --------------------

write : / resbd-rsnum.

write : / resbd-rspos.

This report will give the output like this.

0000001234

0012

Regards,

LIJO JOHN.

Former Member
0 Kudos

Hello,

Hope that this code will help you

REPORT ZSTRUCTDATA .

  • Table Declaration

  • --------------------

tables : resbd.

data : gt_resbd type table of resbd.

  • Assigning Values to Structure Fields

  • ------------------------------------

resbd-rsnum = 1234.

resbd-rspos = 12.

resbd-aufnr = 'A'.

append resbd to gt_resbd.

resbd-rsnum = 9999.

resbd-rspos = 99.

resbd-aufnr = 'B'.

append resbd to gt_resbd.

  • Displaying Values

  • --------------------

loop at gt_resbd into resbd where aufnr = 'B'.

write : / resbd-aufnr.

write : / resbd-rsnum.

write : / resbd-rspos.

endloop.

Regards,

LIJO JOHN

Former Member
0 Kudos

Hi

define a internal table of same structure

then read the data from that structure

it will get the data at runtime

no problem

reward if usefull