두말할 필요도 없다. 걍 소스만 보면 된다 ''
*--------------------------------------------------------------------*
* TYPE DEFINITIONS
*--------------------------------------------------------------------*
* Long Text
TYPES : TYS_TXTEDIT TYPE RFCLINE256_NEW.
TYPES : TYT_TXTEDIT TYPE STANDARD TABLE OF RFCLINE256_NEW.
TYPES : TYS_TLINE TYPE TLINE.
TYPES : TYT_TLINE TYPE STANDARD TABLE OF TLINE.
*--------------------------------------------------------------------*
* DATA DEFINITION
*--------------------------------------------------------------------*
*IPF_LONG_TEXT TYPE STRING. "보통 화면입력값 TEXTEDIT
DATA : IT_TLINE TYPE TYT_TLINE,
WA_TLINE TYPE TYS_TLINE.
DATA : IT_TEMP_TLINE TYPE TYT_TXTEDIT,
WA_TEMP_TLINE TYPE TYS_TXTEDIT.
DATA : WA_HEADER TYPE THEAD.
DATA : TEMP_TEXT TYPE CHAR4000,
TEMP_FUNCTION(1) TYPE C VALUE 'X',
TEMP_LONG TYPE STRING.
*--------------------------------------------------------------------*
* WRITE LONG TEXT
*--------------------------------------------------------------------*
* SAVE_DETAIL_PROBLEM.
IF IPF_LONG_TEXT IS NOT INITIAL.
CLEAR : TEMP_TEXT, WA_TLINE, IT_TLINE[], TEMP_LONG.
DO.
SPLIT IPF_LONG_TEXT AT CL_ABAP_CHAR_UTILITIES=>CR_LF "<-웹상으로 Enter
INTO TEMP_TEXT IPF_LONG_TEXT.
IF TEMP_TEXT IS NOT INITIAL.
CALL FUNCTION 'ZVIW_SPLIT_STRING_BY_COUNTING' "문자열을 132자리로 나누어서
EXPORTING "IT_TEMP_TLINE 에 담음
I_STR = TEMP_TEXT
I_LEN = 132
TABLES
O_STR = IT_TEMP_TLINE.
LOOP AT IT_TEMP_TLINE INTO WA_TEMP_TLINE. "나누어진 문자열울 새로운 테이블에 담음
MOVE WA_TEMP_TLINE-LINE TO WA_TLINE-TDLINE.
WA_TLINE-TDFORMAT = '/'. "구분자
APPEND WA_TLINE TO IT_TLINE.
ENDLOOP.
ELSE.
CLEAR WA_TLINE.
WA_TLINE-TDFORMAT = '/'.
APPEND WA_TLINE TO IT_TLINE.
ENDIF.
IF IPF_LONG_TEXT IS INITIAL.
EXIT.
ENDIF.
ENDDO.
CLEAR : WA_HEADER.
** Save Long Text
WA_HEADER-TDOBJECT = 'LTQM'. "OB
WA_HEADER-TDID = 'QMSM'. "OB ID
WA_HEADER-TDNAME = TEMP_KEY. "KEY VALUE
WA_HEADER-TDSPRAS = TEMP_LANGU. "SY-LANGU
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = WA_HEADER
IMPORTING
FUNCTION = TEMP_FUNCTION
NEWHEADER = WA_HEADER
TABLES
LINES = IT_TLINE.
CALL FUNCTION 'COMMIT_TEXT'.
COMMIT WORK.
ENDIF.
*--------------------------------------------------------------------*
* READ LONG TEXT
*--------------------------------------------------------------------*
CLEAR : IT_TLINE[], WA_TLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'LTQM' "OB ID
LANGUAGE = TEMP_LANGU "SY-LANGU
NAME = TEMP_NAME "KEY VALUE
OBJECT = 'QMSM' "OB
TABLES
LINES = IT_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
CLEAR : IPF_LONG_TEXT.
IF SY-SUBRC EQ 0.
LOOP AT IT_TLINE INTO WA_TLINE.
CONCATENATE IPF_LONG_TEXT
WA_TLINE-TDLINE
CL_ABAP_CHAR_UTILITIES=>CR_LF
INTO IPF_LONG_TEXT.
ENDLOOP.
ENDIF.
*--------------------------------------------------------------------*
FUNCTION ZVIW_SPLIT_STRING_BY_COUNTING.
*--------------------------------------------------------------------*
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_STR) TYPE CHAR4000
*" REFERENCE(I_LEN) TYPE I
*" TABLES
*" O_STR STRUCTURE RFCLINE256_NEW
*"----------------------------------------------------------------------
DATA: O_LEN TYPE I.
REFRESH : O_STR.
CLEAR : O_STR, O_LEN.
DO.
*--- if Input String doesn't exist, return
O_LEN = STRLEN( I_STR ).
IF O_LEN = 0.
EXIT.
ENDIF.
O_STR = I_STR(I_LEN). "Return Value
APPEND O_STR. CLEAR O_STR.
SHIFT I_STR BY I_LEN PLACES IN CHARACTER MODE.
ENDDO.
ENDFUNCTION.
'SAP > BSP' 카테고리의 다른 글
BSP - BSP에서의 일반적인 팝업 띄우는 소스 (0) | 2008.02.25 |
---|---|
BSP - 띄워지는 화면 최대화 (0) | 2008.02.25 |
BSP - OnManipulation (0) | 2008.02.25 |
BSP - BSP에서의 RANGE변수 (0) | 2008.02.25 |
BSP - LAYOUT MESSAGE 효과적으로 띄우기 (0) | 2008.02.25 |