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: 

Types Declarations

Former Member
0 Kudos

Hi all,

What is the exact syntactical declaration for the types with Include structure ?

I have the below existing types as

TYPES: BEGIN OF exceplist_inv.

INCLUDE STRUCTURE erdod.

TYPES: END OF exceplist_inv

I need to add a new field to this TYPE, the field being username like CDHDR-USERNAME.

The below change to the declaration gives error.

TYPES: BEGIN OF exceplist_inv.

INCLUDE STRUCTURE erdod,

username like CDHDR-USERNAME,

TYPES: END OF exceplist_inv

Moreover I have tried placing the commas and the fullstops at many places but the syntax error still appears.

Need help for the exact syntax for the above.

Regards,

Stock

5 REPLIES 5

Former Member
0 Kudos

Hi,

Do it in this way

TYPES: BEGIN OF exceplist_inv.

erdd type(or) like erdod,

username like CDHDR-USERNAME,

END OF exceplist_inv.

data: itab type exceplist_inv.

u can access the values as

itab-erdd-field1 = ....

itab-username = ......

Former Member
0 Kudos

Hi Stock ,

Declare it this way

TYPES: BEGIN OF exceplist_inv,

username like CDHDR-USERNAME.

INCLUDE STRUCTURE erdod.

TYPES: END OF exceplist_inv

because i dont think you can include elements after you have included a structure.

Regards,

Arun

*Assign points if helpful

Former Member
0 Kudos

Hi stock sys,

Please do so...

TYPES: BEGIN OF exceplist_inv.

INCLUDE STRUCTURE erdod.

Types: username type cdhdr-username.

TYPES: END OF exceplist_inv.

Reward points if found useful

Former Member
0 Kudos

Try it in the following way

TYPES: BEGIN OF exceplist_inv.

INCLUDE STRUCTURE erdod.

types :username like CDHDR-USERNAME,

TYPES: END OF exceplist_inv.

Former Member
0 Kudos

Hi,

If 'erdod' is a standard structure, please try the below given code:

TYPES BEGIN OF exceplist_inv.

TYPES: username LIKE cdhdr-username.

INCLUDE STRUCTURE erdod.

TYPES END OF exceplist_inv.

(OR)

If 'erdod' is a structure defined by you, then try the following code:

data: t_erdod type erdod.

TYPES BEGIN OF exceplist_inv.

TYPES: username LIKE cdhdr-username.

INCLUDE STRUCTURE t_erdod.

TYPES END OF exceplist_inv.

Please award points if it is helpful.

Regards,

Renjith Michael.