<?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: ABAP Logic Error in BW Transformations... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992573#M953831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"SHIFT RESULT LEFT DELETING LEADING SPACE."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 20:59:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-11T20:59:40Z</dc:date>
    <item>
      <title>ABAP Logic Error in BW Transformations...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992571#M953829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting a strange issue when used the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Target : Charasteristic,Data Type CHAR 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: years TYPE tfmatage,&lt;/P&gt;&lt;P&gt;months TYPE tfmatage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;EM&gt;DATA: result TYPE c LENGTH 5.&lt;/EM&gt;(Showing error if included:Result is already declared)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_res TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF source-field-/bic/zdob IS INITIAL.&lt;/P&gt;&lt;P&gt;result = ''.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_date_from = source-field-/bic/zdob&lt;/P&gt;&lt;P&gt;i_date_to = sy-datum&lt;/P&gt;&lt;P&gt;i_flg_separate = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;e_months = months&lt;/P&gt;&lt;P&gt;e_years = years.&lt;/P&gt;&lt;P&gt;if months 0.&lt;/P&gt;&lt;P&gt;l_res = years + months / 100.&lt;/P&gt;&lt;P&gt;WRITE l_res TO RESULT.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write years to RESULT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WRITE / RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the above code (given by Mat in SDN) as a field routine in Transformations...can any one please explain me in detail(step by step) whats it doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirment is to cal age of the employee in YY:MM format based on his DOB &amp;amp; SY datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIMA_DAYS_AND_MONTHS_AND_YEARS give Years &amp;amp; Months between 2 dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please update me where i was doing wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If months = 0 the the result should be only years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: if Months &amp;amp; Years of FM Output is 40Y,0M the i want only 40 to be updated insted of 40.00 so that the reason why i enhanced your code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is giving me strange output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Output which got months it is being update correctly but&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for output for which months are 0 it is being update as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If FM output is 40Y,0M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the output being updated is ' 40' (2 spaces before 40)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In report i need to enter 2 spaces before 40 to retrive values of 40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please ask if you need any info&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 16:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992571#M953829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T16:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Logic Error in BW Transformations...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992572#M953830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After writing  to 'RESULT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this code.&lt;/P&gt;&lt;P&gt;SHIFT RESULT  LEFT  DELETING LEADING  SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" I think this will solve your leading space issue".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added in the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;EM&gt;DATA: result TYPE c LENGTH 5.&lt;/EM&gt;(Showing error if included:Result is already declared)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_res TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF source-field-/bic/zdob IS INITIAL.&lt;/P&gt;&lt;P&gt;result = ''.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_date_from = source-field-/bic/zdob&lt;/P&gt;&lt;P&gt;i_date_to = sy-datum&lt;/P&gt;&lt;P&gt;i_flg_separate = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;e_months = months&lt;/P&gt;&lt;P&gt;e_years = years.&lt;/P&gt;&lt;P&gt;if months 0.&lt;/P&gt;&lt;P&gt;l_res = years + months / 100.&lt;/P&gt;&lt;P&gt;WRITE l_res TO RESULT.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write years to RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;after writing  to 'RESULT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this code.&lt;/P&gt;&lt;P&gt;SHIFT RESULT  LEFT  DELETING LEADING  SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" I think this will solve your leading space issue".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WRITE / RESULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Marudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 19:06:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992572#M953830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T19:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Logic Error in BW Transformations...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992573#M953831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"SHIFT RESULT LEFT DELETING LEADING SPACE."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 20:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-logic-error-in-bw-transformations/m-p/3992573#M953831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T20:59:40Z</dc:date>
    </item>
  </channel>
</rss>

