<?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: Logic for Populating a Work Area in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287446#M1219959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah!!!! &lt;/P&gt;&lt;P&gt;Apologize for misunderstanding the requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got your requirement...&lt;/P&gt;&lt;P&gt;use the code given below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data weekday type DTRESR-WEEKDAY
data string type string.
 
call function date_to_day
exporting
date = sy-datum
importing
weekday = weekday.

if weekday CS 'MONDAY'.
  read table itab into wa_knwev with key unloading_point = value_for_unloading_point
       transporting unloading_point MOAB1 MOBI1 MOAB2 MOBI2. 
elseif weekday cs 'TUESDAY'.
  read table itab into wa_knwev with key unloading_point = value_for_unloading_point
       transporting unloading_point DIAB1 DIBI1 DIAB2 DIBI2.
 
"like wise for other days you can do it this way....
elseif weekday CS 'WED'.
  
elseif weekday CS 'SAT'.
   string = 'SATURDAY'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2009 05:56:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-18T05:56:46Z</dc:date>
    <item>
      <title>Logic for Populating a Work Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287443#M1219956</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;I have a standard sap structure KNWEV. In the structure the values will get populated as give below.&lt;/P&gt;&lt;P&gt;For an Unloading point for different days ie for Monday the times for unloading will be &lt;/P&gt;&lt;P&gt;Monday  8 30 12 30 14 30 16 30.&lt;/P&gt;&lt;P&gt;Tuesday 9 30 12 30 14 30 16 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The values will get populated for all the days for an unloading point. and its stored in structure as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KNWEV Field names and Field Values&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unloading_point   Monday1 Monday2 Monday3 Monday4 Tuesday1 Tuesday2 Tuesday3 Tuesday4 etc&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Dock A                8 30       12 30      14 30       16 30      9 30         12 30       14 30          16 30 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose for a unloading date let it be 18 / March / 2009 , it is a Tuesday &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to populate work area in my program with Unloading point and Time for Tuesday  taking values from KNWEV &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Work Area&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unloading point   Tuesday1 Tuesday2 Tuesday3 Tuesday4 .&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------" /&gt;&lt;P&gt;Dock A               9 30         12 30       14 30          16 30 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how can i move fields from structure to my work area taking the field names as Monday1 Monday2 .. and so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Avi on Mar 18, 2009 12:11 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 18:40:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287443#M1219956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Logic for Populating a Work Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287444#M1219957</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 the code below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data weekday type DTRESR-WEEKDAY
data string type string.

call function date_to_day
exporting
date = sy-datum
importing
weekday = weekday.

if weekday CS 'WED'.
   string = 'WEDNESDAY'.
elseif weekday CS 'SAT'.
   string = 'SATURDAY'.
endif.                                       " For all other days it takes it automatically....

read table itab into wa_knwev with key unloading_point = weekday.
" I don't know whether which variable contains the weekday in the internal table so i have used the variabel unloading point...
" The above read statement will get the record in the work area for the date you mention in the FM...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is what you required ...&lt;/P&gt;&lt;P&gt;if this is not meeting the requirement please do specify a bit more on your requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 20:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287444#M1219957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T20:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Logic for Populating a Work Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287445#M1219958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sidharth,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;But my table field name is MONDAY1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example see table KNVA there you can see the table field names&lt;/P&gt;&lt;P&gt;For Monday it has 4 fields in the table - MOAB1 , MOBI1,MOAB2,MOBI2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if from function module Date_to_Day gives me MONDAY &lt;/P&gt;&lt;P&gt;then I have to move values from these fields MOAB1 , MOBI1,MOAB2,MOBI2  to my work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got my requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Avi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:35:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287445#M1219958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Logic for Populating a Work Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287446#M1219959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah!!!! &lt;/P&gt;&lt;P&gt;Apologize for misunderstanding the requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got your requirement...&lt;/P&gt;&lt;P&gt;use the code given below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data weekday type DTRESR-WEEKDAY
data string type string.
 
call function date_to_day
exporting
date = sy-datum
importing
weekday = weekday.

if weekday CS 'MONDAY'.
  read table itab into wa_knwev with key unloading_point = value_for_unloading_point
       transporting unloading_point MOAB1 MOBI1 MOAB2 MOBI2. 
elseif weekday cs 'TUESDAY'.
  read table itab into wa_knwev with key unloading_point = value_for_unloading_point
       transporting unloading_point DIAB1 DIBI1 DIAB2 DIBI2.
 
"like wise for other days you can do it this way....
elseif weekday CS 'WED'.
  
elseif weekday CS 'SAT'.
   string = 'SATURDAY'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 05:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-for-populating-a-work-area/m-p/5287446#M1219959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-18T05:56:46Z</dc:date>
    </item>
  </channel>
</rss>

