cancel
Showing results for 
Search instead for 
Did you mean: 

Need BAPI FM to delete condition types from VL02N --> Header --> Conditions Tab

Former Member
0 Kudos

Hello Folks,

Please help on the following requirement.

I am using BDC procedure in my program to add and delete Published Freight and Discount Freight condition types for Deliveries in VL02N. Consider we may or may not have other conditions types along with above said 2 condition types in all deliveries. I am not worrying about adding them in any position between available condition types. But i am facing issue while deleting them since we don't know the positions of Published and Discount condition types per each delivery.

In BDC, we provide fixed position to identify them to delete. But we don't know which condition is available in those positions. We many not expect all deliveries condition types with fixed positions right? So i guess, we need to identify them dynamically to apply our logic.

Is there any BAPI FM (or) other procedure to identify Published and Discount condition types in VL02N --> Header --> Conditions Tab ?

Based on that i want to delete them when required.

The following is the screen shot for your reference. Thank you.

Thanks,

Rajesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor
0 Kudos

If there is a BAPI then I also would want to know since we are using BDC for a similar interface as well. There is some kind of integration with UPS but it's too complex for our needs, so we have a small custom program.

An unreleased FM wouldn't be a good replacement for BDC IMHO. Can't say I spent a lot of time searching but has not come across a better option so far.

sez41
Active Contributor
0 Kudos

That's a tricky one. What is your requirement exactly? I might suggest another workaround if you can explain the process here: Under what circumstances and why do you want to delete these condition records? If they are to be deleted, maybe they should not have appeared at all in the first place.

Former Member
0 Kudos

Hi Bilgin,

I will explain you the exact requirement. Please have a look at below;

I am doing an SAP shipment (which is having Delivery number along with ship to and ship from addresses) via UPS carrier service (Web Service). With a successful shipment, I will get Tracking number and its Published Freight and Discount Freight. I have to update these at its Delivery-->Header-->Conditions Tab.

Suppose if i cancel the shipment against the delivery then the tracking number should be cancelled and also Published Freight and Discount Freight should be deleted from Delivery-->Header-->Conditions Tab.

For both the cases, I have been using BDC with index positions 1 & 2 and also successful when the deliveries don't have other condition types in Delivery-->Header-->Conditions Tab.

Consider a Delivery has already two condition types when it created. Now i am trying to ship this with UPS web service then the shipment relevant freights should be update at Delivery level. So now Published Freight and Discount Freight will be update at 3rd and 4th position in Pricing elements of Conditions Tab since it already has two other condition types which are occupied by 1 & 2. However It is not a problem and i will consider it as okay because Delivery is showing required Freight details.

Now the problem is with cancel shipment, the earlier added freights are to be deleted from Delivery level since shipment has been cancelled. As per current BDC code, i am unable to delete. Because index 1 & 2 are having other freights which are not the part of shipment. So we can't delete them and also we can't fix index positions in BDC while deleting Publish and Discount Freights.

The following is the screen shot for your reference. Please check and let me know the changes with BDC if any. Otherwise, It would be good if you can find BAPI FM to achieve the requirement. 

Thanks,

Rajesh

sez41
Active Contributor
0 Kudos

Rajesh,

I do not have system access right now, so from the bapi point of view I cannot help. Here is another approach which might help you achieve your requirement:

Set a field in delivery header level for canceling freight costs. Do not try to delete condition records; just set a certain field on delivery header level as 'X' instead.

Write a requirement routine in Vofm for freight condition types. In this routine, if del.hdr field = 'X'. Sy-subrc = 4. Freight condition will be ignored.

You can add some tweaks but I guess you get the idea.

Former Member
0 Kudos

Hi Bilgin,

I have no chance to enhance as you said and Customer will not accept it as well. I am communicating UPS web service via Module Pool screen and updating freights at Delivery level. So obviously i need solution in the way how i request initially.

Please check the problem again and provide your inputs / thoughts. Thank you.

Thanks,

Rajesh