Validation on HSN Code

By | October 28, 2021

In Sage X3, we do have Indian Legislation addon module developed which is suitable for Indian business. Good and Service tax is part of the Indian Legislation where defining HSN code against product and service is mandatory. HSN stands for “Harmonized System of Nomenclature”. HSN code is a 6-digit uniform code that classifies 5000+ products and is accepted worldwide. In India, HSN code has extra 2 digits for further classification. The main purpose of HSN is to classify goods from all over the World in a systematic and logical manner. This brings in a uniform classification of goods and facilitates international trade.

There was a requirement from one of the client to add validation on HSN master where HSN number will take minimum 7 digits for creation not less than that. For example, if the user is trying to enter the HSN code less than 7 digit then it will give a popup message as “HSN code should be greater than 6 digit” and it won’t allow to create HSN Code till user enters the HSN Code greater than or equal to 7. Also client had requested us to add same validation on the Sales Invoice screen while selecting HSN Code in the detail line where the length of HSN code should not be less than 7 digits.

To achieve the above requirement follow the below steps:

Step 1: Go to Development ->Script Dictionary ->Windows and open HSN master window(XX1P4HSN)

Step 2: Jump to ‘XX1P4HSNMST’ screen and add ‘After field’ & ‘After change’ actions on HSNCODE field as per below screenshot :

New Stuff : Restriction on Sales Order if date exceeds the defined due date

[HSN Master screen]
[HSN Master screen]

Step 3: Save and validate the screen and global validate the window

Step 4: Add the below code in SPEHSN script :

[Script-SPEHSN]
[Script-SPEHSN]

Add the similar code in AP_XX1P4HSNCODE action and compile the script.

Now if the user tries to enter less than 7 digits in HSN code field then it will give a popup as “HSN code should be greater than 6 digit”.

[HSN master popup]
[HSN master popup]

Similarly, add same validation for the HSN Code in the detail line of the Sales Invoice screen

-Go to OSIH window, jump to SIH4 screen and add ‘After field’ & ‘After change’ action on ‘HSN Code’ field.
-Save and validate the screen and global validate the window.
-Add the below code in AM_XX1P4HSNCODE & AP_XX1P4HSNCODE actions in SPESIH script and compile the script

[Script-SPESIH]
[Script-SPESIH]

After applying above validation on sales invoice screen if the user tries to select the HSN code having less than 7 digits from HSN Code finder it will give a popup as below screenshot:

[Sales Invoice- HSN Code popup]
[Sales Invoice- HSN Code popup]

In this way we can add validation on HSN Code field in HSN Master of GST Module and in detail line of Sales Invoice screen.