cancel
Showing results for 
Search instead for 
Did you mean: 

Assign serial number automatically to inbound delivery (backgound)

Former Member
0 Kudos

Hello all,

I do have following process: Confirmation of Production Order (CO15) is triggering creation of inbound delivery. This delivery is getting directly posted to EWM.

Requirement: Assigning serial numbers automatically to inbound delivery (OBJK+SER01) at the moment of inbound delivery creation.

Additional facts:

  • Serial number is already existing (created by Z-coding at release of production order) when inbound delivery is getting generated.
  • Serial number profil is existing
  • Serial numbers can be manually maintained via VL32N and is getting transferred to EWM

I already tried following things:

  • I checked Enhancements in FORM serialnumber_automatically but found no option to pass serial numbers to SER01
  • I tried implementing SERNR_ADD_TO_LS in USEREXIT_SAVE_DOCUMENT_PREPARE -> It worked in case of using VL32N, but did not work in case to generating inbound delivery triggered via CO15 -> Reason seems to be temporarily VBELN at this moment

Question:

Is there an enhancement/userexit to assign serial numbers automatically to inbound delivery inside of SAPMV50A?

Any kind of help would be highly appreciated

Accepted Solutions (0)

Answers (1)

Answers (1)

Ajit_Routray
Active Contributor
0 Kudos

Hi Mike,

Enhancement point/BADI:LE_SHP_DELIVERY_PROC Method: DOCUMENT_NUMBER_PUBLISH (Publish Delivery Number After Number Assignment ) ->Plug your code using FM "SERNR_ADD_TO_LS" with IMPORT/EXPORT in this method. Please try.I believe this method will trigger at the generation of delivery and also get the delivery number and can assign the serial no with delivery using SERNR_ADD_TO_LS.

Please try the above and let us know if does not work.

Kind Regards,

Ajit

Former Member
0 Kudos

Hi Ajit,

thank you very much for your answer.

You are right, delivery number is available in DOCUMENT_NUMBER_PUBLISH. I implemented my coding I already used at USEREXIT_SAVE_DOCUMENT_PREPARE (which worked correctly at VL32N), but there was no entry added to SER01. But SY-SUBRC of function stated 0 and ANZSN is 1. I am not sure if problem is caused because of the fact, that delivery is not yet committed to DB. It is really not easy debugging SERNR_ADD_TO_LS and trailing steps 😞

Or what do you think about methode SAVE_AND_PUBLISH_BEFORE_OUTPUT. Decsription says that this methode is called before messages are getting processed. Has data already been passed to LIKP at that moment?

Thank you very much and best regards

Mike

Former Member
0 Kudos

Hi Ajit,

thank you very much for your answer.

You are right, delivery number is available in DOCUMENT_NUMBER_PUBLISH. I implemented my coding I already used at USEREXIT_SAVE_DOCUMENT_PREPARE (which worked correctly at VL32N), but there was no entry added to SER01. But SY-SUBRC of function stated 0 and ANZSN is 1. I am not sure if problem is caused because of the fact, that delivery is not yet committed to DB. It is really not easy debugging SERNR_ADD_TO_LS and trailing steps 😞

Or what do you think about methode SAVE_AND_PUBLISH_BEFORE_OUTPUT. Decsription says that this methode is called before messages are getting processed. Has data already been passed to LIKP at that moment?

Thank you very much and best regards

Mike

Ajit_Routray
Active Contributor
0 Kudos

Hi Mike,

" Or what do you think about methode SAVE_AND_PUBLISH_BEFORE_OUTPUT. Decsription says that this methode is called before messages are getting processed. Has data already been passed to LIKP at that moment? " I guess No.

-> DB committed once per transaction, then distribute to EWM

Alternative Process:

1> Configure your inbound delivery type as stop distribution. ( Please check in IMG->Logistics Execution->Shipping settings of delivery type ).Hope unique delivery type assigned to this Production process.

2> Keep your program as it is working "I tried implementing SERNR_ADD_TO_LS in USEREXIT_SAVE_DOCUMENT_PREPARE -> It worked in case of using VL32N, but did not work in case to generating inbound delivery triggered via CO15 -> Reason seems to be temporarily VBELN at this moment "

3> Schedule the background job of program WS_MONITOR_INB_DEL_DIST ( Tcode VL06ID ) every few mins as per your production process for distribution.

Please check if it can solve your purpose.

Please let me know if you have further queries.

Kind Regards,

Ajit

Former Member
0 Kudos

Hi Ajit,

thank you very much for your efforts.

"DB committed once per transaction, then distribute to EWM" -> yes correct, you're right 🙂

