cancel
Showing results for 
Search instead for 
Did you mean: 

Webservices for Searching Non Exclusive Checked Out Record- SAP MDM 7.1 SP4

Former Member
0 Kudos

Any pointers on how to search for all non exclusive Checked out records along with some other conditions from Java Webdynpro,

1. Out of Box u2013using webservices generator for searching Non Exclusive Checked Out Record. Presently Webservices Generator doesnu2019t allow for this.

2. API Library- are there any APIs to search for Non Exclusive Checked out record

Posting on behalf of Team Members,

Navendu Shirali

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Navendu,

<br>In the MDM Java APIs there is a search mechanism that allows you to filter records based on their check out status.

<br>Briefly listed following is the MDM Java API approach you would use:

<br>

<br>1. Create a an object of type ResultDefinition for your main table record.

<br>Example:

<br>

<br>ResultDefinition resultDefinition = new ResultDefinition(bpTableSchema.getTable().getId());

<br>

<br>2. Add the fields to be included in the above object using the setSelectFields() method.

<br>Example:

<br>

<br>resultDefinition.setSelectFields(bpTableSchema.getFieldIds());

<br>

<br>3. (OPTIONAL) If there are any lookup fields in your main table then you also need to create the supporting result definitions.

<br>ResultDefinition[] supportingResultDefinitions =

getSupportingResultDefinitions(bpTableSchema, false);

<br>

<br>4. Create the object of type Search.

<br>Example:

<br>Search mySearch = new Search(bpTableSchema.getTable().getId());

<br>

<br>5. Create the field dimension and the constraint based on which you need to perform the search. In this example I list all MDM records having the phone number field value as 1564562100.

<br>Example:

<br>String phoneNo = "1564562100";

<br>FieldSearchDimension phoneNumberDimension =

<br> new FieldSearchDimension(phoneNbrFieldId);

<br>

<br> TextSearchConstraint searchPhoneNos =

<br> new TextSearchConstraint(phoneNo, TextSearchConstraint.EQUALS);

<br>

<br> mySearch .addSearchItem(dunsNumberDimension, searchDuns);

<br>

<br>6. Call the RecordDAO class getRecords() method (as per the 7.1 API framework). Here I am using the MDM 5.5 API framework :

<br>Record[] searchRecords =

<br> RecordDAO

<br> .getRecords(context, mySearch, resultDefinition, null,

<br> null, 1000, 0);

<br>

<br>7. Check the Check Out status of the search records.

<br>

<br>for (int i = 0; i < searchRecords.length; i++) {

<br> //Check if the record is checked out and this is the original record.

<br> if (searchRecords<i>.getCheckoutStatus()

<br> == Record.CheckoutStatus.ORIGINAL) {

<br> //Do some action here.

<br> } else

<br> //Check if the record is checked out and the user is not a member of the checked out record.

<br> if (searchRecords<i>.getCheckoutStatus()

<br> == Record.CheckoutStatus.NON_MEMBER) {

<br> //Do some action here.

<br> } else

<br> //Check if the record is checked out and the user is a member of the checked out record.

<br> if (searchRecords<i>.getCheckoutStatus()

<br> == Record.CheckoutStatus.MEMBER) {

<br> //Do some action here.

<br> } else

<br> //Check if the record is checked out and the user is the owner of the checked out record.

<br> if (searchRecords<i>.getCheckoutStatus()

<br> == Record.CheckoutStatus.OWNER) {

<br> //Do some action here.

<br> } else

<br> //Check if the record is not check out.

<br> if (searchRecords<i>.getCheckoutStatus()

<br> == Record.CheckoutStatus.NONE) {

<br> //Do some action here.

<br> }

<br>

<br> }

Edited by: Uday Rao on Apr 27, 2010 5:07 PM

Former Member
0 Kudos

Navendu,

Kindly let me know if this information was helpful.

Thanks and Regards

Uday