WTF Solution

HSN Code Table & Field Name in SAP ABAP 2026

HSN code or SAC code is stored in the MARC table, and the field is STEUC in SAP ABAP. Here we will see how to connect the HSN code table with the material number and plant. If you want to display the HSN/SAC code in the output, then follow the example below.

What is the HSN Code:

The full form of the HSN Code is the Harmonized System of Nomenclature. It means systematically dividing the product. 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 CodePurpose of Code
Those businesses that have a turnover of less than Rs 1.5 crore don't need to use the HSN Code
2 DigitThose businesses that have a turnover of more than Rs 1.5 crore, But less than Rs 5 crore
4 DigitThose businesses that have a turnover of more than Rs 5 crore
6 Digit or 8 DigitThose businesses that deal with imports and exports

What is the SAC Code:

The full form of SAC Code is Servicing Accounting Code. It means systematically dividing the service. HSN code and SAC code are both similar, but HSN code classifies the product and SAC code classifies the service. Those codes start with a 99 number, which is the SAC code. If not, then the HSN code.

In SAP, HSN and SAC codes are both stored in the same table MARC, and the same field STEUC. If you find the HSN/ SAC code, then use the 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 the Purchasing Document Number EBELN, and the output is 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top