Skip to Content
0
Oct 18, 2019 at 12:24 PM

How to use a custom table definition's multiple parameters in a custom AMDP function?

145 Views

I have a z amdp function which is for alternate UoM conversion using marm_convert_material_unit and also a z table definition

Following is the parameters that I have created in my table function:

@ClientDependent: false

@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'Base to Alternate UoM Conversion TF'

define table function zsd_amdp_uom_tf

with parameters

matnr : matnr, //Material Number in_qty :

fklmg, //Input Quantity

in_uom : meins, //Input Unit Of Measure

out_uom : meins //Output Unit Of Measure

returns {

out_qty : fklmg; //Output Quantity

}

implemented by method ZCL_AMDP_UOM=>MARM_CONVERT_MATERIAL_UNIT;

I have included the following line of code in the public section of the Z class

CLASS-METHODS marm_convert_material_unit FOR TABLE FUNCTION zsd_amdp_uom_tf .

How to use the import/export parameters of the table definitions in the ZCL_AMDP_UOM=>MARM_CONVERT_MATERIAL_UNIT ?

CLASS zcl_amdp_uom IMPLEMENTATION.

METHOD marm_convert_material_unit BY DATABASE FUNCTION FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY USING marm.

I have done all this using SAP HANA Studio. Please help in how to proceed further I'm just a beginner in AMDP functions/Table definitions.