*&---------------------------------------------------------------------* *& Form FCODE_DELETE_ROW * *&---------------------------------------------------------------------* FORM fcode_delete_row USING P_TC_NAME TYPE DYNFNAM P_TABLE_NAME P_MARK_NAME . *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------* DATA L_TABLE_NAME LIKE FELD-NAME. FIELD-SYMBOLS TYPE cxtab_control. FIELD-SYMBOLS
TYPESTANDARDTABLE. FIELD-SYMBOLS . FIELD-SYMBOLS . *&SPWIZARD: END OF LOCAL DATA------------------------------------------* ASSIGN (P_TC_NAME) TO. *&SPWIZARD: get the table, which belongs to the tc * CONCATENATE P_TABLE_NAME '[]'INTO L_TABLE_NAME. "table body ASSIGN (L_TABLE_NAME) TO
ASSIGNING. *&SPWIZARD: access to the component 'FLAG' of the table header * ASSIGNCOMPONENT P_MARK_NAME OFSTRUCTURETO. IF = 'X'. DELETE
INDEX SYST-TABIX. IF SY-SUBRC = 0. -LINES = -LINES - 1. ENDIF. ENDIF. ENDLOOP. ENDFORM. " FCODE_DELETE_ROW *&---------------------------------------------------------------------* *& Form COMPUTE_SCROLLING_IN_TC *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_TC_NAME name of tablecontrol * -->P_OK ok code *----------------------------------------------------------------------* FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME P_OK. *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------* DATA L_TC_NEW_TOP_LINE TYPEI. DATA L_TC_NAME LIKE FELD-NAME. DATA L_TC_LINES_NAME LIKE FELD-NAME. DATA L_TC_FIELD_NAME LIKE FELD-NAME. FIELD-SYMBOLS TYPE cxtab_control. FIELD-SYMBOLS TYPEI. *&SPWIZARD: END OF LOCAL DATA------------------------------------------* ASSIGN (P_TC_NAME) TO. *&SPWIZARD: get looplines of TableControl * CONCATENATE'G_' P_TC_NAME '_LINES'INTO L_TC_LINES_NAME. ASSIGN (L_TC_LINES_NAME) TO. *&SPWIZARD: is no line filled? * IF-LINES = 0. *&SPWIZARD: yes, ... * L_TC_NEW_TOP_LINE = 1. ELSE. *&SPWIZARD: no, ... * CALLFUNCTION'SCROLLING_IN_TABLE' EXPORTING ENTRY_ACT = -TOP_LINE ENTRY_FROM = 1 ENTRY_TO = -LINES LAST_PAGE_FULL = 'X' LOOPS = OK_CODE = P_OK OVERLAPPING = 'X' IMPORTING ENTRY_NEW = L_TC_NEW_TOP_LINE EXCEPTIONS * NO_ENTRY_OR_PAGE_ACT = 01 * NO_ENTRY_TO = 02 * NO_OK_CODE_OR_PAGE_GO = 03 OTHERS = 0. ENDIF. *&SPWIZARD: get actual tc and column * GETCURSORFIELD L_TC_FIELD_NAME AREA L_TC_NAME. IF SYST-SUBRC = 0. IF L_TC_NAME = P_TC_NAME. *&SPWIZARD: et actual column * SETCURSORFIELD L_TC_FIELD_NAME LINE1. ENDIF. ENDIF. *&SPWIZARD: set the new top line * -TOP_LINE = L_TC_NEW_TOP_LINE. ENDFORM. " COMPUTE_SCROLLING_IN_TC *&---------------------------------------------------------------------* *& Form FCODE_TC_MARK_LINES *&---------------------------------------------------------------------* * marks all TableControl lines *----------------------------------------------------------------------* * -->P_TC_NAME name of tablecontrol *----------------------------------------------------------------------* FORM FCODE_TC_MARK_LINES USING P_TC_NAME P_TABLE_NAME P_MARK_NAME. *&SPWIZARD: EGIN OF LOCAL DATA-----------------------------------------* DATA L_TABLE_NAME LIKE FELD-NAME. FIELD-SYMBOLS TYPE cxtab_control. FIELD-SYMBOLS
TYPESTANDARDTABLE. FIELD-SYMBOLS . FIELD-SYMBOLS . *&SPWIZARD: END OF LOCAL DATA------------------------------------------* ASSIGN (P_TC_NAME) TO. *&SPWIZARD: get the table, which belongs to the tc * CONCATENATE P_TABLE_NAME '[]'INTO L_TABLE_NAME. "table body ASSIGN (L_TABLE_NAME) TO
. "not headerline *&SPWIZARD: mark all filled lines * LOOPAT
ASSIGNING. *&SPWIZARD: access to the component 'FLAG' of the table header * ASSIGNCOMPONENT P_MARK_NAME OFSTRUCTURETO. = 'X'. ENDLOOP. ENDFORM. "fcode_tc_mark_lines *&---------------------------------------------------------------------* *& Form FCODE_TC_DEMARK_LINES *&---------------------------------------------------------------------* * demarks all TableControl lines *----------------------------------------------------------------------* * -->P_TC_NAME name of tablecontrol *----------------------------------------------------------------------* FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME P_TABLE_NAME P_MARK_NAME . *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------* DATA L_TABLE_NAME LIKE FELD-NAME. FIELD-SYMBOLS TYPE cxtab_control. FIELD-SYMBOLS
TYPESTANDARDTABLE. FIELD-SYMBOLS . FIELD-SYMBOLS . *&SPWIZARD: END OF LOCAL DATA------------------------------------------* ASSIGN (P_TC_NAME) TO. *&SPWIZARD: get the table, which belongs to the tc * CONCATENATE P_TABLE_NAME '[]'INTO L_TABLE_NAME. "table body ASSIGN (L_TABLE_NAME) TO
. "not headerline *&SPWIZARD: demark all filled lines * LOOPAT
ASSIGNING. *&SPWIZARD: access to the component 'FLAG' of the table header * ASSIGNCOMPONENT P_MARK_NAME OFSTRUCTURETO. = SPACE. ENDLOOP. ENDFORM. "fcode_tc_mark_lines *&SPWIZARD: DECLARATION OF TABLECONTROL 'MYITEM' ITSELF CONTROLS: MYITEM TYPE TABLEVIEW USINGSCREEN0120. *&SPWIZARD: LINES OF TABLECONTROL 'MYITEM' DATA: G_MYITEM_LINES LIKE SY-LOOPC. *&SPWIZARD: OUTPUT MODULE FOR TC 'MYITEM'. DO NOT CHANGE THIS LINE! *&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR MODULE MYITEM_CHANGE_TC_ATTR OUTPUT. DESCRIBETABLE ITEM LINES MYITEM-lines. ENDMODULE. *&SPWIZARD: OUTPUT MODULE FOR TC 'MYITEM'. DO NOT CHANGE THIS LINE! *&SPWIZARD: GET LINES OF TABLECONTROL MODULE MYITEM_GET_LINES OUTPUT. G_MYITEM_LINES = SY-LOOPC. ENDMODULE. *&SPWIZARD: INPUT MODUL FOR TC 'MYITEM'. DO NOT CHANGE THIS LINE! *&SPWIZARD: MARK TABLE MODULE MYITEM_MARK INPUT. DATA: g_MYITEM_wa2 likelineof ITEM. if MYITEM-line_sel_mode = 1 and ITEM-MARK = 'X'. loopat ITEM into g_MYITEM_wa2 where MARK = 'X'. g_MYITEM_wa2-MARK = ''. modify ITEM from g_MYITEM_wa2 transporting MARK. endloop. endif. MODIFY ITEM INDEX MYITEM-CURRENT_LINE TRANSPORTING MARK. ENDMODULE. *&SPWIZARD: INPUT MODULE FOR TC 'MYITEM'. DO NOT CHANGE THIS LINE! *&SPWIZARD: PROCESS USER COMMAND MODULE MYITEM_USER_COMMAND INPUT. OK_CODE = SY-UCOMM. PERFORM USER_OK_TC USING'MYITEM' 'ITEM' 'MARK' CHANGING OK_CODE. SY-UCOMM = OK_CODE. ENDMODULE.