cancel
Showing results for 
Search instead for 
Did you mean: 

How to include structure in Types Definition ???

Former Member
0 Kudos

Hello All,

I want a declaration like this in BSP :-

***************************************************************************************

DATA : BEGIN OF imkop OCCURS 100.

INCLUDE STRUCTURE mkop.

DATA : waers LIKE mepro-waers.

DATA : END OF imkop.

***************************************************************************************

<b>In BSP: Type Definitions</b>

I wrote like this :-

***************************************************************************************

Types : BEGIN OF imkop.

INCLUDE STRUCTURE mkop.

Types : waers type mepro-waers.

Types : END OF imkop.

**************************************************************************************

I'm getting an error saying that I can't use structures in this .

Now what should I do ?

Can anyone help me out ?

Regards,

Deepu.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

deepu,

we can declare structures as below.

DATA: event_data TYPE REF TO cl_htmlb_event.

TYPES: BEGIN OF row_iid_type,

row_iid TYPE hap_row_iid,

END OF row_iid_type.

DATA:

t_row TYPE STANDARD TABLE OF row_iid_type,

t_row_wa TYPE row_iid_type,

t_message TYPE STANDARD TABLE OF bal_s_msg .

DATA:

lw_body_element TYPE hap_s_body_elements,

lw_body_column TYPE hap_s_body_columns,

lw_body_cell TYPE hap_s_body_cells,

lw_return TYPE bal_s_msg,

warning TYPE i.

regards,

manasa

Former Member
0 Kudos

Hello Manasa,

U are right .

But if I want to Include the structure of one more Table in current Type

( row_iid_type ) what should I do ?

Hello Sreekanth,

Every time should i create a global structure ???????

Is there no other way other than u mentioned ?????

Regards,

Deepu.K

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can use this syntax.



Types : BEGIN OF imkop.
INCLUDE  type mkop.            "<- Use TYPE instead of STRUCTURE
Types : waers type mepro-waers. 
Types : END OF imkop.

Regards,

Rich Heilman

Former Member
0 Kudos

Hello Rich Heilman,

Thanks for ur reply.

That was a cool answer. This idea didnot struck for me.

Full points awarded. (; (;

Regards,

Deepu.K

Answers (2)

Answers (2)

THE  syntax will be like :

TYPES : BEGIN OF TY_ST,
         SLNO TYPE N ,
         INCLUDE TYPE SFLIGHT.
TYPES : END OF TY_ST.

sreemsft
Contributor

Hi Deepu,

Just go to SE11 and create a structure and use the same in your program.

You can include the existing structure in another structure in SE11->Datatype ( create structure).

Thanks,

Sreekanth

<i>*-- reward if it helps you</i>