Welcome to Marg Care - Marg ERP 9+

Home > Margerp > Gui Format > How to use ' Substr ' command in Marg Software ?

How to use ' Substr ' command in Marg Software ?

2992

Ans.1

SUBSTR command is used to divide a string into two parts. In Marg ERP software user can easily divide the string into two parts i.e. it can be a party name, item name etc.

This command can be used to print some characters of a long item or party name in one line and remaining in another line.

Suppose, we have an item Corex Cough Syrup 100 ml, and we need that the item name should print till syrup in first line and 100 ml will print in second line of the bill format so in this case we can use SUBSTR Command.

  • Go to Masters > Marg Setups > Self Format. Press Enter.

  • A Self Format window will appear.
  • The user will feed current date in reverse format .i.e. (YYYY-MM-DD). Press Enter.

  • An Invoice Format window will appear.
  • The user will select the format as per the requirement.
  • Suppose, select AA.

  • Now the user will select ‘Bill Format’. Press Enter.

  • Then a Bill format-GUI-AA window will appear.
  • The user will select Item. Press Enter.

  • Thereafter all the commands related to product will appear.
  • Now the user will press 'F1' key to search the command of SUBSTR.

  • A Format Variables Window will appear.
  • Now the user will press 'F3' key to refresh all the commands.

  • Thereafter the user needs to type “SUB”.
  • Now all the results related to SUB will appear.
  • The user will select SUBSTR command. Press Enter.

  • The user will press F3 key to paste the searched command.

  • Then the user needs to copy the SB_PROD and paste it in place of SB_NAME.

  • Then the final command will be :

.lw(166, < SUBSTR(SB_PROD,1,15),30 > ,"Verdana",6)

.lf(1)  .                                      

.lw(166, < SUBSTR(SB_PROD,15,30),30 > ,"Verdana",6)

  • Where (SB_PROD, 1, 15), 30 represents that from the character ‘1’ to ‘15’ of the item name should print in First line, where ‘30’ represents that item name is of 30 characters.
  • LF (1) represents that there should be at least 1 line space between both the lines of the item name.
  • And (SB_PROD,15,30) , 30 represents that from character 15 to 30 of the item name should print in second line, where ‘30’ represents that item name is of 30 characters.

  • Then press 'Ctrl+W' and click on 'Save' to save the details.

After following the above steps the item name will be printed as required.


Submit Feedback