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: 

Changing one po line item but getting error for other line item

Former Member
0 Kudos
271

Hi,

i am trying to close PO line items by passing delivery completion as 'X' and GR_TO_DATE as system date using BAPI BAPI_PO_CHANGE and i am passing values to  POITEM and POITEMX structures.

and i am passing line item 00001, but i am getting errors of other line items 'Delivery of item 00007 of document 30374852 already completed'

Please suggest me on this issue.

Thanks

Narendra

11 REPLIES 11

karun_prabhu
Active Contributor
0 Kudos
118

Hello Narendranath Reddy.

     Please paste your code for better analysis.
Regards.

0 Kudos
118

Hi Prabhu,

Please check below code.

       wa_bapimepoitem-po_item lwa_output_temp-ebelp.

       wa_bapimepoitem-no_more_gr = 'X'.

       wa_bapimepoitem-gr_to_date = sy-datum - 1.

       APPEND wa_bapimepoitem TO it_bapimepoitem.

       CLEAR : wa_bapimepoitem .

       wa_bapimepoitemx-po_item = lwa_output_temp-ebelp.

       wa_bapimepoitemx-po_itemx = 'X'.

       wa_bapimepoitemx-no_more_gr = 'X'.

       wa_bapimepoitemx-gr_to_date = 'X'.

       APPEND wa_bapimepoitemx TO it_bapimepoitemx.

       CLEAR : wa_bapimepoitemx.

       CALL FUNCTION 'BAPI_PO_CHANGE'

         EXPORTING

           purchaseorder = lwa_output_temp-ebeln

         TABLES

           return        = it_return

           poitem        = it_bapimepoitem

           poitemx       = it_bapimepoitemx.



Regards

Narendra

0 Kudos
118

Narendranath,

     Coding seems correct.

     I guess the error is arising from some user exit.

     You debug and then once control goes inside the BAPI, set break-point at MESSAGE and find out where the message is arising?

Regards.

nabheetscn
Active Contributor
0 Kudos
118

Hi Narendra

If you do the same via tcode does it give you the same error?

Nabheet

0 Kudos
118

Hi Nabheet,

Via T.Code level if i do necessary changes and press save, it is saving and when i press check button then it is showing error messages

Regards

Narendra

0 Kudos
118

So that means even via tcode also you are not able to do it...Is it a custom message or standard one..do you have any enhacement for the same.. Please provide the message number and message class details

Nabheet

0 Kudos
118

Hi Nabheet,


Its a standard message  and no enhancements written for the same and  Message class is 06 and message no 744


Regards

Narendra

0 Kudos
118

Hi,

I guess this is the configuration message, Infact as per your business standards it should make it as error. you can make it as warning through SPRO also. let me check the path.

go to SPRO - MATERIALS MANAGEMENT -> PURCHASING -> ENVIRONMENT DATA -> DEFINE ATTRIBUTES IN THE SYSTEM

enter as like below make it as warning and check the program again

0 Kudos
118

Hi Kiran,

customization level i have already done and made it as warning message and BAPI is working fine and if i make it as error message then BAPI is giving problem and through T.Code ME22N if check it is giving error messages but if i save it is saving

Regards

Narendra

0 Kudos
118

Please find my comments below.

->if you want to complete the delivery any of the item in the PO. The system should check the complete history of the documents for all items.

-> if any of the item is having the history and system will not allow the other items to complete the delivery, this is the sap standard functionality

-> In your case also it was the same. you are trying to close the item 1, since the goods are delivered for item 7. So the system is not allowing to change the any other items also.

-> if you want to allow this business case, you need to configure the message as warning.

Finally it is working fine for me in normal PO's. In case of contracts this situation will araise. Please check with your functional colleagues once again.

for more information. put the break point on the below

INCLUDE : LMEPOF1U

perform mepo_kekpo_item_check.


Rg, Kiran

Former Member
0 Kudos
118

Could be a reason

Where one PO line item having multiple schedule line item and all schedule line items are not delivered and before that you are trying to complete the PO line item.

Check if it is a functional restriction

Regards
Ansumesh