cancel
Showing results for 
Search instead for 
Did you mean: 

How to search a newly created checkedout record

pradeep_kumar5
Active Participant
0 Kudos

Hi Experts,

User x is not able to search a checkedout record created by user y (which is not checkedin even once). I am using RetrieveLimitedRecordsCommand to search that record. Even in Web Dynpro Configurator (WDC) component standard search it is not retrieving those records.

Is there any work around to get that ?

Regards,

Pradeep

Accepted Solutions (1)

Accepted Solutions (1)

pradeep_kumar5
Active Participant
0 Kudos

Hi guys,  thanks for your replies. I want to search the record by MDM java API not by data manager.  As of now I am using the below code

RetrieveLimitedRecordsCommand retrieveLimitedRecordsCommand = null;

ResultDefinition resultDefinition = new ResultDefinition(tableId);

try {

     retrieveLimitedRecordsCommand = new RetrieveLimitedRecordsCommand   (repositoryBean.getUserSessionContext());

     retrieveLimitedRecordsCommand.setSearch(search);

     retrieveLimitedRecordsCommand.setResultDefinition(resultDefinition);

     retrieveLimitedRecordsCommand.execute();

RecordResultSet recordResultSet = retrieveLimitedRecordsCommandForEntityType.getRecords();         

            int count = 0;

            if(recordResultSet != null){

                 

           count = recordResultSet.getCount();

           

      }

            logger.infoT("Count:"+count);

      Integer[] recordArray = new Integer[count];          

            for(int i =0;i<count;i++){

     

                  int record = Integer.parseInt(recordResultSet.getRecord(i).getId().toString().substring(1));

                  recordArray[i] = record;

     

            }

        return recordArray;

By using the above code I am not able to search the newly created checkedout record. Is there any other way to get it?

Regards,

Pradeep

Former Member
0 Kudos

I am sorry Pradeep. I aint worked on Java API- Suggest you can either ask MDM team member to unprotect records from Data Manager or you can probably post this query on other forum. I wonder if you would get coded responses over this MDM forum.

Regards,

Ali

Former Member
0 Kudos

Pradeep,

To retrieve checked out records, you need to use RetrieveCheckoutRecordsByOriginalCommand class. This class will return the record Id of checkout records, which you can use to display the the record.

For more information follow the link: RetrieveCheckoutRecords

Hope, it will help you.

Thx/ -Tarun

martin_schffler
Participant
0 Kudos

Hi Pradeep,

You have not posted how you build your search object but I assume the issue is there.

Please have a look at the setCheckoutSearchType method of the Search object and use the correct type to build your search (i.e. try using Search.CheckOutSearchType.ALL).

Of course the user you use to connect to the MDM has to have the right authorizations to see the checked out records. The API won't help you to see records you are not allowed to see.

You can check if this is the case by starting the DataManager with this user and see if you are able to see the record there.

Regards,

Martin

Answers (4)

Answers (4)

0 Kudos

You can search checked out record with MDM JAVA API in SAP MDM using property "setCheckoutSearchType()" of "Search" object. Here code example:


Code example:

    Search search = new Search;

    search.setCheckoutSearchType(Search.CheckOutSearchType.STANDARD);

    RetrieveLimitedRecordsCommand cmd = new RetrieveLimitedRecordsCommand(

    cmd.setSearch(search);

    cmd.execute();

You set search type. It can be one of the three:

Search.CheckOutSearchType.STANDARD - you will find record which was checked out as new, and you will find record which existed in MDM and which has protected version and checked out version. You will find checked out version.

Search.CheckOutSearchType.ORIGINAL - you will find original record which is not checked out. If you are searching record which checked out as new, you will not find anything, but if you are searching record which existed in MDM and it checked out, and it has protected version and checked out version, you will find protected version - it is original record.

Search.CheckOutSearchType.ALL - if you are searching record which checked out as new, then you will find it. If you are searching record which existed in MDM and it checked out and it has two versions - protected(original) and checked out version (user can change it), you will find protected version (original).

pradeep_kumar5
Active Participant
0 Kudos

Hi Martin, I tried your approach. It works man..!! Really thanks alot.

@ Tarun: If I use RetrieveCheckoutRecordsByOriginalCommand i need to provide Original Id's. It is not possible get Original record Ids for the newly created checkedout records.

Regards,

Pradeep

Former Member
0 Kudos

Hi Pradeep,

If you are searching for checked-out record via Portal or Web Dynpro system then i think you cannot see that record unless checked-In.

But if you are searching check-out record in MDM, then it is very much possible to view the record in MDM. Though you cannot alter/make changes to checked-out record in MDM but you can surely view it in MDM.

Please check and let us know.

Regards,

Ali

former_member190061
Participant
0 Kudos

Hello,

If I am not wrong, do you wana search record in Data Manager??(If not kindly elaborate more.....)If that is the case why don't you use Free Form Search?, where you have so many options with Created date, Update date and so on...

Regards,

Girish