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

Probelm in Class Method

former_member207480
Participant
0 Likes
2,136

Hi,

I have created one class interface and assigning method with follwing sequence

ZIF_VEHICLE_MODEL~GET_MODEL

But when I add ~GET_MODEL after ZIF_VEHICLE_MODEL, system shows below error message.

Special characters are not allowed in names

Message no. OO103

Kindly suggest the same.

Thanks and Regards

Amol Khochare

12 REPLIES 12
Read only

matt
Active Contributor
0 Likes
2,011

Why not share the code you've written instead of a fragment? How people expect help when they post so little detail is beyond me.

Read only

0 Likes
2,011

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,011

Can you show us how you implemented the interface in the class?

I think there is something missing...

Read only

0 Likes
2,011

This message was moderated.

Read only

Former Member
0 Likes
2,011

you can't name the method with ~ symbol. This symbol is used to emhpasize, that the method's definition placement is in the corresponding interface.

Read only

0 Likes
2,011

So how can i implement this. When I go to define the code, it shows error message as field is unknown due to did not implement in method.

Regards

Amol Khochare

Read only

0 Likes
2,011

Hi Amol

You should not define the method directly in your ZCL_CAR_DETAILS. Instead, in class ZCL_CAR_DETAILS, go to "Interface" tab and enter the interface ZIF_VEHICLE_MODEL there.

After that, if you switch back to the "Methods" tab, you should see the methods from the interface class already there.

Rgds

Eng Swee

Read only

0 Likes
2,011

Amol,

Add the interface you have created in the INTERFACE tab instead of the METHODS tab.

thanks,

Vikram.M

Read only

Former Member
0 Likes
2,011

Hi AMOL,

            it seems u are trying for a multiple inheritance from the SAP technical.

  1. First of all multiple inheritance are used for re usability,that means the same interfaces

       can be used in different classes for different functionality.

    So create an interface with name ZIF_VECHILE_MODEL AND method name GET_MODEL and

parameter name RV_MODEL. And activate it.


Next create a CLASS with name ZCL_CAR_DETAILS.And if u want to use the the GET_MODEL METHOD IN THIS CLASS,NO NEED TO WRITE ZIF_VECHILE_MODEL~GET_MODEL EXPLICITLY.


  • JUST GO TO INTERFACES TAB IN THE CLASS AND GIVE THE INTERFACE NAME

   ZIF_VECHILE_MODEL,THATS ALL.

  •   NOW GO AND CHECK IT IN THE METHODS TAB,IT WILL COME DEFAULTLY.
Read only

0 Likes
2,011

Ok Thank u. I understood.

Thanks and Regards

Amol Khochare

Read only

0 Likes
2,011

Details are not showing after Method.

Thanks and Regards

Amol Khochare

Read only

0 Likes
2,011

Hi,

      I didnt get ur problem