cancel
Showing results for 
Search instead for 
Did you mean: 

SUP2.1.3 Android. How to get SAP operation output table result

Former Member
0 Kudos

Dear All,

I had a SAP operation in a MBO, The operation manage to update the SAP and it have a SAP return output, I was tick the output table in the operation. (as attached)

My problem is I could not get the output return value in the android application.

Hope someone can help me.

Thank you.

Regards,

Choong

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

The operation in SUP will not support the output of an operation.

You can find workaround for this here,

http://scn.sap.com/thread/3374229

http://scn.sap.com/thread/3363221

- Midhun VP

Former Member
0 Kudos

Dear Midhum,

Thanks for your reply, based on the workaround provided, I should change the output as export parameters and add the result checker to check against the export parameters?

May I know whether you have any sample of result checker which only checking the single export parameters return like E_REMARKS and E_SUBRC as attached?

Thank you.

Regards

Choong

midhun_vp
Active Contributor
0 Kudos

Unfortunately I don't have a sample code for result checker. One of the other workaround I mentioned is create an MBO using the RFC you used for operation and mark the output of the operation as output in the MBO. Keep this MBO in a particular sync group, ex. operation and whenever you want to do this operation call the synchronize method on this sync group, that executes the operation RFC. Once it is done do a findall query on the MBO to get the output returned. This solves your problem. But you will not be able to do the operation while the device is offline, as you know synchronize API need internet connectivity. But if you really want an offline also with this workaround, you can check whether the device is online or not, if the device is offline you can store the data locally (the app developer has to extend local DB in this case) and when the device comes online you can pass the locally stored data and call synchronize.

Hope this helps you.

- Midhun VP

Former Member
0 Kudos

Hi Midhun,

Thanks for the alternative workaround provided, I've using this method previously, but it have a problem when uploading more than 1000 records in the T_ITEMS input parameters table. That's the reason I shift the RFC from MBO synchronization to operation.

Regards,

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Choong,

but it have a problem when uploading more than 1000 records in the T_ITEMS input parameters table

are you making transactions offline and then uploading to the system once device is online?

Please put more inputs.

Rgrds,

Jitendra

Former Member
0 Kudos

Hi Jitendra,

Our application is doing on online mode, user can choose multiple header and then call the RFC MBO to upload the header and line items to the SAP, so the selected header and line item will store to personalization parameters and synchronize the MBO.

Previously we have a case that user upload 1 header and 1000 line items but hit an error like the following :


The whole length of personalization parameters exceeds the limit of authenticate parameters and the safe length is 512 bytes

So by working out the problem, we shift the RFC MBO to the operation then solve the problem to upload 1000 line item to the SAP.

May I know whether there is any workaround on this error?

Regards,

Marcus

Former Member
0 Kudos

Hi and Jitendra,

I had open another tread for synchronization problem with 1000 line items. Possible you can give some comment?

Your reply is highly appreciated.

Thank you.

Regards

Choong

Answers (1)

Answers (1)

former_member186566
Active Participant
0 Kudos

Hi

Former Member
0 Kudos

Hi Yokesvaran,

SyBooks Online

Above is the default result checker for the sap, its seem like its able to validate when the operation return success as well. But the sample provided is check the table name "RETURN" instead of output parameters (please correct me if i'm wrong as I'm not good in java knowledge).


if ( type.equals("") || type.equals("S") || type.equals("I") )                   

{

  SybLogger.debug("Success");

  //sendDebugMsg(returnStructure);

  OHLog.info(OHLog.EIS_SUCCESS, returnStructure.getInt("NUMBER"), message.isEmpty()?"Success":message);

}

May I know whether you have sample for check against the output parameters?

Anyone can help on this?

Thank you.


Regards

Choong

former_member186566
Active Participant
0 Kudos

Hi

Former Member
0 Kudos

Hi Yokesvaran,

Thank for your sample provided, it will definitely help for me.

After I add in the result checker to the specific operation, the validation will return to the "msg". May I know how android program retrieve the validation return from this result checker. Sorry if i'm being ask the stupid because I don't know how the full cycle to implement the result checker.

Regards

Choong

former_member186566
Active Participant
0 Kudos

Hi

Are you developing native application?

Did you create a new Result checker for your operation?

Did you create a Error Screen in workflow?

We can extract data from SAP in two ways, "Return structure" and "Return table", go through the code you can understand it easily. In the sample code if "return structure" is null, then extracted data by "return table".

Once you got the data, you have to decide whether you want to call error throwing method( DSException () ) or not. For example, if it returns any exception, you should call that method. some cases, SAP will return data as empty or null or with some other failure note, then also you should call the same method.

When the method is called with required parameters, then in application, error screen will be show up along with the error message.

In my case its a server initiated hybrid app, when SAP error throws, then new error message will be delivered to device.

Let me know if you need more clarification.

Regards

Yokesvaran Kumarasamy

Former Member
0 Kudos

Hi Yokesvaran,

Thanks for your well explanation and it's easy to understand for those who never implement result checker like me.

I'm develop a native android app and starting to develop the custom_result_checker.txt for the operation.

By utilize the result checker, logically it can validate the operation and return the success message to display on the android screen. (please correct me if I'm wrong)

May I know what is the practice to return the message from result checker and display on the screen? by calling method ( DSException () )?

Besides that, May I know how to get the result checker return (maybe DSException ()) from the android activity screen?

Thank you.

Regards

Marcus

Former Member
0 Kudos

Hi Yokesvaran,

I developed the result checker and set it to the MBO's operation, when I run the application and synchronize the operation, My result checker return the success message as DSException() and the return was update to the SUP Server log file. BUT the sap didn't update the value as expected. I suspect the DSException() will cause the SAP value didn't update.

Should I remove the DSException() when SAP Operation return success status? If yes, how should I collect the result checker return in native android's activity?

Please help.

Regards,

Choong

Former Member
0 Kudos

Hi Yokesvaran,

Sorry on my mistake that the SAP value have successful update as expected.

The only pending is how to collect the result checker return on the native android activity. Is that possible to achieve?

Anyone can help on this?

Regards

Choong

former_member186566
Active Participant
0 Kudos

Hi,

DSException will always return a message. But how did you decided that its a success message?

Please refer the attached screenshot of SAP data source details in workspace.

You have to extract the type then you can decide that its a success or failure. Usually this will be a run time issue like SAP down for RFC failure.

But some time RFC will return a message which means a failure note.

For example,

You are passing all the required parameter to operation, RFC validating all the parameters in operation

if it fails to satisfy in some point, Developer can return failure message. In this case DSException will consider it as successful operation eventhough its failure operation. But user has to extract the message then if it is failure he has call the DSException to throw the error.

So please cross check it once again.

Regards

Yokesvaran Kumarasamy

Former Member
0 Kudos

Hi Yokesvaran,

Attached herewith my result checker, the RFC operation will return E_SUBRC with 00 to indicate as success update and 04 as failed update. No matter what is the RFC return I will fire the DSException and it will show on the SUP Server log.

Is that possible the native android activity can retrieve the DSException so that I can prompt a message to the application?


Regards,

Choong

former_member186566
Active Participant
0 Kudos

Hi

You cant directly access the Result Checker from your native code. You should write logs in Result checker and then read the log in you native code. So you can identify the error code, error type and its message then you can show it in your screen.

Below url explains how to write logs in result checker.

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01333.0210/doc/html/eka1309286690779...

Use Android API's to fetch the log and show to screen. I never used Logs (read/write) in my applications, If i found some thing related to this, i will share it with you.

Regards

Yokesvaran Kumarasamy