Skip to Content
Former Member
Feb 02, 2011 at 09:12 PM

Reading data from Lookup [qualified flat] (multi-valued) table


I have a main table u2019ABCu2019 which has a Lookup [qualified flat] (multi-valued) field u2018XYZu2019 along with some other text fields. I am able to read data from table ABC including lookup field data, but I do not see the relation

For Ex: If for a contract in table u2018ABCu2019, there are multiple line items in look up table. I have a contract with 2 line items in u2018ABCu2019, but 4 line items in look up table (2 records each for each line item with item number). Now, when I read the data from table u2018ABCu2019 for that contract, I get all the 4 lines in result table; but item no is blank even though there is item no field in table u2018XYZu2019.

Below is the sample code:

wa_query-parameter_code = Contract ID Field.

wa_query-operator = 'EQ'.

wa_query-dimension_type = 1. "mdmif_search_dim_field.

wa_query-constraint_type =8. " mdmif_search_constr_text.

wa_string = Contract Number.

GET REFERENCE OF wa_string INTO wa_query-value_low.

APPEND wa_query TO lt_query.

CLEAR wa_query.

CALL METHOD lcl_api->mo_core_service->query


iv_object_type_code = 'ABCu2019

it_query = lt_query


et_result_set = lt_result_set_key.

LOOP AT lt_result_set_key INTO ls_result_set_key.

lt_keys = ls_result_set_key-record_ids.


  • Contract Price for lower bound

ls_result_set_definition-field_name = XYZ'.

APPEND ls_result_set_definition TO lt_result_set_definition.

CALL METHOD lcl_api->mo_core_service->retrieve


iv_object_type_code = 'ABCu2019

it_result_set_definition = lt_result_set_definition

it_keys = lt_keys


et_result_set = lt_result_set.

In table lt_result_set, I see 4 records, but I do not know which 2 records belong to item 1 of the contract and other 2 records for item2.

Can anyone help me in resolving this. Any kind of help is appreciated.