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 enable pushbutton dynamically

Former Member
0 Likes
1,164

Hi Experts,

i have developed a module pool program with 2 sub-screens, where one of the sub-screens is having table control

and a few push buttons. Well, my requirement is, once i populate the table control with some records and choose

or perform line selection against any record on table control, push button 'EDIT' must be in enabled mode so that i can

edit the data and save it to Ztable back. Initially, the push button 'EDIT' is in disable mode.

Please help me out........

Thanks.

Praveen

6 REPLIES 6
Read only

Kiran_Valluru
Active Contributor
0 Likes
959

Hi.,

Capture the lead selection of table control .,

and in PAI set the flag.,

IN PBO.,

loop at screen.

if flag = 'X'.

if screen-group = 'SC1' " screen group which u assigned to Push button

screen-input = 1.

endif.

endloop.

hope this helps u.,

Thanks & Regards,

Kiran

Read only

0 Likes
959

Hello K K,

as you gave me the logic , i followed that and even its working too. But the problem is after performing line selection

on table control, the push button is not getting enabled automatically but getting enabled when i press enter key or

provide any input after line selection.

well, can we use line selection button as push button ...?

Or do we have some other way to do so ?

Because i user don't want to press any key or button. push button must be enabled soon after choosing one or more record

using line selection on table control..

Is it possible ?

with best regards.

Praveen

Read only

0 Likes
959

Because i user don't want to press any key or button. push button must be enabled soon after choosing one or more record

using line selection on table control..

Is it possible ?

No, you must trigger a roundtrip to refresh the screen display. Selecting a table control line does not do that. The program itself doesn't even know which line is selected until a roundtrip is triggered. Why don't you double-click to edit or keep the button enabled and message the user if it's clicked without selecting a row?

Read only

0 Likes
959

Hi.,

In Web Dynpro ABAP it is possible., we have Events like OnLeadSelect for Table in WDA., but Unfortunately there are no such events in table control in module pool. You have to press any button or Enter Key to trigger the event or to refresh.,

hope this helps u.,

Thanks & Regards

Kiran

Read only

0 Likes
959

Praveen,

As mentioned by Kiran, that is the only trigger. on lead selection event automatic recogonization is not handled in ABAP Module Pool programming. User has to press the enter button.

Thanks,

Greetson

Read only

0 Likes
959

Hi Praveen,

Its definitely possible to hide/unhide pushbutton from application toolbar, based on line selection.

Just adapt the logic from below code:



Data:gt_ucomm         TYPE TABLE OF sy-ucomm,

REFRESH gt_ucomm.
  READ TABLE gt_data INTO gs_data WITH KEY chk = 'X'.
  IF sy-subrc NE 0.
    APPEND 'T&C' TO gt_ucomm.
  ENDIF.

  SET PF-STATUS 'STATUS_9003' EXCLUDING gt_ucomm.
  SET TITLEBAR 'TITLE' WITH text-004.

Here T&C is the function code assigned to the pushbutton.

Write this logic in the module status*, in PBO module.

Hope you will be able to resolve your issue by above method.

Do appreciate if found helpful.

BR,

Vinit