Ansicht
Dokumentation

APO_BAPI_SEND_TRANS_OBJECTS - Send Transaction Data

APO_BAPI_SEND_TRANS_OBJECTS - Send Transaction Data

CL_GUI_FRONTEND_SERVICES - Frontend Services   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Purpose

You can use this function to select and transfer transaction data (orders, stocks, and so on) to external (non-SAP) systems.

This function can be used to transfer data that was created by an external system (or an SAP system) or locally in SAP APO. (The function is not meant for transferring data to SAP systems. To do this, use the relevant CIF transfer functions.)

You can specify the following for the transfer:

  • The objects (for example, sales orders, external procurement orders, and so on) that are selected and transferred, and the criteria used to do this.
  • How and to which target systems these objects are to be sent.
  • Whether all detailed data for an object is to be transferred or only parts of it (for example, no characteristics information is transferred).

These points will now be considered in detail.

Features

Selection

1. Possible Selection Criteria

  • You can enter the product or locations to select the data. You can choose whether to use external names (as they are used in the BAPIs or the external system, for example) or internal names (as they are used in SAP APO). Only master data that is either known to or defined in the logical system or system group specified is selected.
  • Alternatively, the data can be selected using order numbers. Note that in this case only objects can be selected that can have order numbers. (Stocks or planned independent requirements, for example, cannot then be transferred). Note also that there can also be many orders (for example, generated by SNP) without an order number. Orders that have been created by external systems are selected using the logical system specified. That is, only orders for the logical system specified are selected. All orders that are local to SAP APO (order type 8) are selected.

Specify also which planning version is to be used and which objects (for example, stocks, orders, and so on) are to be transferred.

Specify also whether the transfer is to be direct or whether the objects to be transferred should only be selected and displayed at first. If you set the indicator "Display Selections" the objects are selected and displayed. You can then transfer them in a later step.

2. Extended Selection Criteria

When selecting by location product you can also use the following selection criteria:

  • By default, only orders that were created locally in SAP APO or transferred from the logical system specified are selected. In the case of planned independent requirements and stocks, all objects that exist in the system group specified are selected. You can also specify in the extended selections whether orders that are in the same system group but which were transferred from a different logical system are also to be selected.
  • When selecting by location product (not order number), the following selection parameters are also available. In this case, only objects where at least one location product meets these criteria are selected.
  • Selection by certain ATP categories. Note that you can only enter individual values for these selection criteria. You cannot enter intervals or exclude elements.

  • You can specify whether only location products for certain planners are to be selected.

  • Furthermore, you can also specify whether to select by receipt element only, requirements element only, or according to both. This is only possible for orders and not for stocks or planned independent requirements, for example. By default, the system searches for receipt and requirements elements. If you specify that the system is only to search for receipt elements, only orders/schedule lines are selected where the location products from the selection appear in the receipt elements. With the exception of VMI orders, selecting sales orders/deliveries in this way does not usually return useful results, since these consist solely of requirements elements.
    If, instead, you want to select by requirements element only, only orders/schedule lines are selected where the location products from the selection appear in the requirements elements. For stock transfers this means, for example, that you can also specify whether the selection should be based on requirements or receipts.

  • For the "self-defined selection", you can enter any values that you want. Their interpretation depends on the customer implementation (BAdI implementation). Further technical details are provided at the end of this document.

  • Selection by certain order types. Note that when entering values for these selection criteria you can only enter individual values. You cannot enter intervals or exclude elements.
  • Selection by time interval. Only orders/planned independent requirements that lie either completely or partially within this time interval are transferred. This does not affect the transfer of stocks using object "StockAPS". The following information is necessary to specify a time interval:
  • The type of time interval: That is, is a calendar day, calendar week, or a relative period of time entered.

  • The start and end of the interval. The entry must be made in accordance with the type of time interval. For more information, see the F1 help for the time interval. Note that you cannot use the input help (F4) for this.

  • You can optionally specify which time zone is used. The time stamps for the interval start and end are calculated from the interval specified and displayed in UTC time.

  • When using a time interval to transfer requirements/receipt elements, note that making a selection according to start and/or end time only delivers useful results for objects that have actual dates/ times. Since stocks, for example, do not have dates/times, you are not advised, as a rule, to use these selection parameters for stocks.

  • Specifying the selection mode: This is only possible in certain application cases, since restrictions exist. You must note these restrictions. For more information, see the F1 help for the selection mode.

