on 05-23-2018 10:50 AM
I'm using SAP REST adapter to send a JSON message. I need the output for certain amount field to be 10.00 how can I achieve that?
XML : <AMOUNT>510.00</AMOUNT>
When it gets converted as JSON it becomes
JSON: "AMOUNT": 510
How do I populate it as "AMOUNT": 510.00
In the conversion rule I specified it as Decimal
When I specify as string it comes as
"AMOUNT": "510.00" but I need it without quotes.
Please advise.
Thank you.
Larry
Hi Smith,
As per your requirement, AMOUNT field should be declared as xsd:decimal in Data Type and in REST adapter, Under Custom XML/JSON conversion rules, use TYPE as "decimal" and specify the DEFAULTVALUE as 0.00
Thanks and Regards
Saikiran Kanduri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Larry,
I'm afraid it's not (yet) possible for REST adapter to specify any format.
Instead you can achieve this in Mapping, using "FormatNum" module.
Best regards,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tom,
I am also having a similar requirement. I also tried using FormatNum. since this is coming after the mapping(at channel level). it is still giving wrong results.
Flow is : SAP(Proxy)<–>SAP PO<–> REST API Service.
One of the XML field is receiving as below
"UnitPrice":"10:00"
expected :"UnitPrice": 10:00(without the quotes). i have used xml/json conversion table as shown below
I also tried with "integer", decimal, it gives the values as 10 instead of 10.00 . with boolean it gives as "10.00".
Can you please suggest how can i get the exact value without the quotes and with decimal values(10.00)
and also, if i have "0.0". it is populating only 0. the expected value is 0.0
can you please advice here.
regards
Smith
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.