10-17-2008 6:27 PM
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
10-17-2008 7:20 PM
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
10-17-2008 7:50 PM
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