Skip to Content

include multiple infotypes into structure

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

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

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2017 at 02:42 PM

    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

    Add comment
    10|10000 characters needed characters exceeded