I am quite sure that triggering EWM distribution by Background-Job will not solve this problem. My coding for determine serial numbers + SERNR_ADD_TO_LS is currently implemented in DOCUMENT_NUMBER_PUBLISH. This method is called at the moment, when inbound delivery is getting created. All relevant datasets LIKP+LIPS+OBJK+SER01 are/should be written out of this process. From my point of view, EWM distribution is not relevant in combination with my problem.

Best Regards

Mike

Ajit_Routray
Active Contributor
0 Kudos

Hi Mike,

Sorry for misunderstanding 😞

Another Alternative:

FM"GN_DELIVERY_CREATE "- I guess this FM is used for delivery creation specially WMS .

There is Enhancement Spot/BADI inside this FM.

ES_BADI_LE_SHP_DELIVERY_CREATE/SHP_BADI_GN_DELIVERY_CREATE

In this method IMPORT Parameter IT_GN_SERNR.

Please try to pass and check the result

VBELN -> No Problem If it is blank
POSNR -> Correct delivery item
SERNR -> Your Serial No
UII ->If any

-> Post goods receipt in Tcode MIGO if you want to debug.

Kind Regards,

Ajit

Former Member
0 Kudos

Hi Ajit,

thank you very much for this hint. I have to shift checking this hint to tomorrow.

Out of my test's I got an other interesting perception. After function SERNR_ADD_TO_LS I implemented MODIFY on internal table. Result: OBJK + SER01 entry was correctly written and LIPS entry was missing --> seems that there is a update function problem. Is there a function update module for SER01 in Update Task or something like that?

Thank you very much and best regards

Mike

Former Member
0 Kudos

Hi Ajit,

I checked SHP_BADI_GN_DELIVERY_CREATE and found out that first of all switch LE_SFWS_OM_1 has to be activated. This switch is stated in context with "Outsourced Manufacturing". I am not sure what happens by activating this switch and I am not sure if this is the correct way solving my problem.

I am a little bit despaired 😞 Do you have an other alternative left?

Thank you very very much

Mike

Ajit_Routray
Active Contributor

Hi Mike,

Sorry, it would not work , no changing parameter.

Alternative Process:

Use BADI/ES : LE_SHP_DELIVERY_PROC Method: FILL_DELIVERY_ITEM ( I knew you already tried in other method , Please try once in the above method )

Please call 'SERNR_ADD_TO_LS' and also update the serial no count in lips-anzsn 2017-11-03-13-45-45.png

Reference> Program: SAPLV50S/ LV50SF10 PERFORM gn_lips_fuellen_sernr CHANGING gla_subrc.

Please try and let us know the result.

Kind Regards,

Ajit

Former Member
0 Kudos

Hello Ajit,

I already solved the problem and my solution is nearly like you mentioned in your last post. I did my implementations in DOCUMENT_NUMBER_PUBLISH and do use function SERNR_ADD_TO_LS. I also did recognise that it is necessary to have LIPS-ANZSN set and that was my fault. Because of different structures between table and workarea, table MODIFY did not work correctly (no syntax error, no dump -> probably because of using field symbols). Stupid mistake on my side.

Sorry and thank you so much for giving me hints.

Best Regards

Mike

Former Member
0 Kudos

Hello Ajit,

back again 😞

My solution works fine in case of incompletion log at inbound delivery is active. But in my case EWM warehouse is linked to ERP and inbound delivery should be directly forwarded to EWM.

If I deactive incompletion log, ANZSN on LIPS is not getting updated and serial numbers are not gonna get linked. If I activate completion log again and inbound delivery is getting blocked (LIKP-VLSTK "A") everthing is fine (ANZSN + SER01).

Do you have a clue what further steps I can follow?

Thank you very much and Best Regards

Mike

Ajit_Routray
Active Contributor
0 Kudos

Hi Mike,

"If I deactive incompletion log, ANZSN on LIPS is not getting updated and serial numbers are not gonna get linked. If I activate completion log again and inbound delivery is getting blocked (LIKP-VLSTK "A") everthing is fine (ANZSN + SER01)." -Understood,your code execute after checking of incompletion log.

"Do you have a clue what further steps I can follow?"-> In my opinion, best place to call 'SERNR_ADD_TO_LS' and also update the serial no count in lips-anzsn in BADI/ES : LE_SHP_DELIVERY_PROC Method: FILL_DELIVERY_ITEM .Also share the program name and screen shot for your reference in my last post.

Please try and let us know if you face any further issues.

Kind Regards,

Ajit

Former Member
0 Kudos

Hello Ajit,

I got my problem solved and it is an EWM driven problem. In my case inbound delivery (enriched by serial number) was forwarded to EWM. On EWM side serial number profile was missing. Because of this fact, EWM update response to ERP deleted serial numbers on inbound delivery (ERP) again.

Thank you so much and best Regards

Mike

former_member192897
Active Contributor
0 Kudos

Hi Ajit, I agree with your workaround.