Requirement to restrict business user from releasing sales document more than once after credit block
Business Requirement:
If the customer is blocked due to credit then credit release should happen only for the first time.
When the second order is created for the customer and is blocked for credit then the system should through error message with below info
Solution approach:
Userexit_SAVE_DOCUMENT
Logic
If SY-TCODE EQ ‘VKM4’
Pass KUNNR into Table VBAK and fetch all entries where VBAK – CMGST = ‘D’ and VBAK-GBSTK and VBAK-LFSTK = ‘C’
If SY-SUBRC is INITIAL
Pass VBELN into table VBFA-VBELV and fetch VBELN with VBTYP_N = ‘M’
If SY-SUBRC is INITIAL
Pass VBELN into Table BSID – ZUONR and fetch BELNR
If SY-SUBRC is INITIAL
Message ‘Payment pending for Order exist. Hence cannot release this Sales Order’ type ‘E’.
I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz answer back as I'm looking to create my own blog and would like to know where u got this from. thank you. reefer for sale
ReplyDelete