*&---------------------------------------------------------------------*
*& Include ZCOA1001_F01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form convert_lzero_in
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM convert_lzero_in CHANGING p_value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_value
IMPORTING
output = p_value.
ENDFORM. " convert_lzero_in
*&---------------------------------------------------------------------*
*& Form convert_lzero_out
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM convert_lzero_out CHANGING p_value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_value
IMPORTING
output = p_value.
ENDFORM. " convert_lzero_out
*&---------------------------------------------------------------------*
*& Form get_kstar_text
*&---------------------------------------------------------------------*
* 원가요소 텍스트
*----------------------------------------------------------------------*
FORM get_kstar_text USING p_kstar
CHANGING p_ltext.
CLEAR: p_ltext.
CHECK NOT p_kstar IS INITIAL.
SELECT SINGLE ltext INTO p_ltext
FROM csku WHERE spras = sy-langu
AND ktopl = 'DS00'
AND kstar = p_kstar.
ENDFORM. " get_kstar_text
*&---------------------------------------------------------------------*
*& Form get_cost_center_text
*&---------------------------------------------------------------------*
* 코스트 센터 텍스트
*----------------------------------------------------------------------*
FORM get_cost_center_text USING p_kokrs p_kostl p_datbi
CHANGING p_ktext.
DATA: l_ktext LIKE cskt-ktext.
CLEAR: p_ktext.
CHECK NOT p_kostl IS INITIAL.
SELECT ktext INTO l_ktext
FROM cskt WHERE spras = sy-langu
AND kokrs = p_kokrs
AND kostl = p_kostl
AND datbi >= p_datbi.
EXIT.
ENDSELECT.
IF sy-subrc EQ 0.
p_ktext = l_ktext.
ENDIF.
ENDFORM. " get_cost_center_text
*&---------------------------------------------------------------------*
*& Form prctr_text
*&---------------------------------------------------------------------*
* 손익센터 Text
*----------------------------------------------------------------------*
FORM prctr_text
USING value(kokrs) TYPE kokrs
value(prctr) TYPE prctr
value(datum) TYPE sydatum
CHANGING prctr_text TYPE ktext.
CLEAR: prctr_text.
CHECK NOT prctr IS INITIAL.
CALL FUNCTION 'KE_PROFIT_CENTER_KTEXT_GET'
EXPORTING
prctr = prctr
datum = datum
kokrs = kokrs
IMPORTING
ktext = prctr_text
EXCEPTIONS
not_found = 0.
ENDFORM. " prctr_text
*&---------------------------------------------------------------------*
*& Form prctr_grp_text
*&---------------------------------------------------------------------*
* 손익센터 그룹 텍스트
*----------------------------------------------------------------------*
FORM prctr_grp_text USING p_kokrs p_grpname
CHANGING p_descript.
DATA: l_co_area LIKE bapico_group-co_area,
l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapi1112_list,
ls_xdata TYPE bapi1112_list.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_co_area = p_kokrs.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_PROFITCENTERGRP_GETLIST'
EXPORTING
controllingareamask = l_co_area
groupnamemask = l_grpname
TABLES
grouplist = lt_xdata.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " prctr_grp_text
*&---------------------------------------------------------------------*
*& Form get_cost_grp_text
*&---------------------------------------------------------------------*
* 코스트 센터 그룹 텍스트
*----------------------------------------------------------------------*
FORM get_cost_grp_text USING p_kokrs p_grpname
CHANGING p_descript.
DATA: l_co_area LIKE bapico_group-co_area,
l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapi1112_list,
ls_xdata TYPE bapi1112_list.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_co_area = p_kokrs.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETLIST'
EXPORTING
controllingareamask = l_co_area
groupnamemask = l_grpname
TABLES
grouplist = lt_xdata.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " get_cost_grp_text
*&---------------------------------------------------------------------*
*& Form pro_check_confirm
*&---------------------------------------------------------------------*
*-. 확인 Dialog
*----------------------------------------------------------------------*
FORM pro_check_confirm USING p_val1 p_val2 p_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y' "-. Default
textline1 = p_val1 "-. 내역.
titel = p_val2 "-. Title.
start_column = 25
start_row = 6
cancel_display = gc_false
IMPORTING
answer = p_ans.
ENDFORM. " pro_check_confirm
*&---------------------------------------------------------------------*
*& Form progress_indicator
*&---------------------------------------------------------------------*
* 화면 Status bar에 상태 표시
*----------------------------------------------------------------------*
FORM progress_indicator USING p_act TYPE i
p_max TYPE i
p_text TYPE any.
DATA: l_percent TYPE p,
l_ptext(80) TYPE c.
IF p_max NE 0.
l_percent = p_act / p_max * 100.
ENDIF.
l_ptext(3) = l_percent.
l_ptext+3 = '%'.
l_ptext+6(60) = p_text.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = l_percent
text = l_ptext.
ENDFORM. " progress_indicator
*&---------------------------------------------------------------------*
*& Form GET_LAST_DATE
*&---------------------------------------------------------------------*
* 해당일 속하는 달의 마지막 날짜.
*----------------------------------------------------------------------*
* 예> 20050701 -> 20050731
*----------------------------------------------------------------------*
FORM get_last_date USING p_date.
DATA: lv_mon(6) TYPE n,
lv_day(2) TYPE n.
lv_mon = p_date(6).
CALL FUNCTION 'FIMA_END_OF_MONTH_DETERMINE'
EXPORTING
i_date = p_date
IMPORTING
* E_FLG_END_OF_MONTH =
e_days_of_month = lv_day.
CONCATENATE lv_mon lv_day INTO p_date.
ENDFORM. " GET_LAST_DATE
*&---------------------------------------------------------------------*
*& Form convert_material_unit
*&---------------------------------------------------------------------*
* 단위 환산
*----------------------------------------------------------------------*
FORM convert_material_unit USING p_matnr LIKE mara-matnr
p_in_me LIKE mara-meins
p_out_me LIKE mara-meins
p_menge LIKE ekpo-menge
p_ret_qty.
DATA: i_menge LIKE ekpo-menge.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = p_matnr
i_in_me = p_in_me
i_out_me = p_out_me
i_menge = p_menge
IMPORTING
e_menge = i_menge
EXCEPTIONS
error_in_application = 1
OTHERS = 2.
IF sy-subrc = 0.
p_ret_qty = i_menge.
ENDIF.
ENDFORM. " convert_material_unit
*&---------------------------------------------------------------------*
*& Form CUR_amt_SAP_TO_IDOC
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cur_amt_sap_to_idoc USING p_waers
p_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_IDOC'
EXPORTING
currency = p_waers
sap_amount = p_amt
IMPORTING
idoc_amount = p_amt.
ENDFORM. " CUR_amt_SAP_TO_IDOC
*&---------------------------------------------------------------------*
*& Form get_kunnr_text
*&---------------------------------------------------------------------*
* 고객 Text
*----------------------------------------------------------------------*
FORM get_kunnr_text USING p_kunnr
CHANGING p_name1.
CLEAR: p_name1.
CHECK NOT p_kunnr IS INITIAL.
SELECT SINGLE name1 INTO p_name1
FROM kna1 WHERE kunnr = p_kunnr.
ENDFORM. " get_kunnr_text
*&---------------------------------------------------------------------*
*& Form get_pernr_text
*&---------------------------------------------------------------------*
* 사원 Text
*----------------------------------------------------------------------*
FORM get_pernr_text USING p_pernr
CHANGING p_ename.
CLEAR: p_ename.
CHECK NOT p_pernr IS INITIAL.
SELECT ename INTO p_ename
FROM pa0001
WHERE pernr = p_pernr
AND begda <= sy-datum
AND endda >= sy-datum.
EXIT.
ENDSELECT.
ENDFORM. " get_pernr_text
*&---------------------------------------------------------------------*
*& Form get_domain_text
*&---------------------------------------------------------------------*
* 도메인 Text
*----------------------------------------------------------------------*
FORM get_domain_text USING p_domname
p_value
CHANGING p_text.
DATA: l_domname LIKE dd07l-domname,
l_value LIKE dd07l-domvalue_l,
l_dd07v LIKE dd07v,
lt_dd07v TYPE TABLE OF dd07v,
l_rc LIKE sy-subrc.
l_domname = p_domname.
l_value = p_value.
CLEAR: l_dd07v, l_rc.
CHECK NOT p_value IS INITIAL.
CALL FUNCTION 'DD_DOMVALUE_TEXT_GET'
EXPORTING
domname = l_domname
value = l_value
langu = sy-langu
IMPORTING
dd07v_wa = l_dd07v
rc = l_rc.
p_text = l_dd07v-ddtext.
ENDFORM. " get_domain_text
*&---------------------------------------------------------------------*
*& Form get_werks_text
*&---------------------------------------------------------------------*
* 플랜트 Text
*----------------------------------------------------------------------*
FORM get_werks_text USING p_werks
CHANGING p_name1.
CLEAR: p_name1.
CHECK NOT p_werks IS INITIAL.
SELECT SINGLE name1 INTO p_name1
FROM t001w WHERE werks = p_werks.
ENDFORM. " get_werks_text
*&---------------------------------------------------------------------*
*& Form get_matnr_text
*&---------------------------------------------------------------------*
* 자재코드 Text
*----------------------------------------------------------------------*
FORM get_matnr_text USING p_matnr
CHANGING p_maktx.
CLEAR: p_maktx.
CHECK NOT p_matnr IS INITIAL.
SELECT SINGLE maktx INTO p_maktx
FROM makt WHERE matnr = p_matnr
AND spras = sy-langu.
ENDFORM. " get_matnr_text
*&---------------------------------------------------------------------*
*& Form func_area_text
*&---------------------------------------------------------------------*
* 기능영역 Text
*----------------------------------------------------------------------*
FORM func_area_text
USING value(p_farea) TYPE fkber
CHANGING p_farea_text TYPE fkbtx.
CLEAR: p_farea_text.
CHECK NOT p_farea IS INITIAL.
SELECT SINGLE fkbtx FROM tfkbt INTO p_farea_text
WHERE spras = sy-langu
AND fkber = p_farea.
ENDFORM. " func_area_text
*&---------------------------------------------------------------------*
*& Form kosar_text
*&---------------------------------------------------------------------*
* 코스트센터 범주 Text
*----------------------------------------------------------------------*
FORM kosar_text USING value(kosar)
CHANGING kosar_text.
CLEAR: kosar_text.
CHECK NOT kosar IS INITIAL.
SELECT SINGLE ktext FROM tkt05 INTO kosar_text
WHERE spras = sy-langu
AND kosar = kosar.
ENDFORM. " kosar_text
*&---------------------------------------------------------------------*
*& Form gsber_text
*&---------------------------------------------------------------------*
* 사업영역 Text
*----------------------------------------------------------------------*
FORM gsber_text USING value(gsber)
CHANGING gsber_text.
DATA: ls_businessarea_detail LIKE bapi0003_2.
CLEAR: gsber_text.
CHECK NOT gsber IS INITIAL.
CALL FUNCTION 'BAPI_BUSINESSAREA_GETDETAIL'
EXPORTING
businessareaid = gsber
language = '3'
IMPORTING
businessarea_detail = ls_businessarea_detail
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
gsber_text = ls_businessarea_detail-bus_ar_des.
ELSE.
CLEAR gsber_text.
ENDIF.
ENDFORM. " gsber_text
*&---------------------------------------------------------------------*
*& Form khinr_text
*&---------------------------------------------------------------------*
* 표준계층구조영역 Text
*----------------------------------------------------------------------*
FORM khinr_text
USING p_kokrs
p_fieldname
p_setname
CHANGING c_text.
DATA: ld_setid LIKE sethier-setid,
ld_set_class LIKE setcls-setclass,
ld_descript TYPE settext.
CASE p_fieldname.
WHEN 'KHINR'.
ld_set_class = '0101'.
WHEN 'PHINR'.
ld_set_class = '0107'.
ENDCASE.
*-. Set-Id ermitteln
CALL FUNCTION 'G_SET_ENCRYPT_SETID'
EXPORTING
setclass = ld_set_class
shortname = p_setname
kokrs = p_kokrs
IMPORTING
setid = ld_setid.
CALL FUNCTION 'G_SET_BUF_READ'
EXPORTING
i_setid = ld_setid
IMPORTING
e_descript = ld_descript
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
c_text = ld_descript.
ELSE.
CLEAR c_text.
ENDIF.
ENDFORM. " khinr_text
*&---------------------------------------------------------------------*
*& Form hkont_text
*&---------------------------------------------------------------------*
* 계정과목 Text
*----------------------------------------------------------------------*
FORM hkont_text USING p_ktopl
p_hkont
CHANGING p_txt50.
CLEAR: p_txt50.
CHECK NOT p_hkont IS INITIAL.
SELECT SINGLE txt50 FROM skat INTO p_txt50
WHERE spras = sy-langu
AND ktopl = p_ktopl
AND saknr = p_hkont.
ENDFORM. " hkont_text
*&---------------------------------------------------------------------*
*& Form cur_amt_idoc_to_sap
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cur_amt_idoc_to_sap USING p_waers
p_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_IDOC_TO_SAP'
EXPORTING
currency = p_waers
idoc_amount = p_amt
IMPORTING
sap_amount = p_amt.
ENDFORM. " cur_amt_idoc_to_sap
*&---------------------------------------------------------------------*
*& Form get_stagr_text
*&---------------------------------------------------------------------*
* 통계주요지표 Text
*----------------------------------------------------------------------*
FORM get_stagr_text USING p_kokrs
p_stagr
CHANGING p_bezei.
CLEAR: p_bezei.
CHECK NOT p_stagr IS INITIAL.
SELECT SINGLE bezei INTO p_bezei
FROM tkt03 WHERE spras = sy-langu
AND kokrs = p_kokrs
AND stagr = p_stagr.
ENDFORM. " get_stagr_text
*&---------------------------------------------------------------------*
*& Form pro_check_confirm_2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM pro_check_confirm_2 USING p_text1 p_text2 p_title
p_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y' "-. Default
textline1 = p_text1 "-. 내역.
textline2 = p_text2 "-. 내역.
titel = p_title "-. Title.
start_column = 25
start_row = 6
cancel_display = gc_false
IMPORTING
answer = p_ans.
ENDFORM. " pro_check_confirm_2
*&---------------------------------------------------------------------*
*& Form racct_text
*&---------------------------------------------------------------------*
* G/L 계정 마스터레코드 (계정과목표: 내역)
*----------------------------------------------------------------------*
FORM racct_text USING p_ktopl
p_saknr
CHANGING p_txt20.
CLEAR: p_txt20.
CHECK NOT p_saknr IS INITIAL.
SELECT SINGLE txt20 INTO p_txt20
FROM skat WHERE spras = sy-langu
AND ktopl = p_ktopl
AND saknr = p_saknr.
ENDFORM. " racct_text
*&---------------------------------------------------------------------*
*& Form get_bklas_text
*&---------------------------------------------------------------------*
* 평가클래스 Text
*----------------------------------------------------------------------*
FORM get_bklas_text USING p_bklas
CHANGING p_bkbez.
CLEAR: p_bkbez.
CHECK NOT p_bklas IS INITIAL.
SELECT SINGLE bkbez INTO p_bkbez
FROM t025t WHERE spras = sy-langu
AND bklas = p_bklas.
ENDFORM. " get_bklas_text
*&---------------------------------------------------------------------*
*& Form get_vkgrp_text
*&---------------------------------------------------------------------*
* 지점/팀 Text
*----------------------------------------------------------------------*
FORM get_vkgrp_text USING p_vkgrp
CHANGING p_vkgrp_nm.
CLEAR: p_vkgrp_nm.
CHECK NOT p_vkgrp IS INITIAL.
SELECT SINGLE bezei INTO p_vkgrp_nm
FROM tvgrt WHERE spras = sy-langu
AND vkgrp = p_vkgrp.
ENDFORM. " get_vkgrp_text
*&---------------------------------------------------------------------*
*& Form get_vkbur_text
*&---------------------------------------------------------------------*
* 사업부 Text
*----------------------------------------------------------------------*
FORM get_vkbur_text USING p_vkbur
CHANGING p_vkbur_nm.
CLEAR: p_vkbur_nm.
CHECK NOT p_vkbur IS INITIAL.
SELECT SINGLE bezei INTO p_vkbur_nm
FROM tvkbt WHERE spras = sy-langu
AND vkbur = p_vkbur.
ENDFORM. " get_vkbur_text
*&---------------------------------------------------------------------*
*& Form get_kdgrp_text
*&---------------------------------------------------------------------*
* 본부 Text
*----------------------------------------------------------------------*
FORM get_kdgrp_text USING p_kdgrp
CHANGING p_kdgrp_nm.
CLEAR: p_kdgrp_nm.
CHECK NOT p_kdgrp IS INITIAL.
SELECT SINGLE ktext INTO p_kdgrp_nm
FROM t151t WHERE spras = sy-langu
AND kdgrp = p_kdgrp.
ENDFORM. " get_kdgrp_text
*&---------------------------------------------------------------------*
*& Form get_bzirk_text
*&---------------------------------------------------------------------*
* 사업총괄 Text
*----------------------------------------------------------------------*
FORM get_bzirk_text USING p_bzirk
CHANGING p_bzirk_nm.
CLEAR: p_bzirk_nm.
CHECK NOT p_bzirk IS INITIAL.
SELECT SINGLE bztxt INTO p_bzirk_nm
FROM t171t WHERE spras = sy-langu
AND bzirk = p_bzirk.
ENDFORM. " get_bzirk_text
*&---------------------------------------------------------------------*
*& Form get_AUART_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_auart_text USING p_auart
CHANGING p_txt.
CLEAR p_txt.
SELECT SINGLE txt INTO p_txt
FROM t003p WHERE spras = sy-langu
AND auart = p_auart.
ENDFORM. " get_AUART_text
*&---------------------------------------------------------------------*
*& Form CONV_UNIT
*&---------------------------------------------------------------------*
* 일반적인 단위환산
*----------------------------------------------------------------------*
FORM conv_unit USING p_from
p_new
p_mgv
p_rc.
CALL FUNCTION 'CF_UT_UNIT_CONVERSION'
EXPORTING
unit_new_imp = p_new
unit_old_imp = p_from
value_old_imp = p_mgv
IMPORTING
value_new_exp = p_mgv
EXCEPTIONS
overflow = 1
OTHERS = 2.
p_rc = sy-subrc.
ENDFORM. " CONV_UNIT
*&---------------------------------------------------------------------*
*& Form get_SWERKS_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_ww080_text USING p_ww080
CHANGING p_bezek.
CHECK NOT p_ww080 IS INITIAL.
SELECT SINGLE bezek INTO p_bezek
FROM t25a8 WHERE spras = sy-langu
AND ww080 = p_ww080.
ENDFORM. " get_ww080_text
*&---------------------------------------------------------------------*
*& Form get_prodh_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_prodh_text USING p_prodh
CHANGING p_vtext.
CHECK NOT p_prodh IS INITIAL.
SELECT SINGLE vtext INTO p_vtext
FROM t179t WHERE spras = sy-langu
AND prodh = p_prodh.
ENDFORM. " get_prodh_text
*&---------------------------------------------------------------------*
*& Form get_bztxt_tEXT
*&---------------------------------------------------------------------*
* 사업총괄
*----------------------------------------------------------------------*
FORM get_bztxt_text USING p_rwerks
CHANGING p_rname.
CHECK NOT p_rwerks IS INITIAL.
SELECT SINGLE bztxt INTO p_rname
FROM t171t
WHERE spras = sy-langu
AND bzirk = p_rwerks.
ENDFORM. " get_bztxt_tEXT
*&---------------------------------------------------------------------*
*& Form get_costelement_grp_text
*&---------------------------------------------------------------------*
* 원가요소 그룹 Text
*----------------------------------------------------------------------*
FORM get_costelement_grp_text USING p_ktopl TYPE ktopl
p_grpname
CHANGING p_descript.
DATA: l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapiset_hier,
ls_xdata TYPE bapiset_hier,
lt_value TYPE TABLE OF bapi1113_values.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_COSTELEMENTGRP_GETDETAIL'
EXPORTING
chartofaccounts = p_ktopl
groupname = l_grpname
TABLES
hierarchynodes = lt_xdata
hierarchyvalues = lt_value.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " get_costelement_grp_text
*&---------------------------------------------------------------------*
*& Form GET_VTWEG_TEXT
*&---------------------------------------------------------------------*
* 조직단위: 유통경로:
* -->P_VTWEG 유통경로 코드
* <--P_VTEXT 유통경로 TEXT
*----------------------------------------------------------------------*
FORM get_vtweg_text USING p_vtweg
CHANGING p_vtext.
CLEAR p_vtext.
SELECT SINGLE vtext INTO p_vtext
FROM tvtwt
WHERE spras = sy-langu
AND vtweg = p_vtweg.
ENDFORM. " GET_VTWEG_TEXT
*&---------------------------------------------------------------------*
*& Form GET_ANKT_TXK50
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_WA_XLIST03_ANLKL text
* <--P_WA_XLIST03_TXK50 text
*----------------------------------------------------------------------*
FORM get_ankt_txk50 USING p_anlkl
CHANGING p_txk50.
CLEAR p_txk50.
SELECT SINGLE txk50 INTO p_txk50
FROM ankt
WHERE spras = sy-langu
AND anlkl = p_anlkl.
ENDFORM. " GET_ANKT_TXK50
*& Include ZCOA1001_F01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form convert_lzero_in
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM convert_lzero_in CHANGING p_value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_value
IMPORTING
output = p_value.
ENDFORM. " convert_lzero_in
*&---------------------------------------------------------------------*
*& Form convert_lzero_out
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM convert_lzero_out CHANGING p_value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_value
IMPORTING
output = p_value.
ENDFORM. " convert_lzero_out
*&---------------------------------------------------------------------*
*& Form get_kstar_text
*&---------------------------------------------------------------------*
* 원가요소 텍스트
*----------------------------------------------------------------------*
FORM get_kstar_text USING p_kstar
CHANGING p_ltext.
CLEAR: p_ltext.
CHECK NOT p_kstar IS INITIAL.
SELECT SINGLE ltext INTO p_ltext
FROM csku WHERE spras = sy-langu
AND ktopl = 'DS00'
AND kstar = p_kstar.
ENDFORM. " get_kstar_text
*&---------------------------------------------------------------------*
*& Form get_cost_center_text
*&---------------------------------------------------------------------*
* 코스트 센터 텍스트
*----------------------------------------------------------------------*
FORM get_cost_center_text USING p_kokrs p_kostl p_datbi
CHANGING p_ktext.
DATA: l_ktext LIKE cskt-ktext.
CLEAR: p_ktext.
CHECK NOT p_kostl IS INITIAL.
SELECT ktext INTO l_ktext
FROM cskt WHERE spras = sy-langu
AND kokrs = p_kokrs
AND kostl = p_kostl
AND datbi >= p_datbi.
EXIT.
ENDSELECT.
IF sy-subrc EQ 0.
p_ktext = l_ktext.
ENDIF.
ENDFORM. " get_cost_center_text
*&---------------------------------------------------------------------*
*& Form prctr_text
*&---------------------------------------------------------------------*
* 손익센터 Text
*----------------------------------------------------------------------*
FORM prctr_text
USING value(kokrs) TYPE kokrs
value(prctr) TYPE prctr
value(datum) TYPE sydatum
CHANGING prctr_text TYPE ktext.
CLEAR: prctr_text.
CHECK NOT prctr IS INITIAL.
CALL FUNCTION 'KE_PROFIT_CENTER_KTEXT_GET'
EXPORTING
prctr = prctr
datum = datum
kokrs = kokrs
IMPORTING
ktext = prctr_text
EXCEPTIONS
not_found = 0.
ENDFORM. " prctr_text
*&---------------------------------------------------------------------*
*& Form prctr_grp_text
*&---------------------------------------------------------------------*
* 손익센터 그룹 텍스트
*----------------------------------------------------------------------*
FORM prctr_grp_text USING p_kokrs p_grpname
CHANGING p_descript.
DATA: l_co_area LIKE bapico_group-co_area,
l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapi1112_list,
ls_xdata TYPE bapi1112_list.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_co_area = p_kokrs.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_PROFITCENTERGRP_GETLIST'
EXPORTING
controllingareamask = l_co_area
groupnamemask = l_grpname
TABLES
grouplist = lt_xdata.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " prctr_grp_text
*&---------------------------------------------------------------------*
*& Form get_cost_grp_text
*&---------------------------------------------------------------------*
* 코스트 센터 그룹 텍스트
*----------------------------------------------------------------------*
FORM get_cost_grp_text USING p_kokrs p_grpname
CHANGING p_descript.
DATA: l_co_area LIKE bapico_group-co_area,
l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapi1112_list,
ls_xdata TYPE bapi1112_list.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_co_area = p_kokrs.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_COSTCENTERGROUP_GETLIST'
EXPORTING
controllingareamask = l_co_area
groupnamemask = l_grpname
TABLES
grouplist = lt_xdata.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " get_cost_grp_text
*&---------------------------------------------------------------------*
*& Form pro_check_confirm
*&---------------------------------------------------------------------*
*-. 확인 Dialog
*----------------------------------------------------------------------*
FORM pro_check_confirm USING p_val1 p_val2 p_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y' "-. Default
textline1 = p_val1 "-. 내역.
titel = p_val2 "-. Title.
start_column = 25
start_row = 6
cancel_display = gc_false
IMPORTING
answer = p_ans.
ENDFORM. " pro_check_confirm
*&---------------------------------------------------------------------*
*& Form progress_indicator
*&---------------------------------------------------------------------*
* 화면 Status bar에 상태 표시
*----------------------------------------------------------------------*
FORM progress_indicator USING p_act TYPE i
p_max TYPE i
p_text TYPE any.
DATA: l_percent TYPE p,
l_ptext(80) TYPE c.
IF p_max NE 0.
l_percent = p_act / p_max * 100.
ENDIF.
l_ptext(3) = l_percent.
l_ptext+3 = '%'.
l_ptext+6(60) = p_text.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = l_percent
text = l_ptext.
ENDFORM. " progress_indicator
*&---------------------------------------------------------------------*
*& Form GET_LAST_DATE
*&---------------------------------------------------------------------*
* 해당일 속하는 달의 마지막 날짜.
*----------------------------------------------------------------------*
* 예> 20050701 -> 20050731
*----------------------------------------------------------------------*
FORM get_last_date USING p_date.
DATA: lv_mon(6) TYPE n,
lv_day(2) TYPE n.
lv_mon = p_date(6).
CALL FUNCTION 'FIMA_END_OF_MONTH_DETERMINE'
EXPORTING
i_date = p_date
IMPORTING
* E_FLG_END_OF_MONTH =
e_days_of_month = lv_day.
CONCATENATE lv_mon lv_day INTO p_date.
ENDFORM. " GET_LAST_DATE
*&---------------------------------------------------------------------*
*& Form convert_material_unit
*&---------------------------------------------------------------------*
* 단위 환산
*----------------------------------------------------------------------*
FORM convert_material_unit USING p_matnr LIKE mara-matnr
p_in_me LIKE mara-meins
p_out_me LIKE mara-meins
p_menge LIKE ekpo-menge
p_ret_qty.
DATA: i_menge LIKE ekpo-menge.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = p_matnr
i_in_me = p_in_me
i_out_me = p_out_me
i_menge = p_menge
IMPORTING
e_menge = i_menge
EXCEPTIONS
error_in_application = 1
OTHERS = 2.
IF sy-subrc = 0.
p_ret_qty = i_menge.
ENDIF.
ENDFORM. " convert_material_unit
*&---------------------------------------------------------------------*
*& Form CUR_amt_SAP_TO_IDOC
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cur_amt_sap_to_idoc USING p_waers
p_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_IDOC'
EXPORTING
currency = p_waers
sap_amount = p_amt
IMPORTING
idoc_amount = p_amt.
ENDFORM. " CUR_amt_SAP_TO_IDOC
*&---------------------------------------------------------------------*
*& Form get_kunnr_text
*&---------------------------------------------------------------------*
* 고객 Text
*----------------------------------------------------------------------*
FORM get_kunnr_text USING p_kunnr
CHANGING p_name1.
CLEAR: p_name1.
CHECK NOT p_kunnr IS INITIAL.
SELECT SINGLE name1 INTO p_name1
FROM kna1 WHERE kunnr = p_kunnr.
ENDFORM. " get_kunnr_text
*&---------------------------------------------------------------------*
*& Form get_pernr_text
*&---------------------------------------------------------------------*
* 사원 Text
*----------------------------------------------------------------------*
FORM get_pernr_text USING p_pernr
CHANGING p_ename.
CLEAR: p_ename.
CHECK NOT p_pernr IS INITIAL.
SELECT ename INTO p_ename
FROM pa0001
WHERE pernr = p_pernr
AND begda <= sy-datum
AND endda >= sy-datum.
EXIT.
ENDSELECT.
ENDFORM. " get_pernr_text
*&---------------------------------------------------------------------*
*& Form get_domain_text
*&---------------------------------------------------------------------*
* 도메인 Text
*----------------------------------------------------------------------*
FORM get_domain_text USING p_domname
p_value
CHANGING p_text.
DATA: l_domname LIKE dd07l-domname,
l_value LIKE dd07l-domvalue_l,
l_dd07v LIKE dd07v,
lt_dd07v TYPE TABLE OF dd07v,
l_rc LIKE sy-subrc.
l_domname = p_domname.
l_value = p_value.
CLEAR: l_dd07v, l_rc.
CHECK NOT p_value IS INITIAL.
CALL FUNCTION 'DD_DOMVALUE_TEXT_GET'
EXPORTING
domname = l_domname
value = l_value
langu = sy-langu
IMPORTING
dd07v_wa = l_dd07v
rc = l_rc.
p_text = l_dd07v-ddtext.
ENDFORM. " get_domain_text
*&---------------------------------------------------------------------*
*& Form get_werks_text
*&---------------------------------------------------------------------*
* 플랜트 Text
*----------------------------------------------------------------------*
FORM get_werks_text USING p_werks
CHANGING p_name1.
CLEAR: p_name1.
CHECK NOT p_werks IS INITIAL.
SELECT SINGLE name1 INTO p_name1
FROM t001w WHERE werks = p_werks.
ENDFORM. " get_werks_text
*&---------------------------------------------------------------------*
*& Form get_matnr_text
*&---------------------------------------------------------------------*
* 자재코드 Text
*----------------------------------------------------------------------*
FORM get_matnr_text USING p_matnr
CHANGING p_maktx.
CLEAR: p_maktx.
CHECK NOT p_matnr IS INITIAL.
SELECT SINGLE maktx INTO p_maktx
FROM makt WHERE matnr = p_matnr
AND spras = sy-langu.
ENDFORM. " get_matnr_text
*&---------------------------------------------------------------------*
*& Form func_area_text
*&---------------------------------------------------------------------*
* 기능영역 Text
*----------------------------------------------------------------------*
FORM func_area_text
USING value(p_farea) TYPE fkber
CHANGING p_farea_text TYPE fkbtx.
CLEAR: p_farea_text.
CHECK NOT p_farea IS INITIAL.
SELECT SINGLE fkbtx FROM tfkbt INTO p_farea_text
WHERE spras = sy-langu
AND fkber = p_farea.
ENDFORM. " func_area_text
*&---------------------------------------------------------------------*
*& Form kosar_text
*&---------------------------------------------------------------------*
* 코스트센터 범주 Text
*----------------------------------------------------------------------*
FORM kosar_text USING value(kosar)
CHANGING kosar_text.
CLEAR: kosar_text.
CHECK NOT kosar IS INITIAL.
SELECT SINGLE ktext FROM tkt05 INTO kosar_text
WHERE spras = sy-langu
AND kosar = kosar.
ENDFORM. " kosar_text
*&---------------------------------------------------------------------*
*& Form gsber_text
*&---------------------------------------------------------------------*
* 사업영역 Text
*----------------------------------------------------------------------*
FORM gsber_text USING value(gsber)
CHANGING gsber_text.
DATA: ls_businessarea_detail LIKE bapi0003_2.
CLEAR: gsber_text.
CHECK NOT gsber IS INITIAL.
CALL FUNCTION 'BAPI_BUSINESSAREA_GETDETAIL'
EXPORTING
businessareaid = gsber
language = '3'
IMPORTING
businessarea_detail = ls_businessarea_detail
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
gsber_text = ls_businessarea_detail-bus_ar_des.
ELSE.
CLEAR gsber_text.
ENDIF.
ENDFORM. " gsber_text
*&---------------------------------------------------------------------*
*& Form khinr_text
*&---------------------------------------------------------------------*
* 표준계층구조영역 Text
*----------------------------------------------------------------------*
FORM khinr_text
USING p_kokrs
p_fieldname
p_setname
CHANGING c_text.
DATA: ld_setid LIKE sethier-setid,
ld_set_class LIKE setcls-setclass,
ld_descript TYPE settext.
CASE p_fieldname.
WHEN 'KHINR'.
ld_set_class = '0101'.
WHEN 'PHINR'.
ld_set_class = '0107'.
ENDCASE.
*-. Set-Id ermitteln
CALL FUNCTION 'G_SET_ENCRYPT_SETID'
EXPORTING
setclass = ld_set_class
shortname = p_setname
kokrs = p_kokrs
IMPORTING
setid = ld_setid.
CALL FUNCTION 'G_SET_BUF_READ'
EXPORTING
i_setid = ld_setid
IMPORTING
e_descript = ld_descript
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
c_text = ld_descript.
ELSE.
CLEAR c_text.
ENDIF.
ENDFORM. " khinr_text
*&---------------------------------------------------------------------*
*& Form hkont_text
*&---------------------------------------------------------------------*
* 계정과목 Text
*----------------------------------------------------------------------*
FORM hkont_text USING p_ktopl
p_hkont
CHANGING p_txt50.
CLEAR: p_txt50.
CHECK NOT p_hkont IS INITIAL.
SELECT SINGLE txt50 FROM skat INTO p_txt50
WHERE spras = sy-langu
AND ktopl = p_ktopl
AND saknr = p_hkont.
ENDFORM. " hkont_text
*&---------------------------------------------------------------------*
*& Form cur_amt_idoc_to_sap
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM cur_amt_idoc_to_sap USING p_waers
p_amt.
CALL FUNCTION 'CURRENCY_AMOUNT_IDOC_TO_SAP'
EXPORTING
currency = p_waers
idoc_amount = p_amt
IMPORTING
sap_amount = p_amt.
ENDFORM. " cur_amt_idoc_to_sap
*&---------------------------------------------------------------------*
*& Form get_stagr_text
*&---------------------------------------------------------------------*
* 통계주요지표 Text
*----------------------------------------------------------------------*
FORM get_stagr_text USING p_kokrs
p_stagr
CHANGING p_bezei.
CLEAR: p_bezei.
CHECK NOT p_stagr IS INITIAL.
SELECT SINGLE bezei INTO p_bezei
FROM tkt03 WHERE spras = sy-langu
AND kokrs = p_kokrs
AND stagr = p_stagr.
ENDFORM. " get_stagr_text
*&---------------------------------------------------------------------*
*& Form pro_check_confirm_2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM pro_check_confirm_2 USING p_text1 p_text2 p_title
p_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y' "-. Default
textline1 = p_text1 "-. 내역.
textline2 = p_text2 "-. 내역.
titel = p_title "-. Title.
start_column = 25
start_row = 6
cancel_display = gc_false
IMPORTING
answer = p_ans.
ENDFORM. " pro_check_confirm_2
*&---------------------------------------------------------------------*
*& Form racct_text
*&---------------------------------------------------------------------*
* G/L 계정 마스터레코드 (계정과목표: 내역)
*----------------------------------------------------------------------*
FORM racct_text USING p_ktopl
p_saknr
CHANGING p_txt20.
CLEAR: p_txt20.
CHECK NOT p_saknr IS INITIAL.
SELECT SINGLE txt20 INTO p_txt20
FROM skat WHERE spras = sy-langu
AND ktopl = p_ktopl
AND saknr = p_saknr.
ENDFORM. " racct_text
*&---------------------------------------------------------------------*
*& Form get_bklas_text
*&---------------------------------------------------------------------*
* 평가클래스 Text
*----------------------------------------------------------------------*
FORM get_bklas_text USING p_bklas
CHANGING p_bkbez.
CLEAR: p_bkbez.
CHECK NOT p_bklas IS INITIAL.
SELECT SINGLE bkbez INTO p_bkbez
FROM t025t WHERE spras = sy-langu
AND bklas = p_bklas.
ENDFORM. " get_bklas_text
*&---------------------------------------------------------------------*
*& Form get_vkgrp_text
*&---------------------------------------------------------------------*
* 지점/팀 Text
*----------------------------------------------------------------------*
FORM get_vkgrp_text USING p_vkgrp
CHANGING p_vkgrp_nm.
CLEAR: p_vkgrp_nm.
CHECK NOT p_vkgrp IS INITIAL.
SELECT SINGLE bezei INTO p_vkgrp_nm
FROM tvgrt WHERE spras = sy-langu
AND vkgrp = p_vkgrp.
ENDFORM. " get_vkgrp_text
*&---------------------------------------------------------------------*
*& Form get_vkbur_text
*&---------------------------------------------------------------------*
* 사업부 Text
*----------------------------------------------------------------------*
FORM get_vkbur_text USING p_vkbur
CHANGING p_vkbur_nm.
CLEAR: p_vkbur_nm.
CHECK NOT p_vkbur IS INITIAL.
SELECT SINGLE bezei INTO p_vkbur_nm
FROM tvkbt WHERE spras = sy-langu
AND vkbur = p_vkbur.
ENDFORM. " get_vkbur_text
*&---------------------------------------------------------------------*
*& Form get_kdgrp_text
*&---------------------------------------------------------------------*
* 본부 Text
*----------------------------------------------------------------------*
FORM get_kdgrp_text USING p_kdgrp
CHANGING p_kdgrp_nm.
CLEAR: p_kdgrp_nm.
CHECK NOT p_kdgrp IS INITIAL.
SELECT SINGLE ktext INTO p_kdgrp_nm
FROM t151t WHERE spras = sy-langu
AND kdgrp = p_kdgrp.
ENDFORM. " get_kdgrp_text
*&---------------------------------------------------------------------*
*& Form get_bzirk_text
*&---------------------------------------------------------------------*
* 사업총괄 Text
*----------------------------------------------------------------------*
FORM get_bzirk_text USING p_bzirk
CHANGING p_bzirk_nm.
CLEAR: p_bzirk_nm.
CHECK NOT p_bzirk IS INITIAL.
SELECT SINGLE bztxt INTO p_bzirk_nm
FROM t171t WHERE spras = sy-langu
AND bzirk = p_bzirk.
ENDFORM. " get_bzirk_text
*&---------------------------------------------------------------------*
*& Form get_AUART_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_auart_text USING p_auart
CHANGING p_txt.
CLEAR p_txt.
SELECT SINGLE txt INTO p_txt
FROM t003p WHERE spras = sy-langu
AND auart = p_auart.
ENDFORM. " get_AUART_text
*&---------------------------------------------------------------------*
*& Form CONV_UNIT
*&---------------------------------------------------------------------*
* 일반적인 단위환산
*----------------------------------------------------------------------*
FORM conv_unit USING p_from
p_new
p_mgv
p_rc.
CALL FUNCTION 'CF_UT_UNIT_CONVERSION'
EXPORTING
unit_new_imp = p_new
unit_old_imp = p_from
value_old_imp = p_mgv
IMPORTING
value_new_exp = p_mgv
EXCEPTIONS
overflow = 1
OTHERS = 2.
p_rc = sy-subrc.
ENDFORM. " CONV_UNIT
*&---------------------------------------------------------------------*
*& Form get_SWERKS_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_ww080_text USING p_ww080
CHANGING p_bezek.
CHECK NOT p_ww080 IS INITIAL.
SELECT SINGLE bezek INTO p_bezek
FROM t25a8 WHERE spras = sy-langu
AND ww080 = p_ww080.
ENDFORM. " get_ww080_text
*&---------------------------------------------------------------------*
*& Form get_prodh_text
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_prodh_text USING p_prodh
CHANGING p_vtext.
CHECK NOT p_prodh IS INITIAL.
SELECT SINGLE vtext INTO p_vtext
FROM t179t WHERE spras = sy-langu
AND prodh = p_prodh.
ENDFORM. " get_prodh_text
*&---------------------------------------------------------------------*
*& Form get_bztxt_tEXT
*&---------------------------------------------------------------------*
* 사업총괄
*----------------------------------------------------------------------*
FORM get_bztxt_text USING p_rwerks
CHANGING p_rname.
CHECK NOT p_rwerks IS INITIAL.
SELECT SINGLE bztxt INTO p_rname
FROM t171t
WHERE spras = sy-langu
AND bzirk = p_rwerks.
ENDFORM. " get_bztxt_tEXT
*&---------------------------------------------------------------------*
*& Form get_costelement_grp_text
*&---------------------------------------------------------------------*
* 원가요소 그룹 Text
*----------------------------------------------------------------------*
FORM get_costelement_grp_text USING p_ktopl TYPE ktopl
p_grpname
CHANGING p_descript.
DATA: l_grpname LIKE bapico_group-groupname,
lt_xdata TYPE TABLE OF bapiset_hier,
ls_xdata TYPE bapiset_hier,
lt_value TYPE TABLE OF bapi1113_values.
CLEAR: p_descript.
CHECK NOT p_grpname IS INITIAL.
l_grpname = p_grpname.
REFRESH lt_xdata.
CALL FUNCTION 'BAPI_COSTELEMENTGRP_GETDETAIL'
EXPORTING
chartofaccounts = p_ktopl
groupname = l_grpname
TABLES
hierarchynodes = lt_xdata
hierarchyvalues = lt_value.
READ TABLE lt_xdata INTO ls_xdata INDEX 1.
CHECK sy-subrc = 0.
p_descript = ls_xdata-descript.
ENDFORM. " get_costelement_grp_text
*&---------------------------------------------------------------------*
*& Form GET_VTWEG_TEXT
*&---------------------------------------------------------------------*
* 조직단위: 유통경로:
* -->P_VTWEG 유통경로 코드
* <--P_VTEXT 유통경로 TEXT
*----------------------------------------------------------------------*
FORM get_vtweg_text USING p_vtweg
CHANGING p_vtext.
CLEAR p_vtext.
SELECT SINGLE vtext INTO p_vtext
FROM tvtwt
WHERE spras = sy-langu
AND vtweg = p_vtweg.
ENDFORM. " GET_VTWEG_TEXT
*&---------------------------------------------------------------------*
*& Form GET_ANKT_TXK50
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_WA_XLIST03_ANLKL text
* <--P_WA_XLIST03_TXK50 text
*----------------------------------------------------------------------*
FORM get_ankt_txk50 USING p_anlkl
CHANGING p_txk50.
CLEAR p_txk50.
SELECT SINGLE txk50 INTO p_txk50
FROM ankt
WHERE spras = sy-langu
AND anlkl = p_anlkl.
ENDFORM. " GET_ANKT_TXK50
상세한 설명 감사합니다.