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: 

How to create table field to store multiple record fields

Former Member
0 Kudos

Hi all,

I am trying to create table to store the multiple record files in one field.

These multiple values are the listbox items which are selected in the BSP.

First I want to define the table field to store these values.

Please help me out.

thanks in advance.

2 REPLIES 2

Former Member
0 Kudos

Hi HCC,

I'm assuming you want to create a table field within another table.

Here is a sample code:

TYPES: BEGIN OF CONTAINERITEM,

SERIAL_NUMBER TYPE STRING,

END OF CONTAINERITEM.

TYPES: ICONTAINERITEM TYPE CONTAINERITEM OCCURS 0.

TYPES: BEGIN OF CONTAINER,

BOX_TYPE LIKE ZKIU-VHILM,

CONTAINERITEM TYPE ICONTAINERITEM,

END OF CONTAINER.

DATA: I_CONTAINER TYPE TABLE OF CONTAINER.

Now you'll have an internal table ( I_CONTAINER) with box_type as field and containeritem as a nested table where you can store many serial numbers.

How to use:

LOOP AT I_CONTAINER INTO WA_CONTAINER.

LOOP AT WA_CONTAINER-CONTAINERITEM INTO WA_CONTAINERITEM.

ENDLOOP.

ENDLOOP.

Former Member
0 Kudos

If you rae looking for creating database table field which can stored multiple records, then follow these steps.

1. Create a table type (SE11) with sructure that you wnat as line type.

2. Create data element with reference to above table type as data type.

3. When you create your table use above data element for filed defination.

This will allow you to store multiple records in that field.

-- Reward if helpful

Shrikant