cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.1.3 iOS : Only one Data record being returned

Former Member
0 Kudos

Hi All,

I am trying to fetch some data from the SUP server from my iOS device.

I set my personalization parameters and call the Synchronize function but i am only getting one data row for my MBO . whereas i have more than 10 rows present in Table. has any one encountered this issue?

I think there is some small configuration issue on the server which only retuens on record.

Please can any one guide me on what this could be.

I would really appreciate your help here.

Below is the code.

Azeem

<MBO>PersonalizationParameters *pp =  [<MBO>DB getPersonalizationParameters];

    pp.CUST_NO_PK = @"0000000011";

    pp.SALESORG_PK = @"1000";

    pp.username = @"XXXXX";

    [pp save];

    while ([<MBO>DB hasPendingOperations])

        [NSThread sleepForTimeInterval:0.2];

    NSLog(@"Start PersonalizationParameters Synchronize");

    @try {

       [<MBO>DB synchronize];

    }

    @catch (NSException *exception) {

        MBOLogError(@"<MBO>DB synchronize Exception%@: %@", [exception name], [exception reason]);

    }

    NSLog(@"End  PersonalizationParameters Synchronize");

    <MBO>MBO_PURCHASEORDER_GETLISTSynchronizationParameters *sp = [<MBO>MBO_PURCHASEORDER_GETLIST getSynchronizationParameters];

    [sp delete];

    //Supply New params Here. i am leaving them as blank for now.If i don't save empty params here i don't even get one row

    [sp save];

     while ([<MBO>DB hasPendingOperations])

     [NSThread sleepForTimeInterval:0.2];

    NSLog(@"Start SynchronizationParameters Synchronize");

    @try {

        [<MBO>DB synchronize];

    }

    @catch (NSException *exception) {

        MBOLogError(@"<MBO>DB synchronize Exception%@: %@", [exception name], [exception reason]);

    }

    NSLog(@"End SynchronizationParameters Synchronize");

    NSMutableArray * array = [[NSMutableArray alloc] init];

    <MBO>MBO_PURCHASEORDER_GETLISTList * PO = [<MBO>MBO_PURCHASEORDER_GETLIST findAll];

    if ([PO length] > 0)

    {

        for (<MBO>MBO_PURCHASEORDER_GETLIST * oneRec in PO)

        {

            NSLog(@"Details %@",[oneRec toString]);

            [array addObject:oneRec];

        }

    }

    NSLog(@"Array Count %d",[array count]);

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183031
Participant
0 Kudos

Hi Azeem,

i am not pretty familiar with the concept of MBO.

But,..As per my Analysis,i came up with two points.

1)based on customerNO,SalesORG,Username field combinations its fetching single record data.

or

2)after getting reference to

  <MBO>MBO_PURCHASEORDER_GETLISTSynchronizationParameters *sp = [<MBO>MBO_PURCHASEORDER_GETLIST getSynchronizationParameters]; 
the below statement is deleting the all the records in purchase order list.

   [sp delete]; 

when you call

[sp save];   // it seems it calls the defaults values and creates one record for you.

So, when you fetch the data it gives one record for you.

it will be good if you provide,what is the exact business scenario which you are trying.

and what is exact data you are getting in that record while fetching the records.

Regards
MBR.