Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Need User exit when we change the Order Header Status

$
0
0

Hi All,

 

My Requirement :

On save, if header status is changed, send the new status to Third party

Header status = ZEDUHDR
Possible values: RVW (In review), APP (Approved), REJ (Rejected), CVEX (Contract Value Exceeded)

ZSD_<ThirdPary>_STATUS_UPD

Statuses map to the following codes:
New statuses to be added:
5 = In review
6 = Approved
7 = Rejected
8 = Insufficient funds

 

I have applied the code in the user exit USEXIT_SAVE_DOCUMENT --> fm : Z_MV45AFZZ_SAVE_DOCUMENT as below :


SELECT SINGLE estat INTO l_estat FROM tj30t

           WHERE stsma = 'ZEDUHDR' AND  txt04 = 'RVW' AND spras = 'EN'.

 

           READ TABLE it_status WITH KEY   stat = l_estat.

           IF sy-subrc EQ 0.

             status_code    = 5.

             return-message = 'Order status is in Review'.

             APPEND return.

             RETURN.

           ENDIF.


SELECT SINGLE estat INTO l_estat FROM tj30t

           WHERE stsma = 'ZEDUHDR' AND  txt04 = 'APP' AND spras = 'EN'.

 

           READ TABLE it_status WITH KEY   stat = l_estat.

           IF sy-subrc EQ 0.

             status_code    = 6 .

             return-message = 'Order status is Approved'.

             APPEND return.

             RETURN.

           ENDIF.

 

But When I am changing the status from review to approve in VA02  transactioin HEADER-->STATUS and trying to SAVE it is not triggering the above user exit

USEXIT_SAVE_DOCUMENT .

Could you please suggest which user exit will be suitable to trigger when the status is changed .

 

Thank you.

 

Regards,

Bharat 


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>