3. Log/Technical Transfer Parameters

You can use these to specify how the data is to be sent and where is it to be sent to. You can also configure whether the selected data is to first be displayed before the transfer and then transferred in another step, or whether the transfer is to take place immediately.

  • Send mode:
    You use the send mode to specify whether the data is to be sent as IDocs, tRFC, or both (if configured in Customizing).
  • Target system:
    If you want to send the data to a particular target system, specify it here. The target system must be entered in Customizing correctly. The target system does not need to be specified if the distribution model is used, since the target systems are determined automatically in this case.
  • Use distribution model:
    If the distribution model is used, the ALE distribution model is read and the target systems are determined automatically. If you do not want to send data to all target systems entered, specify the target system as described above.
  • Display selections
    Here you can specify whether the selection results are displayed before the data is transferred. The data is then transferred in another step. This can be helpful when checking the size of the data selected, the correctness of the data, and the target systems that were found.
  • The items "performance/packaging/error checks" and "transfer details" are dealt with later on.

Integration

Standard BAPIs are used for selecting and transferring the objects. The technical integration requires that you understand these BAPIs and objects (for example, which objects and data are selected and how the transfer works from a technical point of view, which fields are available, and so on).

1.Which data can be selected and transferred:

You can select and transfer the following objects or data. The transaction data must be available in SAP APO liveCache.

  • "SalesOrderAPS" (BUS10501). This corresponds to sales orders, deliveries, and so on.
    The entire order (that is, with all items/schedule lines) is always transferred, as soon as an item matches the selection criteria.
  • "ProcurementOrderAPS" (BUS10502). This corresponds to external procurement orders such as purchase orders, stock transfers, and so on.
    The entire order (that is, with all items/schedule lines) is always transferred, as soon as an item matches the selection criteria.
  • "ManufactOrderAPS" (BUS10503). This corresponds to in-house production orders such as planned orders or production orders.
    The entire order is always transferred. If there are RPM components, these are also selected and transferred.
  • "StockAPS" (BUS10504). This corresponds to stocks.
  • "PlannedIndReqmtsAPS" (BUS10020). This corresponds to planned independent requirements.
  • Requirements/receipt elements. This roughly corresponds to a requirements/stock list or product view.

You can find the relevant interfaces (parameters, fields) for the "Receive" methods and the business objects in the BAPI Explorer. There you can also find the relevant ALE interfaces and function module interfaces for the "Receive" methods.

2. How is the data transferred:

The data is transferred using the interface objects or the following BAPIs (or ALE message types for the BAPIs):

  • Sales orders, deliveries,and so on:
    "SalesOrderAPS.GetList2" or "SalesOrderAPS.RequestList2" is used to select the data. The data is transferred using "IF10501.ReceiveList2".
  • External procurement orders:
    "ProcurementOrderAPS.GetList2" or "ProcurementOrderAPS.RequestList2" is used to select the data. The data is transferred using "IF10502.ReceiveList2".
  • In-house production orders:
    "ManufactOrderAPS.GetList2" or "ManufactOrderAPS.RequestList2" is used to select the data. The data is transferred using "IF10503.ReceiveList2".
  • Stocks:
    "StockAPS.GetList2" or "StockAPS.RequestList2" is used to select the data. The data is transferred using "IF10504.ReceiveList2".
  • Planned independent requirements:
    "PlannedIndReqmtsAPS.GetList" or "PlannedIndReqmtsAPS.RequestList" is used to select the data. The data is transferred using "IF10020.ReceiveList".
  • Requirements/receipt elements:
    "PPDSServiceAPS.GetReqsReceipts" or "PlannedIndReqmtsAPS.RequestReqsReceipts" is used to select the data. The data is transferred using "IF10500.ReceiveReqsReceipts".

If user exits or BAdI implementations are used within the BAPIs mentioned, you must take these into account since they are also run through. This can influence the result. You can also find more information about the named selection methods in the BAPI Explorer.

3. What must be taken into account for the selection and transfer of data:

