Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2008 at 01:44 PM

    Dear fellow MDM ABAPers,

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2008 at 03:18 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2008 at 04:46 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2008 at 05:25 PM

    Hi Siva,

    give your email.

    will send you the code.

    + An

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2008 at 05:51 PM

    Dear An,

    Thanks for your assistance.

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

    Regards

    Siva K.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 05:09 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.