DATA(io_router) = NEW cl_rest_router( ).
io_router->attach(
EXPORTING
iv_template = '/sbctestclark' " Unified Name for Resources
iv_handler_class = 'ZCL_SBC_REQ_PROVIDER_CLARK' " Object Type Name
* it_parameter = " Resource contructor parameters
).
ro_root_handler = io_router.
DATA(lo_entity) = mo_request->get_entity( ).
DATA(lv_data) = lo_entity->get_string_data( ).
DATA ls_sbcdto TYPE ZSBWAPTRANSEXTENSIONDTO.
DATA ls_response TYPE string.
DATA: ls_specialchart TYPE char50 value '-'''.
/ui2/cl_json=>deserialize(
EXPORTING
json = lv_data " JSON string
CHANGING
data = ls_sbcdto " Data to serialize
).
LOOP AT ls_sbcdto-transmissions ASSIGNING FIELD-SYMBOL(<ls_sbctransmission>).
*Update delivery
LOOP AT <ls_sbctransmission>-sddocuments ASSIGNING FIELD-SYMBOL(<ls_sddocument>).
IF STRLEN( <ls_sddocument>-delivery ) EQ 7.
CONCATENATE '1YY' <ls_sddocument>-delivery INTO <ls_sddocument>-delivery.
ENDIF.
LOOP AT <ls_sddocument>-sddocumentitems ASSIGNING FIELD-SYMBOL(<ls_sddocumentitem>).
*Remove special chara in customer material
replace all occurrences of '-' in <ls_sddocumentitem>-CUSTOMERMATERIAL with ''.
replace all occurrences of '_' in <ls_sddocumentitem>-CUSTOMERMATERIAL with ''.
replace all occurrences of '@' in <ls_sddocumentitem>-CUSTOMERMATERIAL with ''.
replace all occurrences of '#' in <ls_sddocumentitem>-CUSTOMERMATERIAL with ''.
replace all occurrences of '*' in <ls_sddocumentitem>-CUSTOMERMATERIAL with ''.
CONDENSE <ls_sddocumentitem>-CUSTOMERMATERIAL NO-GAPS.
ENDLOOP.
ENDLOOP.
ENDLOOP.
/ui2/cl_json=>serialize(
EXPORTING
data = ls_sbcdto " Data to serialize
RECEIVING
r_json = ls_response " JSON string
).
mo_response->create_entity( )->set_string_data( iv_data = ls_response ).
{
"TRANSMISSIONS": [
{
"TRANSMISSIONID": "TRANSMISSION",
"SENDERID": "Sender",
"PREVIOUSTRANSMISSIONID": null,
"TRANSMISSIONDATE": "20200106",
"SDDOCUMENTS": [
{
"HEADERACTIONCODE": "000",
"HEADERREFERENCE": null,
"ISOCURRENCY": "EUR",
"SOLDTOPARTY": null,
"SUPPLIER": null,
"PARTNERDESCRIPTION": null,
"UNLOADINGPOINTNAME": null,
"DELIVERY": "DEL7C37",
"EXTERNALDELIVERYNOTE": null,
"DELIVERYRELEVANCEDATE": "2022-01-06T12:36:31",
"HEADERDOCUMENTREFERENCEDATE": null,
"CUSTOMERVATREGISTRATIONNUMBER": null,
"SUPPLIERVATREGISTRATIONNUMBER": null,
"SHIPPINGDATE": null,
"PAYMENTDUEDATE": null,
"GOODSRECEIPTDATE": null,
"DOCUMENTDATE": null,
"CREDITADVICEID": null,
"CHEQUENUMBER": null,
"SUPPLIERPOSTINGNUMBER": null,
"DELIVERYNETVALUE": null,
"DELIVERYVATAMOUNT": null,
"SDDOCUMENTITEMS": [
{
"PRODUCT": "GT8887",
"CUSTOMERMATERIAL": "GT_8 887",
"ITEM": null,
"ITEMACTIONCODE": null,
"QUANTITY": null,
"ISOUNITOFMEASURE": null,
"ITEMDOCUMENTREFERENCEDATE": null,
"VATINDICATOR": null,
"VATRATE": null,
"VATAMOUNT": null,
"NETVALUE": null,
"NETPRICE": null,
"NETPRICEUNIT": null
},
{
"PRODUCT": "GT8888",
"CUSTOMERMATERIAL": "GT88*8",
"ITEM": null,
"ITEMACTIONCODE": null,
"QUANTITY": null,
"ISOUNITOFMEASURE": null,
"ITEMDOCUMENTREFERENCEDATE": null,
"VATINDICATOR": null,
"VATRATE": null,
"VATAMOUNT": null,
"NETVALUE": null,
"NETPRICE": null,
"NETPRICEUNIT": null
}
]
}
]
}
]
}
Log on to the SAP BTP Cockpit (Cloud Foundry environment) with your registered subaccount.
Choose Connectivity Destination New Destination to create a new destination for aligning transmission data.
For self-billing with automatic posting:
Destination Property | Value |
---|---|
Name | SBWAP_TRANS_EXT |
Type | HTTP |
Description | Destination for transmission data alignment in self-billing with automatic posting |
URL | <The URL path of the RESTful API created in the previous step> |
Proxy Type |
|
Authentication | Basic Authentication |
User | <User with the authorization of the RESTful API created in the previous step> |
Password | <Password of the user> |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |