cancel
Showing results for 
Search instead for 
Did you mean: 

MBO Or Odata Or A combination for my App

Former Member
0 Kudos

Hi Experts,

I am new to SAP Mobile app development and quite confused as to how to build my app with the below functionality:

1. Retrieve all the invoice document numbers from SAP

2. When user clicks one of the invoice documents - the invoice opens as pdf.

My dilemma is:

I do not want to hit SAP every time user logs onto the app. The list of invoices should be loaded only the first time and then only if new invoice is posted or existing invoice changed. Seems like MBO approach must be taken for data caching etc

Once the user clicks on the invoice, I wish to hit SAP database at the runtime, get the invoice and display as pdf. Seems like ODATA approach must be taken.

Can ODATA work for both these requirements?

Accepted Solutions (1)

Accepted Solutions (1)

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you were to use the MBO approach, the following sample may be of some help.

MBOs and Hybrid Apps https://cw.sdn.sap.com/cw/docs/DOC-152083

In the hybrid app you can add an attachment viewer control that when clicked on will perform a query against an MBO to return the base64 encoded content that is the PDF.

I believe there are a set of methods that can be called directly from JavaScript such as showAttachmentContents and showLocalAttachment methods that can be used if you do not wish to use the attachment viewer control.

How large are the PDF's?  I would verify the above approach can handle the PDF download and can do so in a timely manner early on.  I believe there are some size limitations on some platforms. 

The following sample show how to take a picture from a device, upload it to the SUP server and then later view it on the device.  You could modify this sample to use the attachment viewer control instead of the image control and replace the jpg images with pdfs.

PhoneGap and Hybrid Web Container Customization Sample for 2.1 ESD #3  https://cw.sdn.sap.com/cw/docs/DOC-149428

Answers (0)