on 12-27-2013 7:44 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
As Midhun VP said, You cannot handle output of an operation, but you can validate it.
For example
If operation returns a run time exception (Like SAP server down or RFC failure etc), by default your mobile app will not recognize it as an error, it just process and stop the request. So you can write Result Checker to validate the result, then you can show "Operation failure" messages in app.
Refer the above link for how to create and implement Result checker in operation. But you might have java knowledge to implement this.
All the best.
Regards
Yokesvaran Kumarasamy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yokesvaran,
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
I have attached the sample ResultChecker "LeaveRC.java" with this post which I used in my application.
In this example you have to extract data for "Type" and "Message" from "Return" table. So then you can validate success or failure of an operation.
I hope this may be helpful to you
Regards
Yokesvaran Kumarasamy
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
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
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
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
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
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
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.
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
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.