Webdynpro 1
Webdynpro 1
Webdynpro 1
lo_importing->get_attribute(
EXPORTING
name = `ZOPMODE`
IMPORTING
value = lv_zopmode ).
lo_importing->get_attribute(
EXPORTING
name = `N_ADVANCE`
IMPORTING
value = lv_n_advance ).
lo_importing->get_attribute(
EXPORTING
name = `COMMENTS`
IMPORTING
value = lv_COMMENTS ).
ENDMETHOD.
FUNCTION zhressf_travel_rquest_approve.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(WORKITEM_ID) TYPE SWR_STRUCT-WORKITEMID
*" REFERENCE(ZOPMODE) TYPE ZOPMODE
*" REFERENCE(N_ADVANCE) TYPE PTRV_SUM_ADVANC OPTIONAL
*" REFERENCE(COMMENTS) TYPE CHAR255 OPTIONAL
*" EXPORTING
*" VALUE(PERNR) TYPE PERNR_D
*" VALUE(ENAME) TYPE EMNAM
*" VALUE(TRIPNO) TYPE REINR
*" VALUE(BEGDA) TYPE BEGDA
*" VALUE(ENDDA) TYPE ENDDA
*" VALUE(REASON) TYPE RKUNDE
*" VALUE(LOCATION) TYPE RZIELORT
*" VALUE(COUNTRY) LIKE T706O-TEXT25
*" VALUE(ADVANCE) TYPE PTRV_SUM_ADVANC
*" VALUE(CURRENCY) TYPE WAERS
*" VALUE(ADD_DEST) TYPE ZHRESS_ADD_DEST
*" VALUE(FLAG) TYPE CHAR1
*" VALUE(TRIP_HISTORY) TYPE ZTEMP_TRIP_HISTORY
*" VALUE(HIDE_FLAG) TYPE WDUI_VISIBILITY
*" VALUE(REQUEST_EXPENSE) TYPE CHAR1
*" VALUE(EXPENSE_DETAIL) TYPE ZTRAV_EXP_TAB
*"----------------------------------------------------------------------
TABLES : pcl1.
* history of trip
DATA: BEGIN OF aend OCCURS 10. "Tabelle Status/Änderer
INCLUDE STRUCTURE ptk11.
DATA: END OF aend.
* status of trip
DATA: BEGIN OF statu . "Status der Reise
INCLUDE STRUCTURE ptk12.
DATA: END OF statu.
DEFINE rp-imp-c1-te.
set extended check off. "MAWK070411
import te-version to ote-version
vsch
from database pcl1(te)
* Begin of note 980127
* id te-key.
id te-key
accepting padding
accepting truncation.
* End of note 980127
rp-imp-te-subrc = sy-subrc.
set extended check on. "MAWK070411
END-OF-DEFINITION.
CASE zopmode.
WHEN 'READ'.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
EXPORTING
workitem_id = workitem_id
language = sy-langu
user = sy-uname
TABLES
simple_container = swt_cont.
IF sy-subrc = 0.
READ TABLE swt_cont INTO wa WITH KEY element = 'PERNR'.
IF sy-subrc = 0.
lv_pernr = wa-value.
ENDIF.
ENDLOOP.
IF sy-subrc = 0.
lv_request_expense = wa-value.
ENDIF.
CLEAR lwa_trip_history.
*VORSC
*WAERS
ENDLOOP.
ENDIF.
IF lv_request_expense = 'E'.
pernr = lv_pernr.
ename = lv_ename.
tripno = lv_tripno.
begda = lv_begda.
endda = lv_endda.
reason = lv_reason.
location = lv_location.
country = lv_country.
advance = lv_advance.
currency = lv_currency.
flag = lv_flag.
hide_flag = lv_hide_flag.
request_expense = lv_request_expense.
ENDIF.
WHEN 'APPR'.
IF sy-subrc = 0.
IF sy-subrc = 0.
lv_request_expense = wa-value.
ENDIF.
ENDIF.
*Update Cluster
*key of cluster
te-key-pernr = lv_pernr.
te-key-reinr = lv_tripno.
te-key-perio = lv_perio.
te-key-pdvrs = lv_pdvrs.
*import cluster
rp-imp-c1-te.
lwa_vsch-vorsc = n_advance.
lwa_vsch-vorhw = lwa_vsch-vorsc.
lwa_vsch-datvs = sy-datum.
APPEND lwa_vsch TO vsch.
* vsch-VORSC = '500'.
* vsch-VORHW = vsch-vorsc.
* l_sum = l_sum + vsch-VORSC.
* MODIFY vsch TRANSPORTING vorsc vorhw.
* ENDLOOP.
CLEAR lwa_statu.
*update trip status in cluster
* lwa_statu-druck = lwa_ptrv_perio-druck.
* lwa_statu-antrg = lwa_ptrv_perio-antrg.
* lwa_statu-abrec = lwa_ptrv_perio-abrec.
* lwa_statu-ueblg = lwa_ptrv_perio-ueblg.
* lwa_statu-uebrf = lwa_ptrv_perio-uebrf.
* lwa_statu-uebdt = lwa_ptrv_perio-uebdt.
statu-druck = lwa_ptrv_perio-druck.
statu-antrg = lwa_ptrv_perio-antrg.
statu-abrec = lwa_ptrv_perio-abrec.
statu-ueblg = lwa_ptrv_perio-ueblg.
statu-uebrf = lwa_ptrv_perio-uebrf.
statu-uebdt = lwa_ptrv_perio-uebdt.
*APPEND lwa_statu TO statu.
CLEAR lwa_aend.
* update trip chnages
lwa_aend-datum = sy-datum.
lwa_aend-uzeit = sy-uzeit.
lwa_aend-uname = sy-uname.
lwa_aend-repid = sy-repid.
lwa_aend-druck = lwa_ptrv_perio-druck.
lwa_aend-antrg = lwa_ptrv_perio-antrg.
lwa_aend-abrec = lwa_ptrv_perio-abrec.
lwa_aend-ueblg = lwa_ptrv_perio-ueblg.
lwa_aend-uebrf = lwa_ptrv_perio-uebrf.
lwa_aend-uebdt = lwa_ptrv_perio-uebdt.
lwa_aend-runid = '0000000000'.
lwa_aend-statu = ''.
*update table
SELECT SINGLE * FROM ptrv_shdr INTO gw_shdr WHERE pernr = te-key-
pernr
AND reinr = te-key-reinr
AND perio = te-key-perio
AND seqno = '01'.
IF sy-subrc EQ 0.
gw_shdr-sum_advanc = n_advance.
gw_shdr-sum_payout = n_advance.
MODIFY ptrv_shdr FROM gw_shdr. "TRANSPORTING SUM_ADVANC.
ENDIF.
ENDIF.
ENDIF.
lwa_container-element = 'STATUS'.
lwa_container-value = '1'.
lwa_container-element = 'COMMENT'.
lwa_container-value = comments.
WHEN 'REJ'.
lwa_container-element = 'STATUS'.
lwa_container-value = '2'.
lwa_container-element = 'COMMENT'.
lwa_container-value = comments.
WHEN 'SBFC'.
lwa_container-element = 'STATUS'.
lwa_container-value = '3'.
APPEND lwa_container TO ltab_container.
lwa_container-element = 'COMMENT'.
lwa_container-value = comments.
ENDFUNCTION.
METHOD display_request .
* declarations for context navigation
DATA lo_zhr_disp_request TYPE REF TO if_wd_context_node.
DATA lo_exporting TYPE REF TO if_wd_context_node.
DATA lo_importing_1 TYPE REF TO if_wd_context_node.
lo_table_node->set_attribute(
name = 'HIDE_TRIP_HISTORY'
value = '02' ).
lo_table_node->set_attribute(
name = 'HIDE_EXPENSE_DETAIL'
value = '01' ).
ENDIF.
IF lv_request_expense = 'E'.
LOOP AT lt_expense_detail_f INTO wa_expense_detail_f.
lo_table_node->set_attribute(
name = 'HIDE_TRIP_HISTORY'
value = '01' ).
lo_table_node->set_attribute(
name = 'HIDE_EXPENSE_DETAIL'
value = '02' ).
ENDIF.