Example of Data Exchange Using Queries

Transfer Default Values for Order Confirmation

The production progress of a discrete production is entered using confirmations. For this, the user creates a Time Ticket Confirmation in the ERP system in transaction CO11N. After the user has chosen the Actual Data pushbutton, the system suggests the input fields with the relevant data of the associated order operation. The machine that is used for production can provide the actual data for yield, scrap, and manual rework. Using PCo, this data is to be transferred to the relevant input fields automatically when the actual data is suggested.

Conversion

Read access for the data of the external data source is required. A suitable code position for implementing the PCo query is the include ZXCOFU06 that belongs to the user exit CONFPP01. If the user chooses the Suggest Actual Data pushbutton, the user exit code is run.

Simplifications

For simplicity, the fully qualified path details for the data source tags are hard-coded. The fully qualified path must always be stated in the internal PCo format using / as the separator. Note the following:

  • Use the test program RPCO_BS_INT_TEST or the search help S_PCO_ELM_BROWSE_TAG to determine the fully qualified path.

  • If the fully qualified path of the tag is too long, use the function module S_PCO_CALL_POPUP_NAMESP_BROWS and evaluate the output parameter ET_SEL_NODES. You can take the fully qualified path as a string variable from the component TAG_ID.

Implementation of a User Exit

  1. Call transaction CMOD and create any project.

  2. Assign the enhancement CONFPP01.

  3. Switch to the component view and place the mouse pointer on the EXIT_SAPLCORF_101 entry of the function module exit.

  4. Use the mouse to double-click.

    The system switches to the display of the function module EXIT_SAPLCORF_101.

  5. Create the implementation for the user exit by placing the mouse pointer on ZXCOFU11 in the change mode and then double-clicking.

  6. Insert the sample code from the document (page 21 to 24) attached to SAP Note 1576651 Information published on SAP site as the source code.

  7. Save and activate your changes.

  8. Activate the user exit.

Sample Code Explanations

The sample code in SAP Note 1576651 Information published on SAP site consists of the following parts:

  • Generating an application handle

  • Instantiating the wrapper class for PCo integration (CL_PCO_PAC)

  • Structuring the buffer table with information on tags whose values are to be read

  • Calling the wrapper method to read tag information

  • Converting the query results (data reference) to floating point values and assigning them to relevant fields of the confirmation structure

  • Error handling or success message

Optimization Options

You have the following options for optimizing system performance:

  • Dynamic determination of the path information using the work center of the operation that is confirmed:

    • You can use the feature classification for work centers or equipment to store path components as characteristic values.

  • Evaluation of PCo user messages

    • Table PCO_MSG_OBJ of the exception object lo_pco_exc

    • Evaluation of export parameter ET_PCO_MSG_OBJ of the method READ_TAG