Application Development 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: 

help regarding table control in module pool

Former Member
0 Kudos
1,298

Hi All,

I am using table control in my program to input some data and as output it displays the same entries but the rest of the rows are grayed out.

i want it to either display input enabled blank table control with no data as output. Or it should display the entries made and the rest of the rows input enabled.

please provide help <removed by moderator>

Thanks in advance,

Chandni Sharma.

Edited by: chandnisharma89 on Mar 8, 2012 9:29 PM

Edited by: Thomas Zloch on Mar 8, 2012 10:10 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
563

check this:

table control default no of lines are 10.

in order to enble the table control lines u need to set the lines component of structure table control say TC.

At screen Provide this logic.


process before output.
module status_001.  <-- in this module set the lines of structure TC.
process after input.
loop at i_tab.
endloop.

module get_lines_in_itab.

provide the code in corresponding modules.


module status_001 output.
tc-lines = v_lines + 30.  <---set the lines of table control 30 lines more than the lines in internal table
endmodule.

module get_lines_in_itab.
data v_lines type i.
clear v_lines.
describe table itab lines v_lines.
endmodule.

revert back if problem not solved!

8 REPLIES 8

Former Member
0 Kudos
563

I see 2 options

1) Put empty lines in your program internal table so that they will be displayed as input enabled in your table control

2) As alternative, you can use table control wizard to insert delete, add buttons for your table. In that way, if user wants to input new line, he has to click add button to add new line. Same thing to delete a line, he has to click the delete button

Dean

0 Kudos
563

Thanks Dean.

i would do that if i do not find any other option. that would definitely solve my problem but i was looking for a standard way to do this. i cannot add add and delete row buttons since my client is not in favor of that.

Former Member
0 Kudos
563

If you want to enable an entire column you have to place something like this in the PBO module


LOOP AT SCREEN.
  CASE SCREEN-FIELDNAME.
    WHEN 'YOUR_FIELD_NAME'.
      SCREEN-INPUT = 0.
    WHEN OTHERS.
  ENDCASE.
  MODIFY SCREEN.
ENDLOOP.

0 Kudos
563

Thanks fsimionatto. i think this should work but i am not able to judge how to use the case statement for my Table_control-cols-screen-name.

the name of the fields is contained in the 'name' field of structure 'screen' which is a field of 'cols' field of my table control.

0 Kudos
563

Hi,

Try this.


LOOP AT flights-cols INTO cols. " Give your own condition
  IF cols-screen-name = 'ABC'.
    cols-screen-input = '0'.
  ENDIF.
  MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.

Regards,

Danish.

0 Kudos
563

Thanks Danish, i did try this but this does not seem to solve my problem. my table control output is still grayed out except for the rows with entries.

Former Member
0 Kudos
564

check this:

table control default no of lines are 10.

in order to enble the table control lines u need to set the lines component of structure table control say TC.

At screen Provide this logic.


process before output.
module status_001.  <-- in this module set the lines of structure TC.
process after input.
loop at i_tab.
endloop.

module get_lines_in_itab.

provide the code in corresponding modules.


module status_001 output.
tc-lines = v_lines + 30.  <---set the lines of table control 30 lines more than the lines in internal table
endmodule.

module get_lines_in_itab.
data v_lines type i.
clear v_lines.
describe table itab lines v_lines.
endmodule.

revert back if problem not solved!

0 Kudos
563

Thanks watchpoint. this solved my problem. thank you so much.