cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Short text of Inspection Lot using BO Interface - I_INSPECTIONLOTTP_2 (EML/RAP)

Jose3
Explorer
0 Kudos
307

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.

 

View Entire Topic
Andrei_Karanchuck
Product and Topic Expert
Product and Topic Expert

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:

Andrei_Karanchuck_0-1736495306294.png

After executing the code, the short text was updated as expected, and the result is shown below:

Andrei_Karanchuck_1-1736495336631.png

I hope this helps you resolve the issue.

BR,
Andrei