*& Module pool ZVVF_MM050_MRP_INDCTR *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
PROGRAM ZVVF_MM050_MRP_INDCTR .
tables :zvvf_mrp_indctr.
data : begin of IT_Data occurs 0,
w_sel(1) type c.
include structure ZVVF_MRP_INDCTR.
data : end of it_data.
data : wa_data like it_data.
data : w_sel(1) type c.
DATA : W_FLG(1) TYPE C VALUE ' '.
data : w_matnr type zvvf_mrp_indctr-matnr,
w_werks type zvvf_mrp_indctr-matnr,
w_valid_from type zvvf_mrp_indctr-valid_from,
w_valid_to(10) type c,
w_mrp_indctr type zvvf_mrp_indctr-mrp_ind.
*&spwizard: declaration of tablecontrol 'W_TABL_CTRL' itself
controls: W_TABL_CTRL type tableview using screen 0100.
*&spwizard: lines of tablecontrol 'W_TABL_CTRL'
data: g_W_TABL_CTRL_lines like sy-loopc.
data: OK_CODE like sy-ucomm.
*&spwizard: output module for tc 'W_TABL_CTRL'. do not change this line!
*&spwizard: update lines for equivalent scrollbar
module W_TABL_CTRL_change_tc_attr output.
describe table IT_DATA lines W_TABL_CTRL-lines.
endmodule. "W_TABL_CTRL_change_tc_attr OUTPUT
*&spwizard: output module for tc 'W_TABL_CTRL'. do not change this line!
*&spwizard: get lines of tablecontrol
module W_TABL_CTRL_get_lines output.
g_W_TABL_CTRL_lines = sy-loopc.
endmodule. "W_TABL_CTRL_get_lines OUTPUT
*&spwizard: input modul for tc 'W_TABL_CTRL'. do not change this line!
*&spwizard: mark table
module W_TABL_CTRL_mark input.
data: g_W_TABL_CTRL_wa2 like line of IT_DATA.
if W_TABL_CTRL-line_sel_mode = 1
and IT_DATA-W_SEL = 'X'.
loop at IT_DATA into g_W_TABL_CTRL_wa2
where W_SEL = 'X'.
g_W_TABL_CTRL_wa2-W_SEL = ''.
modify IT_DATA
from g_W_TABL_CTRL_wa2
transporting W_SEL.
endloop.
endif.
modify IT_DATA
index W_TABL_CTRL-current_line
transporting W_SEL.
endmodule. "W_TABL_CTRL_mark INPUT
*&spwizard: input module for tc 'W_TABL_CTRL'. do not change this line!
*&spwizard: process user command
module W_TABL_CTRL_user_command input.
OK_CODE = sy-ucomm.
perform user_ok_tc using 'W_TABL_CTRL'
'IT_DATA'
'W_SEL'
changing OK_CODE.
sy-ucomm = OK_CODE.
endmodule. "W_TABL_CTRL_user_command INPUT
*----------------------------------------------------------------------*
* INCLUDE TABLECONTROL_FORMS *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form USER_OK_TC *
*&---------------------------------------------------------------------*
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA: L_OK TYPE SY-UCOMM,
L_OFFSET TYPE I.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH P_OK FOR P_TC_NAME.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
L_OFFSET = STRLEN( P_TC_NAME ) + 1.
L_OK = P_OK+L_OFFSET.
*&SPWIZARD: execute general and TC specific operations *
CASE L_OK.
WHEN 'INSR'. "insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
WHEN 'DELE'. "delete row
* PERFORM FCODE_DELETE_ROW USING P_TC_NAME
* P_TABLE_NAME
* P_MARK_NAME.
* CLEAR P_OK.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
CLEAR P_OK.
* WHEN 'L--'. "total left
* PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
*
* WHEN 'L-'. "column left
* PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
*
* WHEN 'R+'. "column right
* PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
*
* WHEN 'R++'. "total right
* PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
*
WHEN 'MARK'. "mark all filled lines
PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'DMRK'. "demark all filled lines
PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
* WHEN 'SASCEND' OR
* 'SDESCEND'. "sort column
* PERFORM FCODE_SORT_TC USING P_TC_NAME
* l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*&---------------------------------------------------------------------*
*& Form FCODE_INSERT_ROW *
*&---------------------------------------------------------------------*
FORM fcode_insert_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA L_LINES_NAME LIKE FELD-NAME.
DATA L_SELLINE LIKE SY-STEPL.
DATA L_LASTLINE TYPE I.
DATA L_LINE TYPE I.
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS
FIELD-SYMBOLS
No comments:
Post a Comment