Inicio del área de contenido

Este gráfico es explicado en el texto respectivo Controlling the Synchronization of Picklists (Example) Localizar documento en árbol de navegación

Use

You do not want the picklists in the XML repository to be overwritten by the picklists transferred by SAP R/3 to CATS notebook during synchronization. Instead, you want the picklists to be updated as follows:

Procedure

  1. Define a separate class, ZsynchronizationInboundHandler. This class must implement the IsynchronizationInboundHandler interface.
  2. Implement the getObjectName method.
  3. Implement the handleInboundContainer method.

Java Source Code

package com.sap.mycats.customer.examples;

 

import com.sap.mycats.basics.database.badi.*;

import com.sap.mycats.basics.tools.badi.*;

import com.sap.mycats.basics.customer.synchronization.ISynchronizationInboundHandler;

 

/**

 * This example of an ISynchronizationInboundHandler appends or updates

 * received elements. The standard handler would replace all records with the

 * received table.

 */

public class ZSynchronizationInboundHandler

    implements ISynchronizationInboundHandler

{

    public final static String ZPICKLIST_WBS = "ZPICKLIST_POSID";

 

 

    public ZSynchronizationInboundHandler () {

    }

 

 

    public String getObjectName () {

        return ZPICKLIST_WBS;

    }

 

 

    public void handleInboundContainer (ITableReadOnly anInboundContainer) {

        DatabaseCustomer database = DatabaseCustomer.getInstance();

        for (int i = 0; i < anInboundContainer.getRowCount(); i++) {

            IRecordReadWrite record = null;

            try {

                record = RecordFactory.createRecord(ZPICKLIST_WBS);

            } catch (Exception e) {

                return;

            }

            record.setCorrespondingFields(anInboundContainer.getRecordReadOnly(i));

            ITableReadWrite oldRecords

                = database.select(ZPICKLIST_WBS, "primary", record, record);

            for (int j = 0; j < oldRecords.getRowCount(); j++) {

                database.delete(ZPICKLIST_WBS, oldRecords.getRecordReadWrite(j));

            }

            database.insert(ZPICKLIST_WBS, record);

        }

    }

}

Fin del área de contenido