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

Remove pushbutton during runtime

Former Member
0 Likes
689

HI experts,

how can I remove a pushbutton during runtime from the screen?

if certain conditions are true than I have to remove the pushbuttons from displaying.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
662

Hi,

Take the group1 for the textbox (i/o field) which need to be hidden on a certain condition as ABC using the attributes of the textbox.

Now use the code to hide the button on a cretain condition.


if <condition>. "condition as per your requirement
  loop at screen.
    if screen-group1 = 'ABC'. "group1 for i/o field defined in its attributes
      screen-invisible = 1. "to hide the i/o field
    endif.
    modify screen.
  endloop.
else. "if condition is not true then display i/o field
  loop at screen.
    if screen-group1 = 'ABC'. "group1 for i/o field defined in its attributes
      screen-invisible = 0. "to display the i/o field
    endif.
    modify screen.
  endloop.
endif.

Hope this helps you.

Regards,

Tarun

6 REPLIES 6
Read only

Former Member
0 Likes
662

HI,

SET PF-STATUS <Status> EXLCUDING table_ucommand.

Check this link..

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba42335c111d1829f0000e829fbfe/content.htm

Read only

0 Likes
662

It's working only if the pushbutton is on the status bar, but mine is under a table control, on the screen.

Read only

0 Likes
662

Use:

LOOP AT SCREEN.

Read only

0 Likes
662

screen-invisible = 1.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
663

Hi,

Take the group1 for the textbox (i/o field) which need to be hidden on a certain condition as ABC using the attributes of the textbox.

Now use the code to hide the button on a cretain condition.


if <condition>. "condition as per your requirement
  loop at screen.
    if screen-group1 = 'ABC'. "group1 for i/o field defined in its attributes
      screen-invisible = 1. "to hide the i/o field
    endif.
    modify screen.
  endloop.
else. "if condition is not true then display i/o field
  loop at screen.
    if screen-group1 = 'ABC'. "group1 for i/o field defined in its attributes
      screen-invisible = 0. "to display the i/o field
    endif.
    modify screen.
  endloop.
endif.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
662

Thanks