on 12-19-2011 7:12 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
Any comment to my approach?
Regards,
Donald
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.