Sending Z Tables via SAP Data Modeler and Custom Z Program - For ABAP RAP

Sending Z Tables via SAP Data Modeler and Custom Z Program - For ABAP RAP

Manual: Sending Z Tables via SAP Data Modeler and Custom Z Program

In the SAP Data Modeler, create an “ANY” Entity including the desired Z tables. Ensure the Domain is set to ANY.



Inside the entity, select the desired columns to send in the Column Definition.

 
Save the new Entity.

You can follow the steps for creating an ANY entity manually referring to the following link: ANY Entity

In transaction SE38, locate the Z Program provided by Onibex: Z_PROGRAM_CUD_ZTABLES.

In Display/Change mode, review the program logic to confirm it sends the appropriate Z tables.
Update this Z Program to include the necessary logic to handle the tables specific to your implementation.
This process ensures the program reacts to create, update, and delete events on the Z tables.

Example ABAP Code for Sending Z Tables

To send Z tables, use the following structure depending on the operation type. For create or update operations, set iv_update = abap_true and iv_delete = abap_false. For delete operations, use iv_update = abap_false and iv_delete = abap_true.

"----------------------------------------------------------------------*
"*  CONSTANTS                                                          *
"----------------------------------------------------------------------*
CONSTANTS:
  gc_aliastab_header TYPE zonta_oc_col_all-tabname     VALUE 'HEADER',
  gc_aliastab_items  TYPE zonta_oc_col_all-tabname     VALUE 'ITEMS',
  gc_tabname_hd      TYPE zonta_oc_col_all-tabname     VALUE 'ZONTA_SO_H',
  gc_tabname_items   TYPE zonta_oc_col_all-tabname     VALUE 'ZONTA_SO_ITEM',
  gc_entity          TYPE zonta_obj_oc-business_proc   VALUE 'ANY_ZTABLE_AUTOMATIC',


* Send for each table:
When is creation or change you need pass the parameter iv_update = true and Iv_delete = false, but if is delete you need pass iv_delete = true and iv_update =  false, and parameter iv_entity_business_proc = “name of your entity” 

"----------------------------------------------------------------------*
"*  Send HEADER table                                                  *
"----------------------------------------------------------------------*
NEW zoncl_fetch_data( )->send_json_any_ltable_rap(
  iv_tabname              = gc_tabname_hd
  iv_aliastab             = gc_aliastab_header     " Table Alias
  iv_update               = abap_true
  iv_delete               = abap_false
  it_tables_data          = gt_data_hd
  iv_alias                = abap_false
  iv_fieldname            = abap_true
  iv_entity_business_proc = gc_entity
  iv_dest                 = 'ONIBEX_DEMO'
  iv_bothnames            = abap_false
).

"----------------------------------------------------------------------*
"*  Send ITEMS table                                                   *
"----------------------------------------------------------------------*
NEW zoncl_fetch_data( )->send_json_any_ltable_rap(
  iv_tabname              = gc_tabname_items
  iv_aliastab             = gc_aliastab_items     " Table Alias
  iv_update               = abap_true
  iv_delete               = abap_false
  it_tables_data          = gt_data_it            " <-- recommend using gt_data_it for items
  iv_alias                = abap_false
  iv_fieldname            = abap_true
  iv_entity_business_proc = gc_entity
  iv_dest                 = 'ONIBEX_DEMO'
  iv_bothnames            = abap_false
).


    • Related Articles

    • Sending Z Tables via SAP Data Modeler and Custom Z Program - For Classic ABAP

      Manual: Sending Z Tables via SAP Data Modeler and Custom Z Program In the SAP Data Modeler, create an “ANY” Entity including the desired Z tables. Ensure the Domain is set to ANY. Inside the entity, select the desired columns to send in the Column ...
    • Onibex SAP Data Modeler - Functionalities

      Introduction The following table outlines key functionalities offered by the SAP Data Modeler, highlighting features designed to enhance data extraction, customization, and integration within SAP environments. No Function Description 1 Direct Data ...
    • SAP Data Modeler - Identifying CDS Views Compatible with OneConnect Modeler

      The purpose of this manual is to provide a simple and practical guide to identifying CDS views within SAP that are compatible with the OneConnect Data Modeler. It outlines the necessary steps in a clear and concise manner, allowing users to quickly ...
    • SAP Data Modeler - Entity Creation and Main Customizing

      Introduction This document provides a step-by-step guide for creating and configuring an entity within Onibex's SAP Modeler using transaction ZONT_ONECM. An entity in the Data Modeler is defined as a set of standard SAP tables and their key fields, ...
    • RFC Data Sending Guide – ZONCL_FETCH_DATA_V2

      RFC Data Sending Guide – ZONCL_FETCH_DATA_V2 This guide describes how to send data from a custom Z table in SAP to a remote system using the class ZONCL_FETCH_DATA_V2. The process supports optional filters and allows update/delete operations on the ...