cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Operation UPDATE not supported for LO-H

AustinKloske
Participant
0 Likes
680

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. 

AustinKloske_3-1742222243166.png

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.    

AustinKloske_0-1742221841126.png

AustinKloske_1-1742221949098.png

AustinKloske_2-1742222026069.png

 

  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. 

AustinKloske_4-1742223136674.png

**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.

 

Screenshot 2025-03-21 at 5.32.37 PM.png

Screenshot 2025-03-21 at 5.23.24 PM.png

 

__PRESENT

__PRESENT

Accepted Solutions (0)

Answers (1)

Answers (1)

baris_yalcin
Product and Topic Expert
Product and Topic Expert

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

AustinKloske
Participant
0 Likes
Thank you for the helpful information.