The factors packaging, transfer type and error handling play an important role when selecting and transferring large volumes of data, in particular. Without packaging, for example, performance problems, memory overflows, or terminations can occur in the case of large volumes of data. This must be taken into account for both the sending (SAP APO) system and the receiving system. The main reason for this is that the entire volume of data is selected and transferred at once if packaging is not used. This may be desired and possible for a small number of objects. However, packaging is recommended for medium and large volumes of data. Since the package size depends on the data constellations, there is no "optimum" package size. For this reason, you must check which package size is most optimal for each scenario and data volume. When using ALE IDocs it is not recommended that you send IDocs with several thousand segments.

3.1. You can use the setting "Performance/Packaging/Error Checks" to control the package size.

  • You can specify a package size for location products when selecting data using location products. If the entry made is > 0, objects for the selected location products are transferred in various packages. If an order contains various location products, it is not split into several packages. Instead, an internal decision is made about the package or location product to which it is assigned for packaging.
  • Package size per object type. Here you can specify the maximum number of orders, stocks, and so on that are to be contained within a package. This packaging occurs in addition to the packaging by location product described above. For example, 30,000 in-house production orders can exist for a location product. If packaging by location product, all 30,000 orders would be sent in one package. By packaging the orders per object type, the package containing 30,000 orders is split into smaller packages (for example, 300 * 100 orders). If no entry is made here, packaging does not occur for the relevant object type.
  • Packaging for in-house production, external procurement, and sales orders/deliveries occurs on order level. That is, a package size of one means that one order is contained in one package.

  • Packaging for planned independent requirements occurs on schedule line level (SCHEDID). That is, a package size of one means that one planned independent requirement for a location product is contained in one package.

  • Packaging for stocks occurs on stock level. That is, a package size of one means that one stock for a location product is contained in one package.

  • Packaging for requirements/receipt elements occurs on schedule line level, That is, a package size of one means that one schedule line (related to parameter IO_ELEMENTS) is contained in one package. Note that in the dependent parameters (for example, if order details or order headers for the schedule lines are transferred) redundant data may be transferred.

You must also consider error handling, that is, how the system is to react to messages that may be generated. You can distinguish between three different error or message situations:

  • Errors/messages during preselection
    Before the data is transferred, a preselection of objects is made to determine the objects to be transferred and to give the user an overview of the objects that match the selection. This preselection is displayed, for example, if you have chosen "Display Selections". If errors occur during the preselection, you can choose "Termt. If Select. Error Occurs" to specify that no objects are to be transferred and that the entire transaction is to be terminated.
    It is not usually advisable to transfer data if a serious error has occurred during the selection, since this would falsify the selection result. To nevertheless force the data to be transferred, you can deactivate "Termt. If Select. Error Occurs". This can be useful, for example, when errors occur that you know are not relevant to the transfer.
    If you do deactivate "Termt. If Select. Error Occurs", you must ensure that no incorrect selection results are transferred.
  • Errors during object details selection
    When the transfer has been started, the detailed data for the objects orders, stocks, and so on) is read according to the preselection quantity. (Error) messages can occur here. These messages are transferred by default to the target system in parameter RETURN_MESSAGES.
    You can control whether these messages are to be considered and, if so, how they are considered. The same is true for logging and displaying the messages.
  • "Add to Log" specifies that these messages are added to the log. If they are not added, the user in the sending SAP APO cannot see if errors have occurred during the selection. The errors are simply transferred to the target system. The method of simply transferring the errors to the target system can be used if only the target system is to deal with error handling and not the sending system.

  • If these messages are added to the log, you can also specify whether the messages are to determine whether or not the relevant package (for which errors have occurred) is to be transferred or not. The option "Always Transfer" means that messages do not influence the transfer. "No Transfer if Error or Termination Messages Occur" means that the relevant data package is not transferred, if these message types occur during the object details selection. A termination message for this package is then added to the log to show that the package was not transferred.

  • "No Duplicate Messages" means that the number of messages in the log is reduced. If conversion errors occur, the same message can occur for several orders. This means that the message appears in the log several times, but contains different order numbers. To make it easier to see the errors in the log, you can suppress multiple duplicated messages.

  • Errors during the technical transfer
  • These include errors when generating IDocs or other errors of a technical nature that prevent the data package from being transferred or created. The relevant data package is displayed with a termination message in the log.

