cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger availability check in delivery document

Former Member
0 Kudos

Hi Experts,

I would like to trigger a new availability check in delivery when the document is saved.

In my scenario the user deletes the delivery block (block for pick and GI) in the header data.

When the delivery block is deleted, a new ATP is needed in order to confirm again the quantity in the document.

The new check should be the same already triggered by the system when the storage location is changed.

I can use also user exit but i don't know what is the correct one.

Someone has a suggestion for me?

Please help me.

Best regards.

Sandro



Accepted Solutions (0)

Answers (1)

Answers (1)

sez41
Active Contributor
0 Kudos

Why wouldn't unchecking field TVLP-VERPR ("Switch off availability check in delivery document") in delivery item customizing (t-code 0VLP) help?

Former Member
0 Kudos

I have TVLP-VERPR to space. the ATP check is performed when I create the delivery or if I change relevant filed in the item data.

In would like to trigger again the ATP check in document save changing only the delivery block in the header data.

The delivery block filed dont trigger again the ATP check.

I need to use a user exit in delivery document, I think, in order to set the item update flag related to a ATP relevant field.

I dont know te correct user exit and what is the field to maintain.

Can you please help me?

regards

former_member223981
Active Contributor
0 Kudos

What is the purpose of executing the ATP check at this point? You haven't changed any ATP relevant field so it is not logical to call the availability check here (which is why it isn't called in the standard). What is the business reason to have an ATP check when you set the delivery block?

Former Member
0 Kudos

The users create the delivery document in advance (some day before) and the castomer care check, the day before, if the stocks are really available in order to inform the ship-to if the delivery is not in time.

0 Kudos

Hi Sandro,

Even Im new ATP. But, try following:

  • Create an output type
    • Multiple issuing
    • Special function
    • Dispatch time as immediate
  • Call rescheduling program in the print program

In your case, the output determination is important:

  • Have a routine in output determination procedure for this output type
  • Have checks in the routine in which cases you should determined the output type. Ex: Change in delivery quantity.

Hope this helps.

Thank you!

Best regards

Sasi

former_member223981
Active Contributor
0 Kudos

Hi Sasi,

I would be reluctant to follow this path. The availability check code really is not designed to be executed in the update task. However, outputs are executed in the update task. If the ATP check is executed via an output, this means that every time we might hit some error in the ATP check, we will encounter an update error (and there are many opportunities for error in ATP). Consequently, this means any other changes made to the delivery will be rolled back and lost. Also, by executing the ATP check in the update task, the system will not actually tell the user there is 0 available.

If you were to follow this, it would need to be tested very thoroughly.

Regards,

Noel

former_member223981
Active Contributor
0 Kudos

I think you should probably review the process of this. If the availability check during delivery creation finds available stock, then the stocks should be really available. If they are not really available, then your scope of check settings are probably not strict enough.

If your business process does require an ATP check when the delivery block is set, I think it could be achieved by this:

1) Add a Z field to the LIPS structure in SE11. This Z field should be an "X" field.

2) In BADI LE_SHP_DELIVERY_PROC, Method CHANGE_DELIVERY_HEADER, you can implement code like "IF CS_LIKP-LIFSK IS NOT INITIAL. IT_XLIPS-<ZFIELD> = "X".

This should ensure that LIPS is changed when you change the header data and consequently an ATP check is executed. The LIPS data has to be changed for the system to trigger ATP - when you just change the delivery block in the header, LIPS is not changed.

Please note that I have not tested the above so I am not sure if it works practically. As I am sure you are aware, often these things sound simple but you can find it is unworkable once you try to implement and test them.

Regards,

Noel

Former Member
0 Kudos

Ciao Noel,

It is not possible to set XLIPS structure/table in  IF_EX_LE_SHP_DELIVERY_PROC~CHANGE_DELIVERY_HEADER.

I'm looking for set the V50AGL-ATP_CHECk field in order to force the ATP check without changing the item relevant fields.

