Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Номер спецификации: BR_D_024
- *& Наименование спецификации: Печатные формы
- *& Дата создания: 22.12.2020
- *& Проект: Создание печатных форм
- *& Разработчик: Федоров К
- METHOD get_vehwaybill_data.
- DATA: ls_form TYPE zstm_vehicle_waybill,
- lt_tor_root TYPE /scmtms/t_tor_root_k,
- lt_tor_stop TYPE /scmtms/t_tor_stop_k,
- lt_tor_stop_first TYPE /scmtms/t_tor_stop_k,
- lt_mtrl_description TYPE /scmtms/t_mat_description_k,
- lt_tor_item_tr TYPE /scmtms/t_tor_item_tr_k,
- lt_sel_opt_f TYPE /bobf/t_frw_query_selparam,
- lt_sel_opt_l TYPE /bobf/t_frw_query_selparam,
- ls_sel_opt_f LIKE LINE OF lt_sel_opt_f,
- ls_sel_opt_l LIKE LINE OF lt_sel_opt_l,
- lt_loc_data_f TYPE /scmtms/t_loc_q_elem_result,
- lt_loc_data_l TYPE /scmtms/t_loc_q_elem_result,
- lv_node_key TYPE /bobf/obm_node_key,
- lv_assoc_key TYPE /bobf/obm_assoc_key,
- lv_node_key_tel TYPE /bobf/obm_node_key,
- lv_assoc_key_tel TYPE /bobf/obm_assoc_key,
- lt_pos_address TYPE /bofu/t_addr_postal_addressk,
- lt_loc_root_f TYPE /scmtms/t_bo_loc_root_k,
- lt_loc_root_l TYPE /scmtms/t_bo_loc_root_k,
- lt_drv_root TYPE /scmtms/t_res_lab_root_k,
- lt_tras_capa_offer TYPE /scmtms/t_res_quantity_k,
- lt_bupa_consignee TYPE /bofu/t_bupa_root_k,
- lt_bupa_root TYPE /bofu/t_bupa_root_k,
- lt_role TYPE /bofu/t_bupa_role_k,
- lt_bupa_ship_root TYPE /bofu/t_bupa_root_k,
- lt_bupa_data TYPE /bofu/t_bupa_root_k,
- ls_bupa_data LIKE LINE OF lt_bupa_data,
- lt_but000 TYPE TABLE OF but000,
- lt_but000_bupa_ship TYPE TABLE OF but000,
- lt_but000_bupa_consignee TYPE TABLE OF but000,
- lt_but000_tor_root TYPE TABLE OF but000,
- lt_relationship TYPE /bofu/t_bupa_relship_k,
- lt_transp_capa_offer TYPE /scmtms/t_res_quantity_k,
- lt_res_root TYPE /scmtms/t_res_root_k,
- lt_telephone TYPE /bofu/t_addr_telephonek,
- lt_stop_first TYPE /scmtms/t_tor_stop_k,
- lt_key_bupa TYPE /bobf/t_frw_key,
- ls_key_bupa LIKE LINE OF lt_key_bupa,
- lt_role_ship TYPE /bofu/t_bupa_role_k,
- lt_bp_root TYPE /bofu/t_bupa_root_k,
- ls_selpar TYPE /bobf/s_frw_query_selparam,
- lt_selpar TYPE /bobf/t_frw_query_selparam,
- go_message TYPE REF TO /bobf/if_frw_message,
- ls_telephone_4_1 LIKE LINE OF lt_telephone,
- ls_telephone_4_2 LIKE LINE OF lt_telephone,
- ls_telephone_6_1 LIKE LINE OF lt_telephone,
- ls_telephone_6_2 LIKE LINE OF lt_telephone,
- ls_telephone_5_1 LIKE LINE OF lt_telephone,
- ls_telephone_5_2 LIKE LINE OF lt_telephone,
- ls_telephone_7_1 LIKE LINE OF lt_telephone,
- ls_telephone_7_2 LIKE LINE OF lt_telephone,
- ls_telephone_42_1 LIKE LINE OF lt_telephone,
- ls_telephone_42_2 LIKE LINE OF lt_telephone,
- ls_telephone_43_1 LIKE LINE OF lt_telephone,
- ls_telephone_43_2 LIKE LINE OF lt_telephone,
- ls_telephone_44_1 LIKE LINE OF lt_telephone,
- ls_telephone_44_2 LIKE LINE OF lt_telephone,
- lv_date TYPE d,
- lv_time TYPE t,
- lv_date_result TYPE c LENGTH 11,
- lv_zzcargo_condition_i TYPE i,
- lv_qua_pcs_val_9 TYPE i,
- lv_gro_wei_val_10 TYPE p LENGTH 10 DECIMALS 2,
- lt_itemtr TYPE /scmtms/t_tor_item_tr_k,
- lt_tor_pdf_data TYPE ztttm_tor_pdf_k.
- *поле 2
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-stop_first
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_tor_stop_first ).
- * IF lt_tor_stop_first IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_tor_stop_first ASSIGNING FIELD-SYMBOL(<ls_tor_stop_first>) INDEX 1.
- IF <ls_tor_stop_first> IS ASSIGNED.
- CLEAR lv_date.
- CLEAR lv_time.
- CLEAR lv_date_result.
- CONVERT TIME STAMP <ls_tor_stop_first>-plan_trans_time TIME ZONE 'UTC'
- INTO DATE lv_date TIME lv_time.
- CONCATENATE lv_date+6(2) '.' lv_date+4(2) '.' lv_date(4) INTO lv_date_result.
- ls_form-zzdate = lv_date_result.
- ENDIF.
- *поле 3
- mo_tor_srv->retrieve(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_tor_root ).
- * IF lt_tor_root IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_tor_root ASSIGNING FIELD-SYMBOL(<ls_tor_root>) INDEX 1.
- IF <ls_tor_root> IS ASSIGNED.
- ls_form-zznumber = <ls_tor_root>-tor_id.
- ENDIF.
- SHIFT ls_form-zznumber LEFT DELETING LEADING '0'.
- *4, 6, 63; 5, 7, 62; 42, 43, 65; 44
- *4, 6, 63
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-bupa_ship_root
- iv_fill_data = abap_true
- IMPORTING
- et_target_key = DATA(lt_bupa_ship_keys)
- et_data = lt_bupa_ship_root ).
- * IF lt_bupa_ship_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- *
- * IF lt_bupa_ship_root IS INITIAL.
- * RETURN.
- * ENDIF.
- SELECT *
- FROM but000
- INTO TABLE lt_but000_bupa_ship
- FOR ALL ENTRIES IN lt_bupa_ship_root
- WHERE but000~partner EQ lt_bupa_ship_root-partner.
- *******************************************************************************
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-item_tr
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_itemtr
- et_target_key = DATA(lt_itemtr_keys) ).
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
- it_key = lt_itemtr_keys
- iv_association = /scmtms/if_tor_c=>sc_association-item_tr-itemparty
- IMPORTING
- et_target_key = DATA(lt_itemparty_keys) ).
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-itemparty
- it_key = lt_itemparty_keys
- iv_association = /scmtms/if_tor_c=>sc_association-itemparty-bupa_root
- IMPORTING
- et_data = lt_bupa_root
- et_target_key = DATA(lt_bupa_root_keys) ).
- *******************************************************************************
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_ship_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
- IMPORTING
- et_target_key = DATA(lt_bupa_addrinfo_keys) ).
- * IF lt_bupa_addrinfo_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_addrinfo_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- IMPORTING
- et_target_key = DATA(lt_address_root_keys) ).
- * IF lt_address_root_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- /scmtms/cl_common_helper=>get_do_keys_4_rba(
- EXPORTING
- iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
- iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_do_node_key = /bofu/if_addr_constants=>sc_node-telephone
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-telephone
- IMPORTING
- ev_node_key = lv_node_key_tel
- ev_assoc_key = lv_assoc_key_tel ).
- * IF lv_node_key_tel IS INITIAL.
- * RETURN.
- * ENDIF.
- *
- * IF lv_assoc_key_tel IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_tel
- iv_fill_data = abap_true
- it_key = lt_address_root_keys
- IMPORTING
- et_data = lt_telephone ).
- * IF lt_telephone IS INITIAL.
- * RETURN.
- * ENDIF.
- /scmtms/cl_common_helper=>get_do_keys_4_rba(
- EXPORTING
- iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
- iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_do_node_key = /bofu/if_addr_constants=>sc_node-postal_address
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-postal_address
- IMPORTING
- ev_node_key = lv_node_key
- ev_assoc_key = lv_assoc_key ).
- * IF lv_node_key IS INITIAL.
- * RETURN.
- * ENDIF.
- *
- * IF lv_assoc_key IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key
- iv_fill_data = abap_true
- it_key = lt_address_root_keys
- IMPORTING
- et_data = lt_pos_address ).
- * IF lt_pos_address IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_bupa_ship_root ASSIGNING FIELD-SYMBOL(<ls_bupa_ship_root>) INDEX 1.
- *4 поле
- IF <ls_bupa_ship_root> IS ASSIGNED AND <ls_bupa_ship_root>-type = '1'.
- READ TABLE lt_but000_bupa_ship ASSIGNING FIELD-SYMBOL(<ls_but000_bupa_ship_4>) WITH KEY partner = <ls_bupa_ship_root>-partner BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_4>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_4_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_4_2 INDEX 2.
- IF <ls_but000_bupa_ship_4> IS ASSIGNED
- AND <ls_pos_address_4> IS ASSIGNED.
- ls_form-zzshipper_name = |{ <ls_but000_bupa_ship_4>-name_first } { <ls_but000_bupa_ship_4>-name_last } { <ls_but000_bupa_ship_4>-namemiddle } { ';' } { <ls_pos_address_4>-region } { ',' } { <ls_pos_address_4>-city_name } { ',' } {
- <ls_pos_address_4>-street_name } { <ls_pos_address_4>-house_id } { ';' } { ls_telephone_4_1-formatted_number_text } { ',' } { ls_telephone_4_2-formatted_number_text }|.
- ENDIF.
- *6 поле
- ELSEIF <ls_bupa_ship_root> IS ASSIGNED AND <ls_bupa_ship_root>-type = '2'.
- READ TABLE lt_but000_bupa_ship ASSIGNING FIELD-SYMBOL(<ls_but000_bupa_ship_6>) WITH KEY partner = <ls_bupa_ship_root>-partner BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_6>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_6_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_6_2 INDEX 2.
- IF <ls_but000_bupa_ship_6> IS ASSIGNED
- AND <ls_pos_address_6> IS ASSIGNED.
- ls_form-zzshipper_name = |{ <ls_but000_bupa_ship_6>-name_first } { <ls_but000_bupa_ship_6>-name_last } { <ls_but000_bupa_ship_6>-namemiddle } { ';' } { <ls_pos_address_6>-region } { ',' } { <ls_pos_address_6>-city_name } { ',' } {
- <ls_pos_address_6>-street_name } { <ls_pos_address_6>-house_id } { ';' } { ls_telephone_6_1-formatted_number_text } { ',' } { ls_telephone_6_2-formatted_number_text }|.
- ENDIF.
- ENDIF.
- *63 поле, 65 поле
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = CORRESPONDING #( lt_tor_root MAPPING key = key )
- iv_association = zif_enh_tor1_c=>sc_association-root-z_pdf
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_tor_pdf_data ).
- READ TABLE lt_tor_pdf_data ASSIGNING FIELD-SYMBOL(<ls_tor_pdf>) INDEX 1.
- IF <ls_tor_pdf> IS ASSIGNED.
- ls_form-zzfn_shipper = <ls_tor_pdf>-bupa_ship_con.
- ls_form-zza51 = <ls_tor_pdf>-carr_con.
- ENDIF.
- *5, 7, 62
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-bupa_consignee_root
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_bupa_consignee
- et_target_key = DATA(lt_bupa_consignee_keys) ).
- * IF lt_bupa_consignee_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- *
- * IF lt_bupa_consignee IS INITIAL.
- * RETURN.
- * ENDIF.
- SELECT *
- FROM but000
- INTO TABLE lt_but000_bupa_consignee
- FOR ALL ENTRIES IN lt_bupa_consignee
- WHERE but000~partner EQ lt_bupa_consignee-partner.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_consignee_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
- IMPORTING
- et_target_key = DATA(lt_bupa_cons_addrinfo_keys) ).
- * IF lt_bupa_cons_addrinfo_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_cons_addrinfo_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- IMPORTING
- et_target_key = DATA(lt_bupa_cons_address_root_keys) ).
- * IF lt_bupa_cons_address_root_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- CLEAR lt_telephone.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_tel
- iv_fill_data = abap_true
- it_key = lt_bupa_cons_address_root_keys
- IMPORTING
- et_data = lt_telephone ).
- * IF lt_telephone IS INITIAL.
- * RETURN.
- * ENDIF.
- CLEAR lt_pos_address.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key
- iv_fill_data = abap_true
- it_key = lt_bupa_cons_address_root_keys
- IMPORTING
- et_data = lt_pos_address ).
- * IF lt_pos_address IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_bupa_consignee ASSIGNING FIELD-SYMBOL(<ls_bupa_consignee>) INDEX 1.
- *5 поле
- IF <ls_bupa_consignee>-type = '1'.
- READ TABLE lt_but000_bupa_consignee ASSIGNING FIELD-SYMBOL(<ls_but000_bupa_consignee_5>) WITH KEY partner = <ls_bupa_consignee>-partner BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_5>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_5_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_5_2 INDEX 2.
- IF <ls_bupa_consignee> IS ASSIGNED
- AND <ls_but000_bupa_consignee_5> IS ASSIGNED
- AND <ls_pos_address_5> IS ASSIGNED.
- ls_form-zzname_consignee = |{ <ls_but000_bupa_consignee_5>-name_first } { <ls_but000_bupa_consignee_5>-name_last } { <ls_but000_bupa_consignee_5>-namemiddle } { ';' } { <ls_pos_address_5>-region } { ',' } {
- <ls_pos_address_5>-city_name } { ',' } { <ls_pos_address_5>-street_name } { <ls_pos_address_5>-house_id } { ';' } { ls_telephone_5_1-formatted_number_text } { ',' } { ls_telephone_5_2-formatted_number_text }|.
- ENDIF.
- *7 поле
- ELSEIF <ls_bupa_consignee>-type = '2'.
- READ TABLE lt_but000_bupa_consignee ASSIGNING FIELD-SYMBOL(<ls_but000_bupa_consignee_7>) WITH KEY partner = <ls_bupa_consignee>-partner BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_7>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_7_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_7_2 INDEX 2.
- IF <ls_bupa_consignee> IS ASSIGNED
- AND <ls_but000_bupa_consignee_7> IS ASSIGNED
- AND <ls_pos_address_7> IS ASSIGNED.
- ls_form-zzname_consignee = |{ <ls_but000_bupa_consignee_7>-name_first } { <ls_but000_bupa_consignee_7>-name_last } { <ls_but000_bupa_consignee_7>-namemiddle } { ';' } { <ls_pos_address_7>-region } { ',' } {
- <ls_pos_address_7>-city_name } { ',' } { <ls_pos_address_7>-street_name } { <ls_pos_address_7>-house_id } { ';' } { ls_telephone_7_1-formatted_number_text } { ',' } { ls_telephone_7_2-formatted_number_text }|.
- ENDIF.
- ENDIF.
- *62 поле
- CLEAR lt_pos_address.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key
- iv_fill_data = abap_true
- it_key = lt_bupa_cons_address_root_keys
- IMPORTING
- et_data = lt_pos_address ).
- * IF lt_pos_address IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_62>) INDEX 1.
- IF <ls_bupa_consignee> IS ASSIGNED.
- SELECT but0bk~bankn, but0bk~accname, bnka~swift
- FROM but0bk
- INNER JOIN bnka
- ON but0bk~banks = bnka~banks
- AND but0bk~bankl = bnka~bankl
- WHERE but0bk~partner = @<ls_bupa_consignee>-partner
- INTO TABLE @DATA(lt_table).
- ENDIF.
- READ TABLE lt_table ASSIGNING FIELD-SYMBOL(<ls_table>) INDEX 1.
- IF <ls_bupa_consignee> IS ASSIGNED
- AND <ls_pos_address_62> IS ASSIGNED
- AND <ls_table> IS ASSIGNED.
- ls_form-zzsupplied_certif = |{ <ls_bupa_consignee>-description } { ';' } { <ls_pos_address_62>-city_name } { ',' } { <ls_pos_address_62>-street_name } { <ls_pos_address_62>-house_id } { <ls_table>-bankn } { ',' } { <ls_table>-accname } { ',' } {
- <ls_table>-swift }|.
- ENDIF.
- *42, 43, 65
- SELECT *
- FROM but000
- INTO TABLE lt_but000_tor_root
- FOR ALL ENTRIES IN lt_tor_root
- WHERE but000~partner EQ lt_tor_root-tspid.
- READ TABLE lt_tor_root ASSIGNING FIELD-SYMBOL(<ls_tor_root_42>) INDEX 1.
- CHECK sy-subrc = 0.
- ls_selpar-attribute_name = /bofu/if_bupa_constants=>sc_query_attribute-root-query_by_role-partner.
- ls_selpar-option = 'EQ'.
- ls_selpar-sign = 'I'.
- ls_selpar-low = <ls_tor_root_42>-tspid.
- APPEND ls_selpar TO lt_selpar.
- * mo_bp_srv = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /bofu/if_bupa_constants=>sc_bo_key ).
- mo_bp_srv->query(
- EXPORTING
- iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
- it_selection_parameters = lt_selpar
- iv_fill_data = abap_true
- IMPORTING
- eo_message = go_message
- et_data = lt_bp_root
- et_key = DATA(lt_bp_root_keys) ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bp_root_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
- IMPORTING
- et_target_key = DATA(lt_tor_root_addrinfo_keys) ).
- * IF lt_tor_root_addrinfo_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_tor_root_addrinfo_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- IMPORTING
- et_target_key = DATA(lt_tor_root_address_keys) ).
- /scmtms/cl_common_helper=>get_do_keys_4_rba(
- EXPORTING
- iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
- iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_do_node_key = /bofu/if_addr_constants=>sc_node-telephone
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-telephone
- IMPORTING
- ev_node_key = lv_node_key_tel
- ev_assoc_key = lv_assoc_key_tel ).
- * IF lt_tor_root_address_keys IS INITIAL.
- * RETURN.
- * ENDIF.
- * CLEAR lt_telephone.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_tel
- iv_fill_data = abap_true
- it_key = lt_tor_root_address_keys
- IMPORTING
- et_data = lt_telephone ).
- * IF lt_telephone IS INITIAL.
- * RETURN.
- * ENDIF.
- CLEAR lt_pos_address.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key
- iv_fill_data = abap_true
- it_key = lt_tor_root_address_keys
- IMPORTING
- et_data = lt_pos_address ).
- * IF lt_pos_address IS INITIAL.
- * RETURN.
- * ENDIF.
- *42 поле
- READ TABLE lt_bp_root ASSIGNING FIELD-SYMBOL(<ls_bupa_root>) INDEX 1.
- IF <ls_bupa_root> IS ASSIGNED.
- IF <ls_bupa_root>-type = '1'.
- READ TABLE lt_but000_tor_root ASSIGNING FIELD-SYMBOL(<lt_but000_tor_root_42>) WITH KEY partner = <ls_tor_root_42>-tspid BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_42>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_42_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_42_2 INDEX 2.
- ENDIF.
- IF <lt_but000_tor_root_42> IS ASSIGNED
- AND <ls_pos_address_42> IS ASSIGNED.
- ls_form-zza42 = |{ <lt_but000_tor_root_42>-name_first } { <lt_but000_tor_root_42>-name_last } { <lt_but000_tor_root_42>-namemiddle } { ';' } {
- <ls_pos_address_42>-region } { ',' } { <ls_pos_address_42>-city_name } { ',' } { <ls_pos_address_42>-street_name } { <ls_pos_address_42>-house_id } { ';' } { ls_telephone_42_1-formatted_number_text } { ',' } { ls_telephone_42_2-formatted_number_text }|.
- ENDIF.
- ENDIF.
- *43 поле
- IF <ls_bupa_root> IS ASSIGNED.
- IF <ls_bupa_root>-type = '2'.
- READ TABLE lt_but000_tor_root ASSIGNING FIELD-SYMBOL(<lt_but000_tor_root_43>) WITH KEY partner = <ls_tor_root_42>-tspid BINARY SEARCH.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_43>) INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_43_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_43_2 INDEX 2.
- IF <lt_but000_tor_root_43> IS ASSIGNED
- AND <ls_pos_address_43> IS ASSIGNED.
- ls_form-zza42 = |{ <lt_but000_tor_root_43>-name_first } { <lt_but000_tor_root_43>-name_last } { <lt_but000_tor_root_43>-namemiddle } { ';' } {
- <ls_pos_address_43>-region } { ',' } { <ls_pos_address_43>-city_name } { ',' } { <ls_pos_address_43>-street_name } { <ls_pos_address_43>-house_id } { ';' } { ls_telephone_43_1-formatted_number_text } { ls_telephone_43_2-formatted_number_text }|.
- ENDIF.
- ENDIF.
- ENDIF.
- *44 поле
- READ TABLE lt_itemtr ASSIGNING FIELD-SYMBOL(<ls_itemtr>) WITH KEY item_cat = 'DRI'.
- READ TABLE lt_telephone INTO ls_telephone_44_1 INDEX 1.
- READ TABLE lt_telephone INTO ls_telephone_44_2 INDEX 2.
- IF <ls_itemtr> IS ASSIGNED.
- ls_form-zza44 = |{ <ls_itemtr>-item_descr } { ';' } { ls_telephone_44_1-formatted_number_text } { ',' } { ls_telephone_44_2-formatted_number_text }|.
- ENDIF.
- *9 поле, 10 поле
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-item_tr
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_tor_item_tr
- et_target_key = DATA(lt_tor_item_tr_key) ).
- * IF lt_tor_item_tr_key IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
- it_key = lt_tor_item_tr_key
- iv_association = /scmtms/if_tor_c=>sc_association-item_tr-bo_material
- IMPORTING
- et_target_key = DATA(lt_tor_bo_material_key) ).
- * IF lt_tor_bo_material_key IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_mtrl_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_mat_c=>sc_node-root
- it_key = lt_tor_bo_material_key
- iv_association = /scmtms/if_mat_c=>sc_association-root-description
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_mtrl_description ).
- * IF lt_mtrl_description IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_mtrl_description ASSIGNING FIELD-SYMBOL(<ls_mtrl_description>) INDEX 1.
- READ TABLE lt_tor_item_tr ASSIGNING FIELD-SYMBOL(<ls_tor_item_tr>) WITH KEY item_cat = mc_item_cat.
- IF <ls_mtrl_description> IS ASSIGNED
- AND <ls_tor_item_tr> IS ASSIGNED.
- lv_qua_pcs_val_9 = <ls_tor_item_tr>-qua_pcs_val.
- ls_form-zzcargo_space = |{ <ls_mtrl_description>-maktx } { ',' } { lv_qua_pcs_val_9 }|.
- ENDIF.
- IF <ls_tor_item_tr> IS ASSIGNED.
- ls_form-zzcargo_condition = <ls_tor_item_tr>-gro_wei_val.
- ls_form-zzcargo_condition_uni = <ls_tor_item_tr>-gro_wei_uni.
- ENDIF.
- *17 поле
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-root
- it_key = it_tor_key
- iv_association = /scmtms/if_tor_c=>sc_association-root-stop
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_tor_stop ).
- READ TABLE lt_tor_stop ASSIGNING FIELD-SYMBOL(<ls_tor_stop_pos_f>) WITH KEY stop_seq_pos = mc_stop_seq_pos_f.
- ls_sel_opt_f-attribute_name = 'LOCATION_ID'.
- ls_sel_opt_f-option = 'EQ'.
- ls_sel_opt_f-sign = 'I'.
- IF <ls_tor_stop_pos_f> IS ASSIGNED.
- ls_sel_opt_f-low = <ls_tor_stop_pos_f>-log_locid.
- ENDIF.
- APPEND ls_sel_opt_f TO lt_sel_opt_f.
- mo_loc_srv->query(
- EXPORTING
- iv_query_key = /scmtms/if_location_c=>sc_query-root-qdb_by_elements
- it_selection_parameters = lt_sel_opt_f
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_loc_data_f ).
- * IF lt_loc_data_f IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_loc_data_f INTO DATA(ls_query_data_f) INDEX 1.
- mo_loc_srv->retrieve(
- EXPORTING
- iv_node_key = /scmtms/if_location_c=>sc_node-root
- it_key = VALUE #( ( key = ls_query_data_f-db_key ) )
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_loc_root_f ).
- * IF lt_loc_root_f IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_loc_root_f ASSIGNING FIELD-SYMBOL(<ls_loc_root_f>) INDEX 1.
- CLEAR lt_pos_address.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key
- iv_fill_data = abap_true
- it_key = lt_address_root_keys
- IMPORTING
- et_data = lt_pos_address ).
- * IF lt_pos_address IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_17>) INDEX 1.
- IF <ls_tor_stop_pos_f> IS ASSIGNED
- AND <ls_loc_root_f> IS ASSIGNED
- AND <ls_pos_address_17> IS ASSIGNED.
- ls_form-zzload_adress = |{ <ls_loc_root_f>-adrnummer } { ',' } { <ls_pos_address_17>-country_code } { ',' } { <ls_pos_address_17>-region } { ',' } { <ls_pos_address_17>-city_name }|.
- ENDIF.
- *26 поле
- READ TABLE lt_tor_stop ASSIGNING FIELD-SYMBOL(<ls_tor_stop_pos_l>) WITH KEY stop_seq_pos = mc_stop_seq_pos_l.
- ls_sel_opt_l-attribute_name = 'LOCATION_ID'.
- ls_sel_opt_l-option = 'EQ'.
- ls_sel_opt_l-sign = 'I'.
- IF <ls_mtrl_description> IS ASSIGNED.
- ls_sel_opt_l-low = <ls_tor_stop_pos_l>-log_locid.
- ENDIF.
- APPEND ls_sel_opt_l TO lt_sel_opt_l.
- mo_loc_srv->query(
- EXPORTING
- iv_query_key = /scmtms/if_location_c=>sc_query-root-qdb_by_elements
- it_selection_parameters = lt_sel_opt_l
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_loc_data_l ).
- * IF lt_loc_data_l IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_loc_data_l INTO DATA(ls_query_data_l) INDEX 1.
- mo_loc_srv->retrieve(
- EXPORTING
- iv_node_key = /scmtms/if_location_c=>sc_node-root
- it_key = VALUE #( ( key = ls_query_data_l-db_key ) )
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_loc_root_l ).
- * IF lt_loc_root_l IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_loc_root_l ASSIGNING FIELD-SYMBOL(<ls_loc_root_l>) INDEX 1.
- READ TABLE lt_pos_address ASSIGNING FIELD-SYMBOL(<ls_pos_address_26>) INDEX 1.
- IF <ls_tor_stop_pos_l> IS ASSIGNED
- AND <ls_loc_root_l> IS ASSIGNED
- AND <ls_pos_address_26> IS ASSIGNED.
- ls_form-zzuploading_adress = |{ <ls_loc_root_l>-adrnummer } { ',' } { <ls_pos_address_26>-country_code } { ',' } { <ls_pos_address_26>-region } { ',' } { <ls_pos_address_26>-city_name }|.
- ENDIF.
- *18 поле
- READ TABLE lt_tor_stop ASSIGNING FIELD-SYMBOL(<ls_tor_stop_f>) WITH KEY stop_seq_pos = mc_stop_seq_pos_f.
- IF <ls_tor_stop_f> IS ASSIGNED.
- CLEAR lv_date.
- CLEAR lv_time.
- CLEAR lv_date_result.
- CONVERT TIME STAMP <ls_tor_stop_f>-plan_trans_time TIME ZONE 'UTC'
- INTO DATE lv_date TIME lv_time.
- CONCATENATE lv_date+6(2) '.' lv_date+4(2) '.' lv_date(4) INTO lv_date_result.
- ls_form-zztimedate_admission = lv_date_result.
- ENDIF.
- *19 поле
- ls_form-zztimedate_admission2 = ls_form-zzdate.
- IF <ls_tor_item_tr> IS ASSIGNED.
- *22 поле
- ls_form-zzweight_load = <ls_tor_item_tr>-gro_wei_val.
- ls_form-zzweight_load_uni = <ls_tor_item_tr>-gro_wei_uni.
- ENDIF.
- * 23 поле
- DATA: lt_seal_ext TYPE ztttm_tor_seal_ext_k.
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
- it_key = lt_itemtr_keys
- iv_association = /scmtms/if_tor_c=>sc_association-item_tr-seal
- IMPORTING
- et_target_key = DATA(lt_seal_keys) ).
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_tor_c=>sc_node-seal
- it_key = lt_seal_keys
- iv_association = zif_enh_tor1_c=>sc_association-seal-z_seal_ext
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_seal_ext ).
- READ TABLE lt_seal_ext ASSIGNING FIELD-SYMBOL(<ls_seal_ext>) INDEX 1.
- IF <ls_seal_ext> IS ASSIGNED.
- ls_form-zzn_seats = <ls_seal_ext>-qua_pcs_val_all.
- ENDIF.
- *24 поле
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_root_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-relationship
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_relationship ).
- * IF lt_relationship IS INITIAL.
- * RETURN.
- * ENDIF.
- CLEAR lt_but000.
- SELECT *
- FROM but000
- INTO TABLE lt_but000
- FOR ALL ENTRIES IN lt_relationship
- WHERE but000~partner EQ lt_relationship-partner.
- READ TABLE lt_but000 ASSIGNING FIELD-SYMBOL(<ls_but000>) INDEX 1.
- IF <ls_but000> IS ASSIGNED.
- ls_form-zzattached_doc = |{ <ls_but000>-partner } { <ls_but000>-name_first } { <ls_but000>-name_last }|.
- ENDIF.
- *25 поле
- mo_tor_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_tor_item_tr_key
- iv_node_key = /scmtms/if_tor_c=>sc_node-item_tr
- iv_association = /scmtms/if_tor_c=>sc_association-item_tr-bo_driver
- IMPORTING
- et_target_key = DATA(lt_driver_key) ).
- mo_drv_srm->retrieve(
- EXPORTING
- it_key = lt_driver_key
- iv_node_key = /scmtms/if_driver_c=>sc_node-root
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_drv_root ).
- READ TABLE lt_drv_root ASSIGNING FIELD-SYMBOL(<ls_drv_root>) INDEX 1.
- IF <ls_drv_root> IS ASSIGNED.
- ls_form-zzinstrqar = |{ <ls_drv_root>-name_last } { <ls_drv_root>-name_first }|.
- *34 поле
- ls_form-zza34 = |{ <ls_drv_root>-name_last } { <ls_drv_root>-name_first }|.
- ENDIF.
- *46 поле
- READ TABLE lt_tor_item_tr ASSIGNING FIELD-SYMBOL(<ls_item_tr>) INDEX 1.
- IF <ls_item_tr> IS ASSIGNED.
- ls_form-zza46 = <ls_item_tr>-platenumber.
- ENDIF.
- * 45 поле, 46 поле
- mo_res_srm->retrieve(
- EXPORTING
- iv_node_key = /scmtms/if_resource_c=>sc_node-root
- it_key = lt_itemtr_keys
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_res_root ).
- * IF lt_res_root IS INITIAL.
- * RETURN.
- * ENDIF.
- mo_res_srm->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_resource_c=>sc_node-root
- it_key = lt_itemtr_keys
- iv_association = /scmtms/if_resource_c=>sc_association-root-transp_capa_offer
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_transp_capa_offer ).
- * IF lt_transp_capa_offer IS INITIAL.
- * RETURN.
- * ENDIF.
- READ TABLE lt_tor_item_tr ASSIGNING FIELD-SYMBOL(<ls_item_tr_45>) WITH KEY item_cat = 'AVR'.
- READ TABLE lt_transp_capa_offer ASSIGNING FIELD-SYMBOL(<ls_transp_capa_offer>) INDEX 1.
- READ TABLE lt_res_root ASSIGNING FIELD-SYMBOL(<ls_res_root>) INDEX 1.
- READ TABLE lt_tor_root ASSIGNING FIELD-SYMBOL(<ls_tor_root_45>) INDEX 1.
- *45 поле
- IF <ls_res_root> IS ASSIGNED
- AND <ls_transp_capa_offer> IS ASSIGNED
- AND <ls_item_tr_45> IS ASSIGNED.
- ls_form-zza45 = |{ <ls_item_tr_45>-tracking_no } { ',' } { <ls_res_root>-description } { ',' } { <ls_transp_capa_offer>-qty_value } { ',' } { <ls_item_tr_45>-gro_wei_valcap } { ',' } { <ls_item_tr_45>-gro_vol_valcap }|.
- ENDIF.
- *46 поле
- IF <ls_item_tr_45> IS ASSIGNED.
- ls_form-zza46 = <ls_item_tr_45>-tracking_no.
- ENDIF.
- MOVE-CORRESPONDING ls_form TO es_form.
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement