2014 Jan 09 8:08 AM
HI Experts,
I have a requirement that i need to display hard-coded values in table control column when i execute tcode.
let's say i'm having 3 columns in my table control
Area weightage hygienescore
malt 1
brewhouse 1
unitank 3
BBT 3
Bottling 3
so here we can able to give input for hygiene column only. rest should come through coding. how to handle this in program.
please help me out in this.
Thanks in Advance
regards
satish
HI Experts,
I have a requirement that i need to display hard-coded values in table control column when i execute tcode.
let's say i'm having 3 columns in my table control
Area weightage hygienescore
malt 1
brewhouse 1
unitank 3
BBT 3
Bottling 3
so here we can able to give input for hygiene column only. rest should come through coding. how to handle this in program.
please help me out in this.
Thanks in Advance
regards
satish
2014 Jan 09 8:37 AM
Hi Satish,
In the Table control Layout mark columns as display only and it should achieve first part. FOr the second part, Write modules in PBO and should do it.
Please ask if not clear?
BR.
2014 Jan 09 9:02 AM
Set attribute of the columns as display only and append other values in internal table in PBO. Better will be to store these values in custom table so that later if some one want to change description only table change will be made no change in program
Do not hardcode.
Nabheet
2014 Jan 09 9:16 AM
Use a internal table to create a table control.
Suppose an internal table ITAB we are using to create a table contol.
In PBO add the values which you want to display when your screen run.
and also make the field like: Area weightage disable.
Only field hygienescore should enable to accept the values.
IN PAI event
when you fill value for field hygienescore , at that time modify the internal table.
I am sure it will work.
Regards
Neeraj
2014 Jan 09 9:18 AM
Hello Satish.
* First table control has to be created with attribute Input Control.
* As suggested by fellow experts, make the first two fields Output field.
* Prepare the internal table with first two column data and then Call Screen.
* In the table control, when user enters data in the third column, automatically it will be saved in the internal table.
Regards.
2014 Jan 09 9:35 AM
Dear Satish,
Please make sure that the Internal Table which you are using in the table control is already appended with the hard-coded values or you need to append the values in the PBO of the screen.
MODULE append_table.
MODULE append_table OUTPUT.
wa-area = 'Malt'.
wa-weigh = '1'.
APPEND wa to itab.
CLEAR wa.
ENDMODULE.
To prevent the user from editing the Area and Weightage colums, you can goto Properties windows -> Attributes -> Program tab -> Untick Input Field.
2014 Jan 09 9:49 AM
Hi,
Generally by using PBO event we initialize the field values. So, in the PBO of the table control we maintain one loop with our required fields. First fill the internal table with you required fields .
in the main program..
wa-area = 'Malt'.
wa-weigh = '1'.
APPEND wa to itab.
CLEAR wa.
do same for the remaing.
in the Flow logic of the screen.
under the PBO.
loop at it into wa with control ctl.
endloop.
2014 Jan 09 9:51 AM
Hi,
Check these programs
demo_dynpro_tabcont_loop
demo_dynpro_tabcont_loop_at
You will have a better idea on table controls.
Regards
Thiru.
2014 Jan 09 11:31 AM
Hi Satish,
Make the first two columns in display mode so that the user cannot enter any values.
For that use the below logic in PBO.
Loop at screen.
if screen-name eq <field_name>
screen-input = 0.
endif.
Endloop.
To hardcode the values in the module pool screen, use the below logic in PBO.
wa-area = 'Malt'.
wa-weigh = '1'.
APPEND wa to itab.
CLEAR wa.
wa-area = 'brewhouse'.
wa-weigh = '1'.
APPEND wa to itab.
CLEAR wa.
Hope this helps you.
Regards,
Riju Thomas.
2014 Jan 10 11:51 AM
Thank u guys, my issue has been resolved with the help of your suggestions.
Regards
satish
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |