SAP MDG · REPLICATION INBOUND

How does the STA inbound replication method update KNVP data in SAP MDG?

The STA inbound replication method prepares current and old KNVP tables, handles delete mode by copying the record and blanking KZ in the old-image table, then calls remote function module ZMDG_UPDATE_STA_KNVP and returns the exported status.

The STA inbound replication method prepares current and old KNVP tables, handles delete mode by copying the record and blanking KZ in the old-image table, then calls remote function module ZMDG_UPDATE_STA_KNVP and returns the exported status.

The STA inbound `replicate_data` method follows a simple remote-update pattern: it prepares a current KNVP table, derives an old-image table only when the record is marked for deletion, and then calls the remote-enabled function module `ZMDG_UPDATE_STA_KNVP` in the target destination. The returned status is copied to `ev_status` so the caller can continue processing or react to the update result.

Process flow

  1. Initialize current and old KNVP tables.
  2. Check whether `is_knvp-kz = 'D'`.
  3. For delete records, append the current record to `lt_knvp` and a copy with blank `kz` to `lt_knvp_old`.
  4. For non-delete records, append only the current record to `lt_knvp`.
  5. Call `ZMDG_UPDATE_STA_KNVP` in RFC destination `iv_destination`.
  6. Import `ex_status` into a local status variable.
  7. Return the status in `ev_status`.

Referenced tables

ObjectPurpose
FKNVPLine type used in the sample for current and old KNVP data preparation.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1METHOD replicate_data. 2 DATA: 3 lt_knvp TYPE STANDARD TABLE OF fknvp, 4 lt_knvp_old TYPE STANDARD TABLE OF fknvp, 5 lv_status TYPE char1, 6 ls_knvp TYPE fknvp. 7 8 9 IF is_knvp-kz = 'D'. 10 APPEND is_knvp TO lt_knvp. 11 12 ls_knvp = is_knvp. 13 ls_knvp-kz = ' '. 14 15 APPEND ls_knvp TO lt_knvp_old. 16 ELSE. 17 APPEND is_knvp TO lt_knvp. 18 ENDIF. 19 20 "OK destination 21 CALL FUNCTION 'ZMDG_UPDATE_STA_KNVP' 22 DESTINATION iv_destination 23 IMPORTING 24 ex_status = lv_status " Status Variable 25* ex_text = " Message 26 TABLES 27 t_knvp = lt_knvp 28 t_knvp_old = lt_knvp_old. 29 30 ev_status = lv_status. 31 32 ENDMETHOD.

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

Related questions and keywords

Alternative questions

  • How can I implement STA inbound KNVP replication in SAP MDG?
  • What is the ABAP pattern for STA partner-function replication to a remote system?
  • How does the STA inbound method handle delete records and old KNVP values?

Possible questions

  • How can I implement STA inbound KNVP replication in SAP MDG?
  • What is the ABAP pattern for STA partner-function replication to a remote system?
  • How does the STA inbound method handle delete records and old KNVP values?
  • Which function module is called for STA KNVP update?
  • How is the old KNVP record prepared when KZ = 'D'?

Keywords

SAP MDGSTA inboundKNVPFKNVPreplicationinbound proxyRFC destinationdelete handlingZMDG_UPDATE_STA_KNVP