This chapter describes the necessary settings in QPPD Customizing as well as in the SAP standard so that QPPD objects with extended data structures can be distributed between two systems using IDOC.

A QPPD object is considered extended in its data structures or is called extended exactly when database fields or value fields have been extended.

Before extended QPPD objects can be transferred, all settings for the transfer of standard QPPD objects must be made.

In the following, the term "system" always refers to the combination of system and client. In particular, it is possible to distribute data between two clients on the same system.

Settings in QPPD Customizing

No changes are necessary in the QPPD customizing.

Settings in the SAP standard

Segments

One to three segments are required for each database table that has been extended.

Example: The PMK table was extended according to customer specifications. For this purpose, a Z-append to the structure /SCT/QP_S_PMK_DATA was created. This contains the seven fields ZZ01, ..., ZZ07. It looks as follows:

image-20240606-080009.png

Analogously, a Z segment is created that contains these fields. So that the data can be transferred correctly, all key fields from the /SCT/QP_PMK table (all fields of the /SCT/QP_PMK_KEY structure) must be contained in the Z segment. So the fields GUID, OBJEKTTYP, ROWGRP, and MKMNR must be contained. The Z-Segment therefore contains the 4 key fields as well as the 7 append fields equal to 11 fields. The following figure shows the Z-Segment ZABC_QPPD_PMK:

image-20240606-080020.png

This segment must now be implemented in the extension to the standard base type.

Extension of the standard base type

In the WE30 an extension to the standard IDOC type /SCT/QP_QVC must be defined. In this example, the customer extension ZABC_QPPD is created for the basic type /SCT/QP_QVC. This will automatically take into account any future changes to the default base type.

image-20240606-080032.png

Under the segment /SCT/QP_QVC_HEADER, an extension is then made as a child segment with the aforementioned Z-PMK segment. This then looks as follows:

image-20240606-080043.png

Announce extension

Although this extension was already linked to the basic type when it was created in WE30, the extension must additionally be made known in WE82.

For this purpose, the extension ZABC_QPPD is linked to the basic type /SCT/QP_QVC and message type /SCT/QP_QPPD. It looks like this:

image-20240606-080053.png

This extension must now be entered in the partner profiles of the sending system.

Partner profiles at the sending system

The partner profiles in the sending system must be supplemented with the extension of the basic type. It looks like this:

image-20240606-080102.png

Redefinition of the IDOC service

The QPPD's own IDOC service implements the sending of the IDOC. The two methods for creating and reading the IDOC must be redefined.

Redefinition creation IDOC

The method /SCT/QP_CL_QV_IDOC_SERVICE→GET_IDOC_FROM_QVC_DATA must be redefined so that the Z append fields can be transferred using Z segment ZABC_QPPD_PMK.

Example:

The ZABCCL_QPPD_IDOC class inherits from the /SCT/QP_CL_QV_IDOC_SERVICE class.

The GET_IDOC_FROM_QVC_DATA method is redefined as follows:

METHOD /sct/qp_if_idoc~get_idoc_from_qvc_data.
 
CLEAR: et_edidd.
"SUPER
"Create IDOC for standard part of QPPD object
CALL METHOD super->/sct/qp_if_idoc~get_idoc_from_qvc_data
EXPORTING
it_qvc_data = it_qvc_data
IMPORTING
et_edidd = DATA(lt_edidd).
"--------------------------------------------------------------------"
"Z-PMK segments
"--------------------------------------------------------------------"
CONSTANTS: lc_pmk TYPE edilsegtyp VALUE 'ZABC_QPPD_PMK'.
DATA: lt_edidd_zpmk LIKE et_edidd, ls_zabc_qppd_pmk TYPE zabc_qppd_pmk.
"Reset
CLEAR: lt_edidd_zpmk.
"All data
LOOP AT it_qvc_data ASSIGNING FIELD-SYMBOL(<ls_qvc_data>).
"PMK
LOOP AT <ls_qvc_data>-pmk ASSIGNING FIELD-SYMBOL(<ls_pmk>).
"Prepare new EDIDD entry
APPEND VALUE #( segnam = lc_pmk sdata = CONV zabc_qppd_pmk( ls_zabc_qppd_pmk ) ) TO lt_edidd_zpmk.
ENDLOOP.
ENDLOOP.
 
TRY.
et_edidd = VALUE #( BASE et_edidd FOR ls_edidd IN lt_edidd WHERE ( segnam = mc->segnam_header ) ( ls_edidd ) ).
CATCH cx_sy_itab_line_not_found.
ENDTRY.
 
IF lt_edidd_zpmk IS NOT INITIAL.
APPEND LINES OF lt_edidd_zpmk TO et_edidd.
ENDIF.
"Dann den Rest
et_edidd = VALUE #( BASE et_edidd FOR ls_edidd IN lt_edidd WHERE ( segnam <> mc->segnam_header ) ( ls_edidd ) ).
 
ENDMETHOD.

Redefinition IDOC Readout

The GET_QVC_DATA_FROM_IDOC method is redefined as follows:

METHOD /sct/qp_if_idoc~get_qvc_data_from_idoc.
"SUPER
CALL METHOD super->/sct/qp_if_idoc~get_qvc_data_from_idoc
EXPORTING
it_edidd = it_edidd
IMPORTING
et_ana = et_ana
et_log = et_log
et_node = et_node
et_nodet = et_nodet
et_noderel = et_noderel
et_num = et_num
et_pmk = et_pmk
et_status = et_status
et_stx = et_stx
et_text_bapi = et_text_bapi
et_text_bapi_flat = et_text_bapi_flat
et_stxtext = et_stxtext
et_val = et_val
et_valt = et_valt
CHANGING
ct_idoc_status = ct_idoc_status.
 
"--------------------------------------------------------------------"
"Z-PMK segments
"--------------------------------------------------------------------"
CONSTANTS: lc_pmk TYPE edilsegtyp VALUE 'ZABC_QPPD_PMK'.
 
DATA:
ls_pmk TYPE zabc_qppd_pmk.
 
"Process Z-segments
LOOP AT it_edidd ASSIGNING FIELD-SYMBOL(<ls_edidd>) WHERE segnam = lc_pmk.
"Reset
CLEAR ls_pmk.
"Apply values from segment
MOVE <ls_edidd>-sdata TO ls_pmk.
 
TRY.
"Find entry
DATA(lr_pmk) = REF #( et_pmk[ guid = ls_pmk-guid
objekttyp = ls_pmk-objekttyp
rowgrp = ls_pmk-rowgrp
mkmnr = ls_pmk-mkmnr ] ).
"Refresh fields
MOVE-CORRESPONDING ls_pmk TO lr_pmk->*.
CATCH cx_sy_itab_line_not_found.
"Add new entry
APPEND CORRESPONDING #( ls_pmk ) TO et_pmk.
ENDTRY.
 
ENDLOOP.
ENDMETHOD.

Announcing the redefinition of the IDOC service in the factory

To ensure that the above redefinitions are also processed, the Z class ZABCCL_QPPD_IDOC must be made known in the Class Factory. Transaction C10 ( Basic settings → Class Factory ) 

The following entry must be maintained in the "Class Factory" sub dialog:

image-20240606-080117.png