cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve main table with lookup flat table using MDM ABAP API

Former Member
0 Kudos

Hi all,

This is my first abap calling MDM OO API to retrieve data item. After retrieved main product items using retrieve method (mo_core_service->retrieve), supplier column contains data like 2,4,8 (integer) instead of supplier name displayed in MDM Data Manager. Supplier column is reference to a Supplier lookup table and integers 2, 4, 8 seem to be index of lookup table.

I intend to retrieve Suppier table into internal table which contains supplier name. Retrieve main product items and then map supplier name with internal table according to index number. Is this approach correct or MDM API provides more convenience method?

Regards,

Donald

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member226173
Active Participant
0 Kudos

Hi Donald,

why dont you extract the whole MDM table into your internal table and then remove the unnecessary data instead of retreiving a single field values .

just out of curiosity is the suppler name a look up by any chance ???

Regards,

Vignesh

Former Member
0 Kudos

Hi all,

Any comment to my approach?

Regards,

Donald

Former Member
0 Kudos

Hi,

Whenever u retrieve main table records using API u will get index value for lookup table.

You first extract data from lookup table pass Lookup table code and along with index value.

Create internal table of type mdm_keys suppose lt_keys and fill the table with index values.

Use api mo_core_service->retrieve_simple and pass lookup table code and lt_keys as exporting parameter.

in importing parameter u will get the entire information index of lookup value,code and descp .

Extract and store the information in a transperent table.

Now whenever u retrieve main table information read this table and extract desc based on key u got.

Regards,

Neethu Joy

Former Member
0 Kudos

Hi Neethu,

Thanks for your response.

You first extract data from lookup table pass Lookup table code and along with index value

May I know how to get index value of records within Lookup table?

Regards,

Donald

Former Member
0 Kudos

Hi Donald,

Below is the sample :

CALL METHOD lr_api->mo_core_service->retrieve_simple

EXPORTING

iv_object_type_code = 'Lookup table code'

it_keys = lt_keys

IMPORTING

et_ddic_structure = it_lookup_table.

here lt_keys is of type mdm_keys which should hold sy-index values.This lt_keys u need to prefill with sy-index values and pass as input parameter to the function which for each index value will extract the corresponding lookup data and will return in et_ddic_structure which u can capture in an internal table.

then execute a loop command on lt_keys and based on it read it_lookup_table .

Regards,

Neethu Joy

Former Member
0 Kudos

Hi Donald,

Are you able to access Index value?

Regards,

Neethu Joy

Former Member
0 Kudos

Hi Neethu,

Thanks for your proposed method using retrieve_simple. I found a solution to my report.

Actually I do not need to get index values of lookup table, what the report intend to get is supplier names. Therefore, my solution is simply make API call using retrieve method to get supplier name by supplying the indexes (acquired from main product items using retrieve method). The disadvantage of this solution is it may make large number of API calls if there are large number of suppliers. I will try retrieve_simple method later. Thanks again.

Regards,

Donald