이제막 아밥을 공부하기 시작한 생왕초짜입니다..
IT쪽으로는 완전 문외한인데 책으로 혼자 공부를 시작하다보니 부족하고 이해안되는게 너무 많습니다..
너무 기초적인 질문이라고 욕하지 마시고 제발 답변 부탁드려요..
구구단이 나오게 alv grid로 짜봤는데요 헤더 부분에 제목을 넣었는데 제목이 두줄로 나오네요..
((출력 화면))
구구단
구구단
9단 입니다
9단 입니다
ㄴ요런 식으로 나오네요..
어찌해야 하나요????
DATA : BEGIN OF it_01 OCCURS 0,
aaa TYPE n,
bbb TYPE c,
ccc TYPE n,
ddd TYPE c,
eee(2) TYPE n,
END OF it_01.
TYPE-POOLS : slis.
DATA : l_pos TYPE i VALUE 0.
DATA : fieldcat TYPE slis_t_fieldcat_alv,
fieldcat_ln LIKE LINE OF fieldcat.
DATA : eventcat TYPE slis_t_event,
eventcat_ln LIKE LINE OF eventcat.
DATA: gt_top_of_page TYPE slis_t_listheader.
PARAMETERS : p_gugu(1) TYPE n.
DO 9 TIMES.
it_01-aaa = p_gugu.
it_01-bbb = 'X'.
it_01-ccc = it_01-ccc + 1.
it_01-ddd = '='.
it_01-eee = it_01-aaa * it_01-ccc.
APPEND it_01.
ENDDO.
PERFORM page_header.
PERFORM build_fieldcat.
PERFORM build_eventcat.
PERFORM alv_write.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_fieldcat .
l_pos = l_pos + 1.
CLEAR fieldcat_ln.
fieldcat_ln-col_pos = l_pos.
fieldcat_ln-fieldname = 'AAA'.
fieldcat_ln-reptext_ddic = '입력단'.
fieldcat_ln-outputlen = '6'.
APPEND fieldcat_ln TO fieldcat.
l_pos = l_pos + 1.
CLEAR fieldcat_ln.
fieldcat_ln-col_pos = l_pos.
fieldcat_ln-fieldname = 'BBB'.
fieldcat_ln-reptext_ddic = ' '.
fieldcat_ln-outputlen = '1'.
APPEND fieldcat_ln TO fieldcat.
l_pos = l_pos + 1.
CLEAR fieldcat_ln.
fieldcat_ln-col_pos = l_pos.
fieldcat_ln-fieldname = 'CCC'.
fieldcat_ln-reptext_ddic = ' '.
fieldcat_ln-outputlen = '1'.
APPEND fieldcat_ln TO fieldcat.
l_pos = l_pos + 1.
CLEAR fieldcat_ln.
fieldcat_ln-col_pos = l_pos.
fieldcat_ln-fieldname = 'DDD'.
fieldcat_ln-reptext_ddic = ' '.
fieldcat_ln-outputlen = '1'.
APPEND fieldcat_ln TO fieldcat.
l_pos = l_pos + 1.
CLEAR fieldcat_ln.
fieldcat_ln-col_pos = l_pos.
fieldcat_ln-fieldname = 'EEE'.
fieldcat_ln-reptext_ddic = '결과'.
fieldcat_ln-outputlen = '4'.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " BUILD_FIELDCAT
*&---------------------------------------------------------------------*
*& Form BUILD_EVENTCAT
*&---------------------------------------------------------------------*
* EVENT 생성
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_eventcat .
eventcat_ln-name = 'TOP_OF_PAGE'.
eventcat_ln-form = 'PAGE_HEADER'.
APPEND eventcat_ln TO eventcat.
ENDFORM. " BUILD_EVENTCAT
*&---------------------------------------------------------------------*
*& Form ALV_WRITE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM alv_write .
DATA : pgm LIKE sy-repid.
pgm = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = fieldcat
i_save = 'U'
it_events = eventcat
TABLES
t_outtab = it_01
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " ALV_WRITE
*&---------------------------------------------------------------------*
*& Form PAGE_HEADER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM page_header .
DATA : ls_line TYPE slis_listheader.
CLEAR : ls_line.
ls_line-typ = 'H'.
ls_line-info = '구구단'.
APPEND ls_line TO gt_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
CONCATENATE p_gugu '단 입니다' INTO ls_line-info SEPARATED BY space.
APPEND ls_line TO gt_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_top_of_page.
ENDFORM. " PAGE_HEADER
FORM page_header .
clear : gt_top_of_page ."<---------------------------요기 추가.;;
DATA : ls_line TYPE slis_listheader.
CLEAR : ls_line.
ls_line-typ = 'H'.
ls_line-info = '구구단'.
APPEND ls_line TO gt_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
CONCATENATE p_gugu '단 입니다' INTO ls_line-info SEPARATED BY space.
APPEND ls_line TO gt_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_top_of_page.