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

abap objects

Former Member
0 Likes
697

Please use a meaningful subject in future

Hi,

I have to add a field in one of the methods of the objecttype. How can I do ? can anybody explain ?

Rgds,

khad.

Edited by: Matt on May 15, 2009 10:44 AM

7 REPLIES 7
Read only

Former Member
0 Likes
668
Read only

Former Member
0 Likes
668

Use a function exit.

Read only

Former Member
0 Likes
668

Hi Sorry to tell you that can you be more clear about what exactly the requirment is,because i see some confusion in your question.can i get more calrity on this point.

Read only

Former Member
0 Likes
668

HI ,

1. Generally for screen enhancements we go to screen painter say transaction SE51 and then through painter we add the specific field in the mentioned screen container.

2. Also we can do this by finding screen exit. we create test project in tcode - CMOD and we test it through SMOD by its components.

These are some ways of adding field to a screen.However you can do this by some other ways also. As far as your question goes I understand you have to add a field in the screen.If you could be more specific with your question then I could give you very specific answers.

Please tell me if you do not understand the explanations given above.

Thanks and regards,

-Sudipta

Read only

Former Member
0 Likes
668

Hi Khadeer,

You can not directly add a field in the method of an object, unless it's an object of your local class.

If your requiremnet is temporary, you can define a new class as a sub class of the previous class and have to REDEFINE the method in which you want to add the field.

Once done, you can create an object for this child calss and use it.

rgds

Sreenivas

Read only

matt
Active Contributor
0 Likes
668

Please use a meaningful subject in future

Read only

Former Member
0 Likes
668

Hi,

You can use the REDEFINITION addition in the METHODS statement

to redefine an inherited public or protected instance method in a subclass.

When you redefine a method, you cannot change its interface.The method retains the same name and interface.

Add the field to that redefined method and access it by creating an object for the subclass.

Thanks,

Shyamala