cancel
Showing results for 
Search instead for 
Did you mean: 

MDM ABAP API for Retrieve - can we get the associated recordids or keys

Former Member
0 Kudos

This question is to the MDM ABAP API resources. I have reviewed the MDM ABAP APIs, and the associated How-To documents. Also I was able to connect to a Repository , do a Query MDM ABAP API, and using the record-ids retrieved , was able to execute the Retrieve mdm abap apis.

For example : to execute the method below, I am providing a set of record-ids in the lt_keys and the fields to be retrieved in the lt_result_set_definition .

CALL METHOD lr_api->mo_core_service->retrieve

EXPORTING

iv_object_type_code = 'Products'

it_result_set_definition = lt_result_set_definition

it_keys = lt_keys

IMPORTING

et_result_set = lt_result_set.

once the api is executed the lt_result_set contains data for the fields specified in the lt_result_set_definition for the lt_keys .

I would like to know which recordid is associated with which set of data retrieved.

Is there a way to specify in the lt_result_set_definition that we would like to retrieve the recordids also ?

If not is there any other way to identify the associated record-id with the above retrieved information ?

Thanks for your help with this question.

Siva K.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Dear Andreas and Annika,

Thanks for your assistance with this question. As I had promised earlier, I did some testing and the results are described below. Most of you may already know this. I had to go through some samples to get a better understanding.

Populated 5 records in a Flat table . They got sequential record ids .

Recordid Code name

1 0001 Test1

2 0002 Test2

3 0003 Test3

4 0004 Test4

5 0005 Test5

Did a Retrieve specifying RecordIds as 1,2, 3

Got answer back as three sets of Name/Value pairs - 0001, 0002, 0003.

Did a Retrieve specifying RecordIds as 1,2, 3, 1,2

Got answer back as 5 sets of name/value pairs - 0001, 0002,0003, 0001 , 0002

Did a Retrieve specifying RecordIds as 1,2, 3, 100, 102

Got answer back as 5 sets of name/value pairs - 0001, 0002,0003, initial, initial

So the abap api tries to return data for all the recordids we request .

If we ask for a record id , it gets data back for that. In the same order as the recordids.

If there is no valid recordid , it does not return any error. It just returns blank records for them.

With this information, I would be able to associate the retrieved data to the Recordid and use that information as needed.

Thanks again for all your assistance.

Regards

Siva K.

Former Member
0 Kudos

Dear An,

Thanks for your assistance.

Please email me the code at krishnamurthy.siva@gmail.com

Regards

Siva K.

Former Member
0 Kudos

Sent you dear,

the ids the query fetches is the ids in which sequence the records got created. I am not sure how it will work with merge shud check that.

there might be a problem in data declaration (defined twice), I know you can take care of that.

Pls have a look, hope it will try to help.

+ An

Former Member
0 Kudos

Hi Siva,

give your email.

will send you the code.

+ An

Former Member
0 Kudos

Dear Andreas,

Thanks for the answer. I will test a few scenarios.

1. specifying a valid set of records in a random order like ( 5, 3, 6 )

2. specifying a set where some of the record ids may be invalid ( 1,200, 3,5,201, 6) where only 1,3,5,6 are valid

I will test and see if I can find any issues and report back.

Thanks again for taking the time to respond to my question.

Regards

Siva K.

Former Member
0 Kudos

Hi Shiva,

the results come in the same order as the ids where provided in.

If you provide an internal table with the ids: 1, 2, 3 the records in the result set will also appear in the order 1, 2, 3.

Kind Regards

Andreas

Former Member
0 Kudos

Dear fellow MDM ABAPers,

I have not received any answers . Do you need more information on this question ? Thanks. Siva K.