Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9008

How to delete a SINGLE interchanging material item from purchase order?

$
0
0

Hello folks, so as the title suggests, I tried to delete a single interchanging material item line from a purchase order that I created through ME21N.

The BAPI that I used is called 'BAPI_PO_CHANGE'.

I sent the poitem and poitemx tables and I managed to delete the the line, but the problem is that along with the interchanging material item, the rest of the interchanging materials of the same father material were deleted as well, and i wanted to delete only a single item!

 

I'll try to explain...

Lets say that I have a purchase order '12345' for a certain material ( matnr = '1111' for example ) and with quantity 4.

In ME21N, when typing material '1111' and then tapping ENTER, I get a popup screen for selecting interchanging materials.

So basically, what I did was selecting material '2222' with quantity 2 and material '3333' with quantity 2.

 

In summary, I have a "father" material '1111' and two interchanging materials of the father: '2222' and '3333'.

In me21n, I can see three purchasing document lines: one belongs to the father and the other two belongs the the interchanging materials of the father material.

 

Now lets get to the interesting part!!!

 

So as of now, I have three purchasing document items in the EKPO table:

1) material = '1111'  ebeln = '12345'  ebelp = '0010'

2) material = '2222'  ebeln = '12345'  ebelp = '0020'  uebpo = '0010'

2) material = '3333'  ebeln = '12345'  ebelp = '0030'  uebpo = '0010'

 

Now what I want to do is delete a single interchanging material item, WITHOUT DELETING THE REST OF THE ITEMS.

I tried to call BAPI_PO_CHANGE for line (2) (with ebeln = '12345' and ebelp = '0020', but the problem is that whenever I try to delete line (2), lines (1) and (3) are also deleted!! In other words, whenever I try to delete an interchanging material item, the rest of the the interchanging items that belongs to the same father material, gets deleted as well.

 

Has anyone ever encountered this problem and managed to solve it?

I would very much appreciate an answer, and sorry for the long post, I tried to be as informative as I could be.

Thanks in advance.


Viewing all articles
Browse latest Browse all 9008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>