‎2010 Nov 17 10:03 AM
Hi Friends
I have tried one program but am getting error in creating selection screen.
so can anyone please help with this.
interface sal_employee.
* data :
* basic type i,
* da type i,
* tds type i,
* m type i,
* sa type i.
methods :
im_basic,
im_da,
im_tds,
im_m ,
im_sa .
endinterface.
class counter definition.
PUBLIC SECTION.
INTERFACES sal_employee.
METHODS :
display_salary_list.
data :
basic type i,
da type i,
tds type i,
m type i,
sa type i.
endclass.
+parameters : salary type i.+
+uline.+
+parameters : employee_id type i.+
+uline.+
+parameters : employee_name(10) type char.+
class counter implementation.
method :sal_employee~im_basic.
basic = ( salary * 12 ) / 100.
endmethod.
method :
sal_employee~im_da.
da = ( salary * 8 ) / 100.
endmethod.
method :
sal_employee~im_tds.
tds = ( salary * 8 ) / 100.
endmethod.
method : sal_employee~im_m .
m = ( salary * 5 ) / 100.
endmethod.
method : sal_employee~im_sa.
sa = ( salary * 67 ) / 100.
endmethod.
METHOD display_salary_list.
write /: 'Basic = ',basic , 'da = ',da , 'tds = ',tds , 'ma = ',m , 'sa = ',sa .
endmethod.
endclass.
start-of-selection.
data obj type ref to counter.
create object obj.
call method obj->sal_employee~im_basic.
call method obj->sal_employee~im_da.
call method obj->sal_employee~im_tds.
call method obj->sal_employee~im_m.
call method obj->sal_employee~im_sa.
call method obj->display_salary_list.Thanx and Regards,
Rahul Jain
Edited by: kishan P on Nov 18, 2010 10:33 AM
‎2010 Nov 17 3:15 PM
I think the error you get
The parameter name ("EMPLOYEE_ID" here) can be up to 8 characters long.
...is meaningful enough - if not press F1 on parameters and you will find the answer.
Also typing this way
employee_name(10) type char.
...is not correct either. Refer documentation as well for getting the answer.
Third thing to notice is the topic of your thread. The issue itself doens't seem to be related to OO ABAP at all, rather a selection screen - please keep that in mind.
Regards
Marcin
‎2010 Nov 18 4:41 AM
‎2010 Nov 18 5:17 AM
Try like this.
PARAMETERS : emp_id TYPE I.
ULINE.
PARAMETERS : ename(10) TYPE c.