PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'INFO_RECORD'
MODULE info_record_change_tc_attr.
*&SPWIZARD: MODULE INFO_RECORD_CHANGE_COL_ATTR.
LOOP AT it_tab
WITH CONTROL info_record
CURSOR info_record-current_line.
MODULE screen.
MODULE info_record_get_lines.
*&SPWIZARD: MODULE INFO_RECORD_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE status_9001.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'INFO_RECORD'
LOOP AT it_tab.
CHAIN.
FIELD it_tab-sno.
FIELD it_tab-matnr.
FIELD it_tab-maktx.
FIELD it_tab-netpr.
FIELD it_tab-netpr1.
FIELD it_tab-rad.
MODULE info_record_modify ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE info_record_user_command.
*&SPWIZARD: MODULE INFO_RECORD_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE INFO_RECORD_CHANGE_COL_ATTR.
MODULE user_command_9001.
REPORT zmm_inforecord.
TABLES : eina,eine.
TYPES : BEGIN OF ty_tab,
infnr TYPE eina-infnr,
matnr TYPE eina-matnr,
maktx TYPE makt-maktx,
meins TYPE eina-meins,
urzla TYPE eina-urzla,
umrez TYPE eina-umrez,
umren TYPE eina-umren,
ekorg TYPE eine-ekorg,
esokz TYPE eine-esokz,
werks TYPE eine-werks,
netpr TYPE eine-netpr,
netpr1 TYPE eine-netpr,
rad TYPE c,
lifnr TYPE eina-lifnr,
name1 TYPE lfa1-name1,
SNO TYPE I,
END OF ty_tab.
TYPES : BEGIN OF ty_lfa1,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
END OF ty_lfa1.
TYPES : BEGIN OF ty_lifnr,
lifnr TYPE ekko-lifnr,
END OF ty_lifnr.
DATA: G_TC_9000_LINES LIKE SY-LOOPC.
DATA it_lfa1 TYPE TABLE OF ty_lfa1 WITH HEADER LINE.
DATA it_lifnr TYPE TABLE OF ty_lifnr WITH HEADER LINE.
DATA it_a018 TYPE a018-lifnr .
DATA it_eina TYPE TABLE OF eina WITH HEADER LINE.
DATA it_eine TYPE TABLE OF eine WITH HEADER LINE.
DATA it_tab TYPE TABLE OF ty_tab WITH HEADER LINE.
DATA it_makt TYPE TABLE OF makt WITH HEADER LINE.
DATA it_bdcdata TYPE TABLE OF bdcdata.
DATA wa_bdcdata TYPE bdcdata.
DATA lv_date(10).
DATA lv_name1 TYPE lfa1-name1.
DATA lv_vendor(45) TYPE c.
DATA lv_vend TYPE lfa1-lifnr.
DATA lv_ven TYPE lfa1-lifnr.
DATA dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE.
DATA : it_return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.
DATA it_ekko TYPE TABLE OF ekko WITH HEADER LINE.
DATA it_ekpo TYPE TABLE OF ekpo WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR eina-matnr.
PARAMETERS : p_lifnr TYPE eina-lifnr OBLIGATORY,
p_werks TYPE eine-werks DEFAULT 'CK01' MODIF ID bl1,
p_ekorg TYPE eine-ekorg DEFAULT 'TKPO' MODIF ID b12.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_WERKS' OR screen-name = 'P_EKORG'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_lifnr.
SELECT lifnr FROM ekko INTO TABLE it_lifnr WHERE bstyp = 'L'.
LOOP AT it_lifnr .
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
input = it_lifnr-lifnr
IMPORTING
output = it_lifnr-lifnr.
ENDLOOP.
SELECT lifnr name1 FROM lfa1 INTO TABLE it_lfa1 FOR ALL ENTRIES IN it_lifnr
WHERE lifnr = it_lifnr-lifnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'LIFNR'
* PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_LIFNR '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = it_lfa1[]
* FIELD_TAB =
return_tab = it_return_tab
* DYNPFLD_MAPPING =
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
AT SELECTION-SCREEN ON p_lifnr.
CLEAR lv_vend.
SELECT lifnr FROM ekko INTO TABLE it_lifnr WHERE bstyp = 'L'.
LOOP AT it_lifnr .
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
input = it_lifnr-lifnr
IMPORTING
output = it_lifnr-lifnr.
ENDLOOP.
SELECT lifnr name1 FROM lfa1 INTO TABLE it_lfa1 FOR ALL ENTRIES IN it_lifnr
WHERE lifnr = it_lifnr-lifnr.
READ TABLE it_lfa1 INTO lv_vend WITH KEY lifnr = p_lifnr.
IF lv_vend is INITIAL .
MESSAGE 'This Vendor Not Maintain Scheduling Agreement' TYPE 'E'.
ENDIF.
START-OF-SELECTION.
WRITE sy-datum TO lv_date.
SELECT * FROM ekko INTO TABLE it_ekko WHERE bstyp = 'L' AND lifnr = p_lifnr.
SELECT * FROM ekpo INTO TABLE it_ekpo FOR ALL ENTRIES IN it_ekko WHERE ebeln = it_ekko-ebeln.
if it_ekpo[] IS NOT INITIAL.
SELECT * FROM eina INTO TABLE it_eina FOR ALL ENTRIES IN it_ekpo WHERE matnr = it_ekpo-matnr
AND lifnr = p_lifnr AND LOEKZ <> 'X' AND matnr in s_matnr .
endif.
IF it_eina[] IS INITIAL.
MESSAGE 'No Data Found' TYPE 'E'.
ELSE.
SELECT * FROM eine INTO TABLE it_eine FOR ALL ENTRIES IN it_eina
WHERE infnr = it_eina-infnr
AND ekorg = p_ekorg
AND werks = p_werks.
SELECT * FROM makt INTO TABLE it_makt FOR ALL ENTRIES IN it_eina
WHERE matnr = it_eina-matnr.
ENDIF.
SELECT SINGLE name1 FROM lfa1 INTO lv_name1 WHERE lifnr = p_lifnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_lifnr
IMPORTING
output = p_lifnr.
CONCATENATE p_lifnr lv_name1 INTO lv_vendor SEPARATED BY ' '.
LOOP AT it_eina .
it_tab-infnr = it_eina-infnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = it_eina-matnr
IMPORTING
output = it_tab-matnr.
* shift it_eina-matnr left deleting leading ' 0 '.
* it_tab-matnr = it_eina-matnr.
it_tab-meins = it_eina-meins.
it_tab-lifnr = it_eina-lifnr.
it_tab-urzla = it_eina-urzla.
it_tab-umren = it_eina-umren.
it_tab-umrez = it_eina-umrez.
READ TABLE it_makt WITH key matnr = it_eina-matnr.
if sy-subrc = 0.
it_tab-maktx = it_makt-maktx.
endif.
LOOP AT it_eine WHERE infnr = it_eina-infnr." AND WERKS = 'CK01'.
it_tab-ekorg = it_eine-ekorg.
it_tab-esokz = it_eine-esokz.
it_tab-werks = it_eine-werks.
it_tab-netpr = it_eine-netpr.
it_tab-sno = it_tab-sno + 1.
APPEND it_tab.
ENDLOOP.
ENDLOOP.
if it_tab[] IS INITIAL.
MESSAGE 'Info record Not Created' TYPE 'S'.
ENDIF.
SORT it_tab ASCENDING BY matnr werks.
DELETE ADJACENT DUPLICATES FROM it_tab COMPARING matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_lifnr
IMPORTING
output = p_lifnr.
SELECT SINGLE lifnr FROM a018 INTO it_a018 WHERE lifnr = p_lifnr.
CALL SCREEN 9001.
MODULE status_9001 OUTPUT.
SET PF-STATUS '9001'.
SET TITLEBAR 'TITLE'.
* if IT_TAB-RAD = 'X'.
* LOOP AT SCREEN.
* IF screen-name = 'NETPR1'.
* screen-input = 0.
* MODIFY SCREEN.
* ENDIF.
* ENDLOOP.
* ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9001 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'.
LOOP AT it_tab ."WHERE rad = 'X'.
PERFORM bdc_dynpro USING 'SAPMM06I' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EINA-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EINA-LIFNR'
it_tab-lifnr.
PERFORM bdc_field USING 'EINA-MATNR'
it_tab-matnr.
PERFORM bdc_field USING 'EINE-EKORG'
it_tab-ekorg. " 'TKPO'.
PERFORM bdc_field USING 'EINE-WERKS'
it_tab-werks. " 'CK01'.
PERFORM bdc_field USING 'RM06I-NORMB'
'X'.
PERFORM bdc_dynpro USING 'SAPMM06I' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EINA-MAHN1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KO'.
* PERFORM bdc_field USING 'EINA-URZLA'
* it_tab-urzla.
* PERFORM bdc_field USING 'EINA-MEINS'
* it_tab-meins.
* PERFORM bdc_field USING 'EINA-UMREZ'
* it_tab-umrez.
* PERFORM bdc_field USING 'EINA-UMREN'
* it_tab-umren.
* if it_a018 IS NOT INITIAL.
PERFORM bdc_dynpro USING 'SAPLV14A' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VAKE-DATAB(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NEWD'.
* ENDIF.
PERFORM bdc_dynpro USING 'SAPMV13A' '0201'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-KBETR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
PERFORM bdc_field USING 'RV13A-DATAB'
lv_date.
PERFORM bdc_field USING 'RV13A-DATBI'
lv_date.
if it_tab-rad = 'X' and it_tab-netpr1 > 0..
PERFORM bdc_field USING 'KONP-KBETR(01)'
it_tab-netpr1.
ELSE.
PERFORM bdc_field USING 'KONP-KBETR(01)'
it_tab-netpr.
ENDIF.
CALL TRANSACTION 'ME12' USING it_bdcdata MODE 'E' UPDATE 'S'.
MESSAGE 'Purchase Info record Changed' TYPE 'S'.
CLEAR it_bdcdata[].
ENDLOOP.
* CLEAR it_tab-netpr.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'SELECT'. "<--select all records
LOOP AT IT_tab.
it_tab-rad = 'X'.
MODIFY IT_tab.
ENDLOOP.
WHEN 'DESEL'. "<--deselect all records
LOOP AT IT_tab.
it_tab-rad = ' '.
MODIFY IT_tab.
ENDLOOP.
when 'RAD'.
LOOP AT SCREEN.
if it_tab-rad = 'X'.
IF screen-name = 'IT_TAB-NETPR1'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
WHEN 'BACK' OR 'CANEL' OR 'EXIT'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module SCREEN OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
ENDFORM. "bdc_dynpro
* ----------------------------------------------------------------------*
* Insert field *
* ----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
* IF fval <> nodata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
SHIFT wa_bdcdata-fval LEFT DELETING LEADING space.
APPEND wa_bdcdata TO it_bdcdata.
* ENDIF.
ENDFORM.
*&SPWIZARD: DECLARATION OF TABLECONTROL 'INFO_RECORD' ITSELF
CONTROLS: info_record TYPE TABLEVIEW USING SCREEN 9001.
*&SPWIZARD: LINES OF TABLECONTROL 'INFO_RECORD'
DATA: g_info_record_lines LIKE sy-loopc.
DATA: ok_code LIKE sy-ucomm.
*&SPWIZARD: OUTPUT MODULE FOR TC 'INFO_RECORD'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE info_record_change_tc_attr OUTPUT.
DESCRIBE TABLE it_tab LINES info_record-lines.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'INFO_RECORD'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE info_record_get_lines OUTPUT.
g_info_record_lines = sy-loopc.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'INFO_RECORD'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE info_record_modify INPUT.
MODIFY it_tab
INDEX info_record-current_line.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'INFO_RECORD'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE info_record_user_command INPUT.
ok_code = sy-ucomm.
PERFORM user_ok_tc USING 'INFO_RECORD'
'IT_TAB'
' '
CHANGING ok_code.
sy-ucomm = ok_code.
ENDMODULE.
*----------------------------------------------------------------------*
* 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 <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <lines> TYPE i.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
ASSIGN (l_lines_name) TO <lines>.
*&SPWIZARD: get current line *
GET CURSOR LINE l_selline.
IF sy-subrc <> 0. " append line to table
l_selline = <tc>-lines + 1.
*&SPWIZARD: set top line *
IF l_selline > <lines>.
<tc>-top_line = l_selline - <lines> + 1 .
ELSE.
<tc>-top_line = 1.
ENDIF.
ELSE. " insert line into table
l_selline = <tc>-top_line + l_selline - 1.
l_lastline = <tc>-top_line + <lines> - 1.
ENDIF.
*&SPWIZARD: set new cursor line *
l_line = l_selline - <tc>-top_line + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <table> INDEX l_selline.
<tc>-lines = <tc>-lines + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE l_line.
ENDFORM. " FCODE_INSERT_ROW
*&---------------------------------------------------------------------*
*& 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 <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <table> LINES <tc>-lines.
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
IF <mark_field> = 'X'.
DELETE <table> INDEX syst-tabix.
IF sy-subrc = 0.
<tc>-lines = <tc>-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 TYPE i.
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 <tc> TYPE cxtab_control.
FIELD-SYMBOLS <lines> TYPE i.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_tc_lines_name.
ASSIGN (l_tc_lines_name) TO <lines>.
*&SPWIZARD: is no line filled? *
IF <tc>-lines = 0.
*&SPWIZARD: yes, ... *
l_tc_new_top_line = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
entry_act = <tc>-top_line
entry_from = 1
entry_to = <tc>-lines
last_page_full = 'X'
loops = <lines>
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 *
GET CURSOR FIELD l_tc_field_name
AREA l_tc_name.
IF syst-subrc = 0.
IF l_tc_name = p_tc_name.
*&SPWIZARD: et actual column *
SET CURSOR FIELD l_tc_field_name LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<tc>-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 <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: mark all filled lines *
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
<mark_field> = '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 <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: demark all filled lines *
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
<mark_field> = space.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*&---------------------------------------------------------------------*
*& Module STATUS_9001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE screen OUTPUT.
g_info_record_lines = SY-LOOPC.
LOOP AT SCREEN.
if it_tab-rad = 'X'.
IF screen-name = 'IT_TAB-NETPR1'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
ENDMODULE.
No comments:
Post a Comment