on 06-01-2013 12:52 PM
Hi all,
I have a requirement, i want to set the values to the attributes of the MBO.
I have a MBO with 2 input fields. In the WF screen i have only one button.
When the user click on the button, MBO has to call by passing the values to MBO dynamically.
i wrote the logic for the 2 fiels in customBeforeMenuitemclick( ). In custom.js
Now i want to set these values to MBO fields(attributes). Is it possible?
Thanks in advance.....
suresh
Hi suresh.
I dont realy understand what you trying to do. If you create a HWC application then in mobile workflow form editor you can create an input field for your input by mapping personalization key with your input field. I think maybe you just want to pass value to Mbo's input parameter without input filed...so you could try to make a standard HWC and look how they can pass data to input field .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Quynh Doan Manh,
Thanks for the help.
Actually i am passing image to SAP.
I don't want to display image in HWC, i want to pass image to MBO input parameter
i called
customGetPictureDataFromCamera() in customBeforeMenuItemClick(screen, menuItem) of custom.js
in customGetPictureDataSuccess(fileName, imageData ) i want to set this image to MBO input paramete. how can i set....
Hi Suresh,
Can you explain your requirement, because it is little unclear. If you want to take image from your camera and pass it via MBO parameters also. First you need to have attribute fields with image data type. After that you can use these fields to parse image(image will b stored in BIGINT binary ) once u got that image in your attribute you can use this binary data where ever you want.
Regards
Srinivas
This sample demonstrates the use of the camera:
Hi Srinivas,
Thanks for the help,
My requirement is save the image in sap. I created a RFC FM with one input parameter of Xstring.
In MBO i created a operation "create"
and in the WF i mapped, input MBO with key21
and i called
customGetPictureDataFromCamera() in customBeforeMenuItemClick(screen, menuItem) of custom.js
function customGetPictureDataSuccess(fileName, imageData ){
var pictureDataValue = new MessageValue();
pictureDataValue.setKey("key21"); // Must be set by the user.
pictureDataValue.setValue(imageData);
pictureDataValue.setType(MessageValueType.TEXT);
var mvc = getWorkflowMessage().getValues();
if( mvc ) {
mvc.add( pictureDataValue.getKey(), pictureDataValue );
Is anything wrong i did?
and
called customGetPictureDataFromCamera() in customBeforeMenuItemClick(screen, menuItem) of custom.js
in customGetPictureDataSuccess(fileName, imageData )
Now i want to map imageData to a variable. How it is possible?
Thanks in advance..
Suresh
Hi Suresh,
I have mimic your requirement with sqlanywhere DB, What I have done please find bellow steps.
1.Created a table in SqlAnywhere with image column.
2.Created MBO with create operation table as Backend.
2.Created Menu (Save Image with CREATE Operation and type "ONLINE REQUEST" , in Menu Properties, Parameter Mappings, Create New KEY(Eg: KY_image) for image attribute and Save) in Workflow screen.
3.when you click on button it will call Custom.js (customGetPictureDataFromCamera()) in CustomBeforeMenuClick() as you mentioned.
4. Once you capture image and save(use in ipad) it, customGetPictureDataSuccess() will be called.
5. In customGetPictureDataSuccess() , pictureDataValue.setKey("KY_image");
Now You can able to save picture in your BackEnd connected to your MBO.
Regards
Srinivas
Hi Pratheek,
I think u already did a project on saving the image in sap.
http://scn.sap.com/thread/3364039
Please share your knowledge.
1. I think in the method customGetPictureDataSuccess(fileName, imageData )
imageData is base64 encoded string
is it correct?
Else, How to convert imageData to BASE64 encoded string
2. In sap bapi , i am using SSFC_BASE64_DECODE fm to decode imageData and saving in table.
My WF application calling BAPI, But IM_IMAGE is empty while calling MBO even-though i wrote below code.
(Please see Jun 4, 2013 5:41 PM replay for IM_IMAGE)
function customGetPictureDataSuccess(fileName, imageData ){
var pictureDataValue = new MessageValue();
pictureDataValue.setKey("key21"); // Must be set by the user.
pictureDataValue.setValue(imageData);
pictureDataValue.setType(MessageValueType.TEXT);
var mvc = getWorkflowMessage().getValues();
Thanks in advance.......
Suresh
Hi Suresh,
What you have done is correct only, only difference I found is in your code you are using "KEY21" how you created this key?, to save image , please follow bellow steps.
1. Create a "Menu" option type Online Request.
2. In properties, "Parameter Mappings" , Add "Key"(don't use already created key here).
3. Use same key in
pictureDataValue.setKey() in custom.js file.
Regards
Srinivas
Hi Suresh,
your question is not clear, if your speaking about dynamic user inputs for your workflow fields, Please create personalisation keys for your MBO input fields which user has to enter values dynamically and Map them in your workflow screen. No need for any coding in custom.js to input values dynamically.
Regards
Srinivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.