2006 May 10 10:35 AM
Hi,
I am working on table control. Where I have to give input and save the input into z table. My requirement is once I enter a row as input it should get changed to output mode, and rest of the rows (below the last row entered)should remain in input mode.
thanz in advance.
Hi,
I am working on table control. Where I have to give input and save the input into z table. My requirement is once I enter a row as input it should get changed to output mode, and rest of the rows (below the last row entered)should remain in input mode.
thanz in advance.
2006 May 10 10:39 AM
Hi Madan
what I understood is you want to input disable them
once you enter the data in the rows.
it is possible after entering the data if you press
enter or do any action.
I think it is possible. Pls correct me if I am wrong.
Check the code below.
In PBO.
LOOP AT dt_members WITH CONTROL tc CURSOR tc-current_line.
* Module modify Table Control
MODULE modify_screen.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Module MODIFY_SCREEN OUTPUT
*&---------------------------------------------------------------------*
* Modify screen
*----------------------------------------------------------------------*
MODULE modify_screen OUTPUT.
* Enable Table control Fields
IF tc-current_line > dg_recs AND
tc-lines > 0.
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
IN PAI
LOOP AT dt_members.
CHAIN.
FIELD : dt_members-PERNR,
dt_members-ENDDA,
dt_members-BEGDA.
* Module Check Values
MODULE check_values ON CHAIN-INPUT.
ENDCHAIN.
* Module Save changes
MODULE save_changes.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Module SAVE_CHANGES INPUT
*&---------------------------------------------------------------------*
* Save Changes
*----------------------------------------------------------------------*
MODULE save_changes INPUT.
IF NOT dt_members-pernr IS INITIAL.
MODIFY dt_members INDEX tc-current_line.
IF sy-subrc <> 0.
APPEND dt_members.
ENDIF.
ENDIF.
ENDMODULE. " SAVE_CHANGES INPUT
let me know if you want more info.
Thanks&Regards,
Siri.
Message was edited by: Srilatha T
2006 May 10 10:39 AM
In PBO section of the screen check the table control lines and then set the fields to be invisible.
in pbo:
loop at itab with <table control>....
module check.
.
.
endloop.
module check.
if not itab-field1 is initial and itab-field2 is initial.
if screen-group1 = <screen group name>.
screen-input = 0.
screen-output = 1.
modify screen.
endif.
endif.
endmodule.
Regards,
Ravi
2006 May 10 10:40 AM
hi madan,
try this...
if sy-ucomm = 'INSE'.( fn code of the button u r pressing after selecting the row).
loop at screen.
IF ( tc1-current_line <> tc1-lines ).
screen-input = 0.
else.
screen-input = 1.
modify screen.
endif.
endloop.
hope this helps,
priya.
2006 May 10 10:43 AM
Hello,
In you PBO,
LOOP AT itab WITH CONTROL table1 CURSOR TBLMORE-CURRENT_LINE.
MODULE GET_LOOPLINES.
ENDLOOP.
in the MODULE GET_LOOPLINES.
DATA : COLS LIKE LINE OF TABLE1-COLS.
if not itab is initial.
LOOP AT TABLE1-COLS INTO COLS.
COLS-SCREEN-INPUT = '1'.
MODIFY TABLE1-COLS FROM COLS INDEX SY-TABIX.
endloop.
endif.
Regards,
Naimesh
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |