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: 

declaration problem...

Former Member
0 Kudos

Hi,

All

how to declare the below statements using types

DATA: t_j_1bagnt OCCURS 0.

INCLUDE STRUCTURE j_1bagnt.

DATA: END OF t_j_1bagnt.

DATA: BEGIN OF t_j_1bnflin_t OCCURS 0.

INCLUDE STRUCTURE j_1bnflin.

DATA: END OF t_j_1bnflin_t.

DATA: BEGIN OF t_j_1bnfstx_t OCCURS 0.

INCLUDE STRUCTURE j_1bnfstx.

DATA: END OF t_j_1bnfstx_t.

DATA: BEGIN OF t_j_1binlin_t OCCURS 0.

INCLUDE STRUCTURE j_1binlin.

DATA: END OF t_j_1binlin_t.

very very urgent i am facing some problems with the declaration if a structure..

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos
DATA: t_j_1bagnt OCCURS 0.
INCLUDE STRUCTURE j_1bagnt.
DATA: END OF t_j_1bagnt.
 " the above is same as

TYPES: BEGIN OF ty_j_1bagnt.
INCLUDE TYPE j_1bagnt. " use of TYPE is suggested
TYPES: END OF ty_j_1bagnt.

DATA : t_j_1bagnt TYPE TABLE OF ty_j_1bagnt, " this is an internal table
       wa_j_1bagnt type ty_j_1bagnt. " this is a work area
 " Make sure you dont use the work area as internal table,
 " internal table can contain multiple records
 " work area can contain only one record its just liek a strucuture

Regards

Gopi

8 REPLIES 8

hymavathi_oruganti
Active Contributor
0 Kudos

The declaration in ur previous post is correct.

example , how to declare the following using types is:

DATA: begin of t_j_1bagnt OCCURS 0.

INCLUDE STRUCTURE j_1bagnt.

DATA: END OF t_j_1bagnt.

using types the above,

types: begin of typ_j_1bagn.

INCLUDE STRUCTURE j_1bagnt.

DATA: END OF t_j_1bagnt. <b>"THIS IS TYPE DECLARATION.</b>

data: t_j_1bagnt type table of typ_j_1bagn<b>,"internal tab</b>

wa_j_1bagn like line of t_j_1bagnt. "<b>work area</b>

Message was edited by:

Hymavathi Oruganti

gopi_narendra
Active Contributor
0 Kudos
DATA: t_j_1bagnt OCCURS 0.
INCLUDE STRUCTURE j_1bagnt.
DATA: END OF t_j_1bagnt.
 " the above is same as

TYPES: BEGIN OF ty_j_1bagnt.
INCLUDE TYPE j_1bagnt. " use of TYPE is suggested
TYPES: END OF ty_j_1bagnt.

DATA : t_j_1bagnt TYPE TABLE OF ty_j_1bagnt, " this is an internal table
       wa_j_1bagnt type ty_j_1bagnt. " this is a work area
 " Make sure you dont use the work area as internal table,
 " internal table can contain multiple records
 " work area can contain only one record its just liek a strucuture

Regards

Gopi

Former Member
0 Kudos

HI

u can declare in the following way

1)types: begin of t_j_1bagnt.

INCLUDE STRUCTURE j_1bagnt.

DATA: END OF t_j_1bagnt

data: typ_j_1bagnt type table of t_j_1bagnt, ->internal table

wa_j_1bagnt like line of t_j_1bagnt. -> work area

2)TYPES: BEGIN OF t_j_1bnflin_t.

INCLUDE STRUCTURE j_1bnflin.

DATA: END OF t_j_1bnflin_t.

data: typ_j_1bnflin_t type table of t_j_1bnflin_t,

wa_j_1bnflin type t_j_1bnflin_t.

in the same way reamining 2 too

regards

sandhya

0 Kudos

TYPES: begin of t_j_1bagnt.

INCLUDE STRUCTURE j_1bagnt.

DATA: END OF t_j_1bagnt.

why it was written as DATA in the ending ( DATA: END OF t_j_1bagnt ).

0 Kudos

Hi Ram,

Its a general Syntax provided By SAP.

Thanks.

0 Kudos

no my doubt was that i have declared as Types: begin of t_xyz

and in the ending i am writing it as data: endof t_xyz.

what is the exact meaning of this declaration.

0 Kudos

HI,

its a wrong syntax.

if u write begin of using types u have write end of also using types.

rgds,

bharat.

Former Member
0 Kudos

types: begin of ty_t_j_1bagnt,

INCLUDE STRUCTURE j_1bagnt,

END OFty_ t_j_1bagnt,

tt_ t_j_1bagnt type standard table of ty_t_j_1bagnt.

types: begin of ty_t_j_1bnflin_t,

INCLUDE STRUCTURE j_1bnflin,

END OFt_j_1bnflin_t,

tt_t_j_1bnflin_t type standard table of ty_t_j_1bnflin_t.

data: it_t_j_1bagnt type tt_ t_j_1bagnt,

wa_t_j_1bagnt type ty_t_j_1bagnt,

it_t_j_1bnflin_t type tt_t_j_1bnflin_t,

wa_ tt_t_j_1bnflin_t type ty_t_j_1bnflin_t.

this is how u need to declare....

reward points if helpful.........