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

Structure used in program

Former Member
0 Likes
780

Hi GURU's

How to used Structure in a program.

thanks...

5 REPLIES 5
Read only

Former Member
0 Likes
704

How do you want to use a structure in your program .

For ex as an internal table or work area ...........

-gopi

Read only

Former Member
0 Likes
704

hi check this...

data: it_table type structure occurs 0 with header line .

ex

data: it_mara type mara occurs 0 with header line .

regards,

venkat appikonda .

Read only

Former Member
0 Likes
704

hi there...

Structures basically are a design of the table which get filled only on run time.

In report program, structures can be used to define an internal table. the syntax is

Data : itab like str occurs 10 with header line.

where str is the structure.

u can compare the structure with a header line or a work area which also gets filled on run time.

otherwise, there is no other use or significance or structure.

Do reward if helpful or get back if further clarification is required.

Read only

Former Member
0 Likes
704

hi,

examine these codes in debug mode,

TYPES: BEGIN OF T_VBAK,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

ERNAM TYPE VBAK-ERNAM,

end of t_vbak.

data : it type STANDARD TABLE OF t_vbak,

wa type t_vbak.

select VBELN

ERDAT

ERNAM

from VBAK

into table it.

select VBELN

ERDAT

ERNAM

from vbak

into wa.

endselect.

Reward points if useful..........

Read only

Former Member
0 Likes
704

Hi ,

Structures are created in DD.So the DD objects are globally avaliable to all the work bench tools.

We use the Structures in programs to crete the data objects like field strings

example:

if we have a structure ZSTRUCT in DD.

in prog

data fs_data type ZSTRUCT.

We use the structures in programs to create intenal tables.

data itab_data type standard table of ZSTRUCT.

The main advantage of creating structure in DD is if there are any changes are done on structure those are reflect on all programs using this structure.