2008 May 31 3:58 PM
Hi all,
I have 4 columns inside a table control and all of the columns and rows are in DISABLE mode. Then at the bottom of the table control i have a button . If that button is clicked, one of the column(1st row, 3rd field) alone should be changed to ENABLE MODE.. NOT the whole column, only the first row of the 3rd column alone should be changed to EDIT mode.
How to do this..
Anyone pls help me.. Its urgent..
Regards,
Shanthi
Hi all,
I have 4 columns inside a table control and all of the columns and rows are in DISABLE mode. Then at the bottom of the table control i have a button . If that button is clicked, one of the column(1st row, 3rd field) alone should be changed to ENABLE MODE.. NOT the whole column, only the first row of the 3rd column alone should be changed to EDIT mode.
How to do this..
Anyone pls help me.. Its urgent..
Regards,
Shanthi
2008 May 31 7:09 PM
Hi..
Yes thats possible but you should have unique keys in your internal table to identify the specific cell.
in my example below:
I am calling module in PBO inside loop.. endloop of table control, gw_detail is workarea of table control itab. Code is:
IF gw_detail-zz_approver EQ 'AKALE'.
PERFORM modify_screen_fields_mass.
endif.
FORM modify_screen_fields_mass .
LOOP AT SCREEN.
IF screen-name = 'APPROVAL_STATUS'.
*...make field as editable
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDFORM. " modify_screen_fields_mass
Reward points if this helps!!
thnx.
Ags.
Edited by: Agasti Kale on May 31, 2008 8:10 PM
Edited by: Agasti Kale on May 31, 2008 8:10 PM
2008 Jun 01 2:45 AM
Hi Shanti,
If you have a table control, you must have LOOP .... ENDLOOP screen flow logic loops both in your PBO as well as PAI with addition AT CONTROL in one of them.
I am also assuming that you follow best practice of transfering ok_code to another variable save_ok and clear ok_code in the PAI event. Let us assume that your button has function code 'FUN'.
In the PAI event module which is called from within the the above table loop, you should decide which line to modify (for example update a variable w_line with a decision value say 3).
Under PBO event block, within this LOOP (I am talking about the loop in the screen-flow-logic), call a module say 'MODIFY_TABCTRL_SCREEN_FIELDS'. Let the name of the table control be TABCTRL and name of the data structure is 'ZTABLE' and has fields like FIELD1, FIELD2, etc.
Also in the PAI module which is called from within loop
MODULE MODIFY_TABCTRL_SCREEN_FIELDS.
IF tabctrl-current_line = w_line.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZTABLE-FIELD3'.
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMODULE.
What we do above is modifying a specific field in a specific row (in the above case 3rd field in 3rd row).
Hope this helps.
Regards
Suresh Radhakrishnan
2008 Jun 01 1:25 PM
Hi,
I tried in the way u gave. But the ENTIRE 3rd column gets enabled. But i dont want that. Only the 1st rows 3rd column should get enabled. NOT all the ROWS in the 3rd column.
How to do this...
After entering the value in the 1st row , 3rd column and press ENTER key, the corresponding values should be fetched from the DB table and should be shown in the 1st row automatically.
How to do this also..
Regards,
Shanthi
2008 Jun 01 10:27 PM
Hi Shanthi,
I think you have missed altogether the condition <IF tabctrl-current_line = w_line.> in your module. That is why you get the entire 3rd column in all rows getting enabled. The w_line is something you have to work-out to set in the PAI module. That is you need to decide on which line you want the 3rd column to get enabled. Mind you should also have an ELSE block to disable other rows' 3rd column.
MODULE MODIFY_TABCTRL_SCREEN_FIELDS.
IF tabctrl-current_line = w_line.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZTABLE-FIELD3'.
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZTABLE-FIELD3'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP
ENDIF
ENDMODULE.
Regarding your second question of fetching from db-table after filling 3rd column:
Add the following module in your PAI event:
PROCESS AFTER INPUT.
<bla bla bla ...>
LOOP WITH CONTROL TABCTRL.
<bla bla bla. ...>
MODULE fetch_values.
ENDLOOP.
In your ABAP program define the following logic. Assuming you have declared ZTABLE with a TABLE statement in your module pool:
MODULE fetch_values.
IF ZTABLE-FIELD1 IS INITIAL AND ZTABLE-FIELD2 IS INITIAL .
SELECT SINGLE * FROM ZTABLE WHERE FIELD1 = ZTABLE-FIELD1.
ENDIF.
ENDMODULE.
Here again for all the rows where FIELD1 and FIELD2 are INITIAL the above select statement will fire.
However, the best way to do this is after LOOP WITH CONTROL..., outside the loop you have another module, where you implement the above logic looping through your internal table and filling the fields. These values will anyway picked up from your internal table back into your table control in PBO (If you had properly implemented Internal table, LOOP WITH CONTROL, Table Control fields, etc.
Hope this helps.
Regards
Suresh Radhakrishnan
Edited by: Suresh Radhakrishnan on Jun 2, 2008 7:58 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |