<?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: Modify the Records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716051#M629900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the changes in RED color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF ty_emp,
         empid(4) TYPE c,
         ename(30) TYPE c,
         dept(4) TYPE c,
         grade(1) TYPE c,
         salary TYPE i,
       END OF ty_emp.

* TABLE TYPE
DATA: it_emp TYPE TABLE OF ty_emp WITH HEADER LINE,
      fs_emp TYPE ty_emp.
 " declarations
DATA : n TYPE i. 
DATA: salary TYPE i,
net_salary TYPE i.
 " declarations

fs_emp-empid = 'E100'.
fs_emp-ename = 'X'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'A'.
fs_emp-salary = 10000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E200'.
fs_emp-ename = 'Y'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'A'.
fs_emp-salary = 11000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E101'.
fs_emp-ename = 'Z'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'A'.
fs_emp-salary = 12000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E103'.
fs_emp-ename = 'B'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 8000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E104'.
fs_emp-ename = 'B'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 7000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E105'.
fs_emp-ename = 'C'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'C'.
fs_emp-salary = 5000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E100'.
fs_emp-ename = 'D'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 8500.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E200'.
fs_emp-ename = 'E'.
fs_emp-dept = 'D300'.
fs_emp-grade = 'B'.
fs_emp-salary = 9000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E104'.
fs_emp-ename = 'F'.
fs_emp-dept = 'D300'.
fs_emp-grade = 'A'.
fs_emp-salary = 13000.
APPEND fs_emp TO it_emp.

 " Calculations
DESCRIBE TABLE it_emp LINES n.

 " Calculations
LOOP AT it_emp INTO fs_emp.
  salary = salary + fs_emp-salary.
  CLEAR : fs_emp.
ENDLOOP.

 " Calculations
net_salary = salary / n.

 " Calculations
LOOP AT it_emp INTO fs_emp.
  IF fs_emp-salary LT net_salary.
    fs_emp-salary = fs_emp-salary + ( fs_emp-salary / 5 ).
    MODIFY it_emp FROM fs_emp TRANSPORTING salary.
  ENDIF.
  CLEAR : fs_emp.
ENDLOOP.

LOOP AT it_emp INTO fs_emp.
WRITE:/ fs_emp-empid,
        fs_emp-ename,
        fs_emp-dept,
        fs_emp-grade,
        fs_emp-salary.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your second requirement do as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort it_emp by dept.
LOOP AT it_emp INTO fs_emp where dept = 'D100' and salary GT 10000.
WRITE:/ fs_emp-empid,
        fs_emp-ename,
        fs_emp-dept,
        fs_emp-grade,
        fs_emp-salary.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2007 07:35:01 GMT</pubDate>
    <dc:creator>gopi_narendra</dc:creator>
    <dc:date>2007-08-10T07:35:01Z</dc:date>
    <item>
      <title>Modify the Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716047#M629896</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 the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Modify the salry of all the employees whose salary is less than the average salary of all the employees , increase their current salary by 20%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Display  all records where Dept no is D100 where salary is GE 10000 in sorted order of salary 9In ascending Order).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF TY_EMP,&lt;/P&gt;&lt;P&gt;EMPID(4) TYPE C,&lt;/P&gt;&lt;P&gt;ENAME(30) TYPE C,&lt;/P&gt;&lt;P&gt;DEPT(4) TYPE C,&lt;/P&gt;&lt;P&gt;GRADE(1) TYPE C,&lt;/P&gt;&lt;P&gt;SALARY TYPE I,&lt;/P&gt;&lt;P&gt;END OF TY_EMP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLE TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;FS_EMP TYPE TY_EMP,&lt;/P&gt;&lt;P&gt;IT_EMP TYPE TABLE OF TY_EMP WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;FS_EMP-EMPID = 'E100'.&lt;/P&gt;&lt;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.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 07:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716047#M629896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Modify the Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716048#M629897</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;&lt;/P&gt;&lt;P&gt;In your coding u had just declared the variables but where u had compared for employee details and for their salary????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) for  1st query use a check or comparator operator for that salary details and after that for increasing 20%&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Int_salary is for calculating 20%
int_salary1 is same as salary
int_origsalary is original salray which u hav calculated already 
int_salary = 20/100.
int_salary1 = int_salary + int_origsalary&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;Check this sample one&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT int_outtab.
*    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
    ON CHANGE OF int_outtab-ebelp.
      SELECT knumh kschl vakey FROM konh INTO int_konh
