A distribution for three different objects (three different specification types) is to be implemented. However, the objects are to be sent to different systems in each case.
For example, specification type A should only be sent from the ECE system to the ECP system, specification type B only from the ECE system to the SPG system, and specification type C from the ECE system to both systems.
Provided that only the standard QPPD means are used, this is not possible: In the distribution model, the standard message type /SCT/QP_QVC would be entered for the connections between ECE and SPG/ECP. Thus, all three specification types would always be distributed to both systems SPG/ECP.
One possibility would certainly be to suppress the distribution for A and/or B with Z redefinitions in the e.g. IDOC service. However, a less complicated and more elegant solution is the following:
As Specification type C is to be sent to both systems, it can continue to use the standard QPPD for distribution.
For the other two specification types A and B, the following solution could be implemented: The idea is to use the standard QPPD distribution with Z message types as a logical bracket. In this case, exactly one Z-message type must be created for each different distribution. In addition, exactly one corresponding Z follow-up process is created for each Z message type, which is linked to the required specification types.
Technically, therefore, exactly two new Z message types are required in this example with the two specification types A and B, as well as a total of two new FBD ABAP classes. In addition, settings are required in both SAP standard and QPPD customizing. These settings are explained below.
Message types
To begin, logical message types must be created in WE81 for each different distribution.
For this example, the two message types, ZABC_IDOC_OUT_A and ZABC_IDOC_OUT_B, are required.
The goal is to use the message types as a logical bracket for a distribution.
The message type ZABC_IDOC_OUT_A is used exclusively for distribution from ECE to ECP.
The message type ZABC_IDOC_OUT_B exclusively for distribution from ECE to SPG.
The standard QPPD message type /SCT/QP_QVC is used for distribution to both systems ECP/SPG.
Distribution control
The distribution is controlled exclusively via the standard SAP distribution model in BD64. There the required message types for the QPPD distribution are assigned to the sending and receiving systems. These settings are not transported and must be set adequately in each system.
Next, it is necessary to create a new Z-ABAP class for each Z message type for the corresponding follow-up process. This must inherit from the standard class /SCT/QP_CL_FUP_IDOC_OUT. Then the method /SCT/QP_IF_FUP~PROCESS must be redefined to perform the distribution with the Z message type.
In this example, the class ZABC_CL_FUP_IDOC_OUT_A was created for the Z message type ZABC_IDOC_OUT_A, and the class ZABC_CL_FUP_IDOC_OUT_B was created for the message type ZABC_FUP_IDOC_OUT_B. The redefined method only changes the message type and therefore only requires the following coding.
METHOD /sct/qp_if_fup~process.    DATA(ls_fup_data) = is_fup_data.    ls_fup_data-msgtype = 'ZABC_IDOC_OUT_A'.    super->/sct/qp_if_fup~process( is_fup_data = ls_fup_data ).  ENDMETHOD.Thus, this Z class ZABC_CL_FUP_IDOC_OUT_A triggers a QPPD data distribution with the QPPD standard IDOC (basic type /SCT/QP_QVC) with optional Z extension and the Z message type ZABC_IDOC_OUT_A.
Since the ZABC_IDOC_OUT_A message type is used and the distribution model provides this message type only for the connection from ECE to ECP, the IDOCs generated by the standard QPPD are sent only to the ECP.
Follow-up processes
In TA:/SCT/QP_C10, a Z follow-up process is created for each of the two Z message types and the previously created ABAP classes are entered as classes.
The respective follow-up processes are assigned to the specification types in C25. In this example, the objects of the specification type CERT are to be distributed from the system ECE only to the system ECP by the corresponding follow-up process ZABC_IDOC_OUT_A.
In addition, distribution occurs only when the status of the specification type is RELEASED (IZQFR).
The data of the specification type ARBPL should only be distributed from the system ECE to the system SPG. The follow-up process ZABC_IDOC_OUT_B created for this purpose has been assigned to the specification type.
The distribution of data for this specification type should be done for each status. For this reason, no statuses have been added to the specification type.
Standard IDOC distribution
In the WE82, the Z message types are mapped to the standard QPPD base type /SCT/QP_QVC and any existing Z extension.
In all sending systems, the partner profile for the respective target systems must be extended in transaction WE20. In this case, the system ECE is the sending system for the two systems ECP/SPG. The message types ZABC_FUP_IDOC_OUT_A and ZABC_FUP_IDOC_OUT_B must be added as outbound parameters for the respective target system.
Example of the settings in ECE for the target system ECP:
However, all Z message types implementing QPPD distribution must be assigned to the standard process code /SCT/QP_ALE_IN in the WE42, since these settings are transported.
In transaction WE20, the input parameters for the partner profile must be extended in the receiving systems for the respective sending systems. In this case, the systems receive ECP/SPG from the ECE. For this purpose, the message types ZABC_FUP_IDOC_OUT_A and ZABC_FUP_IDOC_OUT_B are added as input parameters for the respective target system. These use the standard process code.










