on 04-04-2022 10:44 AM
Dear experts,
I'm having some difficulties with using HTTP (POST) calls using the HTTA adapter via B1IF 2.0
a. Manage Payload
I found some difficulties in creating the payload because in 2.0 it is not necessary to create a preparation atom with all properties like in version 1.0 (httppreparationatom-v1.xml), but just write the payolad in the XPath Expression and other properties in the adapter.
Below you can see a working example. I can't understand:
<call>
<payloadTEST>
<io pltype="json">
<object>
<string name="DocEntry">220010</string>
<string name="LineNumber">100</string>
<string name="LineNumber2">10</string>
<string name="LineNumber3">0</string>
<string name="TimeType">A</string>
<string name="CloseEntry">true</string>
<string name="ManualBooking">true</string>
<string name="Duration">60</string>
<string name="CalculateDuration">false</string>
<string name="Remarks">TEST B1IF</string>
</object>
</io>
</payloadTEST>
<cookie>testcookie=20220404101949236818656</cookie>
</call>
b. Manage Error
The other problem I've encountered is on the error handling.
If the payload format is wrong or the operation cannot be executed, the layer returns ERROR 400 and the B1IF throws an exception. Is it possible to catch and manage the response of the layer error in the step?
Thanks in advance.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabio,
I'm trying to use B1DI to add customer details. If the error is default SAP restriction say Duplicate Customer Code is not allowed I'm getting it as Failure in Response. But if the error is from the SPTransaction Notification I'm getting the below internal server error and not as a response "failure" in the second screenshot. Could you please tell me how to get this internal server error "Customer Ref. No. Cannot be Duplicated" which is from SP Transaction notification as a response. This is my Response atom.
Default SAP restriction:
SP Transaction notification Restriction:
How can I get the error response like below instead of the error in the screenshot {"Response": [ {"Result": "failure","ActionMessage": " Exception : DI Error: (-10) 1320000140 - Business partner code 'OP-8512578' Customer name cannot be duplicate-The di call #1 did fail."}],}],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
it depends on what your goal is.
My original post was about a call to an external WS (if it is your goal too change B1DI with HTTA)
If instead you need to do an operation on SAPB1 use B1DI or B1SL depending on your environment and needs.
Also check out this usefull playlist: https://www.youtube.com/watch?v=a2z_LnJ1AxA&list=PLMdHXbewhZ2Sils0OrNUsVS-g69EaQnEe
Fabio
Hi Fabio,
I'm having the same issue, whenever there is an error say if it's from the SPTransactionNotification I get it like this in Postman but when I try it with an API Call from application there is no response.
I get this error in API call correctly when the error is from Default SAP Application but when the error is not a default configuration I'm not getting the error message like this. can you please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
8 | |
7 | |
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.