SAP MDG · REPLICATION OUTBOUND

How do I implement an outbound proxy flow for MDG/BP data with nested payload mapping, technical fault handling, and a GTS-style validate/update sequence?

Use the standard outbound proxy pattern: copy source data into local variables, normalize it, fill the generated root and child nodes step by step, call the proxy method, catch technical faults such as `cx_ai_system_fault`, and return a readable application message. For GTS-style flows, validate customer name, country, and address data first, then reuse the prepared payload for the update call.

Use the standard outbound proxy pattern: copy source data into local variables, normalize it, fill the generated root and child nodes step by step, call the proxy method, catch technical faults such as `cx_ai_system_fault`, and return a readable application message. For GTS-style flows, validate customer name, country, and address data first, then reuse the prepared payload for the update call.

Use the outbound proxy pattern when an MDG or business application must assemble runtime data and send it to an external system. The recommended sequence is to keep the original input unchanged, normalize the values, populate the generated root structure first, then fill child nodes such as partner key, header, central data, address data, communication data, and sales/company data before calling the generated proxy method.

Process flow

  1. Collect the source data from the business context.
  2. Copy the input into a working structure and keep the original unchanged.
  3. Normalize values such as names, partner numbers, country, and language.
  4. Fill the generated root proxy structure first.
  5. Populate child nodes step by step: partner key, header, central data, address data, communication data, and sales/company data.
  6. Instantiate the generated proxy class.
  7. Call the outbound proxy method with the fully populated request structure.
  8. Catch `cx_ai_system_fault` or the proxy-specific system exception and convert it to a readable message using `get_text( )`.

Report-based harness such as `ZSAM_TEST`

Use a controlled test entry point for manual proxy payload assembly and outbound execution.

Referenced tables

ObjectPurpose
— No table is explicitly specified in the retrieved proxy pattern; use the generated proxy structures and response types from your own proxy setup.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example: generic_outbound_proxy_sample.abap

Exact relevant implementation excerpt from the knowledge document set.

1"============================================================================== 2" Generic Outbound Proxy Sample 3" Purpose: 4" - Show the common pattern for preparing data, filling generated proxy 5" structures, calling the proxy, and handling technical faults. 6" Flow: 7" - Collect source values 8" - Normalize the values 9" - Fill the nested request structure 10" - Create the proxy instance 11" - Call the proxy method 12" - Convert technical failures into a readable return message 13"============================================================================== 14 15REPORT zsam_outbound_proxy_sample. 16 17PARAMETERS: 18 p_partner TYPE kunnr, 19 p_reqid TYPE char3, 20 p_country TYPE land1, 21 p_name1 TYPE name1_gp, 22 p_name2 TYPE name2_gp. 23 24DATA: 25 ls_request TYPE zmt_partner_transfer_gts_req, 26 ls_response TYPE zmt_partner_transfer_gts_res, 27 lo_proxy TYPE REF TO zco_si_partner_transfer_gts_in, 28 lv_message TYPE string. 29 30START-OF-SELECTION. 31 32 " Keep the input in local working variables so the mapping is explicit. 33 DATA(lv_partner) = p_partner. 34 DATA(lv_reqid) = p_reqid. 35 DATA(lv_country) = p_country. 36 DATA(lv_name1) = p_name1. 37 DATA(lv_name2) = p_name2. 38 39 " Normalize the values that the receiver expects in a stable format. 40 TRANSLATE lv_name1 TO UPPER CASE. 41 TRANSLATE lv_name2 TO UPPER CASE. 42 43 " Fill the generated proxy structure step by step. 44 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_key-partner_id = lv_partner. 45 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_key-partner_typ = '02'. 46 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_head-extern_no = lv_partner. 47 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_head-partn_cat = '2'. 48 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-central-partnerexternal = lv_partner. 49 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-central_org-name1 = lv_name1. 50 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-central_org-name2 = lv_name2. 51 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_address-country = lv_country. 52 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-iv_upd_task_pntbp = abap_false. 53 54 " Add any additional business controls or derived values here. 55 IF lv_reqid IS NOT INITIAL. 56 ls_request-mt_partner_transfer_gts_req-partner_inbound_gts-partner-partner_key-org_logsystem = sy-sysid. 57 ENDIF. 58 59 TRY. 60 " Create the proxy object and send the payload. 61 CREATE OBJECT lo_proxy. 62 lo_proxy->si_partner_transfer_gts_inboun( 63 EXPORTING 64 input = ls_request 65 IMPORTING 66 output = ls_response ). 67 68 lv_message = |Proxy call completed successfully for partner { lv_partner }|. 69 70 CATCH cx_ai_system_fault INTO DATA(lx_system_fault). 71 " Convert the technical error into a readable message for the caller. 72 lv_message = lx_system_fault->get_text( ). 73 ENDTRY. 74 75 " Display the final status for the test harness. 76 WRITE: / lv_message.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How do I build and call a generated outbound proxy in ABAP?
  • How should I map business partner data into a nested proxy structure?
  • How do I handle `cx_ai_system_fault` in an outbound proxy call?

Possible questions

  • How do I implement an outbound proxy flow for MDG/BP data with nested payload mapping, technical fault handling, and a GTS-style validate/update sequence?
  • What is the correct pattern for preparing source data and calling an outbound proxy in ABAP?
  • How do I structure a report-based test harness for proxy payload assembly?
  • What should be checked before sending customer name, country, and address data to GTS?
  • How do I convert a technical proxy fault into a readable application message?

Keywords

ABAPoutbound proxygenerated proxy classnested structurecx_ai_system_faulttechnical fault handlingpayload mappingbusiness partnerGTSvalidateupdatereport test harnessZSAM_TEST