Application Development and Automation 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: 
Read only

Bapi_po_change delete lock indicator

Former Member
0 Likes
3,358

Hi experts ,

How can i remove lock indicator for line items in PO through Bapi_po_change.If the particular line item is trash , i want to unlock it .can i do this with the BAPI .A sample code will be useful.

regards

Prasun

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,991

You need to pass below details for BAPI - BAPI_PO_CHANGE

Importing parameter

PURCHASEORDER <=== PO number

Tables parameter

POITEM

PO_ITEM <=== Po Line item number

DELETE_IND <=== ' ' (This shld be SPACE)

POITEM

PO_ITEM <=== Po Line item number

PO_ITEMX <=== 'X'

DELETE_IND <=== 'X'

After this you need to commit usig the BAPI - BAPI_TRANSACTION_COMMIT

Importing parameter

WAIT <=== 'X'

You need to pass below details for BAPI - BAPI_PO_CHANGE

Importing parameter

PURCHASEORDER <=== PO number

Tables parameter

POITEM

PO_ITEM <=== Po Line item number

DELETE_IND <=== ' ' (This shld be SPACE)

POITEM

PO_ITEM <=== Po Line item number

PO_ITEMX <=== 'X'

DELETE_IND <=== 'X'

After this you need to commit usig the BAPI - BAPI_TRANSACTION_COMMIT

Importing parameter

WAIT <=== 'X'

7 REPLIES 7
Read only

Former Member
0 Likes
1,992

You need to pass below details for BAPI - BAPI_PO_CHANGE

Importing parameter

PURCHASEORDER <=== PO number

Tables parameter

POITEM

PO_ITEM <=== Po Line item number

DELETE_IND <=== ' ' (This shld be SPACE)

POITEM

PO_ITEM <=== Po Line item number

PO_ITEMX <=== 'X'

DELETE_IND <=== 'X'

After this you need to commit usig the BAPI - BAPI_TRANSACTION_COMMIT

Importing parameter

WAIT <=== 'X'

Read only

0 Likes
1,991

its not working

Read only

0 Likes
1,991

Hi,

I checked it. It works... One mistake from my side Highlighted... Structure name change.

You need to pass below details for BAPI - BAPI_PO_CHANGE

Importing parameter

PURCHASEORDER <=== PO number

Tables parameter

Structure name : -


POITEM

PO_ITEM <=== Po Line item number

DELETE_IND <=== ' ' (This shld be SPACE)

Structure name : -


POITEMX (This is what changed)

PO_ITEM <=== Po Line item number

PO_ITEMX <=== 'X'

DELETE_IND <=== 'X'

After this you need to commit using the BAPI - BAPI_TRANSACTION_COMMIT

Importing parameter

WAIT <=== 'X'

Regards,

Bhargava

Read only

0 Likes
1,991

Hi ,

It worked man .Thanks a lot .Can you kindly tell me how unlock it back ,actually the requirement was if the poitem is locked ie trash , i have unlock it then update the final invoice and delivery complete indicator ,and lock the item back .1st 2 things i have achieved ,now how shall i lock it back .

regards

Prasun

Read only

0 Likes
1,991

Great News...

To lock the Item back u need to pass DELETE_IND with 'S'.

DELETE_IND

' ' - To unlock

'S' - To Lock

'X' - To set delete....

You need to pass below details for BAPI - BAPI_PO_CHANGE

Importing parameter

PURCHASEORDER <=== PO number

Tables parameter

Structure name : -


POITEM

PO_ITEM <=== Po Line item number

DELETE_IND <=== 'S'

After this you need to commit using the BAPI - BAPI_TRANSACTION_COMMIT

Importing parameter

WAIT <=== 'X'

Hope this will solve ur issue..

Regards,

Bhargava

Read only

0 Likes
1,991

thanks a lot man it worked . i have awarded u points for the same.

regards

Prasun

Read only

1,991

Hi guys,

I just want to add an observation to this post .

My scenario was as follows: sales order - >purchase requisition - > purchase order.

My task was to reject the line item in the sales order and of course this means that you have to delete the line item in the PO first (and cancel the subsequent documents).

If you are to delete the line item in the PO, set the DELETE_IND to 'L' and not 'X'. The value 'X' only marks it for archiving and does not "release" the quantity; EBAN-BSMNG was not set to 0 and system returned message V1544.

This is on R/3 4.7c, i don;t know if on ECC you have the same problem.

Best regards,

Andrei Sosea