<?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 code for combining two fields in transformation rule in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614799#M600104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may like this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : v_year(4) type c.
move sy-datum+4(4) to v_year. " Here v_year will be 2007

If &amp;lt;your variable having year&amp;gt; eq v_year.
   move fieldA to 
else.
   move fieldB to
endif.
 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2007 13:47:30 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-08-02T13:47:30Z</dc:date>
    <item>
      <title>Abap code for combining two fields in transformation rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614798#M600103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a routine in a transformation rule that combines two fields from one virtual cube into one field in my destination cube. The combination should work according to this pseudo code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If (current year)&lt;/P&gt;&lt;P&gt;    then FieldA should be used&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;    then FieldB should be used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know how the abap code for this should be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mikael Kilåker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 13:40:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614798#M600103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T13:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Abap code for combining two fields in transformation rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614799#M600104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may like this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : v_year(4) type c.
move sy-datum+4(4) to v_year. " Here v_year will be 2007

If &amp;lt;your variable having year&amp;gt; eq v_year.
   move fieldA to 
else.
   move fieldB to
endif.
 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 13:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614799#M600104</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-02T13:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Abap code for combining two fields in transformation rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614800#M600105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have not been able to solve the problem, my code looks like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_year(4) type c.&lt;/P&gt;&lt;P&gt;    move sy-datum+4(4) to v_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if SOURCE_FIELDS-CALYEAR eq v_year.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       RESULT = SOURCE_FIELDS-/BIC/VE_SALHIS.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         move SOURCE_FIELDS-/BIC/VE_SALHIS to RESULT.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       RESULT = SOURCE_FIELDS-/BIC/VE_SETS.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         move SOURCE_FIELDS-/BIC/VE_SETS to RESULT.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried using the rows that are commented, but for some reason the if statement is never true, so only data from SOURCE_FIELDS-/BIC/VE_SETS is transformed into my result variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mikael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 15:44:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614800#M600105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T15:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Abap code for combining two fields in transformation rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614801#M600106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mikael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Dates in backend are usually stored in YYYYMMDD format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Hence, the syntax should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;move sy-datum(4) to v_year.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;instead of &lt;/P&gt;&lt;P&gt;move sy-datum+4(4) to v_year.&lt;/P&gt;&lt;P&gt;&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 15:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614801#M600106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T15:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Abap code for combining two fields in transformation rule</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614802#M600107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check your sy-datum how it get stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is way move syntax get worked. Please below mentioned example.&lt;/P&gt;&lt;P&gt;related to how MOVE syntax worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE f&lt;EM&gt;off1(len1) TO g&lt;/EM&gt;off2(len2). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;With offset off2 and length len2, field g receives the contents of field f with offset off1 and length len1. The offset and length specifications can also be variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA: FIELD1(10) VALUE '1234567890', &lt;/P&gt;&lt;P&gt;      OFF1 TYPE I VALUE 1, &lt;/P&gt;&lt;P&gt;      LEN1 TYPE I VALUE 2, &lt;/P&gt;&lt;P&gt;      FIELD2(8) VALUE 'abcdefgh', &lt;/P&gt;&lt;P&gt;      OFF2 TYPE I VALUE 3, &lt;/P&gt;&lt;P&gt;      LEN2 TYPE I VALUE 4. &lt;/P&gt;&lt;P&gt;MOVE FIELD1&lt;EM&gt;OFF1(LEN1) TO FIELD2&lt;/EM&gt;OFF2(LEN2). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD2 now has the value 'abc23  h'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 15:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-code-for-combining-two-fields-in-transformation-rule/m-p/2614802#M600107</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-02T15:52:52Z</dc:date>
    </item>
  </channel>
</rss>

