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: 

include multiple infotypes into structure

Former Member
0 Kudos
299

TYPES : BEGIN OF ty_ldb_data,
perno TYPE persno,
start_date TYPE begda,
end_date TYPE endda.
INCLUDE STRUCTURE p0000.
INCLUDE STRUCTURE p0001.
INCLUDE STRUCTURE p0002.
INCLUDE STRUCTURE p0007.
INCLUDE STRUCTURE p2001.
INCLUDE STRUCTURE p2002.
INCLUDE STRUCTURE p2003.
TYPES: END OF ty_ldb_data.
DATA : lt_ldb_data TYPE STANDARD TABLE OF ty_ldb_data,
ls_ldb_data TYPE ty_ldb_data.

I am receiving an compilation error that PERNR already exists.

Is their a way to have a single internal table with all the infotypes in it.

if yes then how should i store Multiple lines into those Tables.

ls_ldb_data-P0000 = P000[]. <= would this statement work.

append ls_ldb_data to lt_ldb_data.

thanks

3 REPLIES 3

former_member197132
Participant
0 Kudos
192

Hello Rajat,

You are receiving error because the multiple structure in your local structure have PERNR field. to avoid this you can create and ZSTRUCTURE or Local Structure in which you include multiple PERNER as PERNR_1 , PERNR_2 , .........PERNR_N with required fields and use that to create your internal table.

ChrisSolomon
Active Contributor
0 Kudos
192

Why would you EVER do this? Why do you need this "super table" of everything in one row/entry? In some cases, it won't even make sense. What problem are you actually trying to solve?

raymond_giuseppi
Active Contributor
0 Kudos
192

You could use one disambiguating option of the INCLUDE statement like 'RENAMING WITH SUFFIX suffix'. You could also use the 'AS name' also to easily map data read from database.

Regards,
Raymond