HSN Code or SAC Code are stored in the same table and field in SAP ABAP. The table name is MARC and Field name is STEUC. If you want to display the HSN/SAC code in the output, Then follow the below example.
Table of Contents
What is HSN Code:
The full form of the HSN Code is a Harmonized System of Nomenclature, It means dividing the product in a systematic manner. It is used in invoices, and bills for GST or TAX purposes. HSN codes are different digits not a single length of the digit, Normally different digits of HSN codes are used for different purposes, Which follows below.
Length of Code | Purpose of Code |
---|---|
Those businesses that have a turnover of less than Rs 1.5 crore, They do not need to use HSN Code | |
2 Digit | Those businesses that have a turnover of more than Rs 1.5 crore, But less than Rs 5 crore |
4 Digit | Those businesses that have a turnover of more than Rs 5 crore |
6 Digit or 8 Digit | Those businesses that deal with imports and exports |
What is SAC Code:
Full form of SAC Code is Servicing Accounting Code, It means divide the service in a systematic manner. HSN code and SAC code both are as like same but HSN code classify the product and SAC code classify the service. Which code start with 99 number then that is SAC code, If not then HSN code.
In SAP, HSN and SAC codes both are stored in the same table MARC, and the same field STEUC. If you find the HSN/ SAC code, Then use material number MATNR and plant code WERKS, In the MARC table pass MATNR AND WERKS then find STEUC as an HSN/SAC code.
Simple ABAP Program to get HSN/SAC Code
In this example required user input is Purchasing Document Number EBELN and output is display HSC/SAC Code.
Code:
TABLES EKPO.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS P_EBELN TYPE EKPO-EBELN.
SELECTION-SCREEN END OF BLOCK B1.
SELECT SINGLE
EBELN,
EBELP,
MATNR,
WERKS
INTO @DATA(WA_EKPO) FROM EKPO
WHERE EBELN = @P_EBELN.
SELECT single
MATNR,
WERKS,
STEUC
INTO @DATA(WA_MARC) FROM MARC
WHERE MATNR = @WA_EKPO-MATNR
AND WERKS = @WA_EKPO-WERKS.
WRITE: 'Purchasing Document Number: ', WA_EKPO-EBELN, /, 'HSN/SAC Code: ', WA_MARC-STEUC.
Explanation:
In this code use EBELN as a user input field, Both user input and output is single value then use SELECT SINGLE. First user input pass EKPO table and fetch the field MATNR Material Number and WERKS plant code and these two fields are pass MARC table and fetch the field STEUC, That is HSC/SAC code.