In SAP Note I have read <<You cannot use BADI interface IF_EX_LE_SHP_DELIVERY_PROC becuase changing V50AGL is not supported in this method>>.

Do you know an exit able to manage the V50AGL structure?

Regards.

former_member223981
Active Contributor
0 Kudos

Yes, you are correct - there is a flaw in my suggested approach 😞

I don't think it is as simple as just setting V50AGL-ATP_CHECK either. In the standard system, this flag is considered here:

SAPLLE_ATP_DELIVERY_INTERFACE  / LLE_ATP_DELIVERY_INTERFACEF0G

FORM                           / MAP_TO_ATP_ITEM_CONTROL_CHECK

**********************************************************

* flag to force a check also if nothing changed to the item.

* note that this flag has a lower priority than the no_check flaggs.

* It enshures a check in a all those cases where a check is performed

* if the delivery quantity is increased.

  if us_v50agl-atp_check is initial.

    cs_i_control-force_check = space.

  else.

    cs_i_control-force_check = charx.

  endif.

**********************************************************

The problem is that the above code is reached via the following call stack:

FORM    MAP_TO_ATP_ITEM_CONTROL_CHECK    SAPLLE_ATP_DELIVERY_INTERFACE

FUNCTION    LE_ATP_INT_MAP_DEL_TO_ATP    SAPLLE_ATP_DELIVERY_INTERFACE

FORM    VERFUEGBARKEIT_PRUEFEN_NEU    SAPFV50P

FORM    LIPS_PRUEFEN    SAPFV50P

FORM    LIPS_BEARBEITEN    SAPFV50P

MODULE (PAI)    LIPS_BEARBEITEN_ND    SAPMV50A

In LIPS_BEARBEITEN_ND, we have the following code:

**********************************************************

* zur Zeit scheint es auch ohne den check keinen Bedarfsfehler

* zu geben, aber wegen Sicherheit:

  check lips ne *lips or lipsd ne *lipsd.

**********************************************************

This CHECK statement is checking if LIPS had been changed. In your example, this CHECK would not be reached as you are not changing LIPS, and even if it was reached, it would not pass the CHECK as you are not changing LIPS!

Unfortunately, I cant see any simple workaround to this. Maybe somebody else in the community can think of an idea....

Former Member
0 Kudos

Sandro,

Let me start by saying that I have no suggestions about the enhancement you have been discussing.  If you have your heart set on creating an enhancement, then there is no need for you to continue  reading the remainder of this posting.

If you are still reading, I do have a question.  You have said

The users create the delivery document in advance (some day before)

OK, not a great idea, but I guess it is not necessarily bad, depending upon your business processes.

and the castomer care check, the day before, if the stocks are really available in order to inform the ship-to if the delivery is not in time.

This is the part I don't understand.  Why wouldn't the stocks "really" be available?  In many companies, they configure their ATP checks, and then implement their business policies and procedures, so that materials are ALWAYS available when the time comes to issue the materials to the delivery.  Are you saying that the stocks are commonly NOT available on the planned PGI date in this situation?

Best Regards,

DB49

Former Member
0 Kudos

Ciao Dogboy 49,

I'm in manufactory scenario.

Sometime the factory not release all the quantities requested and a final check is performed by the customer care in order to inform the ship to about the shortage.

Regards.

Former Member
0 Kudos

Ciao Noel,

I have select the following solution.

As proposed in SAP Note  415716, I have used the FORM routine USEREXIT_SAVE_DOCUMENT_PREPARE (include MV50AFZ1).

In the note you can read: <<If you want to change item data consistently, you should note the source code example EXAMPLE 1 from the correction instruction. With this, the internal tables of the delivery including the change indicators are updated correctly.>>.

With this USEREXIT I can check if the header field are changed and maintain the item data.

Setting V50AGL-ATP_CHECK = 'X' the system perform a new ATP check.

If an error occurs, the save process is cancelled.


This is the solution found.

Replay if have news.

Regards