on 04-26-2005 4:09 AM
Hi
I have some data returned by an RFC which is bound to a table. This contains some Amount fields. The problem is that if there is no decimal value then the Amount is represented as a whole number without the decimals.
We would like to force the zeroes even if there are no decimal values returned by the RFC. Any input in this regard would be of great help.
regards
ceci
Hi Ceci,
1. You can create a simple type and set the format for that simple type with decimal places. (####.00)
2. You have to create the value node and create the value attributes similar to the return table structure of the RFC.
3. Set the data type of the "Amount" value attribute with the created simple type.
4. Loop through the model node and set the data to the value node.
Hope this helps you.
Regards,
Santhosh.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ceci,
To avoid looping through the model node and assign it to the value node. You can create a value node and value attribute under the model node with the cardinality 1:1 and by using the supply function you can avoid looping through the model node.
Refer the blog "Supply functions in WebDynpro"
/people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro
Hope this helps. If you require more info on this send a reply.
Regards,
Santhosh.C
Hi Ceci,
1. Create a simple type "ST_Amount", built-in type decimal and in the "Representation" mention the "Format" as "#,###.00##"
2. Create a value node "vnAmount" with cardinality 1:1 and "singleton=false" under the RFC output table.
3. Create a value attribute "vaAmount" under the value node "vnAmount" and set the "type" as created simple type "ST_Amount".
4. Click on the value node and create a supplyfunction.
5. Goto the implementation tab and write the following code.
IPrivateCO_ComponentName.IVnAmountElement amountElement = node.createVnAmountElement();
node.bind(amountElement);
amountElement.setVaAmount(parentElement.getRFCAmount());
6. In the Table UI element change the binding of the amount field. Select the newly created a value attribute.
This will solve your problem.
Regards,
Santhosh.C
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.