.../ProductSet?$filter=substringof('ABC',ProductId) or substringof('ABC',SupplierName)
lt_filter_select_options = io_tech_request_context->get_filter( )->get_filter_select_options( ).
$filter=SupplierName eq 'Telecomunicaciones Star' and SupplierName ne 'Talpa' and SupplierName ne 'DelBont Industries'
$filter=substringof('Star',SupplierName) and SupplierName ne 'Talpa' and SupplierName ne 'DelBont Industries'
lt_filter_select_options = io_tech_request_context->get_filter( )->get_filter_select_options( ).
IF lt_filter_select_options IS INITIAL.
lo_filter_tree = io_tech_request_context->get_filter_expression_tree( ).
IF lo_filter_tree IS BOUND.
NEW cl_sadl_gw_filter_tree_parser( )->get_complex_condition(
EXPORTING
io_filter_tree = lo_filter_tree
IMPORTING
et_condition = DATA(lt_condition) ).
NEW cl_sadl_cond_to_ranges( )->convert_sadl_cond_to_ranges(
EXPORTING
it_sadl_conditions = lt_condition
IMPORTING
et_ranges = DATA(lt_ranges) ).
ENDIF.
DATA ls_filter_select_option TYPE /iwbep/s_mgw_select_option .
LOOP AT lt_ranges INTO DATA(ls_ranges).
ls_filter_select_option-property = ls_ranges-name.
ls_filter_select_option-select_options = CORRESPONDING #( ls_ranges-range ).
APPEND ls_filter_select_option TO lt_filter_select_options .
ENDLOOP.
ENDIF.
*-get select options from SAP Gateway framework
lt_filters = io_tech_request_context->get_filter( )->get_filter_select_options( ).
lo_filter_tree = io_tech_request_context->get_filter_expression_tree( ).
IF lo_filter_tree IS BOUND.
NEW cl_sadl_gw_filter_tree_parser( )->get_complex_condition(
EXPORTING
io_filter_tree = lo_filter_tree
IMPORTING
et_condition = DATA(lt_condition) ).
NEW cl_sadl_cond_to_ranges( )->convert_sadl_cond_to_ranges(
EXPORTING
it_sadl_conditions = lt_condition
IMPORTING
et_ranges = DATA(lt_ranges) ).
ENDIF.
value #(
( TYPE = `simpleValue` VALUE = `*HT*` ATTRIBUTE = `` )
( TYPE = `attribute` VALUE = `` ATTRIBUTE = `PRODUCT_ID` )
( TYPE = `containsPattern` VALUE = `` ATTRIBUTE = `` )
( TYPE = `simpleValue` VALUE = `*Star*` ATTRIBUTE = `` )
( TYPE = `attribute` VALUE = `` ATTRIBUTE = `SUPPLIER_NAME` )
( TYPE = `containsPattern` VALUE = `` ATTRIBUTE = `` )
( TYPE = `or` VALUE = `` ATTRIBUTE = `` )
).
IF NOT ( lt_condition[ 1 ]-type = 'simpleValue' AND lt_condition[ 1 ]-attribute IS INITIAL AND
lt_condition[ 4 ]-type = 'simpleValue' AND lt_condition[ 4 ]-attribute IS INITIAL AND
lt_condition[ 3 ]-type = 'containsPattern' AND lt_condition[ 3 ]-attribute IS INITIAL AND
lt_condition[ 6 ]-type = 'containsPattern' AND lt_condition[ 6 ]-attribute IS INITIAL
).
lv_wrong_filter = abap_true.
ENDIF.
IF lt_condition[ 2 ]-attribute = 'PRODUCT_ID' AND lt_condition[ 5 ]-attribute = 'SUPPLIER_NAME' .
DATA(supplier) = lt_condition[ 4 ]-value.
DATA(product) = lt_condition[ 1 ]-value.
lt_supplier_name = VALUE #( ( sign = 'I' option = 'CP' low = supplier ) ).
lt_product_id = VALUE #( ( sign = 'I' option = 'CP' low = product ) ).
ELSEIF lt_condition[ 5 ]-attribute = 'PRODUCT_ID' AND lt_condition[ 2 ]-attribute = 'SUPPLIER_NAME' .
supplier = lt_condition[ 1 ]-value.
product = lt_condition[ 4 ]-value.
lt_supplier_name = VALUE #( ( sign = 'I' option = 'CP' low = supplier ) ).
lt_product_id = VALUE #( ( sign = 'I' option = 'CP' low = product ) ).
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
lo_filter_tree = io_tech_request_context->get_filter_expression_tree( ).
lv_function = lo_function->function.
IF lv_function <> 'substringof'.
lv_filter_error = 'Only substringof is supported. '.
lv_wrong_filter = abap_true.
ENDIF.
lt_param_tab = lo_function->parameters.
IF lt_param_tab[ 1 ]->kind = /iwbep/if_mgw_expr_node~kind_literal.
lo_literal ?= lt_param_tab[ 1 ].
lv_literal = lo_literal->literal_converted.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
IF lt_param_tab[ 2 ]->kind = /iwbep/if_mgw_expr_node~kind_property.
lo_property ?= lt_param_tab[ 2 ].
lv_property = lo_property->property_name.
ELSE.
lv_wrong_filter = abap_true.
ENDIF
.../ProductSet?$filter=substringof('2001',ProductId) or substringof('AVANT',SupplierName)
?search=<search string>
data: lv_search_string type string.
lv_search_string = io_tech_request_context->get_search_string( ).
ls_supplier_name-sign = 'I'.
ls_supplier_name-option ='CP'.
ls_supplier_name-low = '*' && lv_search_string && '*'.
APPEND ls_supplier_name TO lt_supplier_name.
ls_product_id-sign = 'I'.
ls_product_id-option ='CP'.
ls_product_id-low = '*' && lv_search_string && '*'.
APPEND ls_product_id TO lt_product_id.
CLASS zcl_zaf_complex_filter_dpc_ext DEFINITION
PUBLIC
INHERITING FROM zcl_zaf_complex_filter_dpc
CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS productset_get_entityset REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_zaf_complex_filter_dpc_ext IMPLEMENTATION.
METHOD productset_get_entityset.
DATA : lo_filter_tree TYPE REF TO /iwbep/if_mgw_expr_node,
lo_left_node TYPE REF TO /iwbep/if_mgw_expr_node,
lo_right_node TYPE REF TO /iwbep/if_mgw_expr_node,
lo_binary TYPE REF TO /iwbep/if_mgw_expr_binary,
lo_function TYPE REF TO /iwbep/if_mgw_expr_function,
lo_property TYPE REF TO /iwbep/if_mgw_expr_property,
lo_literal TYPE REF TO /iwbep/if_mgw_expr_literal,
lt_param_tab TYPE /iwbep/if_mgw_expr_function=>parameter_t,
ls_param_tab TYPE LINE OF /iwbep/if_mgw_expr_function=>parameter_t,
lv_operator TYPE string,
lv_function TYPE string,
lv_literal TYPE string,
lv_property TYPE string,
lv_supported_filter_string TYPE string,
lv_filter_error TYPE string,
lv_wrong_filter TYPE abap_bool,
lt_filter_select_options TYPE /iwbep/t_mgw_select_option.
CONSTANTS : lc_kind_unary TYPE c LENGTH 1 VALUE 'U',
lc_kind_binary TYPE c LENGTH 1 VALUE 'B',
lc_kind_literal TYPE c LENGTH 1 VALUE 'C',
lc_kind_function TYPE c LENGTH 1 VALUE 'F',
lc_kind_member TYPE c LENGTH 1 VALUE 'M',
lc_kind_property TYPE c LENGTH 1 VALUE 'P'.
DATA: lt_headerdata TYPE STANDARD TABLE OF bapi_epm_product_header,
ls_headerdata TYPE bapi_epm_product_header,
lv_maxrows TYPE bapi_epm_max_rows,
ls_entity LIKE LINE OF et_entityset,
lt_product_id TYPE TABLE OF bapi_epm_product_id_range,
ls_product_id TYPE bapi_epm_product_id_range,
lt_supplier_name TYPE TABLE OF bapi_epm_supplier_name_range,
ls_supplier_name TYPE bapi_epm_supplier_name_range,
lt_category TYPE TABLE OF bapi_epm_product_categ_range,
ls_category TYPE bapi_epm_product_categ_range,
lt_return TYPE TABLE OF bapiret2,
lo_message_container TYPE REF TO /iwbep/if_message_container.
DATA supplier_name_range_pair TYPE sabp_s_name_range_pair.
DATA product_categ_range_pair TYPE sabp_s_name_range_pair.
DATA product_id_range_pair TYPE sabp_s_name_range_pair.
*- get number of records requested
DATA(lv_top) = io_tech_request_context->get_top( ).
DATA(lv_skip) = io_tech_request_context->get_skip( ).
IF lv_top IS NOT INITIAL.
lv_maxrows-bapimaxrow = lv_top + lv_skip.
ENDIF.
lo_filter_tree = io_tech_request_context->get_filter_expression_tree( ).
IF lo_filter_tree IS BOUND.
NEW cl_sadl_gw_filter_tree_parser( )->get_complex_condition(
EXPORTING
io_filter_tree = lo_filter_tree
IMPORTING
et_condition = DATA(lt_condition) ).
NEW cl_sadl_cond_to_ranges( )->convert_sadl_cond_to_ranges(
EXPORTING
it_sadl_conditions = lt_condition
IMPORTING
et_ranges = DATA(lt_ranges) ).
ENDIF.
lv_wrong_filter = abap_false.
IF lt_ranges IS NOT INITIAL.
READ TABLE lt_ranges WITH TABLE KEY name = 'SUPPLIER_NAME' INTO supplier_name_range_pair.
IF sy-subrc EQ 0.
lt_supplier_name = CORRESPONDING #( supplier_name_range_pair-range ).
ENDIF.
READ TABLE lt_ranges WITH TABLE KEY name = 'PRODUCT_ID' INTO supplier_name_range_pair.
IF sy-subrc EQ 0.
lt_product_id = CORRESPONDING #( product_id_range_pair-range ).
ENDIF.
READ TABLE lt_ranges WITH TABLE KEY name = 'CATEGORY' INTO product_categ_range_pair.
IF sy-subrc EQ 0.
lt_category = CORRESPONDING #( product_categ_range_pair-range ).
ENDIF.
ELSE.
*value #(
*( TYPE = `simpleValue` VALUE = `*HT*` ATTRIBUTE = `` )
*( TYPE = `attribute` VALUE = `` ATTRIBUTE = `PRODUCT_ID` )
*( TYPE = `containsPattern` VALUE = `` ATTRIBUTE = `` )
*( TYPE = `simpleValue` VALUE = `*Star*` ATTRIBUTE = `` )
*( TYPE = `attribute` VALUE = `` ATTRIBUTE = `SUPPLIER_NAME` )
*( TYPE = `containsPattern` VALUE = `` ATTRIBUTE = `` )
*( TYPE = `or` VALUE = `` ATTRIBUTE = `` )
* )
IF lines( lt_condition ) <> 7.
lv_wrong_filter = abap_true.
ENDIF.
IF NOT ( lt_condition[ 1 ]-type = 'simpleValue' AND lt_condition[ 1 ]-attribute IS INITIAL AND
lt_condition[ 4 ]-type = 'simpleValue' AND lt_condition[ 4 ]-attribute IS INITIAL AND
lt_condition[ 3 ]-type = 'containsPattern' AND lt_condition[ 3 ]-attribute IS INITIAL AND
lt_condition[ 6 ]-type = 'containsPattern' AND lt_condition[ 6 ]-attribute IS INITIAL
).
lv_wrong_filter = abap_true.
ENDIF.
IF lt_condition[ 2 ]-attribute = 'PRODUCT_ID' AND lt_condition[ 5 ]-attribute = 'SUPPLIER_NAME' .
DATA(supplier) = lt_condition[ 4 ]-value.
DATA(product) = lt_condition[ 1 ]-value.
lt_supplier_name = VALUE #( ( sign = 'I' option = 'CP' low = supplier ) ).
lt_product_id = VALUE #( ( sign = 'I' option = 'CP' low = product ) ).
ELSEIF lt_condition[ 5 ]-attribute = 'PRODUCT_ID' AND lt_condition[ 2 ]-attribute = 'SUPPLIER_NAME' .
supplier = lt_condition[ 1 ]-value.
product = lt_condition[ 4 ]-value.
lt_supplier_name = VALUE #( ( sign = 'I' option = 'CP' low = supplier ) ).
lt_product_id = VALUE #( ( sign = 'I' option = 'CP' low = product ) ).
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
ENDIF.
IF lv_wrong_filter = abap_true.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error_unlimited
message_unlimited = lv_filter_error && lv_supported_filter_string.
ENDIF.
*
* "first call of BAPI for select options for 'ProductId'.
IF lt_ranges IS INITIAL.
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
EXPORTING
max_rows = lv_maxrows
TABLES
headerdata = et_entityset
selparamproductid = lt_product_id
* selparamsuppliernames = lt_supplier_name
* selparamcategories = lt_category
return = lt_return.
IF lt_return IS NOT INITIAL.
*---Message Container
lo_message_container = mo_context->get_message_container( ).
lo_message_container->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = lo_message_container.
ENDIF.
"second call of BAPI with select options for 'SupplierName'
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
EXPORTING
max_rows = lv_maxrows
TABLES
headerdata = lt_headerdata
* selparamproductid = lt_product_id
selparamsuppliernames = lt_supplier_name
* SELPARAMCATEGORIES = lt_category
return = lt_return.
IF lt_return IS NOT INITIAL.
*---Message Container
lo_message_container = mo_context->get_message_container( ).
lo_message_container->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = lo_message_container.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
EXPORTING
max_rows = lv_maxrows
TABLES
headerdata = et_entityset
selparamproductid = lt_product_id
selparamsuppliernames = lt_supplier_name
selparamcategories = lt_category
return = lt_return.
IF lt_return IS NOT INITIAL.
*---Message Container
lo_message_container = mo_context->get_message_container( ).
lo_message_container->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = lo_message_container.
ENDIF.
ENDIF.
LOOP AT lt_headerdata INTO ls_headerdata.
"check if product is already part of the result set
READ TABLE et_entityset WITH KEY product_id = ls_headerdata-product_id TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND ls_headerdata TO et_entityset.
ENDIF.
ENDLOOP.
IF lv_skip IS NOT INITIAL.
DELETE et_entityset TO lv_skip.
ENDIF.
ENDMETHOD.
ENDCLASS.
METHOD productset_get_entityset.
DATA : lo_filter_tree TYPE REF TO /iwbep/if_mgw_expr_node,
lo_left_node TYPE REF TO /iwbep/if_mgw_expr_node,
lo_right_node TYPE REF TO /iwbep/if_mgw_expr_node,
lo_binary TYPE REF TO /iwbep/if_mgw_expr_binary,
lo_function TYPE REF TO /iwbep/if_mgw_expr_function,
lo_property TYPE REF TO /iwbep/if_mgw_expr_property,
lo_literal TYPE REF TO /iwbep/if_mgw_expr_literal,
lt_param_tab TYPE /iwbep/if_mgw_expr_function=>parameter_t,
ls_param_tab TYPE LINE OF /iwbep/if_mgw_expr_function=>parameter_t,
lv_operator TYPE string,
lv_function TYPE string,
lv_literal TYPE string,
lv_property TYPE string,
lv_supported_filter_string TYPE string,
lv_filter_error TYPE string,
lv_wrong_filter TYPE abap_bool,
lt_filter_select_options TYPE /iwbep/t_mgw_select_option.
CONSTANTS : lc_kind_unary TYPE c LENGTH 1 VALUE 'U',
lc_kind_binary TYPE c LENGTH 1 VALUE 'B',
lc_kind_literal TYPE c LENGTH 1 VALUE 'C',
lc_kind_function TYPE c LENGTH 1 VALUE 'F',
lc_kind_member TYPE c LENGTH 1 VALUE 'M',
lc_kind_property TYPE c LENGTH 1 VALUE 'P'.
DATA: lt_headerdata TYPE STANDARD TABLE OF bapi_epm_product_header,
ls_headerdata TYPE bapi_epm_product_header,
ls_entity LIKE LINE OF et_entityset,
lt_product_id TYPE TABLE OF bapi_epm_product_id_range,
ls_product_id TYPE bapi_epm_product_id_range,
lt_supplier_name TYPE TABLE OF bapi_epm_supplier_name_range,
ls_supplier_name TYPE bapi_epm_supplier_name_range,
lt_category TYPE TABLE OF bapi_epm_product_categ_range,
ls_category TYPE bapi_epm_product_categ_range,
lt_return TYPE TABLE OF bapiret2,
lo_message_container TYPE REF TO /iwbep/if_message_container.
lv_wrong_filter = abap_false.
lv_supported_filter_string = 'Only the following filterstring is supported: substringof(<some string>,SupplierName) or substringof(<some string>,ProductID)'.
lt_filter_select_options = io_tech_request_context->get_filter( )->get_filter_select_options( ).
IF lt_filter_select_options IS NOT INITIAL.
"implement coding to retrieve data via select options
ELSE.
lo_filter_tree = io_tech_request_context->get_filter_expression_tree( ).
IF lo_filter_tree IS BOUND.
IF lo_filter_tree->kind = lc_kind_binary. " 'B'
lo_filter_tree->prepare_converted_values( ).
lo_binary ?= lo_filter_tree.
lv_operator = lo_binary->operator.
lo_left_node = lo_binary->left_operand.
lo_right_node = lo_binary->right_operand.
IF lo_left_node IS BOUND.
IF lo_left_node->kind = lc_kind_function. " 'F' .
lo_function ?= lo_left_node.
lv_function = lo_function->function.
IF lv_function <> 'substringof'.
lv_filter_error = 'Only substringof is supported. '.
lv_wrong_filter = abap_true.
ENDIF.
lt_param_tab = lo_function->parameters.
IF lt_param_tab IS NOT INITIAL.
IF lt_param_tab[ 1 ]->kind = lc_kind_literal.
lo_literal ?= lt_param_tab[ 1 ].
lv_literal = lo_literal->literal_converted.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
IF lt_param_tab[ 2 ]->kind = lc_kind_property.
lo_property ?= lt_param_tab[ 2 ].
lv_property = lo_property->property_name.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
IF lv_property = 'SUPPLIER_NAME'.
ls_supplier_name-sign = 'I'.
ls_supplier_name-option ='CP'.
ls_supplier_name-low = '*' && lv_literal && '*'.
APPEND ls_supplier_name TO lt_supplier_name.
ELSEIF lv_property = 'PRODUCT_ID'.
ls_product_id-sign = 'I'.
ls_product_id-option ='CP'.
ls_product_id-low = '*' && lv_literal && '*'.
APPEND ls_product_id TO lt_product_id.
ELSE.
" raise error message that filter string does not match the expected format
" an additional property was found in the filter string
lv_filter_error = 'Property:' && lv_property && ' is not supported. '.
lv_wrong_filter = abap_true.
ENDIF.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
ENDIF.
CLEAR lo_function.
CLEAR lo_property.
CLEAR lo_literal.
CLEAR lt_param_tab.
CLEAR ls_param_tab.
CLEAR lv_operator.
CLEAR lv_function.
CLEAR lv_literal.
CLEAR lv_property.
IF lo_right_node IS BOUND.
IF lo_right_node->kind = lc_kind_function. " 'F' .
lo_function ?= lo_right_node.
lv_function = lo_function->function.
IF lv_function <> 'substringof'.
lv_filter_error = 'Only substringof is supported. '.
lv_wrong_filter = abap_true.
ENDIF.
lt_param_tab = lo_function->parameters.
IF lt_param_tab IS NOT INITIAL.
IF lt_param_tab[ 1 ]->kind = lc_kind_literal.
lo_literal ?= lt_param_tab[ 1 ].
lv_literal = lo_literal->literal_converted.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
IF lt_param_tab[ 2 ]->kind = lc_kind_property.
lo_property ?= lt_param_tab[ 2 ].
lv_property = lo_property->property_name.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
IF lv_property = 'SUPPLIER_NAME'.
ls_supplier_name-sign = 'I'.
ls_supplier_name-option ='CP'.
ls_supplier_name-low = '*' && lv_literal && '*'.
APPEND ls_supplier_name TO lt_supplier_name.
ELSEIF lv_property = 'PRODUCT_ID'.
ls_product_id-sign = 'I'.
ls_product_id-option ='CP'.
ls_product_id-low = '*' && lv_literal && '*'.
APPEND ls_product_id TO lt_product_id.
ELSE.
" raise error message that filter string does not match the expected format
" an additional property was found in the filter string
lv_filter_error = 'Property:' && lv_property && ' is not supported. '.
lv_wrong_filter = abap_true.
ENDIF.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
ELSE.
lv_wrong_filter = abap_true.
ENDIF.
ENDIF.
" IF lo_right_node->kind = /iwbep/if_mgw_expr_node~kind_function. " 'F' .
"lr_function ?= lo_right_node.
ELSE.
lv_filter_error = ' Filter is not binary. '.
lv_wrong_filter = abap_true.
ENDIF.
ENDIF.
IF lv_wrong_filter = abap_true.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error_unlimited
message_unlimited = lv_filter_error && lv_supported_filter_string.
ENDIF.
"first call of BAPI for select options for 'ProductId'.
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
* EXPORTING
* MAX_ROWS = lv_maxrows
TABLES
headerdata = et_entityset
selparamproductid = lt_product_id
* selparamsuppliernames = lt_supplier_name
* SELPARAMCATEGORIES = lt_category
return = lt_return.
IF lt_return IS NOT INITIAL.
*---Message Container
lo_message_container = mo_context->get_message_container( ).
lo_message_container->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = lo_message_container.
ENDIF.
"second call of BAPI with select options for 'SupplierName'
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
* EXPORTING
* MAX_ROWS = lv_maxrows
TABLES
headerdata = lt_headerdata
* selparamproductid = lt_product_id
selparamsuppliernames = lt_supplier_name
* SELPARAMCATEGORIES = lt_category
return = lt_return.
IF lt_return IS NOT INITIAL.
*---Message Container
lo_message_container = mo_context->get_message_container( ).
lo_message_container->add_messages_from_bapi(
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message_container = lo_message_container.
ENDIF.
LOOP AT lt_headerdata INTO ls_headerdata.
"check if product is already part of the result set
READ TABLE et_entityset WITH KEY product_id = ls_headerdata-product_id TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND ls_headerdata TO et_entityset.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
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 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 |