2012 Dec 17 10:09 AM
I have a table control req in which i have to do, when i press insert button it shud add a row in the table control at the same time above rowd shud be changed to non-edtable mode.
Pls help me on dis..
Moderator message: please do more research before posting, do not write SMS style.
Message was edited by: Thomas Zloch
2012 Dec 17 10:42 AM
Use this kind of logic inside your table control loop in pbo..
MODULE TC_2000_GET_LINES OUTPUT.
G_TC_2000_LINES = SY-LOOPC.
LOOP AT SCREEN.
IF SCREEN-NAME = fieldname.
IF sy-loopc <> the new_row_number.
SCREEN-INPUT = '0'.
ELSE
SCREEN-INPUT = '1'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.
try searching in SDN as there are lot of posts already been there..
thanks.
2012 Dec 17 11:16 AM
i tried everything it not happening..let me check wid dis code..
2012 Dec 17 11:14 AM
Hi Kaushik,
Design the layout with function grp keys for buttons and follow write code as mentioned below.
In screen PBO and PAI.
*************************************************************************
process before output.
module status_0100.
module desc_lines.
loop at git_final into gwa_final with control tab cursor
tab-top_line.
module modify_screen. ---Refer below for module code
endloop.
process after input.
loop at git_final.
module modify_final_table.
endloop.
module user_command_0100. ---Refer below for module code
***********************
if ok_code is initial.
loop at screen.
if screen-name = 'GWA_FINAL-TEST_CODE'
or screen-name = 'GWA_FINAL-FLD_CODE'
or screen-name = 'GWA_FINAL-ITM_NO'
or screen-name = 'GWA_FINAL-DESCRP'.
screen-input = 0.
modify screen.
endif.
endloop.
elseif okcode_temp = 'INSERT'.
if tab-current_line le g_existlines."g_addline.
loop at screen.
if screen-name = 'GWA_FINAL-TEST_CODE'
or screen-name = 'GWA_FINAL-FLD_CODE'
or screen-name = 'GWA_FINAL-ITM_NO'
or screen-name = 'GWA_FINAL-DESCRP'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
****************************************
Module user_comand_100 input.
case ok_code.
when 'INSERT'.
describe table git_final lines gt_rows.
tab-lines = gt_rows + 1.
g_addline = tab-lines.
append initial line to git_final.
clear ok_code.
**************************************
Praveen Reddy M