Application Development and Automation 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: 
Read only

populating deep structures

Former Member
0 Likes
1,727

Hi Guys.. G'Day..

I define a deep structure in DDIC.

The structure is ZLCHAR

KEY

TEXT

CHARACTERISTICS TYPE ZCHAR

|_ ZKEY

|_ ZTEXT

I UNABLE TO POPULATE CHARACTERISTICS STRUCTURE.

HERE IS MY CODE.

DATA: LT_ZCHAR TYPE ZCHAR OCCURS 0 WITH HEADER LINE.

LT_ZLCHAR TYPE ZLCHAR,

WA_ZCHAR TYPE ZCHAR.

LT_ZCHAR-ZKEY = '12346'.

LT_ZCHAR-ZTEXT = 'NO'.

APPEND LLT_ZCHAR.

LT_ZCHAR-ZKEY = '735737'.

LT_ZCHAR-ZTEXT = 'UNIDENTIFIED'.

APPEND LT_ZCHAR.

LT_ZCHAR-ZKEY = '3563463'.

LT_ZCHAR-ZTEXT = 'YES'.

APPEND LT_ZCHAR.

WA_ZCHAR-KEY = '12345'.

WA_ZCHAR-TEXT = 'IF FLAVOURED OR ADDED INGREDIENT'.

WA_ZCHAR-CHARACTERISTICS = LT_ZCHAR.

APPEND WA_ZCHAR TO LT_ZLCHAR.

Even if I try WA_ZCHAR-CHARACTERISTICS [ ] = LT_ZCHAR[ ]

Getting incompatible syntax error.

Any ideas ?

5 REPLIES 5
Read only

anup_deshmukh4
Active Contributor
0 Likes
786

Hello ,

Have you included the structure or you are have structure as a field ?

Coz if you have included it using .include you will have to access its field directly and if

you have Used it as predefined type you will have to Access it in a different way,

Plz do tell what error you are getting ?

Hope this helps

Read only

0 Likes
786

Hi Anup,

I use the structure as a field.

The error is LT_ZCHAR can not be converted to the type of WA_ZCHAR when I use the following statement.

WA_ZCHAR-CHARACTERISTICS [ ] = LT_ZCHAR[ ]

otherwise just the just the header value of LT_ZCHAR is stored in the LT_ZLCHAR.

Cheers

Sam

Read only

0 Likes
786

My be then you have mismatched ..the data type you have used..!

Please check in the types..!

Read only

Madhurivs23
Participant
0 Likes
786



types: begin of ZCHAR,
          KEY type I,
          TEXT type STRING,
      end of ZCHAR.

data: WA_ZCHAR type ZCHAR.

types: begin of ZLCHAR,
        L_ZKEY type I,
        L_ZTEXT type STRING,
        L_ZCHAR type ZCHAR,
      end of ZLCHAR.

data: IT_ZLCHAR type standard table of ZLCHAR,
      WA_ZLCHAR type ZLCHAR.


WA_ZCHAR-KEY = '1'.
WA_ZCHAR-TEXT = 'no1'.

WA_ZLCHAR-L_ZKEY = '11'.
WA_ZLCHAR-L_ZTEXT = 'no11'.
WA_ZLCHAR-L_ZCHAR = WA_ZCHAR.

append WA_ZLCHAR to IT_ZLCHAR.

loop at IT_ZLCHAR into WA_ZLCHAR.
  write : WA_ZLCHAR-L_ZKEY, WA_ZLCHAR-L_ZTEXT, WA_ZLCHAR-L_ZCHAR-KEY, WA_ZLCHAR-L_ZCHAR-TEXT.
endloop.

Edited by: madhuri sonawane on Jul 30, 2010 10:17 AM

Read only

Former Member
0 Likes
786

Thanks Guys.. its actually an issue in defining the structure in DDIC. The deep structure should be a table type.