2010 Jan 28 9:11 AM
Hi all,
Iam having the scenario where in whenever we fetch the data into a table control from another tablecontrol or internal table, the lines of data occupied by target tablecontrol should be in disabled mode ( i.e, output only mode).
Whenever user enters data manually in the lines of table control, those lines should be in the enabled mode ( so that those can be editable further).
Approach :
Initially I made the table control fields as output only. Whenever enduser clicks a pushbutton, iam adding two more lines to the table control for manual entry.
But it is not working. Whenever enduser clicks button it should add two lines and these lines should be in the enabled mode. Please give me some idea of how to set the added lines in enabled mode programmatically.
Thanks in advance
Regards
Murali Krishna Tatoju
Hi all,
Iam having the scenario where in whenever we fetch the data into a table control from another tablecontrol or internal table, the lines of data occupied by target tablecontrol should be in disabled mode ( i.e, output only mode).
Whenever user enters data manually in the lines of table control, those lines should be in the enabled mode ( so that those can be editable further).
Approach :
Initially I made the table control fields as output only. Whenever enduser clicks a pushbutton, iam adding two more lines to the table control for manual entry.
But it is not working. Whenever enduser clicks button it should add two lines and these lines should be in the enabled mode. Please give me some idea of how to set the added lines in enabled mode programmatically.
Thanks in advance
Regards
Murali Krishna Tatoju
2010 Jan 28 9:22 AM
Hi,
You want to eneable the newly added rows:
so in PAI module
make the table control new lines as editable by using tablecontrol->currentline
loop at screen
if tabctrl->currentline = ''.
field1-name = ''.
field1-input = 1.
modify screen.
repeat the above code for each of the input fields within the table control
2010 Jan 28 10:05 AM
Hi,
When i use field1-input, it is giving error saying field1 is not the structure. So, I have used itab-field1-input. Still it is unable to recognize the command input. it is saying -- " itab structure does not have field "field1-input".
Murali
2010 Jan 28 10:10 AM
2010 Jan 28 12:00 PM
Hi Radhika,
when i use this code
loop at screen.
screen-input = 0.
endloop.
in the same screen Iam having some screen fields and one table control.
it is disabling the screen fields but not the tablecontrol fields. so please consider this.
Initially iam setting the tablecontrol fields as input-enabled through layout ( this means tablecontrol fields are enabled).
after fetching the data into the tablecontrol, i want to disable the tablecontrol fields ( up to the data stored ).
please tell me how to disable the table control fields.
thanks
regards
Murali
2010 Jan 28 12:11 PM
2010 Jan 28 10:02 AM
2010 Jan 28 10:11 AM
Hi Swarna,
I want to know how to make the table control lines enabled via programmatically.
2010 Jan 28 5:55 PM
Hi Murali,
I think if ur query is like if the datafrom the table has some N lines then these N lines should be in disable mode and if the user made a new entry then it is in enable mode.
So,
1 Case.
DESCRIBE TABLE ITAB LINES line.
then PBO.
in
LOOP WITH CONTROL tabc.
MODULE dis_tab.
ENDLOOP.
MODULE DIS_TAB.
if tabc-current_line not gt line.
loop at screen.
if screen-name = 'DB/ITTABLE'.
screen-input = 0.
modify screen.
endloop.
else.
loop at screen.
if screen-name = 'DB/IT table'.
screen-input = 1.
modify screen.
endloop.
endif.
endmodule.
-Anmol
2010 Jan 29 6:17 AM
Hi Anmol,
Thanks for your views. I have used the code suggested by you.
if not tbc1000-current_line gt line.
LOOP AT SCREEN.
IF screen-name = 'xekpo3'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'xekpo3'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
But it is not working.
thanks,
Murali
2010 Jan 29 7:50 AM
Hi Murali,
Try this code,
DATA: wa_cols TYPE cxtab_column.
loop at TC_RATE_CARD-cols into wa_cols. "TC_RATE_CARD - Name of the Table Control.
wa_cols-SCREEN-INPUT = 0.
modify TC_RATE_CARD-cols from wa_cols.
endloop.
ENDIF.
additionally for your requirement to enable new rows use this code,
PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL tc.
MODULE modify_screen.
ENDLOOP.
MODULE STATUS_0100.
MODULE modify_screen OUTPUT.
row_count = row_count + 1.
LOOP AT SCREEN.
if row_count = 2. " For the 2nd row in the table control
screen-input = 1.
MODIFY SCREEN .
endif.
ENDLOOP.
Hope it helps you,
Regards,
Abhijit G. Borkar
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |