2007 Jun 25 7:57 AM
Hi all,
I have a requiremet where i have to populate the position, emp group, emp subgroup, personnel area, personnel sub area of an employee for the last 3 years EXCLUDING CURRENT YEAR into the smartform table.
e.g. If an HR executove is taking out the record of an employee in year 2022, then he should get all the records of years 2021, 2020 and 2019 in a tabular form in smartform.
Please guide me. Its urgent!!!!
Thanks & Regards,
preeti
2007 Jun 25 8:13 AM
Hi,
You can do it this way :
In case of your example.
gv_year = '2022'.
gv_year1 = gv_year - 3.
gv_year2 = gv_year - 1.
concatenate gv_year1 '0101' into gv_date1 . " date will be 01.01.2019
concatenate gv_year2 '1231' into gv_date2 . " date will be 31.12.2021
Now write this select query:
select pernr begda endda werks btrtl
from pa0001
into table gt_pa0001
where begda ge gv_date1 and
begda le gv_date2.
Thanks.
Hi all,
I have a requiremet where i have to populate the position, emp group, emp subgroup, personnel area, personnel sub area of an employee for the last 3 years EXCLUDING CURRENT YEAR into the smartform table.
e.g. If an HR executove is taking out the record of an employee in year 2022, then he should get all the records of years 2021, 2020 and 2019 in a tabular form in smartform.
Please guide me. Its urgent!!!!
Thanks & Regards,
preeti
2007 Jun 25 8:03 AM
Hi Preeti,
Check out this table PA0001.
Then may be you have to write your own customized FM to extract data.
Reward if useful!
2007 Jun 25 8:05 AM
Hi Preeti,
In the smart form write a code say for example ..
Data:P_date type sy-datum.
after getting the year ... u subtract one and three from it ,
and write select query between 1 and 3. u will get result..
Thanks & Regards
Bhaskar rao.M
2007 Jun 25 8:05 AM
Use select statement. Use variables
var1 = input - 4
var2 = input -1
select fields from pa0001into table itab
where pernr =
and begda between var1 and var2.
2007 Jun 25 8:06 AM
Hi
In the smartform
create program Lines and write a select statement to PA0001 to select all the records first
then seggregate the records with the Year condition
year = date1+0(4) .
year1 = year1 - 1.
year2 = year1 - 3.
now do the processing of data records of a pernr using the BEGDA and ENDDA such that the years in those dates lies between these Year1 and YEAr2.
Reward points for useful Answers
Regards
Anji
2007 Jun 25 8:08 AM
Hi,
Code the program in such a way so that it gets data from pa0001 table and pass the internal table to smartform.Use table concept in smartform to display it.If you are using LDB,you can use rp-provide-from-last macro.
2007 Jun 25 8:13 AM
Hi,
You can do it this way :
In case of your example.
gv_year = '2022'.
gv_year1 = gv_year - 3.
gv_year2 = gv_year - 1.
concatenate gv_year1 '0101' into gv_date1 . " date will be 01.01.2019
concatenate gv_year2 '1231' into gv_date2 . " date will be 31.12.2021
Now write this select query:
select pernr begda endda werks btrtl
from pa0001
into table gt_pa0001
where begda ge gv_date1 and
begda le gv_date2.
Thanks.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |