Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

A/R User Exit Spec and code

Former Member
0 Likes
608

The spec -


1. Canadian tax - currently based on Freight type: Read the country(?) Ship-from (plant jurisdiction) to Ship-to(customer jurisdiction) and the inco term on the line item of the sales order and if it's not equal to 'DDP' the line item tax classification will be set to '0' exempt. (This is freight that comes into Canada from the US)

We will look at the shipto and shipfrom txjcd on the sales order document and billing document along with the inco term logic and we will tax freight when they are both Canada

Example Scenario:

For Freight charges where the Ship from is in Canada (Bedco, Artmedco, etc) and the Ship-to is in Canada the freight will always be taxable regardless of the inco term. This is freight that ships within Canada, no boarder crossing.

2. Regular Freight - US & Canada: If separate line item on sales order, it may be exempt from tax based upon state. revisit

a. D.1 Freight included on the line item

i. The freight is passed to the external system by populating the field FREIGHT. The freight amount is always included in the base amount.

ii. An example to fill the freight using the user-exit:

iii. In the customer pricing procedure (for example ZUSA01) enter ‘4’ in the subtotal field of the freight condition type (OTC must have this configuration in the pricing procedure for the freight pricing conditions).

iv. In the customer structure CI_TAX_INPUT_USER, add the field KZWI4 as in KOMP-KZWI4.

v. In the user-exit, add the code CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.

3. For PO Specific A/R Tax Exemptions using material tax class of ‘2’, pass the TAXM1 field to the ACCOUNT_NO field in Taxware

oSolution:

For PO Specific Tax Exemptions – CSR will go to the line item detail “Billing” Tab, Tax Classification field (TAXM1) and change that to “2” – One-Time Exemption. Configuration complete.

CSR will go to the “Text” Tab, Internal Item Notice and CSR will provide a brief description as to why that line is tax exempt.

This the code----


TABLES: KNVV, KNA1, KOMK, MLAN, T001W, KNVI.

DATA: w_taxm1 LIKE mlan-taxm1,

i_kna1 LIKE kna1,

c_com_tax type com_tax,

i_komk LIKE KOMK.

*--- if this freight comes into canada from US then set TAXM1 to 0

*----otherwise set TAXM1 to 2 and apply frieght charges. Set ACCNT_CLS

*----to 'Y' each time TAXM1 is passed to ACCNT_NO.

IF KNA1-LAND1 EQ 'CA'.

IF C_COM_TAX-TXJCD_SF EQ C_COM_TAX-TXJCD_ST.

CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.

w_taxm1 = 2.

CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.

CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'.

ELSEIF C_COM_TAX-TXJCD_SF NE C_COM_TAX-TXJCD_ST.

C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.

C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.

SELECT SINGLE * FROM KNVV

WHERE INCO1 = KOMK-INCO1

AND INCO1 NE 'DDP'.

IF SY-SUBRC EQ 0.

w_taxm1 = 0.

CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.

CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'.

ENDIF.

ENDIF.

ENDIF.

SELECT SINGLE taxkd FROM knvi INTO knvi-taxkd

WHERE kunnr = i_komk-kunwe

AND aland = i_komk-land1.

IF SY-TCODE = 'VA01' OR SY-TCODE = 'VA02' OR SY-TCODE = 'VA03' OR

SY-TCODE = 'VF01' OR SY-TCODE = 'VF02' OR SY-TCODE = 'VF03' OR SY-TCODE

= 'VF04' OR SY-TCODE = 'VF05' OR SY-TCODE = 'VF05'.

SELECT SINGLE * FROM kna1 INTO i_kna1

WHERE kunnr = i_komk-kunwe.

IF i_KNA1-land1 EQ 'CA'.

C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.

C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.

ENDIF.

ENDIF.

I am able to enter the user exit, but there is no value for KNA1-LAND1 or C_COM_TAX-TAXJCD_SF or C_COM_TAX-TAXJCD_ST. Does anyone what I am missing ? Please help.

Thanks in advance !!!!

N

1 REPLY 1
Read only

Former Member
0 Likes
387

Hi NP ,

which User exit ur using ? Are u talking abt MIRO or VF01.

Regards

Prabhu