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

Error in Selection Screen

Former Member
0 Likes
564

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

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
488

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

Read only

0 Likes
488

Thread moved to ABAP General forum.

Read only

former_member225631
Active Contributor
0 Likes
488

Try like this.

PARAMETERS : emp_id TYPE I.

ULINE.

PARAMETERS : ename(10) TYPE c.