Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regd HR abap - smartforms

Former Member
0 Likes
867

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

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

6 REPLIES 6
Read only

Former Member
0 Likes
830

Hi Preeti,

Check out this table PA0001.

Then may be you have to write your own customized FM to extract data.

Reward if useful!

Read only

Former Member
0 Likes
830

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

Read only

former_member225631
Active Contributor
0 Likes
830

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.

Read only

Former Member
0 Likes
830

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

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
830

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.

Read only

Former Member
0 Likes
831

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.