Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *& Дата создания: 02.12.2020
- *& Проект: Создание печатных форм
- *& Разработчик: Федоров К. Г.
- METHOD get_carrieragr_data.
- DATA ls_body TYPE zstm_agreement_body.
- DATA:
- lt_selpar TYPE /bobf/t_frw_query_selparam, "стандарт
- lt_fag TYPE /scmtms/t_fag_root_k, "Database table БО
- ls_fag LIKE LINE OF lt_fag,
- lt_bfu TYPE /bofu/t_bupa_root_k,
- lt_bfu_bupa TYPE /bofu/t_bupa_root_k,
- lt_fagrtt TYPE /scmtms/t_short_text_k,
- lt_tax_number TYPE /bofu/t_bupa_taxno_k,
- lt_role TYPE /bofu/t_bupa_adrinfo_k,
- lt_adress TYPE /bofu/t_addr_addressi_k,
- lt_formatted_address TYPE /bofu/t_addr_formatted_addrk,
- lt_formated_add TYPE /bofu/t_addr_formatted_addrk,
- lv_assoc_key_telephone TYPE /bobf/obm_assoc_key,
- lv_assoc_key_facsimile TYPE /bobf/obm_assoc_key,
- lt_email TYPE /bofu/t_addr_emailk,
- lt_telephone TYPE /bofu/t_addr_telephonek,
- lt_facsimile TYPE /bofu/t_addr_facsimilek,
- lt_bupa_role TYPE /bofu/t_bupa_role_k,
- lt_postal_address TYPE /bofu/t_addr_postal_addressk,
- ls_telephone_1 LIKE LINE OF lt_telephone,
- ls_telephone_2 LIKE LINE OF lt_telephone,
- ls_facsimile LIKE LINE OF lt_facsimile,
- lv_tel_no_zeroes TYPE num20,
- lv_fax_no_zeroes TYPE num20,
- ls_selpar TYPE /bobf/s_frw_query_selparam,
- go_message TYPE REF TO /bobf/if_frw_message,
- lt_fag_party TYPE /scmtms/t_fag_party_k,
- ls_header TYPE zstm_agreement_header,
- ls_footer TYPE zstm_agreement_footer,
- lt_fagpty TYPE /scmtms/t_fag_party_k,
- ls_fagpty LIKE LINE OF lt_fagpty,
- lt_but0bk TYPE TABLE OF but0bk,
- lt_bnka TYPE TABLE OF bnka,
- lv_tax_number_ru1 LIKE ls_body-forwarder_tax_payer_id,
- lv_tax_number_ru3 LIKE ls_body-forwarder_tax_payer_id,
- ls_fagpty_12 LIKE ls_fagpty,
- ls_fagpty_1 LIKE ls_fagpty,
- lt_key TYPE /bobf/t_frw_key,
- lo_addr_srv TYPE REF TO /bobf/if_tra_service_manager,
- lt_bupa_text TYPE /scmtms/t_bp_text_k,
- lt_partner_alt_key TYPE TABLE OF bu_partner,
- lt_fag_contractors TYPE /scmtms/t_fag_contractors_k,
- lt_common TYPE /bofu/t_bupa_common_k,
- lt_text TYPE /scmtms/t_bp_text_k,
- lt_hrp TYPE TABLE OF /scmb/hrp5561,
- lt_t005t TYPE TABLE OF t005t,
- ls_t005t LIKE LINE OF lt_t005t,
- lt_t005u TYPE TABLE OF t005u,
- ls_t005u LIKE LINE OF lt_t005u,
- lt_bp_email TYPE /bofu/t_addr_emailk,
- lt_bp_tax_number TYPE /bofu/t_bupa_taxno_k,
- lt_bupa_addressinformation TYPE /bofu/t_bupa_adrinfo_k,
- ls_email LIKE LINE OF lt_email,
- ls_telephone LIKE LINE OF lt_telephone.
- CHECK it_key IS NOT INITIAL.
- mo_fag_srv->retrieve(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-root
- it_key = it_key
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_fag ).
- READ TABLE lt_fag INTO ls_fag INDEX 1.
- mo_fag_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-root
- it_key = it_key
- iv_association = /scmtms/if_fag_c=>sc_association-root-root_text
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_fagrtt ).
- READ TABLE lt_fagrtt INTO DATA(ls_fagrtt) INDEX 1.
- *lv_1 РАБОТАЕТ, ДЛЯ ls_fagrtt-description НЕТ description
- es_header-agreement_id = |{ ls_fag-fagrmntid044 } { ls_fagrtt-description }|.
- mo_fag_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-root
- it_key = it_key
- iv_association = /scmtms/if_fag_c=>sc_association-root-party
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_fagpty
- et_target_key = DATA(lt_party_key) ).
- READ TABLE lt_fagpty INTO ls_fagpty_12 WITH KEY pty_rco012_i = '12'.
- READ TABLE lt_fagpty INTO ls_fagpty_1 WITH KEY pty_rco012_i = '1'.
- mo_fag_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-party
- it_key = lt_party_key
- iv_association = /scmtms/if_fag_c=>sc_association-party-bupa_bo_pty
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_bfu_bupa
- et_target_key = DATA(lt_bupa_key) ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bupa_key " lt_bofu_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)
- et_key_link = DATA(lt_bupa_root_to_addrinfo) ).
- 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) ).
- * ----------------------------------------------------------------------------------------------------
- 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_fagpty_12-ptyintid_id133_i.
- APPEND ls_selpar TO lt_selpar.
- mo_bp_srv->query(
- EXPORTING
- iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
- it_selection_parameters = lt_selpar
- IMPORTING
- et_key = DATA(lt_fag_party_keys) ).
- mo_bupa_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_fag_party_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /scmtms/if_bp_c=>sc_association-root-text
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_bupa_text ).
- READ TABLE lt_bupa_text ASSIGNING FIELD-SYMBOL(<ls_bupa_text>) WITH KEY txt_type = 'ZDOC'.
- IF <ls_bupa_text> IS NOT ASSIGNED.
- READ TABLE lt_bupa_text ASSIGNING <ls_bupa_text> WITH KEY txt_type = 'ZDOCD'.
- ENDIF.
- * ----------------------------------------------------------------------------------------------------
- *lv_2
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- it_key = lt_bupa_key
- iv_association = /bofu/if_bupa_constants=>sc_association-root-common
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_common ).
- READ TABLE lt_common ASSIGNING FIELD-SYMBOL(<ls_common>) INDEX 1.
- IF <ls_common> IS ASSIGNED.
- ls_body-forwarder_name = |{ <ls_common>-firstname } { <ls_common>-lastname }|.
- ENDIF.
- *lv_3
- mo_fag_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-root
- it_key = it_key
- iv_association = /scmtms/if_fag_c=>sc_association-root-contractors
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_fag_contractors ).
- READ TABLE lt_fag_contractors ASSIGNING FIELD-SYMBOL(<ls_fag_contractors>) INDEX 1.
- IF <ls_fag_contractors> IS ASSIGNED.
- SELECT partner
- FROM /scmb/hrp5561
- INTO CORRESPONDING FIELDS OF TABLE lt_hrp
- WHERE external_id EQ <ls_fag_contractors>-org_ext_id
- AND objid EQ <ls_fag_contractors>-org_unit.
- ENDIF.
- READ TABLE lt_hrp ASSIGNING FIELD-SYMBOL(<ls_hrp>) INDEX 1.
- CLEAR lt_selpar.
- CLEAR ls_selpar.
- ls_selpar-attribute_name = /bofu/if_bupa_constants=>sc_query_attribute-root-query_by_role-partner.
- ls_selpar-option = 'EQ'.
- ls_selpar-sign = 'I'.
- IF <ls_hrp> IS ASSIGNED.
- ls_selpar-low = <ls_hrp>-partner.
- ENDIF.
- APPEND ls_selpar TO lt_selpar.
- 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_false
- IMPORTING
- et_key = DATA(lt_bp_root_keys) ).
- mo_bupa_srv->retrieve_by_association(
- EXPORTING
- it_key = lt_bp_root_keys
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /scmtms/if_bp_c=>sc_association-root-text
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_text ).
- READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zpos>)
- WITH KEY txt_type = 'ZPOS' .
- IF <ls_text_zpos> IS ASSIGNED.
- ls_body-client_name = <ls_text_zpos>-text.
- ENDIF.
- READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zhead>)
- WITH KEY txt_type = 'ZHEAD' .
- IF <ls_text_zpos> IS ASSIGNED.
- ls_body-client_name = |{ ls_body-client_name } { <ls_text_zpos>-text }|.
- ENDIF.
- *lv_4
- mo_fag_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /scmtms/if_fag_c=>sc_node-root
- it_key = it_key
- iv_association = /scmtms/if_fag_c=>sc_association-root-contractors
- iv_fill_data = abap_true
- IMPORTING
- et_data = lt_fag_contractors ).
- READ TABLE lt_fag_contractors ASSIGNING FIELD-SYMBOL(<ls_fag_contractors_4>) INDEX 1.
- IF <ls_fag_contractors_4> IS ASSIGNED.
- ls_body-wears = <ls_fag_contractors_4>-party_name.
- ENDIF.
- *lv_5
- READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zdoc>)
- WITH KEY txt_type = 'ZDOC' .
- IF <ls_text_zdoc> IS ASSIGNED.
- ls_body-client_name = <ls_text_zdoc>-text.
- ENDIF.
- READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zdocd>)
- WITH KEY txt_type = 'ZDOCD' .
- IF <ls_text_zdocd> IS ASSIGNED.
- ls_body-client_name = |{ ls_body-client_name } { <ls_text_zdocd>-text }|.
- ENDIF.
- *lv_6 заполнено в lv_2
- *lv_7 РАБОТАЕТ, ПРОВЕРЕНО НАПОЛОВИНУ - НЕТ taxtype = 'RU3'
- CLEAR lt_partner_alt_key.
- APPEND ls_fagpty_12-ptyintid_id133_i TO lt_partner_alt_key.
- CLEAR lt_key.
- CALL METHOD mo_bp_srv->convert_altern_key
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_altkey_key = /bofu/if_bupa_constants=>sc_alternative_key-root-partner
- it_key = lt_partner_alt_key
- IMPORTING
- et_key = lt_key.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-tax_number
- iv_fill_data = abap_true
- it_key = lt_key
- IMPORTING
- et_data = lt_tax_number ).
- LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru1_7>) WHERE taxtype = 'RU1'.
- lv_tax_number_ru1 = <ls_tax_number_ru1_7>-taxnumber.
- ENDLOOP.
- LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru3_7>) WHERE taxtype = 'RU3'.
- lv_tax_number_ru3 = <ls_tax_number_ru3_7>-taxnumber.
- ENDLOOP.
- ls_body-forwarder_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
- *lv_8 НЕТ taxtype = 'RU5'
- LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru5_8>) WHERE taxtype = 'RU5'.
- IF <ls_tax_number_ru5_8> IS ASSIGNED.
- ls_body-forwarder_registration_number = <ls_tax_number_ru5_8>-taxnumber.
- ENDIF.
- ENDLOOP.
- *lv_9
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
- iv_fill_data = abap_false
- it_key = lt_fag_party_keys
- IMPORTING
- et_target_key = DATA(lt_addressinf_key) ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- iv_fill_data = abap_false
- it_key = lt_addressinf_key
- IMPORTING
- et_target_key = DATA(lt_address_key) ).
- /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-formatted_address
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-formatted_address
- IMPORTING
- ev_assoc_key = DATA(lv_assoc_key) ).
- 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_key
- IMPORTING
- et_data = lt_formatted_address ).
- READ TABLE lt_formatted_address INTO DATA(ls_formatted_address) INDEX 1.
- ls_body-forwarder_location = |{ ls_formatted_address-formatted_postal_address_descr }|.
- *lv_10
- /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 = DATA(lv_node_key_address_2)
- ev_assoc_key = DATA(lv_assoc_key_address_2) ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_address_2
- iv_fill_data = abap_true
- it_key = lt_address_key
- IMPORTING
- et_data = lt_postal_address ).
- READ TABLE lt_postal_address INTO DATA(ls_postal_address) INDEX 1.
- SELECT landx
- FROM t005t
- INTO CORRESPONDING FIELDS OF TABLE lt_t005t
- WHERE land1 EQ ls_postal_address-country_code AND spras = 'R'.
- SELECT bezei
- FROM t005u
- INTO CORRESPONDING FIELDS OF TABLE lt_t005u
- WHERE land1 EQ ls_postal_address-country_code AND bland EQ ls_postal_address-region.
- READ TABLE lt_t005u INTO ls_t005u INDEX 1.
- READ TABLE lt_t005t INTO ls_t005t INDEX 1.
- ls_body-forwarder_mail_address = |{ ls_t005t-landx } { ls_t005u-bezei } { ls_postal_address-pobox_postal_code } { ls_postal_address-city_name } { ls_postal_address-street_name } { ls_postal_address-house_id }|.
- *lv_11
- CLEAR lv_assoc_key_address_2.
- /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-email
- IMPORTING
- ev_assoc_key = lv_assoc_key_address_2 ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_address_2
- iv_fill_data = abap_true
- it_key = lt_address_key
- IMPORTING
- et_data = lt_bp_email ).
- READ TABLE lt_bp_email ASSIGNING FIELD-SYMBOL(<ls_bp_email>) INDEX 1.
- IF <ls_bp_email> IS ASSIGNED.
- ls_body-forwarder_email = <ls_bp_email>-uri.
- ENDIF.
- *lv_12
- /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_assoc_key = lv_assoc_key_telephone ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_telephone
- iv_fill_data = abap_true
- it_key = lt_address_key
- IMPORTING
- et_data = lt_telephone ).
- /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-facsimile
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-facsimile
- IMPORTING
- ev_assoc_key = lv_assoc_key_facsimile ).
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- iv_association = lv_assoc_key_facsimile
- iv_fill_data = abap_true
- it_key = lt_fag_party_keys
- IMPORTING
- et_data = lt_facsimile ).
- READ TABLE lt_telephone INTO ls_telephone_1 INDEX 1.
- SHIFT ls_telephone_1-normalised_number_text LEFT DELETING LEADING '0'.
- READ TABLE lt_telephone INTO ls_telephone_2 INDEX 2.
- SHIFT ls_telephone_2-normalised_number_text LEFT DELETING LEADING '0'.
- READ TABLE lt_facsimile INTO ls_facsimile INDEX 1.
- SHIFT ls_facsimile-normalised_number_text LEFT DELETING LEADING '0'.
- ls_body-forwarder_fax = |{ ls_telephone_1-normalised_number_text } { ls_telephone_2-normalised_number_text } { ';' } { ls_facsimile-normalised_number_text }|.
- *lv_13
- SELECT *
- FROM but0bk
- INTO TABLE lt_but0bk
- WHERE partner = ls_fagpty_12-ptyintid_id133_i.
- READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_13>) INDEX 1.
- IF <ls_but0bk_13> IS ASSIGNED.
- ls_body-forwarder_invoice = <ls_but0bk_13>-bankn.
- ENDIF.
- *lv_14, lv_16
- SELECT *
- FROM but0bk
- INTO TABLE lt_but0bk
- WHERE partner = ls_fagpty_12-ptyintid_id133_i.
- READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_14>) INDEX 1.
- IF <ls_but0bk_14> IS ASSIGNED.
- SELECT *
- FROM bnka
- INTO TABLE lt_bnka
- WHERE bankl = <ls_but0bk_14>-bankl.
- ENDIF.
- READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_14>) INDEX 1.
- IF <ls_bnka_14> IS ASSIGNED.
- ls_body-bank_1 = <ls_bnka_14>-banka.
- ENDIF.
- IF <ls_bnka_14> IS ASSIGNED.
- ls_body-forwarder_bank = |{ <ls_bnka_14>-swift } { '/' } { <ls_bnka_14>-bnklz }|.
- ENDIF.
- *lv_15
- READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_15>) INDEX 1.
- IF <ls_bnka_15> IS ASSIGNED.
- ls_body-forwarder_correspondent_accoun = <ls_bnka_15>-brnch.
- ENDIF.
- *lv_17
- ls_body-client_full_name = ls_body-wears.
- *lv_18
- 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-tax_number
- IMPORTING
- et_data = lt_bp_tax_number ).
- READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru1>) WITH KEY taxtype = 'RU1' .
- IF <ls_bp_tax_number_ru1> IS ASSIGNED.
- lv_tax_number_ru1 = <ls_bp_tax_number_ru1>-taxnumber.
- ENDIF.
- READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru3>) WITH KEY taxtype = 'RU3' .
- IF <ls_bp_tax_number_ru3> IS ASSIGNED.
- lv_tax_number_ru3 = <ls_bp_tax_number_ru3>-taxnumber.
- ENDIF.
- ls_body-client_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
- * CLEAR lt_partner_alt_key.
- *
- * APPEND ls_fagpty_1-ptyintid_id133_i TO lt_partner_alt_key.
- *
- * CLEAR lt_key.
- *
- * CALL METHOD mo_bp_srv->convert_altern_key
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- * iv_altkey_key = /bofu/if_bupa_constants=>sc_alternative_key-root-partner
- * it_key = lt_partner_alt_key
- * IMPORTING
- * et_key = lt_key.
- *
- * CLEAR lt_tax_number.
- *
- * mo_bp_srv->retrieve_by_association(
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- * iv_association = /bofu/if_bupa_constants=>sc_association-root-tax_number
- * iv_fill_data = abap_true
- * it_key = lt_key
- * IMPORTING
- * et_data = lt_tax_number ).
- *
- * CLEAR lv_tax_number_ru1.
- *
- * LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru1_18>) WHERE taxtype = 'RU1'.
- * lv_tax_number_ru1 = <ls_tax_number_ru1_18>-taxnumber.
- * ENDLOOP.
- *
- * CLEAR lv_tax_number_ru3.
- *
- * LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru3_18>) WHERE taxtype = 'RU3'.
- * lv_tax_number_ru3 = <ls_tax_number_ru3_18>-taxnumber.
- * ENDLOOP.
- *
- * ls_body-client_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
- *lv_19
- READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru5>) WITH KEY taxtype = 'RU5' .
- IF <ls_bp_tax_number_ru5> IS ASSIGNED.
- ls_body-client_registration_numbe = <ls_bp_tax_number_ru5>-taxnumber.
- ENDIF.
- *lv_20
- 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
- iv_fill_data = abap_false
- IMPORTING
- et_target_key = DATA(lt_bupa_addressinformation_key) ).
- CLEAR lt_address_key.
- mo_bp_srv->retrieve_by_association(
- EXPORTING
- iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- iv_fill_data = abap_false
- it_key = lt_bupa_addressinformation_key
- IMPORTING
- et_target_key = lt_address_key ).
- CLEAR lv_assoc_key.
- /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_assoc_key = lv_assoc_key ).
- CLEAR lt_postal_address.
- CLEAR ls_postal_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_key
- IMPORTING
- et_data = lt_postal_address ).
- READ TABLE lt_postal_address INTO ls_postal_address INDEX 1.
- CLEAR lt_t005t.
- CLEAR ls_t005t.
- SELECT landx
- FROM t005t
- INTO CORRESPONDING FIELDS OF TABLE lt_t005t
- WHERE land1 EQ ls_postal_address-country_code AND spras = 'R'.
- CLEAR lt_t005u.
- CLEAR ls_t005u.
- SELECT bezei
- FROM t005u
- INTO CORRESPONDING FIELDS OF TABLE lt_t005u
- WHERE land1 EQ ls_postal_address-country_code AND bland EQ ls_postal_address-region.
- READ TABLE lt_t005u INTO ls_t005u INDEX 1.
- READ TABLE lt_t005t INTO ls_t005t INDEX 1.
- ls_body-client_location = |{ ls_t005t-landx } { ls_t005u-bezei } { ls_postal_address-pobox_postal_code } { ls_postal_address-city_name } { ls_postal_address-street_name } { ls_postal_address-house_id }|.
- * CLEAR ls_selpar.
- * CLEAR lt_selpar.
- *
- * 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_fagpty_1-ptyintid_id133_i.
- *
- * APPEND ls_selpar TO lt_selpar.
- *
- * CLEAR lt_fag_party_keys.
- *
- * mo_bp_srv->query(
- * EXPORTING
- * iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
- * it_selection_parameters = lt_selpar
- * IMPORTING
- * et_key = lt_fag_party_keys ).
- *
- * CLEAR lt_addressinf_key.
- *
- * mo_bp_srv->retrieve_by_association(
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
- * iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
- * iv_fill_data = abap_false
- * it_key = lt_fag_party_keys
- * IMPORTING
- * et_target_key = lt_addressinf_key ).
- *
- * CLEAR lt_address_key.
- *
- * mo_bp_srv->retrieve_by_association(
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
- * iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
- * iv_fill_data = abap_false
- * it_key = lt_addressinf_key
- * IMPORTING
- * et_target_key = lt_address_key ).
- *
- * CLEAR lt_formatted_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_key
- * IMPORTING
- * et_data = lt_formatted_address ).
- *
- * CLEAR ls_formatted_address.
- *
- * READ TABLE lt_formatted_address INTO ls_formatted_address INDEX 1.
- *
- * ls_body-client_location = |{ ls_formatted_address-formatted_postal_address_descr }|.
- *lv_21
- ls_body-client_mail_address = ls_body-client_location.
- * CLEAR lv_assoc_key_address_2.
- *
- * /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_assoc_key = lv_assoc_key_address_2 ).
- *
- * CLEAR lt_postal_address.
- *
- * mo_bp_srv->retrieve_by_association(
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- * iv_association = lv_assoc_key_address_2
- * iv_fill_data = abap_true
- * it_key = lt_address_key
- * IMPORTING
- * et_data = lt_postal_address ).
- *
- * READ TABLE lt_postal_address INTO ls_postal_address INDEX 1.
- *
- * ls_body-client_mail_address = |{ ls_postal_address-country_code } { ls_postal_address-region } { ls_postal_address-pobox_postal_code } { ls_postal_address-city_name } { ls_postal_address-street_name } { ls_postal_address-house_id }|.
- *lv_22
- CLEAR lv_assoc_key.
- /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-email
- iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-email
- IMPORTING
- ev_assoc_key = lv_assoc_key ).
- CLEAR lt_email.
- CLEAR ls_email.
- 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_key
- IMPORTING
- et_data = lt_email ).
- READ TABLE lt_email INTO ls_email INDEX 1.
- ls_body-forwarder_email = ls_email-uri.
- * CLEAR lt_adr6.
- *
- * SELECT *
- * FROM adr6
- * INTO TABLE lt_adr6
- * WHERE persnumber = ls_fagpty_1-ptyintid_id133_i.
- *
- * READ TABLE lt_adr6 ASSIGNING FIELD-SYMBOL(<ls_adr6_22>) INDEX 1.
- *
- * IF <ls_adr6_22> IS ASSIGNED.
- * ls_body-forwarder_email = <ls_adr6_22>-smtp_addr.
- * ENDIF.
- *lv_23
- CLEAR lv_assoc_key.
- /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_assoc_key = lv_assoc_key ).
- CLEAR lt_telephone.
- CLEAR ls_telephone.
- 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_key
- IMPORTING
- et_data = lt_telephone ).
- READ TABLE lt_telephone INTO ls_telephone INDEX 1.
- ls_body-client__fax = ls_telephone-normalised_number_text.
- * 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_telephone
- * iv_fill_data = abap_true
- * it_key = lt_address_key
- * IMPORTING
- * et_data = lt_telephone ).
- *
- * CLEAR lt_facsimile.
- *
- * mo_bp_srv->retrieve_by_association(
- * EXPORTING
- * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
- * iv_association = lv_assoc_key_facsimile
- * iv_fill_data = abap_true
- * it_key = lt_fag_party_keys
- * IMPORTING
- * et_data = lt_facsimile ).
- *
- * CLEAR ls_telephone_1.
- * CLEAR ls_telephone_2.
- * CLEAR ls_facsimile.
- *
- * READ TABLE lt_telephone INTO ls_telephone_1 INDEX 1.
- *
- * SHIFT ls_telephone_1-normalised_number_text LEFT DELETING LEADING '0'.
- *
- * READ TABLE lt_telephone INTO ls_telephone_2 INDEX 2.
- *
- * SHIFT ls_telephone_2-normalised_number_text LEFT DELETING LEADING '0'.
- *
- * READ TABLE lt_facsimile INTO ls_facsimile INDEX 1.
- *
- * SHIFT ls_facsimile-normalised_number_text LEFT DELETING LEADING '0'.
- *
- * ls_body-client__fax = |{ ls_telephone_1-normalised_number_text } { ls_telephone_2-normalised_number_text } { ';' } { ls_facsimile-normalised_number_text }|.
- *lv_24
- CLEAR lt_but0bk.
- SELECT *
- FROM but0bk
- INTO TABLE lt_but0bk
- WHERE partner = <ls_hrp>-partner.
- READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_25>) INDEX 1.
- IF <ls_but0bk_25> IS ASSIGNED.
- ls_body-client_invoice = <ls_but0bk_25>-bankn.
- ENDIF.
- *lv_26
- CLEAR lt_bnka.
- SELECT *
- FROM bnka
- INTO TABLE lt_bnka
- WHERE bankl = <ls_hrp>-partner.
- READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_26>) INDEX 1.
- IF <ls_bnka_26> IS ASSIGNED.
- ls_body-client_correspondent_accoun = <ls_bnka_26>-brnch.
- ENDIF.
- *lv_25, lv_27
- CLEAR lt_but0bk.
- SELECT *
- FROM but0bk
- INTO TABLE lt_but0bk
- WHERE partner = <ls_hrp>-partner.
- READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_27>) INDEX 1.
- IF <ls_but0bk_27> IS ASSIGNED.
- SELECT *
- FROM bnka
- INTO TABLE lt_bnka
- WHERE bankl = <ls_but0bk_27>-bankl.
- ENDIF.
- READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_27>) INDEX 1.
- IF <ls_bnka_27> IS ASSIGNED.
- ls_body-bank_2 = <ls_bnka_27>-banka.
- ENDIF.
- IF <ls_bnka_27> IS ASSIGNED.
- ls_body-client_bank = |{ <ls_bnka_27>-swift } { '/' } { <ls_bnka_27>-bnklz }|.
- ENDIF.
- APPEND ls_body TO et_body.
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement