SAP offers an RFC function module, RFC_READ_TABLE, enabling any table to be read through RFC.
The script below is an example of how you can read the MVKE table for a specific material by means of a call instruction.
It has been possible to transfer the values of the material grouping (KONDM) and the product hierarchy (PRODH) fields in their own variables.
In this way the material grouping and the product hierarchy are now available for the material contained in the &V[Material] variable.