{"id":8726,"date":"2016-05-30T09:31:34","date_gmt":"2016-05-30T09:31:34","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=8726"},"modified":"2016-05-30T09:31:34","modified_gmt":"2016-05-30T09:31:34","slug":"determine-the-length-of-data-type-whose-internal-type-is-alphanumeric","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/05\/30\/determine-the-length-of-data-type-whose-internal-type-is-alphanumeric\/","title":{"rendered":"Determine the Length of Data Type, Whose Internal Type is Alphanumeric"},"content":{"rendered":"<p style=\"text-align: justify\">It&#8217;s Very obvious to declare the variables while developing any kind of application. These variables contains a value for particular field.<\/p>\n<p style=\"text-align: justify\">While declaring this variable, we have to set the length of the variable.<\/p>\n<p style=\"text-align: justify\"><u>Two obvious way to set length and corresponding disadvantages:<\/u><\/p>\n<ol style=\"text-align: justify\">\n<li>Check with the length of the field data type of that field.<\/li>\n<\/ol>\n<p style=\"text-align: justify\">For example, if you want to create variable ZITMREF, go to the particular data type page and search for ITEMREF field say ITV. Then check with the length say 20 and write code as<\/p>\n<p style=\"text-align: justify\">Local Char ZITMREF(20).<\/p>\n<p style=\"text-align: justify\"><u>Disadvantage:<\/u> As business requirement keeps changing, we may get the change request where we are supposed to change the data type length. Say you have changed length of ITV Data type from 20 to 30, In this case your code will get crashed as in your code file variable length was defined to 20.<\/p>\n<ol style=\"text-align: justify\" start=\"2\">\n<li>You can randomly set the length of the variable.<\/li>\n<\/ol>\n<p style=\"text-align: justify\">Say Local Char ZITMREF(100).<\/p>\n<p style=\"text-align: justify\"><u>Disadvantage:<\/u> In this approach you generally set the large enough length of variable which does not ensure that the code will never crash, however even if you may not face crashing it will consume the memory more than required.<\/p>\n<p style=\"text-align: justify\"><u>Solution:<\/u> Dynamically read the length of data type and then use it. Here is the Code,<\/p>\n<p style=\"text-align: justify\">Local char ZITMREF(GLONITV)<\/p>\n<p style=\"text-align: justify\">GLONITV will give you the length of data type ITV dynamically, so in future if the length of the data type gets changed, it will automatically update in your code.<\/p>\n<p style=\"text-align: justify\">You just need to add your data type code after \u201cGLON\u201d, and it will give you the length of that alphanumeric data type.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2016\/05\/Length-of-Data-Type.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-8727\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2016\/05\/Length-of-Data-Type.png\" alt=\"Length of Data Type\" width=\"689\" height=\"275\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Hope this blog helps!<\/strong><\/p>\n<h6 style=\"text-align: center\"><strong>Sage X3\u00a0Products<\/strong><\/h6>\n<p style=\"text-align: center\"><strong><a href=\"http:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\" target=\"_blank\">Salesforce \u2013 Sage X3 Integration<\/a>\u00a0| <a href=\"http:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\" target=\"_blank\">Magento \u2013 Sage X3\u00a0Integration<\/a>\u00a0|\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\" target=\"_blank\">Sage CRM-Sage X3 Integration<\/a><\/strong><\/p>\n<p style=\"text-align: left\"><strong>About Us<\/strong><\/p>\n<p style=\"text-align: justify\">Greytrix is one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.<\/p>\n<p style=\"text-align: justify\"><a href=\"http:\/\/www.greytrix.com\/\" target=\"_blank\">Greytrix<\/a>\u00a0have some unique solutions of\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\" target=\"_blank\">Sage X3\u2019s integration with Sage CRM<\/a>,\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\" target=\"_blank\">Salesforce.com<\/a>\u00a0and\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\" target=\"_blank\">Magento eCommerce<\/a>. It also offers best-in-class\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\">Sage X3 customization and development services<\/a>\u00a0to Sage business partners, end users, and Sage PSG worldwide.<\/p>\n<p style=\"text-align: justify\">For more information on Sage X3 Integration and Services, please contact us at\u00a0<a href=\"mailto:x3@greytrix.com\" target=\"_blank\">x3@greytrix.com<\/a>\u00a0.We will be glad to assist you.<\/p>\n<p><strong><em>Other Related Blogs:<\/em><\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2015\/07\/30\/determines-the-quantity-of-available-memory-at-a-given-time\/\" target=\"_blank\">Determines the quantity of available memory at a given time<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2014\/11\/27\/how-to-determine-if-a-mask-variable-can-be-entered-or-is-displayed\/\" target=\"_blank\">How to determine if a mask variable can be entered or is displayed..?<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/02\/09\/use-of-nomap-variable-in-sage-x3\/\" target=\"_blank\">Use of \u201cnomap\u201d variable in Sage X3<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/05\/11\/how-to-know-a-mask-variable-is-initialized-or-not\/\" target=\"_blank\">How to know a Mask Variable is Initialized or not?<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/05\/12\/know-month-name-from-the-given-date\/\" target=\"_blank\">Know Month Name from the Given Date<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s Very obvious to declare the variables while developing any kind of application. These variables contains a value for particular field. While declaring this variable, we have to set the length of the variable. Two obvious way to set length and corresponding disadvantages: Check with the length of the field data type of that field.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/05\/30\/determine-the-length-of-data-type-whose-internal-type-is-alphanumeric\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1150,1822,1839,1942,1945],"class_list":["post-8726","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","tag-length-of-data-type","tag-sage-x3","tag-sage-x3-blogs","tag-sage-x3-technical-assistance","tag-sage-x3-technical-blogs"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/8726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=8726"}],"version-history":[{"count":0,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/8726\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=8726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=8726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=8726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}