How to pass single-column table to AMDP method?

817 Views Asked by At

I need to pass a table with a single column to an AMDP method which throws the error, the other parameters go fine:

TYPES: BEGIN OF s_so_i,
         parent_key   TYPE snwd_so_i-parent_key,
         product_guid TYPE snwd_pd-node_key,
         node_key     TYPE snwd_so_i-node_key,
       END OF s_so_i.
TYPES: BEGIN OF s_product,
         product_guid TYPE snwd_pd-node_key,
         category     TYPE snwd_pd-category,
       END OF s_product.
TYPES: tt_product TYPE STANDARD TABLE OF s_product,
       tt_so      TYPE STANDARD TABLE OF snwd_node_key,  "<-- error
       tt_so_i    TYPE STANDARD TABLE OF s_so_i.

How should I define it?

2

There are 2 best solutions below

0
On BEST ANSWER

Adding this solved the problem:

TYPES: BEGIN OF s_so,
         so_guid TYPE snwd_so-node_key,
       END OF s_so.

TYPES: tt_product TYPE STANDARD TABLE OF s_product,
       tt_so_i    TYPE STANDARD TABLE OF s_so_i,
       tt_so      TYPE STANDARD TABLE OF s_so.  <--

So it seems the table type must point to a structure type.

0
On

instead of using snwd_node_key I can suggest you to use EGUID_S.

EGUID_S is a structure with only including a single column with RAW16 as SYSUUID

instead of

tt_so      TYPE STANDARD TABLE OF snwd_node_key,

use

tt_so      TYPE STANDARD TABLE OF EGUID_S,