<?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: CONVERSION LOGIC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496353#M230444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this logic.&lt;/P&gt;&lt;P&gt;Will it suit your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun .
PARAMETERS : btlamt(18) DEFAULT '0986-03456-01'.

DATA : tmp(2),
       len TYPE i.

*Calculate the Length
len = STRLEN( btlamt ).

len = len - 2.

*Take the last two digits into one variable
tmp = btlamt+len(2).

*If there is 0 follow this logic.
IF tmp CA '0'.

  TRANSLATE tmp USING '0 '.
  CONDENSE tmp NO-GAPS.

  CONCATENATE tmp 'C' INTO tmp.

  btlamt+len(2) =  tmp.

ELSE.
*Write any Logic you need or just display the Bottleamount.

ENDIF.



BREAK-POINT.

WRITE  : / btlamt.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Test this code by giving the Input in the way you want and check the output.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jul 2006 15:22:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-26T15:22:05Z</dc:date>
    <item>
      <title>CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496349#M230440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cau you help me how to write logic for below problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOTTLEAMOUNT CAUFVD-MATNR  CHAR 18&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT  LAST TWO DIGITS OF THE MATERIAL SHOULD BE CONVERTED TO A SINGLE DIGIT WHERE APPLICABLE AND CONCATENATED WITH A  "C" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX: 0986-03456-01&lt;/P&gt;&lt;P&gt;01 = 1C THEN&lt;/P&gt;&lt;P&gt;BOTTLE AMOUNT = 1C (IF ITS ZERO HERE )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ITS NOT ZERO THERE THEN WHTS THE LOGIC I HAVE WRITE FOR ABOVE 2 CONDITIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLZ REVERT BACK ME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS &amp;amp; REGARDS&lt;/P&gt;&lt;P&gt;DIVYA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 14:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496349#M230440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T14:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496350#M230441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm lost,  I'd like to help, but you are going to have to explain a little clearer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 15:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496350#M230441</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-26T15:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496351#M230442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Divya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give clear picture about úr requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 15:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496351#M230442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T15:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496352#M230443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to display bottle amount ex: 0987-0345-01&lt;/P&gt;&lt;P&gt;so the last two digits of the materil should be converted to asingle digit where applicable and concatenate with a  "c"&lt;/P&gt;&lt;P&gt;ex: 0987-0345-01&lt;/P&gt;&lt;P&gt; 01 = 1c&lt;/P&gt;&lt;P&gt;bottle amount = 1c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;similarly if there is no zero in material ex:0987-0998-22&lt;/P&gt;&lt;P&gt;in this case how can we write logic and for above case also hw can we write logic &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filed name is matnr char 18&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;divya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 15:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496352#M230443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T15:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496353#M230444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this logic.&lt;/P&gt;&lt;P&gt;Will it suit your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun .
PARAMETERS : btlamt(18) DEFAULT '0986-03456-01'.

DATA : tmp(2),
       len TYPE i.

*Calculate the Length
len = STRLEN( btlamt ).

len = len - 2.

*Take the last two digits into one variable
tmp = btlamt+len(2).

*If there is 0 follow this logic.
IF tmp CA '0'.

  TRANSLATE tmp USING '0 '.
  CONDENSE tmp NO-GAPS.

  CONCATENATE tmp 'C' INTO tmp.

  btlamt+len(2) =  tmp.

ELSE.
*Write any Logic you need or just display the Bottleamount.

ENDIF.



BREAK-POINT.

WRITE  : / btlamt.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Test this code by giving the Input in the way you want and check the output.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 15:22:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496353#M230444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T15:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: CONVERSION LOGIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496354#M230445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : lv_char2 type char2,
       lv_temp type char15
       lv_temp1 type char15,
       lv_temp2 type char3
       lv_amout type char18,
       lv_lenght type i.


split amount at '-' into lv_temp lv_temp1 lv_char2.

translate lv_char2+(1) '0 '.
condense lv_char2 no-gaps.

concatenate lv_char2 'C' into lv_temp3.

lv_char2 = lv_temp3.


concatenate lv_temp lv_temp1 lv_char2 
       into lv_amount
 seperated by '-'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please Reward Points &amp;amp; Mark Helpful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To mark Helpful Answers ;click radio Button next to the post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RadioButtons&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;o&amp;lt;/b&amp;gt; Helpful Answer&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;o&amp;lt;/b&amp;gt; Very helpful Answer&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;o&amp;lt;/b&amp;gt; Problem Solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click any of the above button next to the post; as per the anwers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 15:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-logic/m-p/1496354#M230445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T15:32:14Z</dc:date>
    </item>
  </channel>
</rss>

