Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove incorrect line items in BADI ME_PROCESS_PO_CUST while Purchase Order creation.

former_member539645
Participant
0 Kudos
432

Hi All,

I am trying to use method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM to remove incorrect line items from Purchase Order at the time of creation through ME59N.

Using below code I am able to get all the line items. Now after checking some validations, I dont want to add second line item to Purchase Order. How can I remove only that line item?

CALL METHOD im_item->get_data
RECEIVING
re_data = lt_data1.

Regards,

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos
359

Did you try to set LOEKZ with method SET_DATA.

(Usually I raise an error in PROCESS_ITEM or CHECK method and invalidate wrong item with method INVALIDATE)

former_member539645
Participant
0 Kudos
359

LOEKZ should be L or D?

akmal1216
Employee
Employee
0 Kudos
359

Hello Ganesh,

You can set LOEKZ field as mentioned by Raymond.

Here are the possible values for LOEKZ:

EKPO-LOEKZ = 'L' Deleted.

EKPO-LOEKZ = 'S' Blocked