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

Delete PO item with version history using BAPI

Former Member
0 Likes
1,076

Dear Experts,

We are having requirement for MASS delete of PO open items while maintaining version history.

Could you please suggest and BAPI or ant other FM if there.

Thank you so much in anticipation.

Regards,

Arpit Varma.

Dear Experts,

We are having requirement for MASS delete of PO open items while maintaining version history.

Could you please suggest and BAPI or ant other FM if there.

Thank you so much in anticipation.

Regards,

Arpit Varma.

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,027

Why don't you want to use classic BAPI_PO_CHANGE, What problems have you encountered ?

Regards,

Raymond

Read only

ThangaPrakash
Active Contributor
0 Likes
1,027

Hello Arpit,

Use the below code

itab_gt_poitem-po_item       i_handling-ebelp.

itab_gt_poitem-DELETE_IND = 'X'.

append itab_gt_poitem.

itab_gt_poitemx-po_item      i_handling-ebelp.

itab_gt_poitemx-po_itemx     = 'X'.

itab_gt_poitem-DELETE_IND = 'X'.  "deletion indicator

append itab_gt_poitemx.

call function 'BAPI_PO_CHANGE'

      exporting

           purchaseorder = i_handling-ebeln

      tables

           return        = t_e_return

           poitem        = itab_gt_poitem

           poitemx       = itab_gt_poitemx.

commit work and wait.


Regards,

Thanga

Read only

Former Member
0 Likes
1,027

We actually need version history as well, could you please suggest if the above BAPI will provide Version history and how?

Thank You/

Regards,

Arpit

Read only

ThangaPrakash
Active Contributor
0 Likes
1,027

Hello Arpit,

yes it provides the Version history as well. It can be found in the table "ALLVERSIONS".

Refer to the SS below.