‎2006 Nov 13 6:06 PM
What is the best approach to get a selected row, all fields, in a table control? I see this done in various transactions in MM but do not see how to do this in documentation.
Thanks
‎2006 Nov 13 6:47 PM
Hi Ben,
Welcome to SDN.
Please check demo program DEMO_DYNPRO_TABLE_CONTROL_1.
Hope this will help.
Regards,
Ferry Lianto
‎2006 Nov 14 2:23 AM
first you shall specify a variable(e.g:flg_sel) for table control attribute "w/SelColumn" .
second ,you shall judge whether flg_sel = 'X' in you source code ,when flg_sel ='X' ,indicate that row was selected .
‎2006 Nov 14 3:08 AM
in the screen flow logic you need something like this:
LOOP AT t_partner.
MODULE get_selected_line.
MODULE process_partner.
ENDLOOP.
PAI module get_selected_line :
MODULE get_selected_line INPUT.
only get cursor position once....as it's constant within each loop
IF sy-stepl EQ 1.
CLEAR wv_cursor_0120.
GET CURSOR LINE wv_cursor_0120.
IF wv_cursor_0120 = 0.
wv_cursor_0120 = 1.
ENDIF.
convert the relative line of the screen to the actual line number in the table
wv_absolute_line = wv_cursor_0120 + tc_partner-top_line - 1.
ENDIF.
ENDMODULE. " GET_SELECTED_LINE INPUT
module process_partner needs to be something like this:
MODULE process_partner INPUT.
only process the selected line
CHECK sy-stepl = wv_cursor_0120.
CASE ok_code.
endcase.
endmodule.
‎2006 Nov 14 3:16 AM
U will have data in internal table for the table control...Along with this u need a FLAG field in the internal table which reflects to as w/selection line in table control..Here, in table control, u can select 1 or more line items based on properties selected for TC....Once selected and on press of any key, the internal table gets triggered and based on the flag = 'X', u can do further processing.
‎2006 Nov 14 4:54 AM
Hi
Check this program-
SAPLSETB
LSETBF01
Below is the name of the perform of the above mentioned program
where u can get the code for Select all pushbutton.
FORM - Lift_Shift_Handler
When 'MARK'.
Hope this helps,
Regds,
Seema.