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

functionality of buttons in table control

Former Member
0 Likes
577

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
551

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.

3 REPLIES 3
Read only

Former Member
0 Likes
552

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

Read only

former_member491305
Active Contributor
0 Likes
551

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.

Read only

Former Member
0 Likes
551

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