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

Problem to update the Version details using BAPI_PO_CHANGE.

Former Member
0 Likes
1,561

Hi,

I'm facing an issue with using FM:BAPI_PO_CHANGE.

Actually My requirement is ,i need to update the po items with Delete Indicator as 'L' for PO items.when i update these items ,bapi will create a new version and same version would be saved in EREV table.Suppose if Poitems are assignind to Delete indicator as 'L'.these items will be displayed with delete icon(Status) at ME23N T.code.If i undelete the same PO Items(at ME23N) then i click  on save button it will ask for updating the version details again.for this i was using the below code.

                    w_poitem-po_item = w_final-ebelp.

                    w_poitem-delete_ind = 'L'.
                    APPEND w_poitem TO t_poitem.

*             Itemx table to update
                    w_poitemx-po_item = w_final-ebelp.
                    w_poitemx-po_itemx = 'X'.
                    w_poitemx-delete_ind = 'X'.

                  APPEND w_poitemx TO t_poitemx.

                      w_versions-post_date  = sy-datum.

                      w_versions-completed  = 'X'.
                      w_versions-reason     = '0009'.
                      w_versions-description = 'Auto'.
                      w_versions-req_by = p_werks."w_ekpo-werks.

                      CALL FUNCTION 'BAPI_PO_CHANGE'
                        EXPORTING
                          purchaseorder = v_po
                          versions      = w_versions
                        TABLES
                          return        = t_bapiret2
                          poitem        = t_poitem
                          poitemx       = t_poitemx
                          allversions   = t_all_versions.

I Can  able to update the version for some of the PO's.in few cases only i'm not getting updated the version.Bapi is not throwing any error messages.can any body help me what could be the reason?

Thanks

Satya.N

Hi,

I'm facing an issue with using FM:BAPI_PO_CHANGE.

Actually My requirement is ,i need to update the po items with Delete Indicator as 'L' for PO items.when i update these items ,bapi will create a new version and same version would be saved in EREV table.Suppose if Poitems are assignind to Delete indicator as 'L'.these items will be displayed with delete icon(Status) at ME23N T.code.If i undelete the same PO Items(at ME23N) then i click  on save button it will ask for updating the version details again.for this i was using the below code.

                    w_poitem-po_item = w_final-ebelp.

                    w_poitem-delete_ind = 'L'.
                    APPEND w_poitem TO t_poitem.

*             Itemx table to update
                    w_poitemx-po_item = w_final-ebelp.
                    w_poitemx-po_itemx = 'X'.
                    w_poitemx-delete_ind = 'X'.

                  APPEND w_poitemx TO t_poitemx.

                      w_versions-post_date  = sy-datum.

                      w_versions-completed  = 'X'.
                      w_versions-reason     = '0009'.
                      w_versions-description = 'Auto'.
                      w_versions-req_by = p_werks."w_ekpo-werks.

                      CALL FUNCTION 'BAPI_PO_CHANGE'
                        EXPORTING
                          purchaseorder = v_po
                          versions      = w_versions
                        TABLES
                          return        = t_bapiret2
                          poitem        = t_poitem
                          poitemx       = t_poitemx
                          allversions   = t_all_versions.

I Can  able to update the version for some of the PO's.in few cases only i'm not getting updated the version.Bapi is not throwing any error messages.can any body help me what could be the reason?

Thanks

Satya.N

2 REPLIES 2
Read only

Sijin_Chandran
Active Contributor
0 Likes
998

Hi Satya  ,

Have you checked the values in  t_bapiret2

Read only

0 Likes
998

Yes Sijin, I have checked it 's not giving any error messages.