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