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

Table control in Screen

Former Member
0 Likes
2,230

Hi,

I have designed an interface like SM31 to maintain a Z-table. My requirement is that I don't want to make Key fields input-enabled until user want to insert a new record and when user clicks on button in toolbar to insert a new row in table control to enter a new record in the Z-table the new row should have key-fields input enabled but not the existing rows.

Can anybody help me out in this regard.

Regards,

Deepti

1 ACCEPTED SOLUTION
Read only

Shivaji16
Active Participant
1,195

Hi Deepti,

Go through the example program in the

ABAPDOCU .."Table_control_with_modification"-

"Report - demo_dynpro_tabcont_loop_at"

You can access the Table control columns with the

field name "cols" of the Table control.

example : controls : tab1 type tableview.

"tab1-cols" will have columns

within the cols we can use the

Screen internal table to modify the

attributes of the screen fields..

6 REPLIES 6
Read only

naimesh_patel
Active Contributor
0 Likes
1,195

Hello,

For existing records, make your fields as screen-input = 0 for primary key. Put one button on the screen, which helps you to make toggle between change and display... and The button for new will come only in the change mode

All other records, do like screen-input = 1. (when new rows are begin inserted )

Regards,

Naimesh

Read only

Shivaji16
Active Participant
1,196

Hi Deepti,

Go through the example program in the

ABAPDOCU .."Table_control_with_modification"-

"Report - demo_dynpro_tabcont_loop_at"

You can access the Table control columns with the

field name "cols" of the Table control.

example : controls : tab1 type tableview.

"tab1-cols" will have columns

within the cols we can use the

Screen internal table to modify the

attributes of the screen fields..

Read only

Former Member
0 Likes
1,195

Hi,

I have gone thru that program already. My requirement is that I want to keep Key Fields input-disabled for existing records and input-enabled to insert new record.

For eg. if there are 10 lines in table control and I insert an 11th line then only 11th line should have key fields as input-enabled and not the existing 10 rows. I am not able to modify screen attributes only for the new line without affecting the existing ones.

Deepti

Read only

Shivaji16
Active Participant
0 Likes
1,195

Kindly check if you have hardcoded any checkboxes for the key field's screen attributes on the properties dialog box.

ex: output only...or input disabled..such things..

Read only

Former Member
0 Likes
1,195

Hai,

First assign a screen group to the columns which are to be input disabled initially and in PBO have a flag set and input disable them using screen attributes. When a new entry is made, reset the flag and enable the fields with reference to the screen group.

You can enable/disable the entire column, row, particular cell of a table control using the screen groups.

Read only

Former Member
0 Likes
1,195

Hi Deepti,

In your table control PBO module you need the following code. Loop at the screen. If the field name is a key field and the key field has a value, then make the field non-input enable. If it is a key field and the key field has no value, then make the field input enabled.

Then in your PAI module you need code to append a blank line to your internal table for the new input enable row.

<u><b>SCREEN FLOW</b></u>

Process Before Output.

loop at control xyz.

module process-control-xyz

endloop.

******************************************************

MODULE PROCES-CONTROL-XYZ.

read table itab index xyz-current_line.

if sy-subrc = 0.

loop at screen.

if screen-name = 'ITAB-KEY_FIELD'.

and not itab-key_field is initial.

screen-input = 0.

else.

screen-input = 1.

endif.

endloop.

else.

exit from step-loop.

endif.

ENDMODULE.

Hope this helps,

Jerrod