PARAMETERS: fname LIKE rlgrap-filename
DEFAULT 'D:\price_all.xls' OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = 'D:\'
IMPORTING
filename = fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
CONTROLS: tc TYPE TABLEVIEW USING SCREEN 0001.
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit,
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
DATA: BEGIN OF tabr OCCURS 0,
tdformat(2) TYPE c ,
tdline(132) TYPE c ,
END OF tabr.
CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',
editor EXPORTING parent = container.
CALL METHOD editor4->set_readonly_mode
EXPORTING
readonly_mode = editor4->true
EXCEPTIONS
OTHERS = 1.
CALL METHOD editor->set_toolbar_mode
EXPORTING
toolbar_mode = editor->false.
DESCRIBE TABLE crm LINES ctr-lines.
GET CURSOR FIELD cursorfield.
GET CURSOR LINE line2.
IF line2 > 0 .
IF cursorfield+(3) = 'CRM' .
i_tmp = ctr-current_line + line2 .
LOOP AT crm .
i_tmp = i_tmp - 1 .
IF crm-box = 'X'.
crm-box = ''.
MODIFY crm .
* CLEAR : CRM .
ENDIF.
IF i_tmp = 1 AND crm-box = ''.
crm-box = 'X'.
MODIFY crm. CLEAR crm .
ENDIF.
ENDLOOP.
ENDIF.
IF cursorfield+(3) = 'ATT' .
i_tmp = atta-current_line + line2 .
LOOP AT att .
i_tmp = i_tmp - 1 .
IF att-box = 'X'.
att-box = ''.
MODIFY att .
* CLEAR : CRM .
ENDIF.
IF i_tmp = 1 AND att-box = ''.
att-box = 'X'.
MODIFY att. CLEAR att .
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
阅读(627) | 评论(0) | 转发(0) |