2025 Jan 08 11:52 AM - edited 2025 Jan 08 11:55 AM
Hallo,
Link to details of Business Object Interface I_INSPECTIONLOTTP_2 - https://api.sap.com/bointerface/PCE_I_INSPECTIONLOTTP_2
I am trying to use this BO interface to update the short text of Inspection Lot
DATA: ls_update_mapped TYPE RESPONSE FOR MAPPED I_InspectionLotTP_2,
ls_update_failed TYPE RESPONSE FOR FAILED I_InspectionLotTP_2,
ls_update_reported TYPE RESPONSE FOR REPORTED I_InspectionLotTP_2.
MODIFY ENTITIES OF I_InspectionLotTP_2
ENTITY InspectionLot
UPDATE FIELDS ( InspectionLotText )
WITH VALUE #( (
%key-inspectionlot = <fs_insplot>-prueflos
%data-InspectionLotText = lv_shorttext
%control-InspectionLotText = if_abap_behv=>mk-on ) )
MAPPED ls_update_mapped
FAILED ls_update_failed
REPORTED ls_update_reported.
<fs_insplot>-prueflos has the inspection lot number and lv_shorttext has the new short text.
Problem faced is - ls_update_failed is always filled with error
CAUSE - UNSPECIFIC
Thanks.
Request clarification before answering.
Hi @Jose3,
I reviewed the documentation and repeated the scenario related to updating the short text of the inspection lot. Here’s what I came up with based on the code from the documentation, and everything worked fine for me. Please try using this code:
DATA(lv_inspectionlot) = '010000000000'.
DATA(lv_inspectionlottext) = 'new value'.
MODIFY ENTITIES OF I_InspectionLotTP_2
ENTITY inspectionlot
UPDATE FIELDS ( inspectionlottext )
WITH VALUE #( ( InspectionLot = lv_inspectionlot
InspectionLotText = lv_inspectionlottext ) )
MAPPED DATA(ls_mapped)
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported).
IF ls_failed IS INITIAL.
COMMIT ENTITIES RESPONSE OF I_InspectionLotTP_2
FAILED DATA(failed)
REPORTED DATA(reported).
ENDIF.
To verify the functionality of this code, I created a lot and, as shown in the screenshots below, the text and inspection lot were updated:
After executing the code, the short text was updated as expected, and the result is shown below:
I hope this helps you resolve the issue.
BR,
Andrei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
45 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.