<?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: append two variables in single variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639061#M1283474</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;The best solution that I can see here is to have 2 internal tables for both month and year and use this code for the retrieval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mbewh into corresponding fields of table it_mbewh&lt;/P&gt;&lt;P&gt;for all entries in it_ekko where matnr = it_ekko-matnr&lt;/P&gt;&lt;P&gt;and bwkey = it_ekko-werks &lt;/P&gt;&lt;P&gt;and ( lfmon IN it_mon1&lt;/P&gt;&lt;P&gt;and lfgja IN it_year1 )&lt;/P&gt;&lt;P&gt;OR ( lfmon IN it_mon2&lt;/P&gt;&lt;P&gt;AND lfgja IN it_year2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, it_mon1 contains the months for current year -1 and it_year1 contains current year -1 while it_mon2 contains the months for the current year and it_year2 contain the current year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 06:13:19 GMT</pubDate>
    <dc:creator>peter_ruiz2</dc:creator>
    <dc:date>2009-05-13T06:13:19Z</dc:date>
    <item>
      <title>append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639060#M1283473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select ekko~ebeln ekko~bedat ekpo~ebelp ekpo~matnr ekpo~werks
       ekpo~netpr from ekko inner join ekpo
       on ekko~ebeln = ekpo~ebeln into
       corresponding fields of table it_ekko
       where matnr in s_matnr and werks in s_werks
         and bedat in s_bedat.

l_low_mon = s_bedat-low+04(02).
l_high_mon = s_bedat-high+04(02).
l_low_yr = s_bedat-low+00(04).
l_high_yr = s_bedat-high+00(04).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if l_low_mon = '01'.
  move '10' to l_low_mon.
  l_low_yr = l_low_yr - 1.
endif.

if l_low_mon = '02'.
  move '11' to l_low_mon.
  l_low_yr = l_low_yr - 1.
endif.

if l_low_mon = '03'.
  move '12' to l_low_mon.
  l_low_yr = l_low_yr - 1.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if l_low_mon = '04'.
  move '01' to l_low_mon.
  l_low_yr = l_low_yr.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly I am moving '02' for the month of May.Like that every month it has to be incremented.&lt;/P&gt;&lt;P&gt;For l_low_month ( 04 to 12 ) ie,from Apr to Dec l_low_yr is same.But for ( 01 to 03 ) ie, Jan to Mar&lt;/P&gt;&lt;P&gt;l_low_year = l_low_yr - 1.( because of Fiscal yr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Condition is similar for l_high_mon and l_high_yr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need l_low_mon and l_high_mon has to be appended in a single field&lt;/P&gt;&lt;P&gt;and l_low_yr and l_high_yr in a single field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from mbewh into corresponding fields of table it_mbewh
   for all entries in it_ekko where matnr = it_ekko-matnr
             and bwkey = it_ekko-werks and
             lfmon = ?
             and lfgja = ?.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because in lfmon I have two fields (l_low_mon,l_high_mon) and lfgja also (l_low_yr,l_high_yr)&lt;/P&gt;&lt;P&gt;For fetching these two variables has to be appended in on variable&lt;/P&gt;&lt;P&gt;Suggest some ideas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bathri.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bathrinath Sankaranarayanan on May 13, 2009 8:05 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bathrinath Sankaranarayanan on May 13, 2009 8:07 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bathrinath Sankaranarayanan on May 13, 2009 8:07 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bathrinath Sankaranarayanan on May 13, 2009 8:08 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bathrinath Sankaranarayanan on May 13, 2009 8:12 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:04:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639060#M1283473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639061#M1283474</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;The best solution that I can see here is to have 2 internal tables for both month and year and use this code for the retrieval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mbewh into corresponding fields of table it_mbewh&lt;/P&gt;&lt;P&gt;for all entries in it_ekko where matnr = it_ekko-matnr&lt;/P&gt;&lt;P&gt;and bwkey = it_ekko-werks &lt;/P&gt;&lt;P&gt;and ( lfmon IN it_mon1&lt;/P&gt;&lt;P&gt;and lfgja IN it_year1 )&lt;/P&gt;&lt;P&gt;OR ( lfmon IN it_mon2&lt;/P&gt;&lt;P&gt;AND lfgja IN it_year2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, it_mon1 contains the months for current year -1 and it_year1 contains current year -1 while it_mon2 contains the months for the current year and it_year2 contain the current year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:13:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639061#M1283474</guid>
      <dc:creator>peter_ruiz2</dc:creator>
      <dc:date>2009-05-13T06:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639062#M1283475</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;Use CONCATENATE command to combine two fields and store value in single field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax: CONCATENATE str1 str2  into str3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by&lt;/P&gt;&lt;P&gt;Prasad gvk.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:13:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639062#M1283475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639063#M1283476</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;u can simply do like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : l_mon(4)  type char.

concatenate l_low_mon l_high_mon into l_mon .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;same for yr also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639063#M1283476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639064#M1283477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate l_low_mon and l_high_mon into a range l_month.&lt;/P&gt;&lt;P&gt;similarly concatenate l_low_yr and l_high_yr into another range l_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass these ranges l_month and l_year to lfmon and lfgja of table mbewh.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sowmya Arni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639064#M1283477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639065#M1283478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
Hi Bathrinath,

&lt;STRONG&gt;1&lt;/STRONG&gt;.Define Range table like below for lfmon
&lt;PRE&gt;&lt;CODE&gt;
TABLES:mbewh.
RANGES:r_lfmon FOR mbewh-lfmon.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;STRONG&gt;2&lt;/STRONG&gt;. Append your l_low_mon and l_high_mon to range table r_lfmon
&lt;PRE&gt;&lt;CODE&gt;
r_lfmon-low    = l_low_mon.
r_lfmon-high   = space.
r_lfmon-sign   = 'I'.
r_lfmon-option = 'EQ'.

APPEND r_lfmon.
CLEAR  r_lfmon.

r_lfmon-low    = l_high_mon.
r_lfmon-high   = space.
r_lfmon-sign   = 'I'.
r_lfmon-option = 'EQ'.

APPEND r_lfmon.
CLEAR  r_lfmon.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;STRONG&gt;3&lt;/STRONG&gt;. Now put that range table in where condition. Do same way for lfgja as well.
&lt;PRE&gt;&lt;CODE&gt;
select * from mbewh into corresponding fields of table it_mbewh
   for all entries in it_ekko where matnr = it_ekko-matnr
             and bwkey = it_ekko-werks and
             lfmon in r_lfmon
             and lfgja in r_lfgja.
&lt;/CODE&gt;&lt;/PRE&gt;

I hope that it solves your problem.

Thanks
Venkat.O
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:33:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639065#M1283478</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-05-13T06:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: append two variables in single variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639066#M1283479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bathrinath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    I am not clear with your requirement, if you want the data from MBEWH betw your high and low date then in where clause you can go for :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE lfmon BETWEEN l_low_mon and l_high_mon
     AND lfgja   BETWEEN l_low_yr and l_high_yr.&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;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:35:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/append-two-variables-in-single-variable/m-p/5639066#M1283479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:35:11Z</dc:date>
    </item>
  </channel>
</rss>

