*&---------------------------------------------------------------------*
*& Report ZTEST_WS_VAT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZTEST_WS_VAT.
*DATA: me TYPE REF TO ZES_CO_CHECK_VAT_PORT_TYPE.
DATA: testobj TYPE REF TO ZES_CO_CHECK_VAT_PORT_TYPE.
DATA: SYS_FAULT TYPE REF TO CX_AI_SYSTEM_FAULT,
APP_FAULT TYPE REF TO CX_AI_APPLICATION_FAULT,
L_EXCEPTION_MSG TYPE STRING.
TRY.
* CREATE OBJECT me
CREATE OBJECT testobj
EXPORTING
LOGICAL_PORT_NAME = 'TEST_CHECKVAT'.
.
CATCH CX_AI_APPLICATION_FAULT.
ENDTRY.
DATA:INPUT TYPE ZES_CHECK_VAT_REQUEST,
OUTPUT TYPE ZES_CHECK_VAT_RESPONSE.
INPUT-COUNTRY_CODE = 'IT'.
INPUT-VAT_NUMBER = 'XXXXXXXXXXX'.
TRY.
* CALL METHOD me->CHECK_VAT
CALL METHOD testobj->CHECK_VAT
EXPORTING
CHECK_VAT_REQUEST = INPUT
IMPORTING
CHECK_VAT_RESPONSE = OUTPUT.
CATCH CX_AI_SYSTEM_FAULT INTO SYS_FAULT.
L_EXCEPTION_MSG = SYS_FAULT->GET_TEXT( ).
WRITE:/'SYSTEM ERROR', L_EXCEPTION_MSG.
EXIT.
CATCH CX_AI_APPLICATION_FAULT INTO APP_FAULT .
L_EXCEPTION_MSG = APP_FAULT->GET_TEXT( ).
WRITE:/'APPLICATION ERROR', L_EXCEPTION_MSG.
EXIT.
ENDTRY.
WRITE: / OUTPUT-VALID,
/ OUTPUT-COUNTRY_CODE,
/ OUTPUT-VAT_NUMBER,
/ OUTPUT-REQUEST_DATE,
/ OUTPUT-NAME,
/ OUTPUT-ADDRESS.