on 04-17-2014 7:31 AM
Hi,
I have made an app in HWC in SMP 2.3.This app have an input field(Order no.), on the base of this number, it display order list.this is working fine.
I am using Standard Bapi in background for displaying the detail on the base of this number.
This order have length of 12 char, and my order number is 4000020.So i have to add manually 5 zero before this number to make it 12 char
i.e.(000004000020).
So, my concern is that " is it possible that it will convert automatically to 12 char by adding zero".?
Please suggest.
Thanks,
Rohit
Is this issue resolved ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may try any of these two methods
1) throw an alert to user to enter exactly 12 character number instead of wrongly entered value. This can be done in the properties of the edit box(Input box).
2)Add a wrapper to the standard BAPI with a similar logic of input valuation that happens in standard BAPI
i.e.. user enters value in mobile device--> value goes to BAPI wrapper (which has input valuation as of standard BAPI and manipulation of inputs happen here) --> manipulated value is sent to -->Standard BAPI and process happens as before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An Abaper would use the FM associated to ALPHA conversion-exit. But for an external call this is not a solution (even not RFC enabled)
Hopefully SAP provided you some tools in Service BAPIs for General BAPI Functions BapiService.DataConversionInt2Ext1() and BapiService.DataConversionExt2Int1() (Here 4000020 is External format and 000004000020 is Internalformat) It should also convert to upercase fields defined in SAP without lowercase (at domain level)
So you may be required to use more BAPI but no wrapper.
Regards,
Raymond
Yes, you can add zeroes to make it a 12 character number to pass it to the BAPI input or else from BAPI you can add the zeroes before processing, an abaper can do this.
Midhun VP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright, you can achieve this in custom.js. Before sending the message value collection you can modify it and send.
You need to first get the data entered in the editbox using the below code:
Add the below code inside your custom.js
// The function customBeforeMenuItemClick you can find inside custom.js
hwc.customBeforeMenuItemClick = function(screen, menuItem) {
if (screen === "Start" && menuItem === "Inventory_detail") // Here you have to give the key of your screen and the button key.
{
var form = document.forms[screen + "Form"];
if (form)
{
cost = form.Enter_Airline_ID.value; // Enter the key of the edit box, cost is a global variable hence it can be accessed anywhere in the custom.js file
// you need to add the zeroes to cost here.
}
if (cost==null || cost == "") //add more fields here for validation.
{
alert("Please enter the mandatory fields");
return false;
}
}
return true;
};
Use the below code to modify the workflow message:
hwc.customBeforeSubmit(screenKey, actionName, workflowMessageToSend) {
if (screenKey == "Start" && (actionName == "Inventory_detail")) {
var myNewValue1 = new MessageValue();
myNewValue1.setKey("keyAppID2");// Your personalization key name
myNewValue1.setValue(Cost);
myNewValue1.setType("TEXT");
var mvc = workflowMessageToSend.getValues();
if( mvc ) {
mvc.add( myNewValue1.getKey(), myNewValue1 );
}
}
return true;
}
Note: Do not map the PK with editbox key in the properties of menuitem used for operation, we are doing it from custom.js
Midhun VP
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
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.