SAP MDG · REPLICATION INBOUND

How do I implement an SAP MDG inbound proxy for customer creation with validation, defaulting, GTS screening, and dual-target replication?

Implement the proxy as a thin wrapper that initializes the response, reformats Brazil postal codes when needed, validates the request, derives defaults, runs GTS screening, checks ECC/S/4 destinations in ZMDG_OS_REPMAP, creates the customer in both targets, and updates GTS only after successful replication.

Implement the proxy as a thin wrapper that initializes the response, reformats Brazil postal codes when needed, validates the request, derives defaults, runs GTS screening, checks ECC/S/4 destinations in ZMDG_OS_REPMAP, creates the customer in both targets, and updates GTS only after successful replication.

Implement the customer inbound proxy as a sequential flow: initialize the response, normalize Brazil postal codes, validate the request, map and default the master data, run GTS screening, resolve ECC and S/4 destinations from `ZMDG_OS_REPMAP`, create the customer in both targets, and then post the GTS result back against the created customer number.

Process flow

  1. Instantiate `ZCL_MDGC_ONLINE_STORE_UTIL`.
  2. Initialize the proxy response fields from the inbound request.
  3. Reformat Brazil postal codes when `i_country = 'BR'` and the postal code is 8 characters.
  4. Call the utility validation method and exit on non-success.
  5. Map inbound customer, address, contact, tax, and sales data into local variables.
  6. Convert the VAT registration number to uppercase.
  7. Derive company-code and sales-area default values from `ls_tvta` and `ls_constants`.
  8. Obtain a temporary business partner and run `validate_gts( )`. If it fails, return immediately with the GTS message.`,

Referenced tables

ObjectPurpose
ZMDG_OS_REPMAPStores the mapping from `sap_target` to the RFC `destination` used by the customer creation proxy.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1METHOD zii_si_sap_dct_customer_create~si_sap_dct_customer_create_inb. 2*&---------------------------------------------------------------------* 3*& Method : ZII_SI_SAP_DCT_CUSTOMER_CREATE~ 4*& SI_SAP_DCT_CUSTOMER_CREATE_INB 5*&---------------------------------------------------------------------* 6*& Type : Inbound service implementation (ABAP proxy) 7*& Interface : ZII_SI_SAP_DCT_CUSTOMER_CREATE 8*&---------------------------------------------------------------------* 9*& Description : Inbound interface for online store (Hybris) customer 10*& creation. Receives the customer master data from the 11*& web shop, validates the request, determines the sales 12*& and company code defaults, runs the GTS sanctioned 13*& party screening, and replicates the customer to the 14*& ECC and S/4 target systems. The response carries the 15*& created customer number and a status of 'S' or 'F' 16*& with the corresponding message. 17*&---------------------------------------------------------------------* 18*& Parameters : 19*& INPUT IMPORTING MT_SAP_DCT_CUSTOMER_CREATE_REQ - request message 20*& with customer, address, contact, tax and 21*& destination data 22*& OUTPUT EXPORTING MT_SAP_DCT_CUSTOMER_CREATE_RES - response with 23*& CUST_NUMBER, HTTP_LOCATION_CODE, CONTROLLER and 24*& RETURN (type / message) 25*&---------------------------------------------------------------------* 26*& Processing logic: 27*& 1. Instantiate the utility class. 28*& 2. Initialise the response (controller, customer number, system and 29*& client as HTTP location code). 30*& 3. Brazil only: reformat an 8-character postal code to 99999-999. 31*& 4. Validate the request. Type not 'S' -> return the validation 32*& message and leave the method. 33*& 5. Map the request fields to the local work fields; the VAT 34*& registration number is converted to upper case. 35*& 6. Determine company code and sales area values, applying the 36*& constants and defaults listed above. 37*& 7. Get a temporary business partner and run the GTS screening. 38*& Type 'F' -> return the GTS message and leave the method. 39*& 8. Read the RFC destinations for the ECC and S/4 targets from 40*& ZMDG_OS_REPMAP. A missing entry returns a configuration error 41*& and no customer is created. 42*& 9. Create the customer in both targets via CREATE_V2 and set the 43*& returned customer number in the response. 44*& 10. On success, post the GTS screening result against the created 45*& customer number. 46*&---------------------------------------------------------------------* 47*& Change history: 48*& 31-07-2026 TE526614 HybrisAdjVAT - Online Store Hybris interface fix VAT 49*&---------------------------------------------------------------------* 50 51 DATA: 52 lo_online_util TYPE REF TO zcl_mdgc_online_store_util, 53 ls_gts_req TYPE zmt_partner_transfer_gts_req, 54 ls_gts_res TYPE zmt_partner_transfer_gts_res, 55 ls_tvta TYPE zmdg_os_tvta, 56 ls_constants TYPE zmdg_os_s_constants, 57 lv_cust_number TYPE kunnr, 58 lv_country TYPE land1_gp, 59 lv_req_id TYPE zmdg_os_reqid, 60 lv_comp_name TYPE name1_gp, 61 lv_cust_name TYPE name2_gp, 62 lv_stras TYPE stras_gp, 63 lv_stras2 TYPE stras_gp, 64 lv_city TYPE ort01_gp, 65 lv_state TYPE regio, 66 lv_pstlz TYPE ad_pstcd1, 67 lv_telf1 TYPE telf1, 68 lv_telf2 TYPE telf2, 69 lv_fax TYPE teltx, 70 lv_email TYPE ad_smtpadr, 71 lv_currency TYPE waers_v02d, 72 lv_guest TYPE zmdg_de_guestacct, 73 lv_taxid TYPE stceg, 74 lv_bukrs TYPE bukrs, 75 lv_akont TYPE akont, 76 lv_zterm_knb1 TYPE dzterm, 77 lv_xzver TYPE xzver, 78 lv_zuawa TYPE dzuawa, 79 lv_vkorg TYPE vkorg, 80 lv_vtweg TYPE vtweg, 81 lv_vkbur TYPE vkbur, 82 lv_vkgrp TYPE vkgrp, 83 lv_inco1 TYPE inco1, 84 lv_inco2 TYPE inco2, 85 lv_zterm_knvv TYPE dzterm, 86 lv_rfc_subrc LIKE sy-subrc. 87 88 CREATE OBJECT lo_online_util. 89 90 IF lo_online_util IS BOUND. 91 DATA(ls_customer) = input-mt_sap_dct_customer_create_req. 92 DATA(ls_output) = output-mt_sap_dct_customer_create_res. 93 94 ls_output-controller = input-controller. 95 ls_output-cust_number = ls_customer-i_cust_number. 96 CONCATENATE sy-sysid '-' sy-mandt INTO ls_output-http_location_code. 97 ls_output-return-controller = input-controller. 98 99 lv_req_id = ls_customer-i_req_id. 100 lv_country = ls_customer-i_country. 101 lv_cust_number = ls_customer-i_cust_number. 102 103 IF lv_country = 'BR'. 104 lv_pstlz = ls_customer-i_pstlz. 105 IF strlen( lv_pstlz ) = 8. 106 DATA(lv_pstlz_p1) = lv_pstlz+0(5). 107 DATA(lv_pstlz_p2) = lv_pstlz+5(3). 108 109 CONCATENATE lv_pstlz_p1 '-' lv_pstlz_p2 INTO lv_pstlz. 110 ls_customer-i_pstlz = lv_pstlz. 111 ENDIF. 112 ENDIF. 113 114 lo_online_util->validate( 115 EXPORTING 116 iv_req_id = lv_req_id 117 iv_cust_number = lv_cust_number 118 iv_country = lv_country 119 IMPORTING 120 ev_return = DATA(lv_validation_ret)

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

Related questions and keywords

Alternative questions

  • How do I build a customer inbound ABAP proxy in SAP MDG?
  • How should an inbound customer creation proxy validate and replicate data in SAP MDG?
  • What is the implementation pattern for a customer create inbound proxy in SAP MDG?

Possible questions

  • How do I implement a customer inbound proxy method in SAP MDG?
  • What is the ABAP flow for customer creation from an external system into SAP MDG?
  • How do I handle validation, defaulting, and destination lookup in an inbound customer proxy?
  • How do I post GTS screening results after customer replication in SAP MDG?
  • Which method calls are typically used in a customer inbound proxy wrapper?

Keywords

SAP MDGABAP proxyinbound service implementationcustomer creationvalidationdefaultingGTS screeningRFC destinationreplication mapapplication logHybrisECCS/4