‎2005 Dec 20 7:51 PM
Can somebody please help me out in writing an ABAP program for the following requirement?
Use "select" statement in your ABAP program to select the database table contents depending upon the query that user has entered at the selection screen.
Display the selected records of database table (point 3) on the output report.
Selection screen:
Below are the selection screen parameters/options that you need to provide
for the user
1. Employee ID
2. Employee Name (either Emp ID or name should be mandatory).
3. Employee Dept/ Designation / joining date
4. Another parameter should be "Age". Thus, if user enters 27 on Age field, every employee under 27 age should be displayed on the report.
Output report:
Employee ID with name / dept / designation / joining date and age should be displayed as details.
‎2005 Dec 20 7:54 PM
‎2005 Dec 20 8:01 PM
This short sample program should get you started.
report zrich_0002.
* declare the internal table
data: ipa0001 type table of pa0001 with header line.
* define the selection screen
select-options: s_pernr for ipa0001-pernr,
s_SNAME for ipa0001-SNAME.
start-of-selection.
* Select the data from database
select * into corresponding fields of table ipa0001
from pa0001
where pernr in s_pernr
and sname in s_sname
and ENDDA = '99991231'.
* Write out the data in a list
loop at ipa0001.
write:/ ipa0001-pernr, ipa0001-sname.
endloop.
Regards,
Rich Heilman
‎2005 Dec 20 8:03 PM
Hi Shailender,
I agree with Rich... it would help you & us if you do the basic coding and then seek the forum for addiotional help.. here is for a start.. create a report & tie it to the logical database PNP.. Use infotype 0002 to get the id ,name & DOB, infotype 0001 to get the Dept & designation and 0041 for joinig date.. it should be a fairly simple report..
Good Luck,
Suresh Datti
‎2005 Dec 20 8:10 PM
Hi
Try to see this FM
HRWPC_RFC_PERSONALDATA_GETLISTand code accordingly...
it is very simple report..
vijay
‎2005 Dec 20 9:50 PM
Hi Shailender,
Why to develop custom report when SAP has delivered this report..
Try Birthday List under HR - Information System - Reports - Pers Mgmt - Admin - Employee - Birthday List .. There are many other reports you can look into..
Hope this helps.
-Bharat
‎2005 Dec 21 4:12 AM
Data: Itab like ztable occurs 0 with header line.
select-options: s_id for ztable-id.
select-options: s_name for ztable-name.
select-options: s_dept for ztable-dept.
select-options: s_age for ztable-age.
start-of-selection.
select * from ztable into corressponding fields of table itab where id = s_id and name = s_name and dept =s_dept and age = s_age.
At selection-screen.
if s_id is not initial .
message i000(zmsg) with 'Provide id'.
endif.
end-of-selection.
Loop at itab.
write:/ itab-id,itab-name,......
endloop.
regards
vijay