2009 Jan 23 11:15 AM
Hi Guys,
I need to add CHANGE button to my table control.
Right now in dialog program I am showing table control with line count = 100.
I need to provide CHANGE button through which table control will become read only as well as if user press that button again it will go into EDIT mode.
Please provide some suggestions.
-
Thanks and Regards,
Nikhil J.
2009 Jan 23 11:42 AM
Hi,
Add two button in your Table Control
Assign a Function Code to it.
In user Command write code against the Function Code.
i.e,
Loop At Screen.
if change button is pressed.
Screen input =1.
if display button is pressed.
Screen input = 0.
Regards
Sandipan
2009 Jan 23 11:30 AM
Hi,
Go through this program: DEMO_DYNPRO_TABCONT_LOOP_AT
Hope this helps.
Regards,
Deepthi.
2009 Jan 23 11:35 AM
2009 Jan 23 11:42 AM
Hi,
Add two button in your Table Control
Assign a Function Code to it.
In user Command write code against the Function Code.
i.e,
Loop At Screen.
if change button is pressed.
Screen input =1.
if display button is pressed.
Screen input = 0.
Regards
Sandipan
2009 Jan 23 12:26 PM
Hi Nikhil,
Take a PF-Status with two buttons, one for display with function code DISPLAY and other for editing with function code EDIT.
Take the group1 of fields as 'ABC', which needs to editable when user clicks EDIT button, and read-only when user click DISPLAY button.
When user clicks display, records are read-only and if user clicks edit button, then records can be edited.
At PBO include code:-
module modify_screen.
case sy-ucomm.
when 'EDIT'.
set pf-status 'Z_PFSTAT' excluding 'EDIT'.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 1. "to make the records as editable
screen-active = 1.
endloop.
modify screen.
endif.
when 'DISPLAY'.
set pf-status 'Z_PFSTAT' excluding 'DISPLAY'.
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 0. "to make fields read-only
screen-active = 0.
endloop.
modify screen.
endif.
endcase.
endmodule.
Now when user click EDIT button the table control rows are in now editable mode and the button EDIT is excluded from the pf-status and display button is included.
On the other hand, when user clicks DISPLAY button, the records of table control are now in read-only mode and DISPLAY button is excluded and EDIT button is included in the pf-status.
This will work as per your requirement.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 23 1:08 PM
Thanks Guys... Overwhelming response
Edited by: Nikhil Jathar on Jan 23, 2009 7:16 AM