'Report'에 해당되는 글 10건
- 2009.08.11 CO03 (생산오더 조회)에서 헤더 설명탭 text 가져오기 1
- 2009.08.06 진행사항 표시 ( 'SAPGUI_PROGRESS_INDICATOR' )
- 2009.04.21 z_color
- 2009.02.03 strlen / replace
- 2009.01.30 Find 1
- 2009.01.30 selection-screen 1
- 2009.01.30 Tree screen
- 2009.01.30 NUMBER RANGE
- 2009.01.29 년/월 Possible Entries 2
- 2009.01.29 READ TEXTPOOL
REPORT ZTEST_00004 .
data: gt_itab like table of caufv with header line.
data: i_caufvd LIKE caufvd.
DATA: gs_textedit_header LIKE thead,
gt_textedit_lines LIKE tline-tdline OCCURS 0.
DATA l_init_flg TYPE c.
DATA lt_tlines LIKE tline OCCURS 0 WITH HEADER LINE.
start-of-selection.
SELECT *
into corresponding fields of table gt_itab
FROM CAUFV
where AUFNR eq '000001000225'.
end-of-selection.
read table gt_itab index 1.
move-corresponding gt_itab to i_caufvd.
CALL FUNCTION 'CO_ZF_GET_TEXT_FOR_OBJECT'
EXPORTING
i_autyp = i_caufvd-autyp
i_caufvd = i_caufvd
i_init = l_init_flg
IMPORTING
e_theader = gs_textedit_header
TABLES
e_tlines = lt_tlines
EXCEPTIONS
not_found = 01.
* data: lt_text like table of TLINE with header line.
*
* CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
* TABLES
* text_stream = lt_tlines
* itf_text = lt_text.
loop at lt_tlines.
write: / lt_tlines-TDLINE.
endloop.
24% -> 100
report zrtest1003.
include zrtest1003_top.
include zrtest1003_f01.
*----------------------------------------------------------------------*
start-of-selection.
*----------------------------------------------------------------------*
select *
into corresponding fields of table gt_itab2
from ztest001.
clear: gt_itab[], gt_itab.
loop at gt_itab2.
do 1000 times.
move-corresponding gt_itab2 to gt_itab.
append gt_itab.
enddo.
endloop.
*----------------------------------------------------------------------*
end-of-selection.
*----------------------------------------------------------------------*
data: l_total type i.
describe table gt_itab lines l_total.
loop at gt_itab.
l_totcnt = l_totcnt + 1.
l_totcnt2 = l_totcnt mod 10.
if l_totcnt2 = 0.
g_rate = sy-tabix / l_total * 100.
perform display_rate.
endif.
endloop.
write: 'End'.
*&---------------------------------------------------------------------* *& Include ZRTEST1003_TOP *&---------------------------------------------------------------------* data: gt_itab like table of ztest001 with header line, gt_itab2 like table of ztest001 with header line. data: l_totcnt type i, l_totcnt2 type i, g_rate(3).
*&---------------------------------------------------------------------* *& Include ZRTEST1003_F01 *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Form DISPLAY_RATE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* form display_rate . data: l_text(50). concatenate g_rate '%' '### ->' gt_itab-aaa into l_text separated by space. call function 'SAPGUI_PROGRESS_INDICATOR' "Progress Bar exporting percentage = g_rate "####-###(%) text = l_text "Prograss bar ### exceptions others = 1. endform. " DISPLAY_RATE
*&---------------------------------------------------------------------* *& Report Y_COLOR *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* include y_color_top. " global Data include y_color_f01. " FORM-Routines START-OF-SELECTION. CLEAR : gt_color. PERFORM color USING 'C100'. PERFORM color USING 'C101'. PERFORM color USING 'C110'. PERFORM color USING 'C200'. PERFORM color USING 'C201'. PERFORM color USING 'C210'. PERFORM color USING 'C300'. PERFORM color USING 'C301'. PERFORM color USING 'C310'. PERFORM color USING 'C400'. PERFORM color USING 'C401'. PERFORM color USING 'C410'. PERFORM color USING 'C500'. PERFORM color USING 'C501'. PERFORM color USING 'C510'. PERFORM color USING 'C600'. PERFORM color USING 'C601'. PERFORM color USING 'C610'. PERFORM color USING 'C700'. PERFORM color USING 'C701'. PERFORM color USING 'C710'. PERFORM color USING 'C800'. CLEAR : gt_fcat. PERFORM fcat USING '1' 'COLOR01' ' '. gs_layout-info_fieldname = 'LINE_COLOR'. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * i_callback_program = l_repid * i_callback_top_of_page = 'TOP-OF-PAGE' is_layout = gs_layout it_fieldcat = gt_fcat * it_sort = gt_sort TABLES t_outtab = gt_color EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.
*&---------------------------------------------------------------------* *& Include Y_COLOR_TOP *&---------------------------------------------------------------------* REPORT y_color. TYPE-POOLS : slis. DATA : BEGIN OF wa_color, color01(4), line_color(4) TYPE c, END OF wa_color. DATA : gt_color LIKE TABLE OF wa_color. DATA : wa_fcat TYPE slis_fieldcat_alv, gt_fcat LIKE TABLE OF wa_fcat, gs_layout TYPE slis_layout_alv.*&---------------------------------------------------------------------* *& Include Y_COLOR_F01 *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* *& Form color *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0058 text *----------------------------------------------------------------------* FORM color USING value(p_color). CLEAR : wa_color. wa_color-color01 = p_color. wa_color-line_color = p_color. APPEND wa_color TO gt_color. ENDFORM. " color *&---------------------------------------------------------------------* *& Form fcat *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0047 text * -->P_0048 text * -->P_0049 text *----------------------------------------------------------------------* form fcat using p_col p_field p_emp . CLEAR wa_fcat. wa_fcat-col_pos = p_col. wa_fcat-fieldname = p_field. wa_fcat-emphasize = p_emp. APPEND wa_fcat TO gt_fcat. endform. " fcat
data: v_text(132) type c.
data: value(50) type c value 'THIS IS TEST DATA'.
data: 20_space(20) type c value '####################'.
data: length type i.
concatenate value 20_space into v_text.
length = strlen( v_text ).
write:/ length.
while sy-subrc = 0.
replace '#' with space into v_text.
endwhile.
write:/ v_text.
find first occurrence of c_2 in i_mon-bwtar results result_tab .
if sy-subrc eq 0.
i_mon-gubun = c_2.
else.
i_mon-gubun = c_1.
endif.
"화면관련
REPORT ZEDU113.
TABLES: SFLIGHT, SSCRFIELDS.
SELECTION-SCREEN BEGIN OF BLOCK BL01 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_CCARID FOR SFLIGHT-CARRID.
SELECTION-SCREEN FUNCTION KEY 1. "펑션버튼 추가
SELECTION-SCREEN FUNCTION KEY 5.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN PUSHBUTTON /10(10) BTN "버트추가
USER-COMMAND ABCD.
SELECTION-SCREEN END OF BLOCK BL01.
SELECTION-SCREEN BEGIN OF BLOCK BL02 WITH FRAME.
PARAMETERS: TEST01(10) TYPE C MODIF ID SC1,
TEST02(10) TYPE C MODIF ID SC2,
TEST03(10) TYPE C MODIF ID SC1,
TEST04(10) TYPE C MODIF ID SC2.
SELECTION-SCREEN END OF BLOCK BL02.
AT SELECTION-SCREEN OUTPUT. "파라메터 이름 색변경
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'SC1'.
SCREEN-INTENSIFIED = '1'. "색을 준다
SCREEN-INPUT = '0'. "파라메터에 값 못넣도록
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 EQ 'SC2'.
SCREEN-INTENSIFIED = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
INITIALIZATION.
MOVE 'MY BUTTON' TO BTN. "버튼
MOVE 'MY FUN' TO SSCRFIELDS-FUNCTXT_01. "펑션버튼
MOVE 'MY FUN' TO SSCRFIELDS-FUNCTXT_05.
AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM EQ 'ABCD'.
MESSAGE S003(ZEDUOPT100) WITH '버튼 처리'.
ELSEIF SSCRFIELDS-UCOMM EQ 'FC01'.
MESSAGE S003(ZEDUOPT100) WITH '펑션 처리'.
ELSEIF SSCRFIELDS-UCOMM EQ 'FC05'.
MESSAGE S003(ZEDUOPT100) WITH '펑션 처리'.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
TOP-OF-PAGE.
*Messages
*----------------------------------------------------------
*
* Message class: ZEDUOPT100
*003 &
T-CODE : SNUM.
2. NUMBER RANGE 를 IMG처럼 만들기.
매개변수 트랜잭션을 만든다. SNUM을 사용하여 만듬.
2. NUMBER RANGE 적용 번호 따기.
FUNCTION
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = 'VH' --> 번호범위 지정시 설정.
object = 'ZSVH' --> 1번에서 지정.
importing
number = zvh10-hcbel
exceptions
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
others = 7.
3. NUMBER RANGE 조회하기. - 외부 지정인 경우 점검.
FUNCTION 'NUMBER_GET_INFO' " NUMBER RANGE 정보 읽어오기
FUNCTION 'NUMBER_CHECK' " NUMBER RANGE 점검.
Import 매개변수 값
NR_RANGE_NR MS
NUMBER SJ20050001
OBJECT ZBUNDL
SUBOBJECT
TOYEAR 2005
NUMERIC_CHECK
Export 매개변수 값
RETURNCODE X.
RETURNCODE값이 'X'이면 NUMBER RANGE가 오류이다.
*&---------------------------------------------------------------------*
*& Report ZRCYKIM107
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report zrcykim107.
data: l_datum type d.
selection-screen begin of block b1 with frame title text-001.
parameters: pa_month type fbuper obligatory default sy-datum+0(6).
selection-screen end of block b1.
*----------------------------------------------------------------------*
at selection-screen on value-request for pa_month.
*----------------------------------------------------------------------*
data: l_dyname like d020s-prog,
l_dynumb like d020s-dnum.
data: lt_dynpfields like table of dynpread with header line.
clear: lt_dynpfields[], lt_dynpfields.
l_dyname = sy-repid.
l_dynumb = sy-dynnr.
lt_dynpfields-fieldname = 'PA_MONTH'.
append lt_dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields.
if lt_dynpfields-fieldvalue is initial.
concatenate sy-datum+0(6) '01' into l_datum.
else.
concatenate lt_dynpfields-fieldvalue+0(6) '01' into l_datum.
endif.
call function 'POPUP_TO_SELECT_MONTH'
exporting
actual_month = l_datum+0(6)
importing
selected_month = pa_month
exceptions
factory_calendar_not_found = 4
holiday_calendar_not_found = 8
month_not_found = 12.
if pa_month is not initial.
clear: lt_dynpfields[], lt_dynpfields.
l_dyname = sy-repid.
l_dynumb = sy-dynnr.
lt_dynpfields-fieldname = 'PA_MONTH'.
lt_dynpfields-fieldvalue = pa_month.
append lt_dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields.
endif.
Syntax
READ TEXTPOOL prog INTO itab LANGUAGE lang.
Effect
This statement reads the text elements of the text pool of the language specified in lang and the program specified in prog from the Repository and places them into the internal table itab. The previous content of itab is deleted. If the text elements cannot be read, then the content of itab remains unchanged.
For prog, you must specify a flat character-like data object, which contains the name of the program of the text elements to be read; the name is case-independent. The internal table can have any table type and its row type must correspond to structure TEXTPOOL from the ABAP Dictionary.
For lang, you must specify a flat character-like data object, which contains a language key of up to one character, whose value must be contained in the SPRAS column of database table T002. If lang contains a blank, the behavior is undefined.
After a successful read, itab contains in the ENTRY column the texts of the text symbols, the selection texts, the list headers and the title from the program attributes. Every text element that exists for the specified language occupies one row of the internal table and is identified uniquely by the columns ID and KEY. The column LENGTH contains the length of the text element. The table below shows the possible values of the columns ID and KEY and their meaning:
ID | KEY | ENTRY |
H | 001 to 004 | List header: Column headings |
I | Text symbol identifier | Text symbol text |
R | - | Program title |
S | Name of a parameter or selection criterion | Selection text |
T | - | List Title: Titlebar |
Note
For selection texts, the actual text in ENTRY is preceded by eight blanks.
System Fields
sy-subrc | Meaning |
0 | At least one text element was read. |
4 | The program specified in |