‎2025 Mar 17 2:53 PM - edited ‎2025 Mar 24 9:20 AM
Facing error "Operation UPDATE not supported for LO-H" while trying to utilize the SAP S/4 HANA Handling Unit API (V4).
We are running the newest available version of on-premise S/4 HANA (2023 FSP02 instance). While the API Reference leads us to believe we should be able to PATCH an existing handling unit, our gateway traces show that this is not possible.
Updating the contents of an existing HU or updating header data of an existing HU over released SAP APIs (via an ABAP client) has resulted in various errors and I'm wondering what actions shown in the API references are functional.
METHOD updateTracking.
DATA ls_business_data TYPE zcl_scm_handling_unit=>tys_handling_unit_type.
DATA ls_entity_key TYPE zcl_scm_handling_unit=>tys_handling_unit_type.
DATA lt_provided_property TYPE /iwbep/if_cp_runtime_types=>ty_t_property_path.
TRY.
"Set entity key
ls_entity_key = VALUE #(
handling_unit_external_id = me->ms_ref_doc-handling_unit_external_id
"warehouse = me->ms_ref_doc-warehouse
handling_unit_reference_do = me->ms_ref_doc-handling_unit_reference_do
).
" Navigate to the resource and create a request for the patch
DATA(lo_request) = zcl_if_api_hub~mo_client_proxy->create_resource_for_entity_set( 'HANDLING_UNIT' )->navigate_with_key( ls_entity_key )->create_request_for_update( /iwbep/if_cp_request_update=>gcs_update_semantic-patch ).
ls_business_data = VALUE #(
handling_unit_second_exter = iv_exidv2
).
APPEND 'HANDLING_UNIT_SECOND_EXTER' TO lt_provided_property.
lo_request->set_business_data(
is_business_data = ls_business_data
it_provided_property = lt_provided_property
).
lo_request->set_if_match( me->mv_etag ).
" Execute the request
DATA(lo_response) = lo_request->execute( ).
lo_response->get_business_data( IMPORTING es_business_data = ls_business_data ).
CATCH /iwbep/cx_cp_remote INTO DATA(lx_remote).
RAISE SHORTDUMP lx_remote.
" Handle remote Exception
" It contains details about the problems of your http(s) connection
CATCH /iwbep/cx_gateway INTO DATA(lx_gateway).
RAISE SHORTDUMP lx_gateway.
" Handle Exception
CATCH cx_web_http_client_error INTO DATA(lx_web_http_client_error).
" Handle Exception
RAISE SHORTDUMP lx_web_http_client_error.
CATCH cx_root INTO DATA(lx_root).
RAISE SHORTDUMP lx_root.
ENDTRY.
ENDMETHOD.
The Outbound Delivery API clearly does not allow for HU updates after creation. Therefore, I feel like we are missing some very important functionality to update HUs over released APIs.
**UPDATE**
After implementing BAPI_HU_CHANGE_HEADER, I found that the BAPI is not suitable for HUs assigned to IM deliveries. The BAPI Throws an error HUFUNCTIONS 261 for all HU vpobj values other than 'non-assigned handling unit'. I plan to use 'WS_DELIVERY_UPDATE' to update IM delivery HUs.
In the end, we will be using the exact same logic to update deliveries and their HUs that we have always previously used from the ECC 6.0 days. The only difference is that we can call it 'Clean Core' by organizing these requirements into a Tier 2 software component until SAP releases API to update IM Handling units.
__PRESENT
__PRESENT
Request clarification before answering.
Hi AustinKloske,
the Handling Unit OData API supports two kinds of Handling Units:
- LO HU (ERP HUs)
- EWM HU
The Handling Unit OData API supports the update of the HU header for EWM HU. But not for LO HU at the moment.
You can check the existing documentation for supported API operations
https://api.sap.com/api/OP_HANDLINGUNIT_0001/documents ->
https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/e1841426f60f4e50913ec9a64aba8332/9240f938e56542f3a2c...
At SAP Customer Influence there is an existing request: https://influence.sap.com/sap/ino/#/idea/273456.
If you want, you can vote for it.
As workaround you could use the existing remote Function Module BAPI_HU_CHANGE_HEADER for your purpose.
Best regards,
Barış Yalçın
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.