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

Reterieve Records that has been checked out from Data Manager

Hi,

I am working with MDM Java API to Retrieve records that has been checked out by MDM DataManager.

This Snippet is a part of it i have work with . i am using com.sap.mdm Package.

We use getCheckoutStatus() to get theCheckout status of a record, but when i apply this method it is showing as (-1) (1, if the record is checked out (-1) for unchecked record )even thought the record is checkedout in DataManager.

Can any one please help in this query. the soln i want is something like from all the records that are in DataManager i need to get the checked out Status of each record.

RecordResultSet records = retrieveRecordsCmd.getRecords();

//for(int xi=0; xi<records.getCount(); xi++)

// {

Record rec=records.getRecord(1);

//System.out.println("records"+records.getRecord(0));

System.out.println("5th record is:"+rec);

System.out.println("check out status of the record :"+rec.getCheckoutStatus());

int recst= Record.CheckoutStatus.CHECKED_OUT;

System.out.println("Current Record Checkout Status is:"+recst);

if(recst==rec.getCheckoutStatus())

{

System.out.println("Manually checking the Checkedout status after the Record is Checked Out :");

}

// }

With Thanks

Mary

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2007 at 01:31 PM

    Hi Mary,

    please try this:

    NumberOfCheckoutRec = 0;

    RecordResultSet records = retrieveRecordsCmd.getRecords();

    for(int n=1; n<records.getCount(); n++)

    {

    Record rec=records.getRecord(n);

    System.out.println("Read record:" + rec);

    System.out.println(" Check out status of the record: " + rec.getCheckoutStatus());

    if(rec.getCheckoutStatus() == 1)

    {

    numberOfCheckoutRec = numberOfCheckoutRec + 1;

    //If you want to check in the checkout rec do this:

    rec.setCheckoutStatus(-1);

    }

    System.out.println(" Numer of checkuot rec is: " + numberOfCheckoutRec );

    }

    Please adjust some bit imprecisions in code.

    Hope this help you.

    Regards,

    Vito

    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.