ABAP AMDP Procedure Output Parameter Type must be Structured
If method contains a database procedure, row type of output parameters must be structured. Additionally, all components of the row type must be elementary. ABAP programmers developing AMDP procedures must convert output table parameters' row types to structured row types. Otherwise SAP developers cannot activate AMDP procedure successfully.
When I try to activate AMDP procedure on SAP HANA Studio, I see following error message:
The method "GET_PLANT_BY_SALESORG" contains a database procedure, which means that the row type of "OUT_TAB" must be structured. All components of the row type must be elementary.
The AMDP activation error is because the PLANTS table type is based on an elementary type WERKS_D data element.
But for AMDP output parameters, the row type of the table must be structured not elementary.
To resolve this issue, I created a structure which includes only the WERKS field of WERKS_D data element as seen in below.
Additionall I created a new ABAP Data Dictionary object as Table Type using above structure as its row type.
When I modify AMDP class code for the procedure method definition by replacing the PLANTS table type with new table type, the AMDP activation is succeeded immediately.