cancel
Showing results for 
Search instead for 
Did you mean: 

Delivery block in sales order

Former Member
0 Kudos

Hello,

I have an issue regarding delivery block.

I've read a couple of posts regarding this, but they all solved their issue by using userexit_save_document or userexit_save_document_prepare which is no option for me.

My issue is the following:

I've created an order type ZTA (copy of TA) and setup a default delivery block "Z1 - in work" to that order type.

This prevents that after saving the order it will not be automatically delivered by a job which is running in background.

So each time I create a ZTA order with VA01, it will set the delivery block Z1. That's fine.

Now let's say when a customer has a delivery block (e.g. Z5), it will not overwrite the order delivery block Z1, when entering sales-to-party (or ship-to-party)!

Now I tried to add some code to userexit_move_field_to_vbak like that:


...
...
    if not kuwev-lifsd is initial.
      vbak-lifsk = kuwev-lifsd.      " Z1 -> Z5
    else.
      if not kuagv-lifsd is initial.
        vbak-lifsk = kuagv-lifsd.     " Z1 -> Z5
      endif.
    endif.
...
...

Result: It will execute my new code sequence, but will not change the delivery block Z1 to Z5 on the VA01 screen. Maybe because I'm at this step not in update but insert mode?

I need to show the customer's delivery block while creating the order, means showing the delv. block after saving is too late.

Is there maybe a better exit to change the order delivery block to the customers delivery block?

Thanks in advance

Wolfgang

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member209761
Active Contributor
0 Kudos

Dear wolf ,

I think you are considering CUSTOMER BLOCKING in XD05 as customer blocked for delivery.

If so, try to write a code to check whether KNA1-LIFSD has a value and if true, replace the field for delivery block in sales order with the value in KNA1-LIFSD

Thanks & Regards,

Hegal K Charles

Former Member
0 Kudos

Hello,

you got it

But how? (see 1st post)

Thanks

Wolfgang

former_member209761
Active Contributor
0 Kudos

Dear Wolf,

I dont know whether it might help you but , we had a requirement to make the information message of CUSTOMER BLOCK (which we do in XD05) to ERROR message .

It was done in the include MV45AFZZ but i do not know much technical details.

What i know is, this include comes much before the SAVE comes.

Also if you can write the logic to check the BLOCK STATUS from customer master and if it has a value, then fill the same in the respective field in sales order, system might throw that blocking reason.

If there is no reason, system will put the the default blocking reason from the sales order.

Better you post the issue in ABAP forum.

You might get more inputs there.

Check and revert back.

Thanks & Regards

Hegal K Charles

Former Member
0 Kudos

Hi Wolfgang,

In your scenario you need to use if condition i think so,means if the sale order is created by the user or customer in that case

the delivery block should be Z5 if not Z1 like this,becoz with out specifying the condition how the system know to mention Z1 or

Z5 so use some logic to make difference between two.

regards

Ram

Former Member
0 Kudos

Hello Ram,

sorry didn't get you. Can you be more specific?

When there is a customer delv. block ( on AG or WE) I wanna use that one instead of the default order delv. block.

Thanks

Wolfgang

Former Member
0 Kudos

Hello Ram,

When there is a customer delv. block ( on AG or WE) I wanna use that one instead of the default order delv. block.

If the customer delivery block is there on AG or WE in that case the block should come with Z5 in normal case it should be

Z1,explain this case to your ABAPer he will do it in easy way.

Regards

Ram

former_member184555
Active Contributor
0 Kudos

Hi Wolfgang,

When there is a customer delv. block ( on AG or WE) I wanna use that one instead of the default order delv. block.

Where can you set the customer delivery block in the Customer master? What is the location of that field?

Thanks,

Ravi

Former Member
0 Kudos

Hello Ravi,

goto VD02, then in menu "extras-blocking data" you have the possibility to enter a delv. block.

In VOV8 we set a delv. block to order type ZTA (copy of TA).

This is set within VA01 automatically. After entering the AG it doesn't change to customers delv. block code.

Thanks

Wolfgang

former_member184555
Active Contributor
0 Kudos

You are correct...but this block can be maintained through XD05 or VD05 also.

In your scenario...do not maintain a default delivery block in the document type maintenance (VOV8). In the exit you have mentioned...the logic should be like...if the order type is ZTA and if the VBAK-LIFSK is initial...place the value Z1 for the delivery block. Hopefully the exit 'move field to VBAK' should work. Please try and let us know if you have any issues.

Thanks,

Ravi