2007 Jul 11 6:37 AM
hi experts,
in my requirement i have displayed data in tablecontrol. now when i select a particular record and press button "EDIT' that should be in editable mode and all other records of table control should be in display mode. how would i do that.can you suggest any example.
2007 Jul 11 6:40 AM
Hi,
I will give you a way to do this one,
You can write the code in the PBO module, you need to use the LOOP AT SCREEN code. here in the PBO use the GET CURSOR to get the Cursor position and the field name so that you come to know which field you need to edit,
then write the LOOP AT SCREEN and ENDLOOP, in between this you can put the ACTIVE = 1 and DISPLAY = 0 to enable that field. for the field you need to use the field name which you got from the GET CURSOR
Regards
Sudheer
hi experts,
in my requirement i have displayed data in tablecontrol. now when i select a particular record and press button "EDIT' that should be in editable mode and all other records of table control should be in display mode. how would i do that.can you suggest any example.
2007 Jul 11 6:40 AM
Hi,
I will give you a way to do this one,
You can write the code in the PBO module, you need to use the LOOP AT SCREEN code. here in the PBO use the GET CURSOR to get the Cursor position and the field name so that you come to know which field you need to edit,
then write the LOOP AT SCREEN and ENDLOOP, in between this you can put the ACTIVE = 1 and DISPLAY = 0 to enable that field. for the field you need to use the field name which you got from the GET CURSOR
Regards
Sudheer
2007 Jul 11 6:43 AM
Hi,
Declare one flag variable and set it as 'X' when u press 'EDIT',and then in PBO,do like this.
PROCESS BEFORE OUTPUT.
MODULE tc2_change_tc_attr.
LOOP AT it_marc INTO x_marc WITH CONTROL tc2 CURSOR tc2-current_line.
MODULE tc2_get_lines.
ENDLOOP.
MODULE tc2_get_lines OUTPUT.
g_tc2_lines = sy-loopc.
IF x_marc-sel = 'X' and flag_edit = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'. -
<" Set the group name1 as G1 for all the table control fields----
>
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
2007 Jul 11 6:55 AM
Hi,
Just put some char1 fields in your table structure, change the type in attributes to 'radiobuttion' and assign a group.
Compare dynpro 8022 of program SAPLMGD2 (hope this is part of your system, too).
If you like to have the radiobuttions not in one line, but in one column, then you go better for the 'mark' column.
other option
**********************
CHeck this <b>demo program RSDEMO02</b> here you can see checkbox in table control, instead of radio button you can use checkbox.
<b>Reward points</b>
Regards
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |