Skip to Content
0

Remove Delivery Block from Outbound Delivery using BAPI

Mar 07, 2017 at 04:44 PM

386

avatar image

Hi all,

I'd like to use BAPI_OUTB_DELIVERY_CHANGE to remove the delivery block from an outbound delivery.

I've used it to change the delivery block numerous times, but never to remove it. There are numerous discussions online for the former, but not the latter, so here goes...

Where I'd normally set header_data-dlv_block = 'QA' to change the block to 'Awaiting Inspection', I've tried header_data-dlv_block = ' ' to remove it, but with no luck.

I've set header_control-dlv_block_flg = 'X' and passed in the delivery number for both structures. Are there any additional parameters for just clearing the delivery block?

Any help much appreciated,

Cheers

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Sam Powell Mar 15, 2017 at 10:06 AM
-1

Here's my code:

I've highlighted where I'm currently passing in '.' as a workaround, although I'm unsure whether this will truly be effective moving forward. Ideally I'd set it to ' ' and clear the delivery block completely.

Cheers,

Sam


untitled.png (30.1 kB)
Show 8 Share
10 |10000 characters needed characters left characters exceeded

This is strange.

I am not a developer, but I tried setting and resetting the delivery block with the same FM and it is working fine. I simply entered nothing in the delivery block field (in the delivery originally I had 06). I am not using a single or double space.

Here is what I entered (after that I ran bapi_transaction_commit in the sequence, of course):

I have no EWM in use and this is from an old IDES system, a regular LF delivery referencing a standard order.

***A few edits, because the editor seems to remove automatically multiple intervals between quotes***

01.jpg (18.2 kB)
02.jpg (28.4 kB)
03.jpg (17.4 kB)
2

Thanks for confirming! That's how I would expect it to work too. Technically either not filling in the field and putting space in it would be the same but you never know.

@OP - try not entering anything in the field, as above. If this does not work then either there is something specific to your system or you're missing a correction note. If you don't have ANST this means your system is rather old. Search for the notes manually.

1

Thanks Veselina & Jelena for your suggestions!

I gave this a try and it didn't seem to take effect, however I'm now fairly certain this is an issue with our system.

There's nothing code-wise that would be stopping the changes from taking effect, so I'll look into correction notes.

Thank you for your time - I'll mark this as answered since it's been proven to work by other users.

Sam

*Edit - Seems I'm unable to mark Veselina's comment as the correct answer, but credit where it is due. Thanks.*

0

Can you check something else - are you able to clear the delivery block manually via back-end transactions like VLl02N, VL02? Is there some message appearing, does it happen with a specific delivery block or with different ones? I read that you have already checked for custom code in exits, but it could be something else - some output setting back the block status, credit control, workflows...

0

Hi Veselina,

Yes, I can clear the delivery block manually in VL02N. There is no message appearing, and after saving the Delivery Block field remains clear. It behaves the same way for other blocks.

Sam

0

When I tried to set delivery block as '.' in my sandbox, it gets populated as a '.' and not as an initial value (as you have described how your system reacts). In my case, there is no delivery block configured as '.', which leads to an error, when I navigate to Administration tab in the delivery (which is a really unpleasant effect). Does this happen in your case? If there is absolutely no way to get this delivery blocks cleared programmatically, then it seems better to speak with your functional colleague to create some dummy delivery block, which does absolutely nothing, than to populate such entries.

Sadly, I am out of ideas, as you have already eliminated custom code as a potential culprit and you have checked that bapi_transaction_commit gets executed in the case, when you tried passing initial values in delivery block.

0

Correct, my delivery block field also populates as '.' ... I'm out of ideas for this, the change has been set aside for the time being, but it's bugging me that I'm getting different results to others here.

That's a good idea to set up a dummy delivery block Veselina - I may have no choice but to do that if a true fix isn't found. I'll pick this up again as soon as I can and report back with any findings.

Thanks for you help!

0

Veselina,

Finally fixed the issue! An include in MV45AFZZ had been resetting the delivery block. It's an old piece of code that a contractor had left in.

We compare against T180-TRTYP to determine whether or not an include is to be run, however this include was comparing against SY-TCODE and was being activated by changes in VA02.

Thanks for your help.

Sam

1
Jelena Perfiljeva
Mar 09, 2017 at 09:12 PM
2

Have you tried to debug it? Could there be some user exit in your system that causes this?

Otherwise - transaction ANST to search for the applicable notes and contact SAP Support if none found.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Jelena,

Yes, I've tried debugging and there's no user exit affecting the value. I'm currently getting around the issue by setting the delivery block to ' . ' (full stop/period), but it's bothering me that clearing the value doesn't appear to work. I also don't trust the robustness of this 'quick fix' going forward.

We don't appear to have transaction ANST available.

Thanks for stopping by,

Sam

0
Vinita Kasliwal Mar 08, 2017 at 12:18 AM
0

Hey SAM

Can you try this one BAPI_OUTB_DELIVERY_REJECT?

Regards

Vinita

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Vinita,

I'm not sure this is going to suit our requirements - we don't want to undo any changes to our delivery, just remove the delivery block once the items have been checked.

The block is being placed on deliveries for replacement items - where the original order was defective or damaged in transit. We want these replacements to be QA'd before they leave the warehouse, to ensure they're 100% ready to go.

If you still think this is suitable, can you tell me anything about parameter techn_control ? Where can I find the rejection control to pass into this parameter? There's very limited documentation about this BAPI online.

Cheers,

Sam

0