EndUserText.label: 'XXXXXXX RFC for tax'
@ObjectModel.query.implementedBy: 'ABAP:ZCL_RFC_DETERMINE_JURISDICTION'
@UI: {
headerInfo: {
typeName: 'xxxxxx',
typeNamePlural: 'xxxxx RFC'
}
}
define custom entity zce_xxxxxx_rfc
with parameters im_country : land_tax,
im_zipcode : ort02_bas
{
key COUNTRY : land_tax;
STATE : regio;
CITY : ort01_gp;
COUNTY : ort02_bas;
ZIPCODE : pstlz;
TXJCD_L1 : lengx_txd;
TXJCD_L2 : lengx_txd;
TXJCD_L3 : lengx_txd;
TXJCD_L4 : lengx_txd;
TXJCD : txjcd;
OUTOF_CITY : outcity;
}
CLASS zcl_rfc_determine_jurisdiction DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_rap_query_provider.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_rfc_determine_jurisdiction IMPLEMENTATION.
METHOD if_rap_query_provider~select.
DATA lt_result TYPE STANDARD TABLE OF zce_xxxxxx_rfc.
DATA: lv_cntry TYPE land_tax,
lv_zipcode TYPE ort02_bas.
TRY.
TRY.
TRY.
IF io_request->is_data_requested( ).
io_request->get_paging( ).
DATA(lt_filter_cond) = io_request->get_parameters( ).
DATA(lt_filter_cond2) = io_request->get_filter( )->get_as_ranges( ).
lv_cntry = VALUE #( lt_filter_cond[ parameter_name = 'IM_COUNTRY' ]-value OPTIONAL ). "Fetching the parameter value
lv_zipcode = VALUE #( lt_filter_cond[ parameter_name = 'IM_ZIPCODE' ]-value OPTIONAL ). "Fetching the parameter value
"Initialize values
DATA(ls_error) = VALUE com_err( ).
"Build Location Data
DATA(ls_locdata) = VALUE com_jur(
country = lv_cntry
zipcode = lv_zipcode ).
CALL FUNCTION 'RFC_DETERMINE_JURISDICTION'
DESTINATION 'XXXXXX'
EXPORTING
location_data = ls_locdata
IMPORTING
location_err = ls_error
TABLES
location_results = lt_result
EXCEPTIONS
OTHERS = 1.
DATA(lv_offset) = io_request->get_paging( )->get_offset( ).
DATA(lv_page_size) = io_request->get_paging( )->get_page_size( ).
io_response->set_total_number_of_records( lines( lt_result ) ).
io_response->set_data( lt_result ).
ENDIF.
CATCH cx_rap_query_provider INTO DATA(lx_exc).
ENDTRY.
CATCH cx_rfc_dest_provider_error INTO DATA(lx_dest).
ENDTRY.
CATCH cx_rap_query_filter_no_range.
ENDTRY.
ENDMETHOD.
ENDCLASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
11 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |