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

Fixed rows and columns in Table control

Former Member
0 Likes
1,930

Hi all,

can we create a table control with fixed rows and columns( say example 5 rows and 10 columns ) without horizontal and vertical scrolling bars. and i want 4 rows totals in the fifth row. above four rows should be editable fileds and fifth is only output fields ( total of four rows ).

i have unchecked horizontal and vertical scrolling parameters but it's not working.

kindly reply if u know the solution for the above requirement.

thanks

Hi all,

can we create a table control with fixed rows and columns( say example 5 rows and 10 columns ) without horizontal and vertical scrolling bars. and i want 4 rows totals in the fifth row. above four rows should be editable fileds and fifth is only output fields ( total of four rows ).

i have unchecked horizontal and vertical scrolling parameters but it's not working.

kindly reply if u know the solution for the above requirement.

thanks

2 REPLIES 2
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
926

Hi,

Say you have an internal table with four records containing some INT values. And in the fifth row you need to display the sum of the four fields.

Now, first you need to alter the internal table for the fifth record, that should contain the sum.

So, using the values in the above rows for the corresponding columns, calculate the sum for each column and append it to the fifth row.

Now you have internal table with five records.

What you need to do is to display the first four row as editable and the fifth row as display only.

Take the group1 for all textbox in table control as 'ABC'

Use this code:-

At screen logic:-


PROCESS BEFORE OUTPUT.
  loop with control tab_ctrl.
    module modify_screen.
  endloop.

In PBO:-


module modify_screen.
  read table itab into wa index tab_ctrl-currentline.
  if sy-subrc eq 0. "if record found
    if sy-tabix eq 5. "to disable 5 row in table control
      if screen-group1 = 'ABC'.
        loop at screen.
          screen-input = 0.  "disable for input
          screen-active = 0.
        endloop.
        modify screen.
      endif.
    endif.
  elseif sy-subrc ne 0. "if no record found then disable rest rows
    if screen-group1 = 'ABC'.
      loop at screen.
        screen-input = 0.  "disable for input
        screen-active = 0.
      endloop.
      modify screen.
    endif.
  endif.
endmodule.

Now if you have more records, the don't use sy-tabix eq 5, but instead use:-


describe itab
lines line_count.

if sy-tabix eq line_count.
  "code to disable
endif.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Edited by: Tarun Gambhir on Feb 3, 2009 12:12 PM

Read only

Former Member
0 Likes
926

PROCESS BEFORE OUTPUT.

MODULE status_1000.

LOOP WITH CONTROL tab_control.

MODULE Populate_table.

ENDLOOP.

*-- Write this Code in PBO..

MODULE status_1000 OUTPUT.

SET PF-STATUS 'ST_STAT'.

SET TITLEBAR 'T_CREATE'.

CLEAR wf_lines.

*--Number of lines of table control

tab_control-lines = 10..

ENDMODULE. " STATUS_1000 OUTPUT

rgds

Amit.