We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Calling BAPI_PO_CHANGE in loop

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Posted by farooq
on Aug 8 at 3:03 PM
People, I found the root cause of my problem. Here are the details incase someone faces the same issue.

Brief problem description:
Calling BAPI_PO_CHANGE in a loop, if one PO returns with error, all the remaining POs return with error too.
Now after many sleepless nights of debugging I found that one error message is not being cleared out from internal message object (class CL_MESSAGE_HANDLER_MM).

The BAPI uses the same message object if one already exists, so the error message is being repeated. If I manually remove the repeating message from the itab, next POs work fine.

I'm reporting to my technical architect, I guess we'd need to report to SAP?

Thank you John Louke, Jim Tarpoff and R.N.Wilhite for your help, much appreciated.

Farooq

---------------Original Message---------------
From: farooq
Sent: Friday, July 15, 2011 12:15 PM
Subject: Calling BAPI_PO_CHANGE in loop

Hello Gurus!
I have an issue while calling BAPI_PO_CHANGE.

I'm looping on BAPI_PO_CHANGE with Purchase Orders one by one, and adding articles to the existing POs.

I'm refreshing all required iTabs and program works fine in case the newly added articles are valid.

But in case if one additional article is faulty, say '0' quantity or 'Discontinued' status, the BAPI returns with error msg, which is correct and required functionality.

But what happens is that all 'correct' articles of all remaining POs following a 'faulty' BAPI call also return in error msg.

I'm calling BAPI_TRANSACTION_COMMIT in case BAPI returns with successful PO change. In case of faulty BAPI returning with error, I've tried using BAPI_TRANSACTION_ROLLBACK.

It doesn't work either.

I'd appreciate any help.

Thank you,
Farooq

__.____._
Copyright © 2011 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Mark as helpful
View this online
  
Popular White Papers

In the Spotlight
View the "Managing the Application Life Cycle" webinar and learn how organizations optimize their SAP applications.
_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language