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: 

BADI ME_PROCESS_PO_CUST

Former Member
0 Kudos

Hi all,

I am facing a problem in changing Purchase Order using BADI ME_PROCESS_PO_CUST.

The requirement is to change the ORIGIN flag at item level, if INCO Terms at header level is changed.

The requirement is handled thorugh BADI (BADI ME_PROCESS_PO_CUST).

But the changes done at the item level is not getting reflected in the database.

The changes aare getting reflected in the database only if it is executed in FOREGROUND

but no changes in BACKGROUND.

I have implemented my custom logic in HEADER and ITEM methods.

Please advise.

Thanks & regards

Deb

2 REPLIES 2

uwe_schieferstein
Active Contributor

Hello Deb

Difficult to say why you get this difference. One possibility would be that the BAdI might not be triggered in background.

In order to test this I would recommend the following approach:


" Add coding to one of the implemented methods:

" We are in background -> trigger dump
IF ( sy-batch = 'X' ).
  MESSAGE 'BAdI passed in background' TYPE 'X' (or 'E' or 'A' )
ENDIF.
...

If you can see the dump when running the PO change in background you can be sure the BAdI is touched. Then there must be another reason for the different behaviour.

Regards

Uwe

0 Kudos

Hi Uwe,

Thanks for your quick response. I think i was bit skewed in my question.

The program is working fine if I do the changing in debugging mode.

It is not working fine if I am doing without debugging mode.

Some times the database is getting updated but sometimes it is not.

But, the screen gets updated for all cases.

I know this is bit wiered but can you hint me a silly mistake at some point ?

Is it a time lag problem ? Should I try putting wait ?

Should I put an enhancement point in ME_UPDATE_DOCUMENT ?

Thanks & regards

Deb