Advertisement
hxxxrz

Untitled

Jan 21st, 2021
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.05 KB | None | 0 0
  1. *& Дата создания: 02.12.2020
  2. *& Проект: Создание печатных форм
  3. *& Разработчик: Федоров К. Г.
  4.  
  5. METHOD get_carrieragr_data.
  6.  
  7. DATA ls_body TYPE zstm_agreement_body.
  8.  
  9. DATA:
  10. lt_selpar TYPE /bobf/t_frw_query_selparam, "стандарт
  11. lt_fag TYPE /scmtms/t_fag_root_k, "Database table БО
  12. ls_fag LIKE LINE OF lt_fag,
  13. lt_bfu TYPE /bofu/t_bupa_root_k,
  14. lt_bfu_bupa TYPE /bofu/t_bupa_root_k,
  15. lt_fagrtt TYPE /scmtms/t_short_text_k,
  16. lt_tax_number TYPE /bofu/t_bupa_taxno_k,
  17. lt_role TYPE /bofu/t_bupa_adrinfo_k,
  18. lt_adress TYPE /bofu/t_addr_addressi_k,
  19. lt_formatted_address TYPE /bofu/t_addr_formatted_addrk,
  20. lt_formated_add TYPE /bofu/t_addr_formatted_addrk,
  21. lv_assoc_key_telephone TYPE /bobf/obm_assoc_key,
  22. lv_assoc_key_facsimile TYPE /bobf/obm_assoc_key,
  23. lt_email TYPE /bofu/t_addr_emailk,
  24. lt_telephone TYPE /bofu/t_addr_telephonek,
  25. lt_facsimile TYPE /bofu/t_addr_facsimilek,
  26. lt_bupa_role TYPE /bofu/t_bupa_role_k,
  27. lt_postal_address TYPE /bofu/t_addr_postal_addressk,
  28. ls_telephone_1 LIKE LINE OF lt_telephone,
  29. ls_telephone_2 LIKE LINE OF lt_telephone,
  30. ls_facsimile LIKE LINE OF lt_facsimile,
  31. lv_tel_no_zeroes TYPE num20,
  32. lv_fax_no_zeroes TYPE num20,
  33. ls_selpar TYPE /bobf/s_frw_query_selparam,
  34. go_message TYPE REF TO /bobf/if_frw_message,
  35. lt_fag_party TYPE /scmtms/t_fag_party_k,
  36. ls_header TYPE zstm_agreement_header,
  37. ls_footer TYPE zstm_agreement_footer,
  38. lt_fagpty TYPE /scmtms/t_fag_party_k,
  39. ls_fagpty LIKE LINE OF lt_fagpty,
  40. lt_but0bk TYPE TABLE OF but0bk,
  41. lt_bnka TYPE TABLE OF bnka,
  42. lv_tax_number_ru1 LIKE ls_body-forwarder_tax_payer_id,
  43. lv_tax_number_ru3 LIKE ls_body-forwarder_tax_payer_id,
  44. ls_fagpty_12 LIKE ls_fagpty,
  45. ls_fagpty_1 LIKE ls_fagpty,
  46. lt_key TYPE /bobf/t_frw_key,
  47. lo_addr_srv TYPE REF TO /bobf/if_tra_service_manager,
  48. lt_bupa_text TYPE /scmtms/t_bp_text_k,
  49. lt_partner_alt_key TYPE TABLE OF bu_partner,
  50. lt_fag_contractors TYPE /scmtms/t_fag_contractors_k,
  51. lt_common TYPE /bofu/t_bupa_common_k,
  52. lt_text TYPE /scmtms/t_bp_text_k,
  53. lt_hrp TYPE TABLE OF /scmb/hrp5561,
  54. lt_t005t TYPE TABLE OF t005t,
  55. ls_t005t LIKE LINE OF lt_t005t,
  56. lt_t005u TYPE TABLE OF t005u,
  57. ls_t005u LIKE LINE OF lt_t005u,
  58. lt_bp_email TYPE /bofu/t_addr_emailk,
  59. lt_bp_tax_number TYPE /bofu/t_bupa_taxno_k,
  60. lt_bupa_addressinformation TYPE /bofu/t_bupa_adrinfo_k,
  61. ls_email LIKE LINE OF lt_email,
  62. ls_telephone LIKE LINE OF lt_telephone.
  63.  
  64. CHECK it_key IS NOT INITIAL.
  65.  
  66. mo_fag_srv->retrieve(
  67. EXPORTING
  68. iv_node_key = /scmtms/if_fag_c=>sc_node-root
  69. it_key = it_key
  70. iv_fill_data = abap_true
  71. IMPORTING
  72. et_data = lt_fag ).
  73.  
  74. READ TABLE lt_fag INTO ls_fag INDEX 1.
  75.  
  76. mo_fag_srv->retrieve_by_association(
  77. EXPORTING
  78. iv_node_key = /scmtms/if_fag_c=>sc_node-root
  79. it_key = it_key
  80. iv_association = /scmtms/if_fag_c=>sc_association-root-root_text
  81. iv_fill_data = abap_true
  82. IMPORTING
  83. et_data = lt_fagrtt ).
  84.  
  85. READ TABLE lt_fagrtt INTO DATA(ls_fagrtt) INDEX 1.
  86.  
  87. *lv_1 РАБОТАЕТ, ДЛЯ ls_fagrtt-description НЕТ description
  88. es_header-agreement_id = |{ ls_fag-fagrmntid044 } { ls_fagrtt-description }|.
  89.  
  90. mo_fag_srv->retrieve_by_association(
  91. EXPORTING
  92. iv_node_key = /scmtms/if_fag_c=>sc_node-root
  93. it_key = it_key
  94. iv_association = /scmtms/if_fag_c=>sc_association-root-party
  95. iv_fill_data = abap_true
  96. IMPORTING
  97. et_data = lt_fagpty
  98. et_target_key = DATA(lt_party_key) ).
  99.  
  100. READ TABLE lt_fagpty INTO ls_fagpty_12 WITH KEY pty_rco012_i = '12'.
  101. READ TABLE lt_fagpty INTO ls_fagpty_1 WITH KEY pty_rco012_i = '1'.
  102.  
  103. mo_fag_srv->retrieve_by_association(
  104. EXPORTING
  105. iv_node_key = /scmtms/if_fag_c=>sc_node-party
  106. it_key = lt_party_key
  107. iv_association = /scmtms/if_fag_c=>sc_association-party-bupa_bo_pty
  108. iv_fill_data = abap_true
  109. IMPORTING
  110. et_data = lt_bfu_bupa
  111. et_target_key = DATA(lt_bupa_key) ).
  112.  
  113. mo_bp_srv->retrieve_by_association(
  114. EXPORTING
  115. it_key = lt_bupa_key " lt_bofu_keys
  116. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  117. iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
  118. IMPORTING
  119. et_target_key = DATA(lt_bupa_addrinfo_keys)
  120. et_key_link = DATA(lt_bupa_root_to_addrinfo) ).
  121.  
  122. mo_bp_srv->retrieve_by_association(
  123. EXPORTING
  124. it_key = lt_bupa_addrinfo_keys
  125. iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
  126. iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
  127. IMPORTING
  128. et_target_key = DATA(lt_address_root_keys) ).
  129. * ----------------------------------------------------------------------------------------------------
  130. ls_selpar-attribute_name = /bofu/if_bupa_constants=>sc_query_attribute-root-query_by_role-partner.
  131. ls_selpar-option = 'EQ'.
  132. ls_selpar-sign = 'I'.
  133. ls_selpar-low = ls_fagpty_12-ptyintid_id133_i.
  134.  
  135. APPEND ls_selpar TO lt_selpar.
  136.  
  137. mo_bp_srv->query(
  138. EXPORTING
  139. iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
  140. it_selection_parameters = lt_selpar
  141. IMPORTING
  142. et_key = DATA(lt_fag_party_keys) ).
  143.  
  144. mo_bupa_srv->retrieve_by_association(
  145. EXPORTING
  146. it_key = lt_fag_party_keys
  147. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  148. iv_association = /scmtms/if_bp_c=>sc_association-root-text
  149. iv_fill_data = abap_true
  150. IMPORTING
  151. et_data = lt_bupa_text ).
  152.  
  153. READ TABLE lt_bupa_text ASSIGNING FIELD-SYMBOL(<ls_bupa_text>) WITH KEY txt_type = 'ZDOC'.
  154.  
  155. IF <ls_bupa_text> IS NOT ASSIGNED.
  156. READ TABLE lt_bupa_text ASSIGNING <ls_bupa_text> WITH KEY txt_type = 'ZDOCD'.
  157. ENDIF.
  158.  
  159. * ----------------------------------------------------------------------------------------------------
  160. *lv_2
  161. mo_bp_srv->retrieve_by_association(
  162. EXPORTING
  163. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  164. it_key = lt_bupa_key
  165. iv_association = /bofu/if_bupa_constants=>sc_association-root-common
  166. iv_fill_data = abap_true
  167. IMPORTING
  168. et_data = lt_common ).
  169.  
  170. READ TABLE lt_common ASSIGNING FIELD-SYMBOL(<ls_common>) INDEX 1.
  171.  
  172. IF <ls_common> IS ASSIGNED.
  173. ls_body-forwarder_name = |{ <ls_common>-firstname } { <ls_common>-lastname }|.
  174. ENDIF.
  175.  
  176. *lv_3
  177. mo_fag_srv->retrieve_by_association(
  178. EXPORTING
  179. iv_node_key = /scmtms/if_fag_c=>sc_node-root
  180. it_key = it_key
  181. iv_association = /scmtms/if_fag_c=>sc_association-root-contractors
  182. iv_fill_data = abap_true
  183. IMPORTING
  184. et_data = lt_fag_contractors ).
  185.  
  186. READ TABLE lt_fag_contractors ASSIGNING FIELD-SYMBOL(<ls_fag_contractors>) INDEX 1.
  187.  
  188. IF <ls_fag_contractors> IS ASSIGNED.
  189. SELECT partner
  190. FROM /scmb/hrp5561
  191. INTO CORRESPONDING FIELDS OF TABLE lt_hrp
  192. WHERE external_id EQ <ls_fag_contractors>-org_ext_id
  193. AND objid EQ <ls_fag_contractors>-org_unit.
  194. ENDIF.
  195.  
  196. READ TABLE lt_hrp ASSIGNING FIELD-SYMBOL(<ls_hrp>) INDEX 1.
  197.  
  198. CLEAR lt_selpar.
  199. CLEAR ls_selpar.
  200.  
  201. ls_selpar-attribute_name = /bofu/if_bupa_constants=>sc_query_attribute-root-query_by_role-partner.
  202. ls_selpar-option = 'EQ'.
  203. ls_selpar-sign = 'I'.
  204.  
  205. IF <ls_hrp> IS ASSIGNED.
  206. ls_selpar-low = <ls_hrp>-partner.
  207. ENDIF.
  208.  
  209. APPEND ls_selpar TO lt_selpar.
  210.  
  211. mo_bp_srv->query(
  212. EXPORTING
  213. iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
  214. it_selection_parameters = lt_selpar
  215. iv_fill_data = abap_false
  216. IMPORTING
  217. et_key = DATA(lt_bp_root_keys) ).
  218.  
  219. mo_bupa_srv->retrieve_by_association(
  220. EXPORTING
  221. it_key = lt_bp_root_keys
  222. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  223. iv_association = /scmtms/if_bp_c=>sc_association-root-text
  224. iv_fill_data = abap_true
  225. IMPORTING
  226. et_data = lt_text ).
  227.  
  228. READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zpos>)
  229. WITH KEY txt_type = 'ZPOS' .
  230. IF <ls_text_zpos> IS ASSIGNED.
  231. ls_body-client_name = <ls_text_zpos>-text.
  232. ENDIF.
  233.  
  234. READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zhead>)
  235. WITH KEY txt_type = 'ZHEAD' .
  236. IF <ls_text_zpos> IS ASSIGNED.
  237. ls_body-client_name = |{ ls_body-client_name } { <ls_text_zpos>-text }|.
  238. ENDIF.
  239.  
  240. *lv_4
  241. mo_fag_srv->retrieve_by_association(
  242. EXPORTING
  243. iv_node_key = /scmtms/if_fag_c=>sc_node-root
  244. it_key = it_key
  245. iv_association = /scmtms/if_fag_c=>sc_association-root-contractors
  246. iv_fill_data = abap_true
  247. IMPORTING
  248. et_data = lt_fag_contractors ).
  249.  
  250. READ TABLE lt_fag_contractors ASSIGNING FIELD-SYMBOL(<ls_fag_contractors_4>) INDEX 1.
  251.  
  252. IF <ls_fag_contractors_4> IS ASSIGNED.
  253. ls_body-wears = <ls_fag_contractors_4>-party_name.
  254. ENDIF.
  255.  
  256. *lv_5
  257. READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zdoc>)
  258. WITH KEY txt_type = 'ZDOC' .
  259. IF <ls_text_zdoc> IS ASSIGNED.
  260. ls_body-client_name = <ls_text_zdoc>-text.
  261. ENDIF.
  262.  
  263. READ TABLE lt_text ASSIGNING FIELD-SYMBOL(<ls_text_zdocd>)
  264. WITH KEY txt_type = 'ZDOCD' .
  265. IF <ls_text_zdocd> IS ASSIGNED.
  266. ls_body-client_name = |{ ls_body-client_name } { <ls_text_zdocd>-text }|.
  267. ENDIF.
  268.  
  269. *lv_6 заполнено в lv_2
  270.  
  271. *lv_7 РАБОТАЕТ, ПРОВЕРЕНО НАПОЛОВИНУ - НЕТ taxtype = 'RU3'
  272. CLEAR lt_partner_alt_key.
  273. APPEND ls_fagpty_12-ptyintid_id133_i TO lt_partner_alt_key.
  274.  
  275. CLEAR lt_key.
  276.  
  277. CALL METHOD mo_bp_srv->convert_altern_key
  278. EXPORTING
  279. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  280. iv_altkey_key = /bofu/if_bupa_constants=>sc_alternative_key-root-partner
  281. it_key = lt_partner_alt_key
  282. IMPORTING
  283. et_key = lt_key.
  284.  
  285. mo_bp_srv->retrieve_by_association(
  286. EXPORTING
  287. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  288. iv_association = /bofu/if_bupa_constants=>sc_association-root-tax_number
  289. iv_fill_data = abap_true
  290. it_key = lt_key
  291. IMPORTING
  292. et_data = lt_tax_number ).
  293.  
  294. LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru1_7>) WHERE taxtype = 'RU1'.
  295. lv_tax_number_ru1 = <ls_tax_number_ru1_7>-taxnumber.
  296. ENDLOOP.
  297.  
  298. LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru3_7>) WHERE taxtype = 'RU3'.
  299. lv_tax_number_ru3 = <ls_tax_number_ru3_7>-taxnumber.
  300. ENDLOOP.
  301.  
  302. ls_body-forwarder_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
  303.  
  304. *lv_8 НЕТ taxtype = 'RU5'
  305. LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru5_8>) WHERE taxtype = 'RU5'.
  306. IF <ls_tax_number_ru5_8> IS ASSIGNED.
  307. ls_body-forwarder_registration_number = <ls_tax_number_ru5_8>-taxnumber.
  308. ENDIF.
  309. ENDLOOP.
  310.  
  311. *lv_9
  312. mo_bp_srv->retrieve_by_association(
  313. EXPORTING
  314. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  315. iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
  316. iv_fill_data = abap_false
  317. it_key = lt_fag_party_keys
  318. IMPORTING
  319. et_target_key = DATA(lt_addressinf_key) ).
  320.  
  321. mo_bp_srv->retrieve_by_association(
  322. EXPORTING
  323. iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
  324. iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
  325. iv_fill_data = abap_false
  326. it_key = lt_addressinf_key
  327. IMPORTING
  328. et_target_key = DATA(lt_address_key) ).
  329.  
  330. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  331. EXPORTING
  332. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  333. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  334. iv_do_node_key = /bofu/if_addr_constants=>sc_node-formatted_address
  335. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-formatted_address
  336. IMPORTING
  337. ev_assoc_key = DATA(lv_assoc_key) ).
  338.  
  339. mo_bp_srv->retrieve_by_association(
  340. EXPORTING
  341. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  342. iv_association = lv_assoc_key
  343. iv_fill_data = abap_true
  344. it_key = lt_address_key
  345. IMPORTING
  346. et_data = lt_formatted_address ).
  347.  
  348. READ TABLE lt_formatted_address INTO DATA(ls_formatted_address) INDEX 1.
  349.  
  350. ls_body-forwarder_location = |{ ls_formatted_address-formatted_postal_address_descr }|.
  351.  
  352. *lv_10
  353. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  354. EXPORTING
  355. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  356. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  357. iv_do_node_key = /bofu/if_addr_constants=>sc_node-postal_address
  358. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-postal_address
  359. IMPORTING
  360. ev_node_key = DATA(lv_node_key_address_2)
  361. ev_assoc_key = DATA(lv_assoc_key_address_2) ).
  362.  
  363. mo_bp_srv->retrieve_by_association(
  364. EXPORTING
  365. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  366. iv_association = lv_assoc_key_address_2
  367. iv_fill_data = abap_true
  368. it_key = lt_address_key
  369. IMPORTING
  370. et_data = lt_postal_address ).
  371.  
  372. READ TABLE lt_postal_address INTO DATA(ls_postal_address) INDEX 1.
  373.  
  374. SELECT landx
  375. FROM t005t
  376. INTO CORRESPONDING FIELDS OF TABLE lt_t005t
  377. WHERE land1 EQ ls_postal_address-country_code AND spras = 'R'.
  378.  
  379. SELECT bezei
  380. FROM t005u
  381. INTO CORRESPONDING FIELDS OF TABLE lt_t005u
  382. WHERE land1 EQ ls_postal_address-country_code AND bland EQ ls_postal_address-region.
  383.  
  384. READ TABLE lt_t005u INTO ls_t005u INDEX 1.
  385. READ TABLE lt_t005t INTO ls_t005t INDEX 1.
  386.  
  387. 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 }|.
  388.  
  389. *lv_11
  390. CLEAR lv_assoc_key_address_2.
  391.  
  392. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  393. EXPORTING
  394. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  395. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  396. iv_do_node_key = /bofu/if_addr_constants=>sc_node-postal_address
  397. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-email
  398. IMPORTING
  399. ev_assoc_key = lv_assoc_key_address_2 ).
  400.  
  401. mo_bp_srv->retrieve_by_association(
  402. EXPORTING
  403. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  404. iv_association = lv_assoc_key_address_2
  405. iv_fill_data = abap_true
  406. it_key = lt_address_key
  407. IMPORTING
  408. et_data = lt_bp_email ).
  409.  
  410. READ TABLE lt_bp_email ASSIGNING FIELD-SYMBOL(<ls_bp_email>) INDEX 1.
  411.  
  412. IF <ls_bp_email> IS ASSIGNED.
  413. ls_body-forwarder_email = <ls_bp_email>-uri.
  414. ENDIF.
  415.  
  416. *lv_12
  417. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  418. EXPORTING
  419. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  420. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  421. iv_do_node_key = /bofu/if_addr_constants=>sc_node-telephone
  422. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-telephone
  423. IMPORTING
  424. ev_assoc_key = lv_assoc_key_telephone ).
  425.  
  426. mo_bp_srv->retrieve_by_association(
  427. EXPORTING
  428. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  429. iv_association = lv_assoc_key_telephone
  430. iv_fill_data = abap_true
  431. it_key = lt_address_key
  432. IMPORTING
  433. et_data = lt_telephone ).
  434.  
  435. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  436. EXPORTING
  437. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  438. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  439. iv_do_node_key = /bofu/if_addr_constants=>sc_node-facsimile
  440. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-facsimile
  441. IMPORTING
  442. ev_assoc_key = lv_assoc_key_facsimile ).
  443.  
  444. mo_bp_srv->retrieve_by_association(
  445. EXPORTING
  446. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  447. iv_association = lv_assoc_key_facsimile
  448. iv_fill_data = abap_true
  449. it_key = lt_fag_party_keys
  450. IMPORTING
  451. et_data = lt_facsimile ).
  452.  
  453. READ TABLE lt_telephone INTO ls_telephone_1 INDEX 1.
  454.  
  455. SHIFT ls_telephone_1-normalised_number_text LEFT DELETING LEADING '0'.
  456.  
  457. READ TABLE lt_telephone INTO ls_telephone_2 INDEX 2.
  458.  
  459. SHIFT ls_telephone_2-normalised_number_text LEFT DELETING LEADING '0'.
  460.  
  461. READ TABLE lt_facsimile INTO ls_facsimile INDEX 1.
  462.  
  463. SHIFT ls_facsimile-normalised_number_text LEFT DELETING LEADING '0'.
  464.  
  465. ls_body-forwarder_fax = |{ ls_telephone_1-normalised_number_text } { ls_telephone_2-normalised_number_text } { ';' } { ls_facsimile-normalised_number_text }|.
  466.  
  467. *lv_13
  468. SELECT *
  469. FROM but0bk
  470. INTO TABLE lt_but0bk
  471. WHERE partner = ls_fagpty_12-ptyintid_id133_i.
  472.  
  473. READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_13>) INDEX 1.
  474.  
  475. IF <ls_but0bk_13> IS ASSIGNED.
  476. ls_body-forwarder_invoice = <ls_but0bk_13>-bankn.
  477. ENDIF.
  478.  
  479. *lv_14, lv_16
  480. SELECT *
  481. FROM but0bk
  482. INTO TABLE lt_but0bk
  483. WHERE partner = ls_fagpty_12-ptyintid_id133_i.
  484.  
  485. READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_14>) INDEX 1.
  486.  
  487. IF <ls_but0bk_14> IS ASSIGNED.
  488. SELECT *
  489. FROM bnka
  490. INTO TABLE lt_bnka
  491. WHERE bankl = <ls_but0bk_14>-bankl.
  492. ENDIF.
  493.  
  494. READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_14>) INDEX 1.
  495.  
  496. IF <ls_bnka_14> IS ASSIGNED.
  497. ls_body-bank_1 = <ls_bnka_14>-banka.
  498. ENDIF.
  499.  
  500. IF <ls_bnka_14> IS ASSIGNED.
  501. ls_body-forwarder_bank = |{ <ls_bnka_14>-swift } { '/' } { <ls_bnka_14>-bnklz }|.
  502. ENDIF.
  503.  
  504. *lv_15
  505. READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_15>) INDEX 1.
  506.  
  507. IF <ls_bnka_15> IS ASSIGNED.
  508. ls_body-forwarder_correspondent_accoun = <ls_bnka_15>-brnch.
  509. ENDIF.
  510.  
  511. *lv_17
  512. ls_body-client_full_name = ls_body-wears.
  513.  
  514. *lv_18
  515. mo_bp_srv->retrieve_by_association(
  516. EXPORTING
  517. it_key = lt_bp_root_keys
  518. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  519. iv_association = /bofu/if_bupa_constants=>sc_association-root-tax_number
  520. IMPORTING
  521. et_data = lt_bp_tax_number ).
  522.  
  523. READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru1>) WITH KEY taxtype = 'RU1' .
  524. IF <ls_bp_tax_number_ru1> IS ASSIGNED.
  525. lv_tax_number_ru1 = <ls_bp_tax_number_ru1>-taxnumber.
  526. ENDIF.
  527.  
  528. READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru3>) WITH KEY taxtype = 'RU3' .
  529. IF <ls_bp_tax_number_ru3> IS ASSIGNED.
  530. lv_tax_number_ru3 = <ls_bp_tax_number_ru3>-taxnumber.
  531. ENDIF.
  532.  
  533. ls_body-client_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
  534.  
  535. * CLEAR lt_partner_alt_key.
  536. *
  537. * APPEND ls_fagpty_1-ptyintid_id133_i TO lt_partner_alt_key.
  538. *
  539. * CLEAR lt_key.
  540. *
  541. * CALL METHOD mo_bp_srv->convert_altern_key
  542. * EXPORTING
  543. * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  544. * iv_altkey_key = /bofu/if_bupa_constants=>sc_alternative_key-root-partner
  545. * it_key = lt_partner_alt_key
  546. * IMPORTING
  547. * et_key = lt_key.
  548. *
  549. * CLEAR lt_tax_number.
  550. *
  551. * mo_bp_srv->retrieve_by_association(
  552. * EXPORTING
  553. * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  554. * iv_association = /bofu/if_bupa_constants=>sc_association-root-tax_number
  555. * iv_fill_data = abap_true
  556. * it_key = lt_key
  557. * IMPORTING
  558. * et_data = lt_tax_number ).
  559. *
  560. * CLEAR lv_tax_number_ru1.
  561. *
  562. * LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru1_18>) WHERE taxtype = 'RU1'.
  563. * lv_tax_number_ru1 = <ls_tax_number_ru1_18>-taxnumber.
  564. * ENDLOOP.
  565. *
  566. * CLEAR lv_tax_number_ru3.
  567. *
  568. * LOOP AT lt_tax_number ASSIGNING FIELD-SYMBOL(<ls_tax_number_ru3_18>) WHERE taxtype = 'RU3'.
  569. * lv_tax_number_ru3 = <ls_tax_number_ru3_18>-taxnumber.
  570. * ENDLOOP.
  571. *
  572. * ls_body-client_tax_payer_id = |{ lv_tax_number_ru1 } { lv_tax_number_ru3 }|.
  573.  
  574. *lv_19
  575. READ TABLE lt_bp_tax_number ASSIGNING FIELD-SYMBOL(<ls_bp_tax_number_ru5>) WITH KEY taxtype = 'RU5' .
  576. IF <ls_bp_tax_number_ru5> IS ASSIGNED.
  577. ls_body-client_registration_numbe = <ls_bp_tax_number_ru5>-taxnumber.
  578. ENDIF.
  579.  
  580. *lv_20
  581. mo_bp_srv->retrieve_by_association(
  582. EXPORTING
  583. it_key = lt_bp_root_keys
  584. iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  585. iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
  586. iv_fill_data = abap_false
  587. IMPORTING
  588. et_target_key = DATA(lt_bupa_addressinformation_key) ).
  589.  
  590. CLEAR lt_address_key.
  591.  
  592. mo_bp_srv->retrieve_by_association(
  593. EXPORTING
  594. iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
  595. iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
  596. iv_fill_data = abap_false
  597. it_key = lt_bupa_addressinformation_key
  598. IMPORTING
  599. et_target_key = lt_address_key ).
  600.  
  601. CLEAR lv_assoc_key.
  602.  
  603. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  604. EXPORTING
  605. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  606. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  607. iv_do_node_key = /bofu/if_addr_constants=>sc_node-postal_address
  608. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-postal_address
  609. IMPORTING
  610. ev_assoc_key = lv_assoc_key ).
  611.  
  612. CLEAR lt_postal_address.
  613. CLEAR ls_postal_address.
  614.  
  615. mo_bp_srv->retrieve_by_association(
  616. EXPORTING
  617. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  618. iv_association = lv_assoc_key
  619. iv_fill_data = abap_true
  620. it_key = lt_address_key
  621. IMPORTING
  622. et_data = lt_postal_address ).
  623.  
  624. READ TABLE lt_postal_address INTO ls_postal_address INDEX 1.
  625.  
  626. CLEAR lt_t005t.
  627. CLEAR ls_t005t.
  628.  
  629. SELECT landx
  630. FROM t005t
  631. INTO CORRESPONDING FIELDS OF TABLE lt_t005t
  632. WHERE land1 EQ ls_postal_address-country_code AND spras = 'R'.
  633.  
  634. CLEAR lt_t005u.
  635. CLEAR ls_t005u.
  636.  
  637. SELECT bezei
  638. FROM t005u
  639. INTO CORRESPONDING FIELDS OF TABLE lt_t005u
  640. WHERE land1 EQ ls_postal_address-country_code AND bland EQ ls_postal_address-region.
  641.  
  642. READ TABLE lt_t005u INTO ls_t005u INDEX 1.
  643. READ TABLE lt_t005t INTO ls_t005t INDEX 1.
  644.  
  645. 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 }|.
  646.  
  647. * CLEAR ls_selpar.
  648. * CLEAR lt_selpar.
  649. *
  650. * ls_selpar-attribute_name = /bofu/if_bupa_constants=>sc_query_attribute-root-query_by_role-partner.
  651. * ls_selpar-option = 'EQ'.
  652. * ls_selpar-sign = 'I'.
  653. *
  654. * ls_selpar-low = ls_fagpty_1-ptyintid_id133_i.
  655. *
  656. * APPEND ls_selpar TO lt_selpar.
  657. *
  658. * CLEAR lt_fag_party_keys.
  659. *
  660. * mo_bp_srv->query(
  661. * EXPORTING
  662. * iv_query_key = /bofu/if_bupa_constants=>sc_query-root-query_by_role
  663. * it_selection_parameters = lt_selpar
  664. * IMPORTING
  665. * et_key = lt_fag_party_keys ).
  666. *
  667. * CLEAR lt_addressinf_key.
  668. *
  669. * mo_bp_srv->retrieve_by_association(
  670. * EXPORTING
  671. * iv_node_key = /bofu/if_bupa_constants=>sc_node-root
  672. * iv_association = /bofu/if_bupa_constants=>sc_association-root-addressinformation
  673. * iv_fill_data = abap_false
  674. * it_key = lt_fag_party_keys
  675. * IMPORTING
  676. * et_target_key = lt_addressinf_key ).
  677. *
  678. * CLEAR lt_address_key.
  679. *
  680. * mo_bp_srv->retrieve_by_association(
  681. * EXPORTING
  682. * iv_node_key = /bofu/if_bupa_constants=>sc_node-addressinformation
  683. * iv_association = /bofu/if_bupa_constants=>sc_association-addressinformation-address
  684. * iv_fill_data = abap_false
  685. * it_key = lt_addressinf_key
  686. * IMPORTING
  687. * et_target_key = lt_address_key ).
  688. *
  689. * CLEAR lt_formatted_address.
  690. *
  691. * mo_bp_srv->retrieve_by_association(
  692. * EXPORTING
  693. * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  694. * iv_association = lv_assoc_key
  695. * iv_fill_data = abap_true
  696. * it_key = lt_address_key
  697. * IMPORTING
  698. * et_data = lt_formatted_address ).
  699. *
  700. * CLEAR ls_formatted_address.
  701. *
  702. * READ TABLE lt_formatted_address INTO ls_formatted_address INDEX 1.
  703. *
  704. * ls_body-client_location = |{ ls_formatted_address-formatted_postal_address_descr }|.
  705.  
  706. *lv_21
  707. ls_body-client_mail_address = ls_body-client_location.
  708.  
  709. * CLEAR lv_assoc_key_address_2.
  710. *
  711. * /scmtms/cl_common_helper=>get_do_keys_4_rba(
  712. * EXPORTING
  713. * iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  714. * iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  715. * iv_do_node_key = /bofu/if_addr_constants=>sc_node-postal_address
  716. * iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-postal_address
  717. * IMPORTING
  718. * ev_assoc_key = lv_assoc_key_address_2 ).
  719. *
  720. * CLEAR lt_postal_address.
  721. *
  722. * mo_bp_srv->retrieve_by_association(
  723. * EXPORTING
  724. * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  725. * iv_association = lv_assoc_key_address_2
  726. * iv_fill_data = abap_true
  727. * it_key = lt_address_key
  728. * IMPORTING
  729. * et_data = lt_postal_address ).
  730. *
  731. * READ TABLE lt_postal_address INTO ls_postal_address INDEX 1.
  732. *
  733. * 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 }|.
  734.  
  735. *lv_22
  736. CLEAR lv_assoc_key.
  737.  
  738. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  739. EXPORTING
  740. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  741. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  742. iv_do_node_key = /bofu/if_addr_constants=>sc_node-email
  743. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-email
  744. IMPORTING
  745. ev_assoc_key = lv_assoc_key ).
  746.  
  747. CLEAR lt_email.
  748. CLEAR ls_email.
  749.  
  750. mo_bp_srv->retrieve_by_association(
  751. EXPORTING
  752. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  753. iv_association = lv_assoc_key
  754. iv_fill_data = abap_true
  755. it_key = lt_address_key
  756. IMPORTING
  757. et_data = lt_email ).
  758.  
  759. READ TABLE lt_email INTO ls_email INDEX 1.
  760.  
  761. ls_body-forwarder_email = ls_email-uri.
  762.  
  763. * CLEAR lt_adr6.
  764. *
  765. * SELECT *
  766. * FROM adr6
  767. * INTO TABLE lt_adr6
  768. * WHERE persnumber = ls_fagpty_1-ptyintid_id133_i.
  769. *
  770. * READ TABLE lt_adr6 ASSIGNING FIELD-SYMBOL(<ls_adr6_22>) INDEX 1.
  771. *
  772. * IF <ls_adr6_22> IS ASSIGNED.
  773. * ls_body-forwarder_email = <ls_adr6_22>-smtp_addr.
  774. * ENDIF.
  775.  
  776. *lv_23
  777. CLEAR lv_assoc_key.
  778.  
  779. /scmtms/cl_common_helper=>get_do_keys_4_rba(
  780. EXPORTING
  781. iv_host_bo_key = /bofu/if_bupa_constants=>sc_bo_key
  782. iv_host_do_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  783. iv_do_node_key = /bofu/if_addr_constants=>sc_node-telephone
  784. iv_do_assoc_key = /bofu/if_addr_constants=>sc_association-root-telephone
  785. IMPORTING
  786. ev_assoc_key = lv_assoc_key ).
  787.  
  788. CLEAR lt_telephone.
  789. CLEAR ls_telephone.
  790.  
  791. mo_bp_srv->retrieve_by_association(
  792. EXPORTING
  793. iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  794. iv_association = lv_assoc_key
  795. iv_fill_data = abap_true
  796. it_key = lt_address_key
  797. IMPORTING
  798. et_data = lt_telephone ).
  799.  
  800. READ TABLE lt_telephone INTO ls_telephone INDEX 1.
  801.  
  802. ls_body-client__fax = ls_telephone-normalised_number_text.
  803.  
  804. * CLEAR lt_telephone.
  805. *
  806. * mo_bp_srv->retrieve_by_association(
  807. * EXPORTING
  808. * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  809. * iv_association = lv_assoc_key_telephone
  810. * iv_fill_data = abap_true
  811. * it_key = lt_address_key
  812. * IMPORTING
  813. * et_data = lt_telephone ).
  814. *
  815. * CLEAR lt_facsimile.
  816. *
  817. * mo_bp_srv->retrieve_by_association(
  818. * EXPORTING
  819. * iv_node_key = /bofu/if_bupa_constants=>sc_node-/bofu/address
  820. * iv_association = lv_assoc_key_facsimile
  821. * iv_fill_data = abap_true
  822. * it_key = lt_fag_party_keys
  823. * IMPORTING
  824. * et_data = lt_facsimile ).
  825. *
  826. * CLEAR ls_telephone_1.
  827. * CLEAR ls_telephone_2.
  828. * CLEAR ls_facsimile.
  829. *
  830. * READ TABLE lt_telephone INTO ls_telephone_1 INDEX 1.
  831. *
  832. * SHIFT ls_telephone_1-normalised_number_text LEFT DELETING LEADING '0'.
  833. *
  834. * READ TABLE lt_telephone INTO ls_telephone_2 INDEX 2.
  835. *
  836. * SHIFT ls_telephone_2-normalised_number_text LEFT DELETING LEADING '0'.
  837. *
  838. * READ TABLE lt_facsimile INTO ls_facsimile INDEX 1.
  839. *
  840. * SHIFT ls_facsimile-normalised_number_text LEFT DELETING LEADING '0'.
  841. *
  842. * ls_body-client__fax = |{ ls_telephone_1-normalised_number_text } { ls_telephone_2-normalised_number_text } { ';' } { ls_facsimile-normalised_number_text }|.
  843.  
  844. *lv_24
  845. CLEAR lt_but0bk.
  846.  
  847. SELECT *
  848. FROM but0bk
  849. INTO TABLE lt_but0bk
  850. WHERE partner = <ls_hrp>-partner.
  851.  
  852. READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_25>) INDEX 1.
  853.  
  854. IF <ls_but0bk_25> IS ASSIGNED.
  855. ls_body-client_invoice = <ls_but0bk_25>-bankn.
  856. ENDIF.
  857.  
  858. *lv_26
  859. CLEAR lt_bnka.
  860.  
  861. SELECT *
  862. FROM bnka
  863. INTO TABLE lt_bnka
  864. WHERE bankl = <ls_hrp>-partner.
  865.  
  866. READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_26>) INDEX 1.
  867.  
  868. IF <ls_bnka_26> IS ASSIGNED.
  869. ls_body-client_correspondent_accoun = <ls_bnka_26>-brnch.
  870. ENDIF.
  871.  
  872. *lv_25, lv_27
  873. CLEAR lt_but0bk.
  874.  
  875. SELECT *
  876. FROM but0bk
  877. INTO TABLE lt_but0bk
  878. WHERE partner = <ls_hrp>-partner.
  879.  
  880. READ TABLE lt_but0bk ASSIGNING FIELD-SYMBOL(<ls_but0bk_27>) INDEX 1.
  881.  
  882. IF <ls_but0bk_27> IS ASSIGNED.
  883. SELECT *
  884. FROM bnka
  885. INTO TABLE lt_bnka
  886. WHERE bankl = <ls_but0bk_27>-bankl.
  887. ENDIF.
  888.  
  889. READ TABLE lt_bnka ASSIGNING FIELD-SYMBOL(<ls_bnka_27>) INDEX 1.
  890.  
  891. IF <ls_bnka_27> IS ASSIGNED.
  892. ls_body-bank_2 = <ls_bnka_27>-banka.
  893. ENDIF.
  894.  
  895. IF <ls_bnka_27> IS ASSIGNED.
  896. ls_body-client_bank = |{ <ls_bnka_27>-swift } { '/' } { <ls_bnka_27>-bnklz }|.
  897. ENDIF.
  898.  
  899. APPEND ls_body TO et_body.
  900. ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement