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

How to populate a Table inside a structure?

Former Member
0 Likes
1,135

Hello,

Im very new to ABAP and Im having a rather sily problem. I have a Structure (ZSHIPMENT) with one component (CASES) of the type Z_CASE_TABLE. Z_CASE_TABLE is a table with a line type of ZCASE_STR. ZCASE_STR is a Structure with one Component (CASE_ID) of type String.

So ZSHIPMENT - ZCASE_TABLE - ZCASE_STR - CASE ID.

I want to write some code to create this object and use it in a method.

This is what Im trying:

method TEST_02.

DATA: Shipment TYPE ZSHIPMENT,

case TYPE ZCASE_STR.

case-case_id = 'case1'.

INSERT case INTO Shipment-cases.

endmethod.

But I get this error: CASE is not an internal table - the "OCCURS n" specification is missing.

Can someone give me a hint on how to populate my memory object?

Ive tryed all shorts of things but I never get it to work.

Thanks in advance.

Gonso

Hello,

Im very new to ABAP and Im having a rather sily problem. I have a Structure (ZSHIPMENT) with one component (CASES) of the type Z_CASE_TABLE. Z_CASE_TABLE is a table with a line type of ZCASE_STR. ZCASE_STR is a Structure with one Component (CASE_ID) of type String.

So ZSHIPMENT - ZCASE_TABLE - ZCASE_STR - CASE ID.

I want to write some code to create this object and use it in a method.

This is what Im trying:

method TEST_02.

DATA: Shipment TYPE ZSHIPMENT,

case TYPE ZCASE_STR.

case-case_id = 'case1'.

INSERT case INTO Shipment-cases.

endmethod.

But I get this error: CASE is not an internal table - the "OCCURS n" specification is missing.

Can someone give me a hint on how to populate my memory object?

Ive tryed all shorts of things but I never get it to work.

Thanks in advance.

Gonso

2 REPLIES 2
Read only

Former Member
0 Likes
678

Just to be sure, enter the debugger in the method and see if shipment is really an an structure with a field and an internal table inside.

We also had a problem like that a few weeks ago, and we had the declaration wrong

Read only

0 Likes
678

Ramiro,

wow! you hit the nail in the head! The zshipment type was not active to its latets version. Thanks to the debugger I could see its real face.

Thanks!!!!