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

How to modify a screen field using super class

0 Likes
2,075

Hey gurus, I need a little help with objects. I'm starting with this and I'm a bit confused using the super class.

Let's say I have a screen field called 'campo' that based on a condition it must be disabled for input.

METHOD modificar.
  super->modificar( if_dynnr = if_dynnr)
<---code for the field 'campo' here--->
........

ENDMETHOD

What can I do to achieve this?

Hey gurus, I need a little help with objects. I'm starting with this and I'm a bit confused using the super class.

Let's say I have a screen field called 'campo' that based on a condition it must be disabled for input.

METHOD modificar.
  super->modificar( if_dynnr = if_dynnr)
<---code for the field 'campo' here--->
........

ENDMETHOD

What can I do to achieve this?

6 REPLIES 6
Read only

former_member763929
Participant
1,948

Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with Community Q&A , as the overview provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your Profile you encourage readers to respond.

Read only

abo
Active Contributor
1,948

and while we're at it... posting, deleting and reposting isn't cool.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,948

I don't understand your question. To have a field "Disabled for input", you use:

DATA ls_screen_element TYPE screen.
LOOP AT SCREEN INTO ls_screen_element.
  IF ls_screen_element-name = 'YOURFIELDNAME'.
    ls_screen_element-INPUT = '0'.
    MODIFY screen FROM ls_screen_element.
  ENDIF.
ENDLOOP.

I don't get what difficulty you have with ABAP Objects.

Read only

matt
Active Contributor
0 Likes
1,948

You can import SCREEN from your PBO into a method.

Read only

0 Likes
1,948

sandra.rossi

thankyou for your answer.

It seems that my problem is when can I use "normal" abap code when programming with ABAP Objects, like the code you wrote, 'MODIFY SCREEN FROM'.

Sorry for my English, guess is not good enough to explain myself.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,948

"MODIFY screen FROM ... " is not an ABAP Objects construct. It's the recommended form. "MODIFY screen" without additional words is obsolete.

About English, I guess Google translator works well, so that should not be a problem to explain your issue.