cancel
Showing results for 
Search instead for 
Did you mean: 

Unmanaged RAP BO with draft: error when pressing edit

MioYasutake
Active Contributor
0 Kudos

I have implemented Unmanaged RAP BO with draft on BTP ABAP trial environment. OData version is V4.

unmanaged implementation in class zbp_i_person_u unique;
with draft;

Create operation with draft went successful however, when I press "Edit" on the detail screen, the following error is issued.

With debugging, I found that the error had occurred at process related to locking.

The failed structure got "NOT_FOUND" error as below.

I haven't written my lock logic yet, and the implementation is almost empty as below.

  METHOD lock.
    if sy-subrc = 0.
    endif.
  ENDMETHOD.

If I disable draft and switched to OData V2 (because with V4 we don't see Edit button without draft), there's no error.

Is draft with unmanaged BO not supported?

Regards,

Mio

MioYasutake
Active Contributor
0 Kudos

Or, should I create a draft entity in the lock method?

MioYasutake
Active Contributor
0 Kudos

I've tried creating a draft entity in the lock method, but unfortunately it is not allowed .

  METHOD lock.
    "create draft entity in case of update request
    MODIFY ENTITIES of zi_person_u in LOCAL MODE
      ENTITY Person
        EXECUTE edit from
        value #( for key in keys ( PersonID = key-PersonID ) )
        REPORTED data(edit_reported)
        FAILED data(edit_failed)
        MAPPED data(edit_mapped).

    reported = CORRESPONDING #( edit_reported ).
    failed = CORRESPONDING #( edit_failed ).
    mapped = CORRESPONDING #( edit_mapped ).

  ENDMETHOD.

I got the following runtime error.

How should draft entity be created when editing an unmanaged BO?

Accepted Solutions (0)

Answers (0)