/*------------------------------------------------------------------------ File : via-serviceadapter.p Purpose : Batching Sample via Service Adapter (Frontend) ----------------------------------------------------------------------*/ /* *************************** Definitions ************************** */ ROUTINE-LEVEL ON ERROR UNDO, THROW. USING Consultingwerk.OERA.* FROM PROPATH. {Consultingwerk/SmartComponentsDemo/OERA/Sports2000/dsCustomer.i} DEFINE VARIABLE oRequest AS FetchDataRequest NO-UNDO . /* *************************** Main Block *************************** */ /* Prepare request parameter object with query string and batch size */ oRequest = NEW FetchDataRequest ("eCustomer", "for each eCustomer where eCustomer.SalesRep = 'HXM' and eCustomer.CustNum < 1400", 15 /* batch size */) . REPEAT: /* Perform request for a batch */ ServiceInterface:FetchData ("Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity", oRequest, OUTPUT DATASET dsCustomer) . /* Process batch data */ FOR EACH eCustomer: DISPL eCustomer.CustNum eCustomer.Name eCustomer.SalesRep . END. /* When a next batch is available, the NextContext contains the Context for the next request. Otherwise, leave here as there is no more data on the backend. */ IF oRequest:NextContext > "" THEN oRequest:Context = oRequest:NextContext . ELSE LEAVE . END.