자료실에 처음 올리네요...
여기 저기서 짜집기 해서 되긴했네요...
cbo에 string을 이용해서 저장했습니다.
string 쓰면 좀 이거저거 안되는게 좀 있습니다.
*** CBO TABLE ZSTRING
* MANDT MANDT 3 0 Client
* ZKEY CHAR 3 0 key
* ZSTRING STRING 2000 0
* SCREEN 0100, CUSTOM CONTROL 만드시고 이름 'TEXTEDIT'
REPORT zlong_c.
TYPES : BEGIN OF it_01,
g_text(255) TYPE c ,
END OF it_01.
TYPES : BEGIN OF it_text01,
zkey TYPE zstring-zkey,
zstr1 TYPE zstring-zstring,
END OF it_text01.
DATA : itab TYPE TABLE OF it_01.
DATA : wa LIKE LINE OF itab.
DATA : ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm.
DATA : init,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.
TYPES : g_text_t(72) TYPE c OCCURS 0.
DATA : g_header LIKE thead,
g_lines TYPE tline OCCURS 0 WITH HEADER LINE,
text_table TYPE g_text_t,
modi TYPE i,
g_number(8).
PARAMETERS p_carrid TYPE sflight-carrid OBLIGATORY DEFAULT 'ab'.
*----------------------------------------------------------------------*
* START-OF-SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.
CALL SCREEN 100.
*---------------------------------------------------------------------*
* MODULE status_0100 OUTPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '1000'.
IF init IS INITIAL.
init = 'X'.
CREATE OBJECT container
EXPORTING
container_name = 'TEXTEDIT'.
CREATE OBJECT editor
EXPORTING
parent = container.
PERFORM read_text.
ENDIF.
ENDMODULE. "status_0100 OUTPUT
*---------------------------------------------------------------------*
* MODULE cancel INPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE cancel INPUT.
CALL METHOD container->free.
CALL METHOD editor->free.
LEAVE PROGRAM.
ENDMODULE. "cancel INPUT
*---------------------------------------------------------------------*
* MODULE user_command_0100 INPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SAVE'.
PERFORM save_text.
ENDCASE.
* SET SCREEN 100.
ENDMODULE. "user_command_0100 INPUT
*&---------------------------------------------------------------------*
*& Form READ_TEXT
*&---------------------------------------------------------------------*
FORM read_text .
DATA : l_lines TYPE tline.
DATA : zstr TYPE string.
SELECT SINGLE zstring INTO zstr
FROM zstring
WHERE zkey = p_carrid.
REPLACE ALL OCCURRENCES OF
cl_abap_char_utilities=>cr_lf IN zstr WITH '##'.
SPLIT zstr AT '##' INTO TABLE itab.
CALL METHOD editor->set_selected_text_as_r3table
EXPORTING
table = itab. "text_table.
CALL METHOD editor->set_selection_indexes
EXPORTING
from_index = 1
to_index = 1.
ENDFORM. " READ_TEXT
*&---------------------------------------------------------------------*
*& Form SAVE_TEXT
*&---------------------------------------------------------------------*
FORM save_text .
DATA : zstr TYPE string,
zstr1 TYPE zstring,
zcnt(10) TYPE c.
CHECK editor IS NOT INITIAL.
CLEAR : itab.
CALL METHOD editor->get_text_as_stream
IMPORTING
text = itab
is_modified = modi
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
OTHERS = 3.
IF NOT itab[] IS INITIAL.
g_lines[] = itab[].
CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
TABLES
text_stream = itab
itf_text = g_lines.
LOOP AT itab INTO wa.
CONCATENATE zstr wa-g_text INTO zstr.
ENDLOOP.
zstr1-zkey = p_carrid.
zstr1-zstring = zstr.
zcnt = STRLEN( zstr ).
CHECK zcnt < 4000.
MODIFY zstring FROM zstr1.
ENDIF.
ENDFORM. " SAVE_TEXT
*&---------------------------------------------------------------------*
*& Module EXIT INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE exit INPUT.
LEAVE TO SCREEN 0.
ENDMODULE. " EXIT INPUT
댓글 3
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
484 |
mm용어집
[13] ![]() | 서키트 | 2008.12.24 | 3200 |
» | long text cbo 적용 [3] | 비와바람 | 2008.12.24 | 4944 |
482 |
ABAP_Command 정리본
[9] ![]() | onefineday | 2008.12.28 | 3463 |
481 |
ABAP_Optimization
[2] ![]() | onefineday | 2008.12.28 | 3147 |
480 |
ABAP_Questions
[3] ![]() | onefineday | 2008.12.28 | 3271 |
479 |
Interactive_reporting_QA
[3] ![]() | onefineday | 2008.12.28 | 3042 |
478 |
Modularization+in+ABAP
[3] ![]() | onefineday | 2008.12.28 | 3715 |
477 |
SAP_R3_Enhancements
[11] ![]() | onefineday | 2008.12.28 | 3459 |
476 |
SAP View Cluster step by step
[3] ![]() | im 해성 | 2008.12.31 | 3583 |
475 |
SAP Tutor Personal Player( sim 파일 뷰어)
[1] ![]() | Wise 멘토 | 2009.01.03 | 3823 |
474 |
ABAP TUTORIAL입니다.
[22] ![]() | 지니 | 2009.01.06 | 3672 |
473 |
ABAP 교육교재-1
[44] ![]() | SNIFF | 2009.01.09 | 3424 |
472 |
ABAP 교육교재-2
[31] ![]() | SNIFF | 2009.01.09 | 3340 |
471 |
ABAP 교육교재-3
[21] ![]() | SNIFF | 2009.01.09 | 3623 |
470 |
abap 교육자료입니다.
[11] ![]() | mhkang | 2009.01.09 | 4638 |
469 |
ABAP4_프로그램_튜닝
[2] ![]() | SNIFF | 2009.01.10 | 3314 |
468 |
SQL사용권고
[2] ![]() | SNIFF | 2009.01.10 | 3448 |
467 |
Standard t-code 정리
![]() | SNIFF | 2009.01.10 | 4996 |
466 |
탐색도움말 만들기&사용하기
[5] ![]() | SNIFF | 2009.01.10 | 3950 |
465 |
ABAP for Power Users
![]() | SNIFF | 2009.01.10 | 3363 |
좋은 자료 감사합니다.