Hi All,
I am using table control in module pool program. The issue is records are getting duplicated on press of enter key.
I cannot use sy-ucomm enter and do some validation thing in my code. As the record should get update in int_tab(internal table). Otherwise ZSTR_TAB(table control)will be blank after pressing enter key.
I have gone through all the previous threads on this. Have implemented sol provided in one of threads. Now records are not getting duplicated but the next line is getting disabled. The code to avoid duplication is :
MODULE read_table_control INPUT.
data tc-lines type i.
DESCRIBE TABLE int_tab LINES tc-lines.
IF tc-lines GE control-current_line.
MODIFY int_tab FROM zstr_tab INDEX control-current_line.
ELSE.
IF gcreate_code = 'CREATE'.
zstr_tab-zemp_num = gemp_num.
INSERT zstr_tab INTO int_tab INDEX control-current_line.
ENDIF.
IF gchange_code = 'CHANGE'.
MODIFY int_tab FROM zstr_tab INDEX control-current_line.
ENDIF.
ENDIF.
ENDMODULE.
This module is in PAI. Now how to make the lines in control input enabled??
Any other sol for avoiding duplicate records on pressing enter key?
Thanks,
Seema