안녕하세요.
ABAP 초보 개발자 입니다.ㅠㅠ
간단한거 같은데 어려운 문제에 봉착하여, 하루를 날려먹고 답답한 마음에 문의를 드립니다.
문제는 ALV에 소문자를 입력하고나서 ENTER나 Cell을 옮기면 " HANDLE_DATA_CHANGED"를 타는데
그 후에 이 입력된 소문자가 대문자로 강제변환이 되어버립니다...
여러 글을 찾아보면서 여러가지 방법을 사용해 보았습니다.
Field 카탈로그에 필드별로 lowercase = 'X' 넣기... 그리고 LAYOUT부분에 셋팅값들 수정해보기.... Table에 도메인 셋팅 확인..등
해보았는데 모두 소용이 없었습니다.ㅠㅠ
현재 CBO테이블을 만들어서 단순 데이터 입력/저장 화면을 구현하면서, CBO테이블에 필드 유형을 "CHAR"로 주고 길이를 1000정도 넣어놓은 상태이며,
전혀 도메인을 사용하지 않았습니다. (이부분이 의심되기도 합니다...)
도무지 왜이러는지 몰라 답답한 마음에 글을 적어보며,
혹시나 같은 문제로 어려움을 경험하셨거나 문제점을 아시는분은 답변 부탁드립니다.
감사합니다.
---------------------------------------------------참조 소스----------------------------------------------------------------
어느 부분인지 몰라 제가 의심되는 부분 캡쳐해봅니다...
데[이터 체인지 이벤트
FORM HANDLE_DATA_CHANGED USING
P_ER_DATA_CHANGED TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL
P_E_ONF4 TYPE CHAR01
P_E_ONF4_BEFORE TYPE CHAR01
P_E_ONF4_AFTER TYPE CHAR01
P_SENDER TYPE ANY.
DATA: LV_ERR(1).
DATA: LS_MODI TYPE LVC_S_MODI.
CLEAR: LV_ERR,
LS_MODI.
LOOP AT P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MODI.
CLEAR: LV_ERR.
CASE P_SENDER.
WHEN GV_GRID1.
READ TABLE GT_LIST INTO GS_LIST INDEX LS_MODI-ROW_ID.
IF SY-SUBRC <> 0.
CONTINUE.
ENDIF.
CASE LS_MODI-FIELDNAME.
ENDCASE.
GS_LIST-MODI_F = 'X'.
MODIFY GT_LIST FROM GS_LIST INDEX LS_MODI-ROW_ID.
ENDCASE.
MODIFY P_ER_DATA_CHANGED->MT_MOD_CELLS FROM LS_MODI.
ENDLOOP.
CALL METHOD P_ER_DATA_CHANGED->REFRESH_PROTOCOL.
CALL METHOD CL_GUI_CFW=>FLUSH.
* ALV 리프래쉬
PERFORM REFRESH_TABLE_DISP.
ENDFORM. " HANDLE_DATA_CHANGED
필드카탈로그 셋팅 FROM
FORM MODIFY_FIEDCAT1 .
DATA: LV_TEXT(100).
CLEAR: LV_TEXT,
GS_FIELDCAT1.
LOOP AT GT_FIELDCAT1 INTO GS_FIELDCAT1.
CLEAR: LV_TEXT,
GS_FIELDCAT1-KEY,
GS_FIELDCAT1-FIX_COLUMN.
if gv_mode = 'C'.
CASE GS_FIELDCAT1-FIELDNAME.
WHEN 'SAUP'.
LV_TEXT = TEXT-F02.
GS_FIELDCAT1-COL_POS = 20.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-EDIT = C_X.
* GS_FIELDCAT1-KEY = C_X.
* GS_FIELDCAT1-FIX_COLUMN = C_X.
WHEN 'WBSNO'.
LV_TEXT = TEXT-F03.
GS_FIELDCAT1-COL_POS = 30.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'PROJNM'.
LV_TEXT = TEXT-F04.
GS_FIELDCAT1-COL_POS = 40.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'ITEMNM'. "총미수금
LV_TEXT = TEXT-F05.
GS_FIELDCAT1-COL_POS = 50.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-CFIELDNAME = 'WAERS'.
WHEN 'SIZE_S'. "경고미수금
LV_TEXT = TEXT-F06.
GS_FIELDCAT1-COL_POS = 60.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-CFIELDNAME = 'WAERS'.
WHEN 'BUYER'. "통화
LV_TEXT = TEXT-F07.
GS_FIELDCAT1-COL_POS = 70.
GS_FIELDCAT1-JUST = C_C.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'EXDT'.
LV_TEXT = TEXT-F08.
GS_FIELDCAT1-COL_POS = 80.
* GS_FIELDCAT1-EDIT = C_X.
WHEN 'ETC'.
LV_TEXT = TEXT-F09.
GS_FIELDCAT1-COL_POS = 80.
* GS_FIELDCAT1-EDIT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
GS_FIELDCAT1-JUST = 'C'.
WHEN OTHERS.
GS_FIELDCAT1-NO_OUT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
ENDCASE.
else.
CASE GS_FIELDCAT1-FIELDNAME.
WHEN 'SAUP'.
LV_TEXT = TEXT-F02.
GS_FIELDCAT1-COL_POS = 20.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-KEY = C_X.
* GS_FIELDCAT1-FIX_COLUMN = C_X.
WHEN 'WBSNO'.
LV_TEXT = TEXT-F03.
GS_FIELDCAT1-COL_POS = 30.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'PROJNM'.
LV_TEXT = TEXT-F04.
GS_FIELDCAT1-COL_POS = 40.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'ITEMNM'. "총미수금
LV_TEXT = TEXT-F05.
GS_FIELDCAT1-COL_POS = 50.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-CFIELDNAME = 'WAERS'.
WHEN 'SIZE_S'. "경고미수금
LV_TEXT = TEXT-F06.
GS_FIELDCAT1-COL_POS = 60.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
* GS_FIELDCAT1-CFIELDNAME = 'WAERS'.
WHEN 'BUYER'. "통화
LV_TEXT = TEXT-F07.
GS_FIELDCAT1-COL_POS = 70.
GS_FIELDCAT1-JUST = C_C.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
WHEN 'EXDT'.
LV_TEXT = TEXT-F08.
GS_FIELDCAT1-COL_POS = 80.
* GS_FIELDCAT1-EDIT = ''.
WHEN 'ETC'.
LV_TEXT = TEXT-F09.
GS_FIELDCAT1-COL_POS = 80.
* GS_FIELDCAT1-EDIT = ''.
GS_FIELDCAT1-LOWERCASE = C_X.
GS_FIELDCAT1-JUST = 'C'.
WHEN OTHERS.
GS_FIELDCAT1-NO_OUT = C_X.
GS_FIELDCAT1-LOWERCASE = C_X.
ENDCASE.
endif.
IF LV_TEXT IS NOT INITIAL.
GS_FIELDCAT1-SCRTEXT_S
= GS_FIELDCAT1-SCRTEXT_M
= GS_FIELDCAT1-SCRTEXT_L
= GS_FIELDCAT1-COLTEXT
= GS_FIELDCAT1-REPTEXT = LV_TEXT.
ENDIF.
MODIFY GT_FIELDCAT1 FROM GS_FIELDCAT1.
ENDLOOP.
ENDFORM. " MODIFY_FIEDCAT1
위 필드카탈로그 셋팅하기전 타는 부분
FORM GET_FIELDCAT_MERGE2 TABLES PT_DATA TYPE TABLE
USING PT_FIELDCAT TYPE LVC_T_FCAT
P_NAME TYPE SLIS_TABNAME.
DATA: LV_NAME TYPE SLIS_TABNAME.
DATA: LT_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
CLEAR: LV_NAME,
PT_FIELDCAT[],
LT_FCAT[].
LV_NAME = P_NAME.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = LV_NAME
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-CPROG
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = LT_FCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'LVC_TRANSFER_FROM_SLIS'
EXPORTING
IT_FIELDCAT_ALV = LT_FCAT[]
* IT_SORT_ALV =
* IT_FILTER_ALV =
* IS_LAYOUT_ALV =
IMPORTING
ET_FIELDCAT_LVC = PT_FIELDCAT[]
* ET_SORT_LVC =
* ET_FILTER_LVC =
* ES_LAYOUT_LVC =
TABLES
IT_DATA = PT_DATA
EXCEPTIONS
IT_DATA_MISSING = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
CHANGING
CT_FIELDCAT = PT_FIELDCAT.
ENDFORM. " GET_FIELDCAT_MERGE2
ALV가 이미 만들어지고 난뒤 수정하고 다시 ALV를 재구성하는거라 ALV구성시 아래부분을 수행합니다.
FORM REFRESH_ALV USING P_GRID TYPE REF TO CL_GUI_ALV_GRID
P_FIELDCAT TYPE LVC_T_FCAT
P_LAYOCAT TYPE LVC_S_LAYO.
* 필드카탈로그
CALL METHOD P_GRID->SET_FRONTEND_FIELDCATALOG
EXPORTING
IT_FIELDCATALOG = P_FIELDCAT[].
* 레이아웃
CALL METHOD P_GRID->SET_FRONTEND_LAYOUT
EXPORTING
IS_LAYOUT = P_LAYOCAT.
GS_SCROLL-ROW = 'X'.
GS_SCROLL-COL = 'X'.
CALL METHOD P_GRID->REFRESH_TABLE_DISPLAY
EXPORTING
I_SOFT_REFRESH = ' '
IS_STABLE = GS_SCROLL.
CALL METHOD CL_GUI_CFW=>FLUSH.
ENDFORM. " REFRESH_ALV
도메인을 사용해야 합니다. lower case 속성에 체크되어 있어야 합니다.