Adressenaufbereitung mit CUSTOMER_ADDRESS_TO_ITF

DATA: lv_address TYPE bapiaddr3.
DATA: it_bapi_return TYPE STANDARD TABLE OF bapiret2 WITH DEFAULT KEY.
 
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
  EXPORTING
    username = sy-uname
  IMPORTING
    address  = lv_address
  TABLES
    return   = it_bapi_return.

DATA: lv_customer TYPE scustom.
lv_customer-name = lv_address-fullname.
lv_customer-street = lv_address-street.
lv_customer-postbox = lv_address-po_box.
lv_customer-postcode = lv_address-postl_cod1.
lv_customer-city   = lv_address-city.
lv_customer-country = lv_address-country.
lv_customer-region = lv_address-region.
lv_customer-telephone = lv_address-tel1_numbr.
lv_customer-email = lv_address-e_mail.

DATA: lv_sender_country TYPE szad_field-send_cntry.
lv_sender_country = 'US'.

DATA: it_address_lines TYPE tline_tab.

CALL FUNCTION 'CUSTOMER_ADDRESS_TO_ITF'
  EXPORTING
    is_customer        = lv_customer
    iv_sending_country = lv_sender_country
*   IV_NUMBER_OF_LINES = 5
  IMPORTING
    et_address         = it_address_lines.

cl_demo_output=>write_data( lv_address ).
cl_demo_output=>write_data( lv_customer ).
cl_demo_output=>write_data( lv_sender_country ).
cl_demo_output=>write_data( it_address_lines ).
cl_demo_output=>display( ).