METHOD if_ex_cts_import_feedback~feedback_after_import.
DATA: corr TYPE trwbo_request,
tables TYPE tt_tabnames.
* Read object keys for import
CLEAR: tables.
LOOP AT requests INTO DATA(request).
CLEAR corr.
CALL FUNCTION 'TR_READ_REQUEST'
EXPORTING
iv_read_objs_keys = 'X'
iv_trkorr = request-trkorr
CHANGING
cs_request = corr
EXCEPTIONS
error_occured = 1
no_authorization = 2
OTHERS = 3.
IF sy-subrc = 0.
* Record any tables for evaluation in BRF+
LOOP AT corr-keys INTO DATA(key)
WHERE object = 'TABU'.
APPEND key-objname TO tables.
ENDLOOP.
ELSE.
* Should never happen based on data requested in FM
ENDIF.
ENDLOOP.
* Sort and remove duplicates and pass to RFC for
* communication
SORT tables.
DELETE ADJACENT DUPLICATES FROM tables.
CALL FUNCTION 'ZCA_WS_CONFIG_UPDATE_DISPATCH'
DESTINATION 'CFGUPDDISP'
EXPORTING
table = tables.
ENDMETHOD.
FUNCTION zca_ws_config_update_dispatch.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(TABLE) TYPE TT_TABNAMES
*"----------------------------------------------------------------------
DATA:timestamp TYPE timestamp,
t_name_value TYPE abap_parmbind_tab,
name_value TYPE abap_parmbind,
r_data TYPE REF TO data,
input TYPE zzca_ws_config_update_dispatch,
proxy TYPE REF TO zco_zws_config_update_dispatch.
CONSTANTS: function_id TYPE if_fdt_types=>id VALUE '005056977E091EECA1F05A7D5FE1B25F'.
* Set timestamp for processing and move input data into reference
GET TIME STAMP FIELD timestamp.
name_value-name = 'TT_TABNAMES'.
GET REFERENCE OF table INTO r_data.
cl_fdt_function_process=>move_data_to_data_object( EXPORTING ir_data = r_data
iv_function_id = function_id
iv_data_object = '005056977E091EECA1F05DC93384D25F' "TT_TABNAMES
iv_timestamp = timestamp
iv_trace_generation = abap_false
iv_has_ddic_binding = abap_true
IMPORTING er_data = name_value-value ).
INSERT name_value INTO TABLE t_name_value.
CLEAR name_value.
TRY.
* Execute BRF+ function
cl_fdt_function_process=>process( EXPORTING iv_function_id = function_id
iv_timestamp = timestamp
IMPORTING ea_result = input-table-item
CHANGING ct_name_value = t_name_value ).
* Only execute proxy if any tables of interest are found
IF input-table-item[] IS NOT INITIAL.
CREATE OBJECT proxy.
CALL METHOD proxy->zca_ws_config_update_dispatch
EXPORTING
input = input.
COMMIT WORK.
ENDIF.
CATCH cx_fdt.
* Do what on error?
CATCH cx_ai_system_fault.
* Do what on error?
ENDTRY.
ENDFUNCTION.
// Insert message headers
def void setHeader(String[] keys, String[] values, Output output, MappingContext context){
def i = 0;
while(i < keys.size()) {
context.setHeader(keys[i], values[i]);
i++;
}
}
// Create context queue to match keys with values
def void joinContexts(String[] input1, String[] input2, String[] input3, Output output, MappingContext context){
output.addValue(input1[0]);
output.addValue(input2[0]);
output.addValue(input3[0]);
}
<?xml version='1.0' encoding='UTF-8'?>
<multimap:Messages xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<multimap:Message1>
<Root>
<StoredProcedure>sp_TVV1T</StoredProcedure>
</Root>
</multimap:Message1>
<multimap:Message2>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID>T01</AdditionalCustomerGroup1_ID>
<AdditionalCustomerGroup1Text>Tier 1</AdditionalCustomerGroup1Text>
</AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID>T02</AdditionalCustomerGroup1_ID>
<AdditionalCustomerGroup1Text>Tier 2</AdditionalCustomerGroup1Text>
</AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID>T03</AdditionalCustomerGroup1_ID>
<AdditionalCustomerGroup1Text>Tier 3</AdditionalCustomerGroup1Text>
</AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID>T04</AdditionalCustomerGroup1_ID>
<AdditionalCustomerGroup1Text>Tier 4</AdditionalCustomerGroup1Text>
</AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID>T05</AdditionalCustomerGroup1_ID>
<AdditionalCustomerGroup1Text>Tier 5</AdditionalCustomerGroup1Text>
</AdditionalCustomerGroup1>
<AdditionalCustomerGroup1>
<AdditionalCustomerGroup1_ID/>
<AdditionalCustomerGroup1Text/>
</AdditionalCustomerGroup1>
</AdditionalCustomerGroup1>
</multimap:Message2>
</multimap:Messages>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<xsl:template match="/">
<root>
<StatementName>
<storedProcedureName action="EXECUTE">
<table><xsl:value-of select="multimap:Messages/multimap:Message1/Root/StoredProcedure"/></table>
<ProcedureParameter type="CLOB">
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<!-- TVM4T Procedure -->
<xsl:for-each select="multimap:Messages/multimap:Message2/AdditionalMaterialGroup4">
<List>
<xsl:for-each select="AdditionalMaterialGroup4[AdditionalMaterialGroup4_ID!='']">
<Item>
<MaterialGroup4><xsl:value-of select="AdditionalMaterialGroup4_ID"/></MaterialGroup4>
<MaterialGroup4Text><xsl:value-of select="AdditionalMaterialGroup4Text"/></MaterialGroup4Text>
</Item>
</xsl:for-each>
</List>
</xsl:for-each>
<!-- TVM5T Procedure -->
<xsl:for-each select="multimap:Messages/multimap:Message2/AdditionalMaterialGroup5">
<List>
<xsl:for-each select="AdditionalMaterialGroup5[AdditionalMaterialGroup5_ID!='']">
<Item>
<MaterialGroup5><xsl:value-of select="AdditionalMaterialGroup5_ID"/></MaterialGroup5>
<MaterialGroup5Text><xsl:value-of select="AdditionalMaterialGroup5Text"/></MaterialGroup5Text>
</Item>
</xsl:for-each>
</List>
</xsl:for-each>
<!-- TVV1T Procedure -->
<xsl:for-each select="multimap:Messages/multimap:Message2/AdditionalCustomerGroup1">
<List>
<xsl:for-each select="AdditionalCustomerGroup1[AdditionalCustomerGroup1_ID!='']">
<Item>
<CustomerGroup1><xsl:value-of select="AdditionalCustomerGroup1_ID"/></CustomerGroup1>
<CustomerGroup1Text><xsl:value-of select="AdditionalCustomerGroup1Text"/></CustomerGroup1Text>
</Item>
</xsl:for-each>
</List>
</xsl:for-each>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</ProcedureParameter>
</storedProcedureName>
</StatementName>
</root>
</xsl:template>
</xsl:stylesheet>
<root xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<StatementName>
<storedProcedureName action="EXECUTE">
<table>sp_TVV1T</table>
<ProcedureParameter type="CLOB">
<![CDATA[
<List>
<Item><CustomerGroup1>T01</CustomerGroup1><CustomerGroup1Text>Tier 1</CustomerGroup1Text></Item>
<Item><CustomerGroup1>T02</CustomerGroup1><CustomerGroup1Text>Tier 2</CustomerGroup1Text></Item>
<Item><CustomerGroup1>T03</CustomerGroup1><CustomerGroup1Text>Tier 3</CustomerGroup1Text></Item>
<Item><CustomerGroup1>T04</CustomerGroup1><CustomerGroup1Text>Tier 4</CustomerGroup1Text></Item>
<Item><CustomerGroup1>T05</CustomerGroup1><CustomerGroup1Text>Tier 5</CustomerGroup1Text></Item>
</List>
]]>
</ProcedureParameter>
</storedProcedureName>
</StatementName>
</root>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |