‎2011 May 24 8:34 AM
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
‎2011 May 24 9:57 AM
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
‎2011 May 24 1:18 PM
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
‎2011 May 24 2:12 PM
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?
‎2011 May 24 4:55 PM
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
‎2011 May 24 5:01 PM
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
‎2011 May 27 12:15 PM
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