Skip to Content
0

include multiple infotypes into structure

Jan 09, 2017 at 12:36 PM

30

avatar image

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

10 |10000 characters needed characters left characters exceeded

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?

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Jan 09, 2017 at 02:04 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi Jan 09, 2017 at 02:42 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded