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

Early Numbering - Unmanaged Draft scenario with Composition relationship

0 Likes
2,039

Hi All,

I am developing a Purchase order based app and using Draft functionality . This app has Non GUID based logic based on below blog :

https://blogs.sap.com/2022/03/16/how-to-develop-an-unmanaged-draft-enabled-rap-business-object-with-...

I am facing an issue while creating Purchase Order and items :

1. During header Field population, Control comes in method METHOD earlynumbering_create and entry is created in Draft Header table.

2. When I click on Item Create, control fails to come to method earlynumbering_create. ALso, I found that method clean up is the only common method getting triggered while creating items.

Due to this I have blank Item number for PO and from second Line item creation , dump appears.

Kindly suggest .

Accepted Solutions (1)

Accepted Solutions (1)

j_pavan_kumar
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Snehal,

Please enable early numbering in the behavior definition of the item entity and then add the quick fix to add the suggested method to your behavior implementation handler class of the item entity.

OR

Another solution is to generate the item numbers during determination on create.

determination genarate_item_no on modify { field item_no ; create; }

Thanks,

Pavan

0 Likes

Hello Pavan,

First option suggested above worked. 🙂

ali-kaplan15
Participant
0 Likes
First one worked for me as well, thanks !

Answers (1)

Answers (1)

j_pavan_kumar
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Snehal,

Early numbering needs to be defined in behavior definition for both header & item entity and the RAP framework will provide you the separate hook methods for early numbering for create of header & create by association for Item then you may implement it for drawing numbers for the key fields.

Sample hooks methods for early numbering:

METHODS earlynumbering_create FOR NUMBERING
      IMPORTING entities FOR CREATE Header.

METHODS earlynumbering_cba_Item FOR NUMBERING
IMPORTING entities FOR CREATE Header\_Item.

Thanks,

Pavan

0 Likes

Hi Pavan,

Thanks for the reply. I tried the solution mentioned above. I am not able to get \_Item association option method EARLY_NUMBER_CBA_ITEM. It only allows header CDS view in class method definations :

METHODS earlynumbering_cba_Item FOR NUMBERING
IMPORTING entities FOR CREATE Header\_Item.