In some cases you need to terminate processing, for example, when almost every package has errors (for example, caused by general system problems). It is then probably not advisable to continue processing as this would lead to long runtimes and many log errors (for the packages with errors). To avoid such situations, you can use the parameter "Max. Faulty Packages" to specify that processing is to be terminated once a certain number of faulty packages is exceeded. Note that this only refers to the number of packages that were not transferred and not to the error (messages) that have occurred in general.

3.2. Transfer details

A lot of data can exist for one object (for example, order, stock, and so on). An in-house production order, for example, has header data, receipt information, requirements, operations, activities, pegging information, and much other data that is contained in separate parameters in the interface. It takes time and memory space to read and transfer all of this data. In many cases, transferring all this detailed data is not necessary or desired. You can specify in the transfer details which detailed data is to be transferred or not transferred for which object or indeed for all objects. In this way, you can specify that pegging information for all objects is not to be transferred, for example.
For performance reasons you are advised to only transfer the data that you actually need.
By default, only the minimal data for the objects is transferred (for example, for in-house production orders only the order header data is transferred and no operations, activities, and so on are transferred).

3.3 Miscellaneous

  • Only errors that occur during the selection or creation of the packages are displayed in the log. The packages are considered to have been transferred or created successfully, as soon as it was possible to transfer them to the relevant middleware, (for example, IDoc was generated, tRFC was generated, and so on). If errors occur later on in processing (for example, IDoc could not be sent or tRFC could not be sent, because the target system is not available, and so on), these messages are not displayed in the log. Instead you must use the relevant monitoring option (depending on the transfer technique/middleware in use), for example IDoc Monitoring, or tRFC Monitoring, and so on).
  • When packaging data by object type it can be the case (especially when sending requirements/stock lists) that data for an order is distributed across several packages. If, for example, when sending the requirements/stock list a package size of 1 is configured and an order exists with two items for the same location product, these two are shared between two packages. Since the same detailed data for the entire order (that is, both items) can be contained in each package, it could be the case that partially redundant information is contained in the packages that are transferred.
  • BAdI definition "APO_BAPI_SENDTRANS" is available for enhancements.
  • BAdI definitions (for example, "APO_BAPI_BUS10503" for in-house production) are also available in the RECEIVE interfaces. You can use these, for example, to implement a receive function (if the data is not to be sent to an external system, for example).

Prerequisites

You must specify the target system(s) to transfer the data. Depending on the means with which you want to transfer the data, you must be familiar with RFC or ALE Customizing. The following information is only meant as overview and does not go into details about the individual Customizing settings.

  • A logical system must exist that represents the target system.
  • In the ALE distribution model (transaction BD64) you must have configured which "Receive" calls are used for which target systems. For example, you can enter "IF10503.ReceiveList2" for in-house production orders. To do this, use "Insert BAPI". (Do not use "Insert Message Type".)
  • Define an RFC destination (transaction SM59) for the target system, if the data is to be transferred using RFC.
  • If the data is to be transferred using tRFC or RFC (that is, not transferred using ALE message types), assign an RFC destination to the BAPI method calls (for example, "IF10503.ReceiveList2"). You can do this in ALE Customizing (transaction BD97).
  • When using ALE message types for the BAPI method calls, you must also make additional Customizing settings for partner agreements, ports, and so on.
  • You must have authorization to display the planning version (C_APO_VERS) and for the transaction.

Standard Variants

Output

Logging

All objects that match the selection and can be transferred are written into the log. When using simulation mode, the selection result can be displayed before the data is transferred. An entry is created in the log for each object to be transferred. For objects that have multiple elements (for example, stock transfers or in-house production orders), not all components or location products are logged, for example. In the case of manufacturing orders, for example, not all components are logged. Instead one entry is made. In the case of stock transfers, for example, the source and destination are not logged. Instead one entry is made. The location product that was contained in the selection criteria is the one that is logged. If several location products from the selection are contained in an order, the location product from the selection that has the most "significance" is used, for example, the main product for in-house production orders or the receipt element for stock transfers.

The location product that is specified in the log for an order/schedule line also determines the package in which this order is processed (for example, for packaging by location product).

You should delete obsolete logs at regular intervals.

Activities

Example






Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 26870 Date: 20240520 Time: 073425     sap01-206 ( 615 ms )