[PURPOSE] Check whether the payment term is suitable for the customer or not in VA01/VA02. [TOOL] INCLUDE: MV45AFZZ USEREXIT: USEREXIT_SAVE_DOCUMENT_PREPARE XVBAK ← New data if any change/else it will be same as old YVBAK ← Old value VBAK ← Work area when you deal with Items it will be some thing like this.. XVBAP ← New data if any change/else it will be same as old YVBAP ← Old data if any change(considers item) /else it is blank If we want to get SO header where in header or items, we can obtain from WA: VBAK does not concerned to use XVBAK or YVBAK or OVBAK. [CODE] FORM USEREXIT_SAVE_DOCUMENT_PREPARE. DATA: P_ZTERM TYPE KNB1-ZTERM, P_MESSAGE TYPE STRING. ** GET PAYMENT TERM IN CUSTOMER MASTER DATA CLEAR P_ZTERM. SELECT SINGLE ZTERM INTO P_ZTERM FROM KNVV WHERE KUNNR = VBAK-KUNNR ...
Solution 1. Include: LMRMDF0H Form: t_drseg_aufbauen_pruefen_1 at the end of form code I cleared position tax code in a loop: ENHANCEMENT 1 ZMUK_MIRO_TAXCODE_EDIT. "active version FIELD-SYMBOLS <ls_drseg> LIKE LINE OF t_drseg[]. LOOP AT t_drseg ASSIGNING <ls_drseg>. CLEAR <ls_drseg>-mwskz. ENDLOOP. ENDENHANCEMENT. After that, system is propagating tax code automatically from MIRO header to all the items. * 如採用Solution1有可能在SAP升級後,標準程式恢復原版,客製的部分就會被蓋掉 Solution 2. BAdI: EXTENSION_US_TAXES Method: MM_ITEM_TAX_MODIFY method IF_EX_EXTENSION_US_TAXES~MM_ITEM_TAX_MODIFY. IF I_RBKPV-MWSKZ1 <> I_DRSEG-MWSKZ. "header tax <> item tax E_MWSKZ = I_RBKPV-MWSKZ1. "item tax = header tax E_CHANGE = 'X'. ENDIF. endmethod. or Function: MRM_BADI_TAX_DATA_CHANGE
留言
張貼留言