*        FOR ALL ENTRIES IN int_outtab
        WHERE vakey = int_outtab-vakey AND
              datab &amp;lt;= int_outtab-bedat AND
              datbi &amp;gt; int_outtab-bedat AND
             ( kschl = 'JMOP' OR kschl = 'JEC1' ).
        SELECT knumh kschl kbetr FROM konp INTO int_konp
        WHERE  knumh = int_konh-knumh .
          IF  int_konp-kschl = 'JMOP'.
            ws_kbetr = int_konp-kbetr / 100 * int_outtab-netwr.
            ws_kbetr1 = ws_kbetr.
          ENDIF.
          IF int_konp-kschl = 'JEC1'.
            ws_kbetr2 = int_konp-kbetr / 100 * ws_kbetr1.
          ENDIF.
          ws_kbetr = ws_kbetr + ws_kbetr2.
        ENDSELECT.
      ENDSELECT.
    ENDON.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You can use Sort condition here for sorting a particular field in inetrnal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 07:27:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716048#M629897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T07:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Modify the Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716049#M629898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rams,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have given solution already in the previous thread that you posted with the same question many days ago. Please check that and close this thread.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Reward points if that helps,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 07:29:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716049#M629898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T07:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Modify the Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716050#M629899</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;1)data:tot_sal type i,&lt;/P&gt;&lt;P&gt;    avg_sal type i,&lt;/P&gt;&lt;P&gt;    count type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_EMP INTO FS_EMP.&lt;/P&gt;&lt;P&gt;tot_sal = tot_sal + FS_EMP-SALARY.&lt;/P&gt;&lt;P&gt;count = count + 1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;avg_sal = tot_sal / count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_EMP INTO FS_EMP where salary &amp;lt; avg_sal.&lt;/P&gt;&lt;P&gt;FS_EMP-salary = FS_EMP-salary + ( FS_EMP-salary * 20 / 100 ).&lt;/P&gt;&lt;P&gt;modify table it_emp from fs_emp.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;skip.&lt;/P&gt;&lt;P&gt;LOOP AT IT_EMP INTO FS_EMP.&lt;/P&gt;&lt;P&gt;WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-GRADE,FS_EMP-SALARY.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)sort it_emp by SALARY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_emp into fs_emp where dept = 'D100' and salary &amp;gt;= 10000.&lt;/P&gt;&lt;P&gt;  WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-GRADE,FS_EMP-SALARY.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 07:34:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716050#M629899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T07:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Modify the Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716051#M629900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the changes in RED color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF ty_emp,
         empid(4) TYPE c,
         ename(30) TYPE c,
         dept(4) TYPE c,
         grade(1) TYPE c,
         salary TYPE i,
       END OF ty_emp.

* TABLE TYPE
DATA: it_emp TYPE TABLE OF ty_emp WITH HEADER LINE,
      fs_emp TYPE ty_emp.
 " declarations
DATA : n TYPE i. 
DATA: salary TYPE i,
net_salary TYPE i.
 " declarations

fs_emp-empid = 'E100'.
fs_emp-ename = 'X'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'A'.
fs_emp-salary = 10000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E200'.
fs_emp-ename = 'Y'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'A'.
fs_emp-salary = 11000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E101'.
fs_emp-ename = 'Z'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'A'.
fs_emp-salary = 12000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E103'.
fs_emp-ename = 'B'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 8000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E104'.
fs_emp-ename = 'B'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 7000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E105'.
fs_emp-ename = 'C'.
fs_emp-dept = 'D100'.
fs_emp-grade = 'C'.
fs_emp-salary = 5000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E100'.
fs_emp-ename = 'D'.
fs_emp-dept = 'D200'.
fs_emp-grade = 'B'.
fs_emp-salary = 8500.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E200'.
fs_emp-ename = 'E'.
fs_emp-dept = 'D300'.
fs_emp-grade = 'B'.
fs_emp-salary = 9000.
APPEND fs_emp TO it_emp.
fs_emp-empid = 'E104'.
fs_emp-ename = 'F'.
fs_emp-dept = 'D300'.
fs_emp-grade = 'A'.
fs_emp-salary = 13000.
APPEND fs_emp TO it_emp.

 " Calculations
DESCRIBE TABLE it_emp LINES n.

 " Calculations
LOOP AT it_emp INTO fs_emp.
  salary = salary + fs_emp-salary.
  CLEAR : fs_emp.
ENDLOOP.

 " Calculations
net_salary = salary / n.

 " Calculations
LOOP AT it_emp INTO fs_emp.
  IF fs_emp-salary LT net_salary.
    fs_emp-salary = fs_emp-salary + ( fs_emp-salary / 5 ).
    MODIFY it_emp FROM fs_emp TRANSPORTING salary.
  ENDIF.
  CLEAR : fs_emp.
ENDLOOP.

LOOP AT it_emp INTO fs_emp.
WRITE:/ fs_emp-empid,
        fs_emp-ename,
        fs_emp-dept,
        fs_emp-grade,
        fs_emp-salary.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your second requirement do as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort it_emp by dept.
LOOP AT it_emp INTO fs_emp where dept = 'D100' and salary GT 10000.
WRITE:/ fs_emp-empid,
        fs_emp-ename,
        fs_emp-dept,
        fs_emp-grade,
        fs_emp-salary.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 07:35:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-the-records/m-p/2716051#M629900</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-08-10T07:35:01Z</dc:date>
    </item>
  </channel>
</rss>

