<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABOUT MATERIAL NUMBER in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203203#M1004574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Check below sample code. U can replace sales org and dist channel with ur varaibles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_matnr TYPE mara-matnr VALUE 'AWE465464654',
      l_len TYPE i,
      l_string TYPE string.

CONSTANTS: c_vkorg TYPE vbak-vkorg VALUE '3CR',
           c_vtweg TYPE vbak-vtweg VALUE '01'.
           
WRITE l_matnr.
l_len = 18 - strlen( l_matnr ).

DO l_len TIMES.
  CONCATENATE '0' l_matnr INTO l_matnr.
ENDDO.

CONCATENATE l_matnr c_vkorg c_vtweg INTO l_string.
WRITE l_string.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Jul 2008 13:00:17 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2008-07-13T13:00:17Z</dc:date>
    <item>
      <title>ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203201#M1004572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, if the material number is with numbers, for example, 1000000001, we can use FM CONVERSION_EXIT_ALPHA_INPUT to add the leading zeros to make the material to 18 char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the material number is with character, how should I make it to 18 char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to CONCATENATE MATNR VKORG VTWEG INTO V_NAME. But the MATNR must be 18 char. Many thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 12:34:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203201#M1004572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T12:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203202#M1004573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1st convert the material to 18 char by using FM &lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_MATN1_INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    input              = matnr&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   OUTPUT             = matnr&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   LENGTH_ERROR       = 1&lt;/P&gt;&lt;P&gt;   OTHERS             = 2&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than use the material for concatenation purpose...&lt;/P&gt;&lt;P&gt;CONCATENATE MATNR VKORG VTWEG INTO V_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 12:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203202#M1004573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T12:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203203#M1004574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Check below sample code. U can replace sales org and dist channel with ur varaibles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_matnr TYPE mara-matnr VALUE 'AWE465464654',
      l_len TYPE i,
      l_string TYPE string.

CONSTANTS: c_vkorg TYPE vbak-vkorg VALUE '3CR',
           c_vtweg TYPE vbak-vtweg VALUE '01'.
           
WRITE l_matnr.
l_len = 18 - strlen( l_matnr ).

DO l_len TIMES.
  CONCATENATE '0' l_matnr INTO l_matnr.
ENDDO.

CONCATENATE l_matnr c_vkorg c_vtweg INTO l_string.
WRITE l_string.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:00:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203203#M1004574</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-07-13T13:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203204#M1004575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is not OK, maybe the concatenate ignore the spaces....so can anyone tell how should i do to keep the spaces?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203204#M1004575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T13:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203205#M1004576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, adding leading zeros is not right, the material number with char. is with the spaces at the end of strings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203205#M1004576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T13:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203206#M1004577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;input = matnr&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;OUTPUT = matnr&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;LENGTH_ERROR = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CONSTANTS: c_space TYPE syhex02 VALUE '00a0'. " Value for space&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA: g_space TYPE string,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;             &lt;STRONG&gt;l_pos type i,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;             &lt;STRONG&gt;l_pos1 type i.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Get the actual value for a space*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;g_space = cl_abap_conv_in_ce=&amp;gt;uccp( c_space ).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;L_pos = strlen( matnr ).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;l_pos1 = 18 - l_pos.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Do l_pos1 times.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;matnr+l_pos(1) = g_space.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;L_pos = l_pos + 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Enddo.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than use the material for concatenation purpose...&lt;/P&gt;&lt;P&gt;CONCATENATE MATNR VKORG VTWEG INTO V_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By this way u can keep the trailing spaces...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:15:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203206#M1004577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T13:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203207#M1004578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh, it's not OK, it '#' at end of the string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:29:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203207#M1004578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T13:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203208#M1004579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is OK..here # represents trailing space. Just to confirm that take a download of that concatenated value..u will find that # is replaced by space..pl. check..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 13:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203208#M1004579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T13:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203209#M1004580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh, i tried, it's not OK, i want to use the V_NAME to read the sales text in FM READ_TEXT.&lt;/P&gt;&lt;P&gt;For example, matnr: R999-100&lt;/P&gt;&lt;P&gt;                   VKORG : 0001&lt;/P&gt;&lt;P&gt;                    VTWEG : 01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The v_name must be 'R999-100          000101', it can't be 'R999-100##########000101'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 14:21:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203209#M1004580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T14:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203210#M1004581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. then try this solution..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: g_space TYPE string,&lt;/P&gt;&lt;P&gt;l_pos type i,&lt;/P&gt;&lt;P&gt;l_pos1 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L_pos = strlen( matnr ).&lt;/P&gt;&lt;P&gt;l_pos1 = 18 - l_pos.&lt;/P&gt;&lt;P&gt;Do l_pos1 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matnr+l_pos(1) = '#'.&lt;/P&gt;&lt;P&gt;L_pos = l_pos + 1.&lt;/P&gt;&lt;P&gt;Enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than use the material for concatenation purpose...&lt;/P&gt;&lt;P&gt;CONCATENATE MATNR VKORG VTWEG INTO V_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace ALL OCCURRENCES of '#' in v_name with space in CHARACTER MODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jul 2008 14:28:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203210#M1004581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-13T14:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABOUT MATERIAL NUMBER</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203211#M1004582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If u dont want leading zeros then u can directly use concatenate statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE material sales org distribution channel INTO v_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want the trailing blanks the u have to do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE matnr TO v_name.&lt;/P&gt;&lt;P&gt;v_name+18(4) = sales org.&lt;/P&gt;&lt;P&gt;v_name+22(3) = distribution channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will keep the trailing blanks. U can arrange the exact position as per ur req.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 04:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/about-material-number/m-p/4203211#M1004582</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-07-14T04:37:12Z</dc:date>
    </item>
  </channel>
</rss>

