cancel
Showing results for 
Search instead for 
Did you mean: 

Unmanaged Draft Duplicate Draft Key Issue

philipdavy
Contributor
0 Kudos

Hello Experts,

I have ran into the same problem mentioned here in these posts.

ABAP Restful Programming Model Unmanaged Draft generate draft key | SAP Community

Draft table Key Field Design in ABAP Restful Application Programming Model RAP | SAP Community

But the question seems to be unanswered. In my scenario, I am using non UUID key entity and when a draft is created , one cannot (or in the whole system ) create another draft. The draft gets greated with a null key and understandebly another one cannot be created. Is there any solution for this problem ?

I am thinking of a workaround solution like update the draft table when 'Keep Draft' is pressed, with a new key value. How to trigger the action 'Keep Draft' in our source code ? or are there any other workarounds ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
Ramjee_korada
Active Contributor

hi Philip,


If any other solution is not found, then you can think of filling that temp guid by generating using a cutover activity program. One time activity only.

It is not a key field in main table hence no issue at the end and no impact.

Also these existing documents can be accessible in list/object page.


best wishes,

Ramjee Korada

Ramjee_korada
Active Contributor

Hello Philip,

I also dont have an answer but I have a workaround which is simple and less effort.

  1. Extend your table with another ZZ structure with one GUID(TempGuid) field

    my example :
    Table : zrkt_proc_doc


  2. Make this TempGuid as key in your interface view ( Z*I***)

  3. Then derive your consumption view
  4. Mark TempGuid as numbering field

  5. You have full control in storing in your table in Unmanaged Scenario
  6. You can create draft entries without any restrictions

Advantages:

  1. Almost out of the box implementation and no custom development behind button " Keep Draft" to see if it is fresh draft ( no active ) or delta draft ( active entry exists )
  2. No need to consume number range without user explicit SAVE. In your proposal, you will need to consume number range.


Restrictions:

your table must be enhancible to append an include with temp_guid. Ex: EKKO also enhancible

I could not imagine any disadvantages.


Best wishes,

Ramjee Korada.

philipdavy
Contributor
0 Kudos

Hello Ramjee Korada,

I have a thought about such a solution . But the issue is that my base database table is a an old one with existing entries.

So if i add GUID as the key it will not find any more entries when I traverse to the object page. Becuase the already entered entries have no GUIDS attached.