Showing posts with label CIF. Show all posts
Showing posts with label CIF. Show all posts

Wednesday, January 12, 2011

Note 1228423 - APO Planning Run and CIF Activities in parallel

Summary
Symptom
Planning runs of one or several SAP SCM / APO applications (e.g. PP/DS MRP, PP/DS-Heuristc, PP/DS-Optimizer, CTM, SNP-Heuristic, SNP-Optimizer, SNP Deployment, SNP TLB) are scheduled in parallel to data transfer from SAP ERP (R/3) to SAP SCM / APO via the Core Interface (CIF).

Planning runs or CIF-updates report (locking) errors or planning results or CIF-updates are inconsistent or incomplete.

These errors can be caused by lock collisions because CIF and a planning run might change the same data (in most cases the same order) concurrently.
Other terms
CTM planning run, SNP heuristic, MRP planning run, Optimizer run, lock errors, stop queues, PP/DS planning run, ATP check
Reason and Prerequisites
Same data (mainly orders) is changed concurrently by CIF and a SCM / APO planning run.

From a technical perspective, in APO in most cases a lock collision will occur in liveCache. Each transaction has to acquire a liveCache lock for each object which has to be changed or deleted by that transaction. The liveCache locks are somehow similar to conventional database locks. Most planning runs and CIF-updates are running in a so-called "transactional simulation". Changes are done temporarily within such a transactional simulation in liveCache. Within a transactional simulation lock collisions can not occur, i.e. several parallel transactions can change an object simultaneously. After all relevant changes are done the application program triggers a so-called "merge" of the transactional simulation. This step merges all temporary changes performed within the transactional simulation into the real (operative) data. To do so, the merge has to acquire a liveCache lock for each object which has to be changed or deleted within that merge. The merge acquires all liveCache locks right at the beginning of the merge. If one or several objects are locked by parallel transactions (usually by parallel merges) the merge will wait up to 20 seconds for these locks. If all needed locks are released within that time the merge starts to update, delete or create liveCache objects as they have been updated, deleted or created during the transactional simulation. If the merge can not acquire all needed locks it terminates and returns an error to the calling application (CIF or a planning run or any other APO transaction.)

Instead of merging a transactional simulation alternatively it could also be deleted. In that case all changes during the transactional simulation are discarded.

If a merge runs into a lock collision then the merge could be restarted (several times) as part of a retry-logic, as implemented in CIF, for instance. If after several retries the merge still can not acquire all locks the entry will remain in the CIF queue showing an error.

Planning runs usually do not have such a retry-logic. If the merge of a planning run can not acquire all needed locks the planning run might terminate completely or it might skip one object (like a product-location-combination) and it will report an error.
Solution
There are different solutions depending on what kind of scenarios / applications are run in SCM / APO. Whether which scenario is used intensive testing is recommended to guarantee expected behaviour. As there are too many scenarios, combinations of scenarios, use cases and configurations it is impossible to describe a detailed solution for any process in SCM / APO. Therefore, this note provides for each APO application just the most important aspects concerning a parallel processing of CIF updates and planning heuristics:
  • Prerequisites for some functions of individual APO applications where no locking issue can occur.
  • Behavior of individual APO applications in case a locking issue occurs.
  • Recommendations for individual APO applications to avoid locking issues in some specific areas.
    1. Master Data

A change of master data might lead to lock collisions with CIF updates as some changes to master data will cause changes to transactional data. Examples are the change of a resource calendar or the change of a resource type. Changing a PPM will not interfere with CIF updates if this change will not result in an immediate re-explosion of the corresponding production orders. Nevertheless, it is not recommended to change a PPM in parallel to a planning run because this might lead to unreasonable or even inconsistent planning results. This becomes obvious by considering a case where a MRP run reads several times a PPM which is changed or even deleted in between.

This example shows why in general, it is not recommended to change master data (neither in APO nor via CIF) in parallel to any planning run. Only the creation of new master data in parallel to planning runs should, in general, not cause any issues.

It is recommended to stop CIF while executing a copy of planning versions (Reports /SAPAPO/VERSION_COPY_PAR und /SAPAPO/VERSION_COPY_TRANS). The following BADIs are offered to control the CIF process while copying
  • /SAPAPO/MVM_COPY1
  • /SAPAPO/MVM_COPY2
  • /SAPAPO/MVM_COPY5
  • /SAPAPO/MVM_COPY6

Further information can be found in note 519014.
    2. Demand Planning (DP)

As no data of DP is send from SAP ERP (R/3) to SCM / APO no locking issues will occur when DP planning runs are scheduled concurrently to CIF transfers.

However when the DP forecast is released to Supply Network Planning and in parallel the forecast is updated or a sales order transfer via CIF triggers forecast consumption then locking issues can occur during the forecast release.
As a result the forecast release adds a corresponding error message into the application log. Then the location product where the locking occurred is skipped and afterwards the forecast release continues with the next location product.

Please note that there is no functionality available to automatically restart the forecast release only for those location products where locking (or other) issues occurred. To resolve the incomplete forecast release either a manual selection of the failed location products is necessary or a restart with the complete selection of location products.
    3. Global ATP
Within this chapter about ATP the following applications and functions are considered as "planning run": CTM, PP/DS, SNP, CIF-updates. They all might change ATP-relevant order documents in the active planning version.
  • ATP checks can be executed in parallel to planning runs.
  • It is not recommended to use the following ATP-related functions in parallel to all planning runs which create, change or deletes order documents:
    • Backorder processing (BOP) in update mode
    • Capable-to-Promise (CTP) in an ATP-check
    • Multi-level-ATP (MATP) check with recreation of receipt elements
    • Converting ATP-Trees: Neither using the conversion-batch-report nor starting immediate online conversion, during sales order update.
      (ATP-Trees are used when checking availability with the following advanced methods: Multi-Level-ATP, Rules-Based-ATP triggered stock transfer [RBA-STO], Consolidation and Subcontracting)

An ATP-check itself will not lead to any locking problems even if a planning run is carried out in parallel. However, SAP does NOT recommend using CTP or MATP with "recreation of receipt elements" during that check. Saving the document which carried out an ATP-check could potentially lead to a problem, if a multi-level ATP-check (incl. RBA-STO, consolidation & subcontracting) was carried out and the ATP-tree is converted immediately or "recreation of receipt elements" was active. Additionally, SAP does not recommend executing the following batch processes in parallel to a planning run:
  • Back-Order-Processing (BOP) in update-mode. This seems to be a very hard constraint, but it is especially true for the critical processes described above. For all the other ATP-processes locking collisions should not occur, nevertheless SAP does not recommended BOP in parallel to a planning run in order to avoid incoherent results between ATP and planning processes as described in the remark below. (BOP in simulation mode is supposed to be uncritical) The process "event driven quantity assignment" (EDQA) is triggering a small BOP in update mode, too. It is therefore another theoretical candidate for a critical process. However, it is extremely unlikely that it really causes troubles.
  • ATP-tree conversion batch-job.

Explanation: The scenarios mentioned above could result in the creation, change or deletion of their corresponding receipt elements (planned orders / purchase requisitions / stock transfer requisitions) including their fixed pegging relations. A planning run might touch the very same orders and depending on the duration of the process, lock-collisions might occur.

Remark: Changing or deleting existing documents is generally more critical than creating new ones. Locking errors often occur randomly, so it could easily happen that all ATP-processes are executed smoothly, although an order change was triggered by a parallel planning process. Please be aware of the fact, that in case of parallel order manipulation neither the results of the planning run nor the result of the parallel ATP processes might be sensible anymore from a business point of view.
Example:
PP/DS is re-planning existing production and planned orders taking into account their current constraints. This will lead to a change of planned input and output dates and quantities. The newly calculated dates and quantities however will not be visible to parallel processes like BOP until the planning has finished and is merging the result to the active version. So the parallel BOP would have calculated its confirmations based on old, outdated data. Its result is meaningless, although NO lock collision occurred!
Solution approach:
Avoiding these incoherent results especially between BOP and planning runs should be possible with a reasonable effort by just selecting the worklists in both applications in a sensible, non-overlapping way; or even simpler by running the BOP after the planning functions have finished their tasks. Additionally the ATP-check (online or BOP) is uncritical when only taking into account receipt elements which are not supposed to be touched by planning applications in SCM anymore. So a straight forward ATP-check taking into account stock, advanced shipping notifications, purchase orders, released production orders and released process orders only, should neither lead to locking collisions nor to incoherent results.
    4. Planning runs of PP/DS

Purchase requisitions and planned orders should not be "updated" via CIF during planning runs of PP/DS.

Changes to Planned/Production orders during parallel planning runs in PP/DS -

In general, we do not recommend online changes in R/3 when doing parallel planning run in APO. Please read note 575624 for more details.
Additionally online changes from R/3 for in-house production orders can cause the below effects on existing orders:
  • De-allocate the orders in APO.
  • Cause loss of scheduling information (i.e. dates/times can change).
  • It can also firm the orders.

So if a planning is happening at the same time, the outcome of the planning run can be invalidated due to the above changes. The liveCache locking concept is the same as explained in the top section of this note. CIF has retry mechanism if it fails to get a lock. Even if this fails, the queue ends up with error.

If an R/3 confirmation happens at the same time as the APO planning run, the R/3 confirmation will always over-ride the changes done by the planning run.  If the APO planning run tries to do the change on the same object that was confirmed, then an error will be raised to the user.

If simulation versions are merged in PP/DS the system might not transfer all the order changes that you made in APO. This is due to parallel changes in R/3 or in the ECC system.
If you want as many of your changes in APO as possible to be transferred then refer to note 1235278 for further details.
    5. Capable-To-Match (CTM)

CIF updates of orders
Depending on the settings for 'Delete Mode' in the CTM profile, no orders or only orders which are not fixed will be deleted.
CTM treats orders that are transferred via CIF as fixed, so it will not lead to any locking problems with respect to CIF updates of orders.

CIF updates of master data
There are no known locking issues for master data changes in parallel to a CTM run. Nevertheless, theoretically order creation may fail due to locked product-location combinations or resource calendars, but the possibility for that to happen is very low.
Depending on the customizing, CTM logs errors or stops execution, there is no retry logic implemented in CTM.

CTM reads in all necessary master and transactional data at the beginning of the plannung run.
If either data is changed parallel to a CTM run, the result might not be consistent to the new situation and, if CTM is to create fixed pegging relationships, log entries for pegging errors may occur. If, for example, the quantity of a customer order is reduced during a CTM run, only the remaining quantity of a planned order is fixed pegged to the customer order.

    6. SNP heuristics / SNP optimizer

In order to avoid locking issues and subsequent application failures during the SNP heuristic planning run the CIF should not update orders which are created, changed or deleted by the SNP planning run. These are orders such as SNP planned order, purchase requisition, stock transfer purchase requisition, SNP scheduling agreements or subcontracting orders.

SNP planning stores the planning result in packages of several orders. The package size and structure is depending on the used SNP planning application, e.g. SNP heuristics creates order packages per location product and order type. In case a locking situation occurs, SNP planning uses a retry mechanism to resolve the locking. When the limited number of retry attempts fails, then the complete order package which includes the lock is discarded and a corresponding error message is recorded in the application log. SNP planning will then continue with the next order package. The prerequisite for storing the planning result in order packages with retry attempts is to use the transactional simulation for planning runs, which is the default setting.
The prerequisite for the retry mechanism is that SNP planning is executed in batch mode.

There are no known locking issues for master data changes in parallel to an SNP planning run. Nevertheless changing master data in parallel to SNP planning can lead to useless planning result with regards to the changed master data and is therefore not recommended. Especially the SNP optimizer reads all necessary master data at the beginning of the planning run and therefore the planning result can be completely outdated when master data is changed during the planning run.

Furthermore when new master data is created which is subsequently considered by a parallel SNP planning run then errors can occur in case time series key figures are used for the new master data in the corresponding SNP Planning Area. The errors will occur when the time series key figures are read by the planning run but not yet created for the new master data.

Also when transactional data is changed in parallel to a planning run, the planning result can be inconsistent or useless after the change when the planning considered the transactional data before the change by CIF happened. Especially when the SNP Optimizer is used then the impact to the planning result can be significant, since the complete supply and demand data is retrieved at the beginning of the planning run.

To avoid inconsistencies in planning results due to outdated data it is recommended not to change the same data by parallel jobs. This can be achieved e.g. by using corresponding selections for the SNP planning runs.
    7. Service Parts Planning (SPP)

Transactional data for which potentially collisions with CIF may occur are: purchase orders, purchase order requisitions, delivery schedules, planned orders, and scrap orders.
SPP applications like forecasting, inventory planning, DRP and deployment access transactional data via the so called transactional data layer (TDL). When CIF is transferring transactional data and SPP applications try to access this data via TDL, then an exception is raised by TDL. The SPP applications catch this exception and write an error message to the application log. The location(product)s for which such an exception occur are handled as not planned. This means triggers for the location(product)s aren't deleted and SPP will try to plan the location(product)s in the next planning run again.

SPP applications access master data via PSM data managers. The PSM data managers call MDL. The underlying master data access modules return an error message in case of a collision. MDL propagates these error messages to PSM. When PSM receives an error message while writing master data, it stops the current processed package and rolls all data back. A package is a subset of a PSM selection, which is processed at once. This means triggers for all location(product)s of the package aren't deleted and SPP will try to plan the location(product)s in the next planning run again.
Collisions can occur for product and location product master data which is written by SPP applications like Forecasting, Inventory Planning, Deployment, Surplus and Obsolescence and the Planning Mode Determination.
    8. CIF

If the transfer of changes in ERP (R/3) via the CIF interface and APO is not locked consistent planning results can only be guaranteed in regards to the initial data at planning start.

If the transfer of changes in ERP (R/3) via the CIF interface and APO is not locked warning messages in the log of the planning run can occur (e.g. master data changes via CIF during planning runs, orders cannot be considered anymore).

In order to avoid inconsistent planning results it is possible to create different CIF integration models with different data objects (e.g. separate models for master and transactional data objects, separate models for different transactional data objects). However you should consider that the re-activation of the integration model automatically trigger a new initial data transfer.

You can block the transfer of specific transaction data. You should be aware that the queue names are automatically generated by CIF so there is no way to manually or via BAdI change the queue names in order to be able to assign queue names which can be used to differentiate the data objects by their content, eg. Purchase Orders of US would have CFPOUS* and Purchase Orders of Germany have CFPODE*. You can only block the transfer of specific data globally.

Here are some examples:
  • CFSTK* Stocks
  • CFSLS* Sales orders and deliveries
  • CFPO* Purchase requisitions and purchase orders
  • CFPLO* Planned and production orders

You can halt all CIF queues that are sent to APO by locking the generic queue
  • CF*

Then neither master nor transactional data is transferred to the APO System. It is also possible to lock the transfer of data changes for only certain master data.
Example: blocking the transfer of material master data changes:
  • CFMAT*

You will find further documentation on the programs RSTRFCI1 and RSTRFCI3 in note 717244.
    9. Other SCM / APO Applications

For all other SCM / APO applications which are not mentioned in this note, please contact SAP.
Header Data


Release Status:Released for Customer
Released on:22.09.2008  18:13:24
Master Language:English
Priority:Recommendations/additional info
Category:Consulting
Primary Component:SCM-APO-INT Interfaces
Affected Releases
Software
Component
Release
From
Release
To
Release
And
subsequent
SCM
410
410
410
 
SCM
415
415
415
 
SCM
500
500
500
 
SCM
510
510
510
X
SCM
700
700
700
 
Related Notes


 
1236322 - Enable Extraction to skip planning objects without LC anchor
 
717244 - Locking/unlocking inbound queues with the RSTRFCI1 program
 
575624 - Locking concept in APO PP/DS (documentation)
 
528913 - Lock R/3 data transfer during SNP, CTM, PP/DS planning
 
519014 - Handling Planning Version Management.

Saturday, December 11, 2010

CIF customer/vendor to APO

If both the vendor and the customer have the same number in the ERP system (for example, customer and vendor 1000), you need to rename one of them when entering them into SAP APO by using the customer exit for the vendor master record (for example, you can rename the vendor S1000). If you do not do this, the system is unable to differentiate between the two locations.
(Reason: The location type is a key field in the /SAPAPO/LOCMAP table, but only an attribute in the /SAPAPO/LOC table.)


If any changes need to be made in relation to the data transfer
you can use the following:

CIF_CUSTOMER_LOCATION_MAP - (ECC )
/SAPAPO/CIF_LOC_INBOUND - (APO)
/SAPAPO/DM_LOCATION_MAINTAIN - (APO)
EXIT_SAPLCLOC_001 (CIFLOC01) - (ECC )
EXIT_SAPLCLOC_002 (CIFLOC01) - (ECC )
EXIT_SAPLCLOC_003 (CIFLOC01) - (ECC )
EXIT_SAPLCDC5_001 (CIFLOC02) - (ECC )
EXIT_/SAPAPO/SAPLCIF_LOC_001 - (APO)
EXIT_SAPMMDUSER_004 (APOMD004) - (APO)
Object type: BUS10002
BAPI: BAPI_LOCSRVAPS_SAVEMULTI_30A
Customer exit: EXIT_SAPL10002_001
(APOBP003)

Thursday, December 9, 2010

CIF Queue STATUS

Outbound Queue STATUS
Please also refer to SAP note 378903.
READY
The queue is ready for transmission. This status should only be a temporary status. However, in the
following case this status can also be a permanent status: a queue was locked manually via transaction
SMQ1 or via a program and then unlocked without being activated at the same time. This queue must
be activated explicitly.
RUNNING
The first LUW of this queue is currently being processed. If a queue in this STATUS hangs for more
than 30 minutes, this may mean that the work process responsible for sending this LUW has terminated.
In this case you can activate this queue again. Note that activating a queue in status RUNNING may
cause a LUW to be executed several times if this LUW is processed in the target system at that time.
We therefore recommend a waiting time of at least 30 minutes before you activate the queue again.
EXECUTED
The first LUW of this queue is processed. The system waits for a qRFC-internal confirmation from the
target system before further LUWs are processed. If a queue in this STATUS hangs for more than 30
minutes, this might mean that the work process responsible for sending this LUW has terminated. In
contrast to status RUNNING, this current LUW has definitely been executed successfully. You can activate this queue again without problems. The qRFC Manager will automatically delete the LUW
already executed and send the next LUW.
SYSLOAD
At the time of the qRFC call, no DIALOG work processes were free in the sending system for sending
the LUW asynchronously. A batch job for subsequent sending has already been scheduled (see SAP
Note 319860 for more details).
SYSFAIL
A serious error occurred in the target system while the first LUW of this queue was executed. The
execution was interrupted. When you double-click on this status, the system displays an error text. You
can find additional information on this error in the corresponding short dump in the target system (ST22).
No batch job is scheduled for a repetition and the queue is no longer processed. To solve the problem,
information from the affected application is required. Refer to SAP Note 335162 for the special error text
"connection closed".
CPICERR
During transmission or processing of the first LUW in the target system, a network or communication
error occurred. When you double-click on this status, the system displays an error text. You can find
additional information on this error in the syslog (SM21), the trace files dev_rd or dev_rfc*. Depending
on the definition in transaction SM59 for the destination used. A batch job is scheduled for subsequent
sending. Status CPICERR may also exist in the following cases although no communication error
occurred: a qRFC application finds out that a LUW cannot be processed any further due to a temporary
error in the application and therefore calls the RESTART_OF_BACKGROUNDTASK function module to
prompt the qRFC Manager to cancel the execution of this LUW and to repeat this LUW later in
accordance with the specification in transaction SM59.In this case, qRFC simulates a communication
error with the text "Command to tRFC/qRFC: Execute LUW once again." If this error occurs very often,
you must contact the corresponding application team.
STOP
On this queue or a generic queue (for example BASIS_*) a lock was set explicitly (SMQ1 or programs).
Note that the qRFC never locks a queue in its processing. After having informed the corresponding
application team, you can unlock and activate this queue using transaction SMQ1.
WAITSTOP
The first LUW of this queue has dependencies to other queues, and at least one of these queues is
currently still locked.
WAITING
The first LUW of this queue has dependencies to other queues, and at least one of these queues
contains other LUWs with higher priorities.
NOSEND
LUWs of this queue are never sent but retrieved by a special application. These queues are only used
internally at SAP (BW or CRM during communication with Mobile Clients). Even if a LUW was read by
the corresponding application (BW, CRM), this status does not change. This LUW is only deleted from
the queue if this application confirms collection (collective confirmation possible). Under no
circumstances should this status be reset using transaction SMQ1 and the queue activated.
NOSENDS
During the qRFC call, the application determines at the same time that the current LUW is not sent
immediately. This is used to debug the execution of an LUW via transaction SMQ1. Contact the
corresponding qRFC application to clarify this status since this is either a programming or configuration
problem.
WAITUPDA
This status is set if qRFC is called within a transaction that also contains one or more update functions.
As a result of this status, the LUW and thus the queue is blocked until the update has been completed
successfully. If this status takes longer than a few minutes, check the status of the update or the update
requests using transaction SM13. After a successful retroactive update, the blocked LUW is sent
automatically. You can also restart the LUWs manually in the WAITUPDA status without a successful
retroactive update (via transaction SMQ1, Reset status, Activate queue). However, you may only
perform this action after having informed the qRFC application (for example, APO, BW, CRM). You must
do this to avoid possible inconsistencies. This WAITUPDA problem may be avoided as follows: If both
qRFC calls and update calls occur within a transaction, qRFC must be executed exclusively within the
update. In this case, the qRFC LUW is only created after the update has been completed successfully.
Caution: If you are using SAP Basis Releases 4.0x, 4.5x, 4.6A or 4.6B, and an update function with the
"collective run" type exists in a LUW, an error in the kernel may cause this status. The queue also hangs
in this case. This error has already been corrected with a kernel patch (see SAP Note 333878).
RETRY / ARETRY
During LUW execution the application has diagnosed a temporary problem and has prompted the qRFC
Manager in the sending system via a specific qRFC call to schedule a batch job for a repetition on the
basis of the definition in transaction SM59 (Menu: Destination > TRFC Options)
ANORETRY
During the LUW execution, the application has found a serious error and prompted the qRFC Manager
via a specific qRFC call to cancel processing of this LUW. Information from the affected application is
required to solve the problem.
MODIFY
Processing this queue is locked temporarily because the LUW data is being modified.
Remark: Report RSQOWKEX reset the status of all queues (CPICERR, RETRY, SYSFAIL) and
restarts the outbound scheduler. This report can be used in exceptional cases; do not schedule this
report on regular basis, investigate the error before restarting the queue.

Inbound Queue STATUS
Please also refer to SAP note 378903.
READY
The queue is ready for processing. This status should only be a temporary status. However, in the
following case this status can also be a permanent status: a queue was locked manually via transaction
SMQ2 or via a program and then unlocked without being activated at the same time. This queue must
be activated explicitly.
RUNNING
The first LUW of this queue is currently being processed. If a queue in this status hangs for more than
30 minutes, this may mean that the work process responsible for sending this LUW has terminated. In
this case you can activate this queue again. Note that activating a queue in status RUNNING may cause
a LUW to be executed several times if this LUW is processed in the target system at that time. We
therefore recommend a waiting time of at least 30 minutes before you activate the queue again.
SYSFAIL
A serious error occurred in the target system while the first LUW of this queue was executed. The
execution was interrupted. When you double-click on this status, the system displays an error text. You
can find additional information on this error in the corresponding short dump in the target system
(ST22).No batch job is scheduled for a repetition and the queue is no longer processed. Information
from the affected application is required to solve the problem. Refer to SAP Note 335162 for the special
error text "connection closed".
CPICERR
During transmission or processing of the first LUW in the target system, a network or communication
error occurred. When you double-click on this status, the system displays an error text. You can find
additional information on this error in the syslog (SM21), the trace files dev_rd or dev_rfc*. Depending
on the registration of this queue (SMQR) a batch job is scheduled for repetition. Refer to SAP Note
369524 for the error text "R/3 logon failed". Status CPICERR may also exist in the following cases
although no communication error occurred: a qRFC application finds out that a LUW cannot be
processed any further due to a temporary error in the application and therefore calls the
RESTART_OF_BACKGROUNDTASK function module in order to prompt the qRFC Manager to cancel
the execution of this LUW and to repeat this LUW later in accordance with the specification in
transaction SM59.In this case, qRFC simulates a communication error with the text "Command to
tRFC/qRFC: Execute LUW once again.". If this error occurs very often, you must contact the
corresponding application team.
STOP
On this queue or a generic queue (for example, BASIS_*) a lock was set explicitly (SMQ2 or programs).
Note that the qRFC never locks a queue in its processing. After having informed the corresponding
application team you can unlock and activate this queue using transaction SMQ2.
WAITSTOP
The first LUW of this queue has dependencies to other queues, and at least one of these queues is
currently still locked.
WAITING
The first LUW of this queue has dependencies to other queues, and at least one of these queues
contains other LUWs with higher priorities.
NOEXEC
During the qRFC call, the application team simultaneously determines that the current LUW is not
processed automatically even if the queue to the QIN Scheduler (SMQR) is registered. This is used to
debug the execution of an LUW via transaction SMQ2. Contact the corresponding qRFC application to
clarify this status since this is either a programming or configuration problem.
RETRY
During LUW execution, the application has diagnosed a temporary problem and has used a specific
qRFC call to prompt the qRFC manager in the sending system to schedule a batch job. This batch job
schedules a repetition after two minutes.
ARETRY
During LUW execution the application has diagnosed a temporary problem and has prompted the qRFC
Manager in the sending system via a specific qRFC call to schedule a batch job for a repetition on the
basis of the registration in transaction SMQR.
ANORETRY
During the LUW execution, the application has found a serious error and prompted the qRFC Manager
via a specific qRFC call to cancel processing of this LUW. Information from the affected application is
required to solve the problem.
MODIFY
Processing this queue is locked temporarily because the LUW data is being modified. 


Source:CIF cookbook.

Saturday, June 26, 2010

CIF Related Transactions

ECC Slide 16
Cfc1 – Maintain Queue Types
Cfc2 – User specific settings for Queues
Cfc9 – Master Data Settings for Online Transfer or Periodic Change Transfer 
Cfg1 - Application Log
Cfm1 – Create Int.Model
Cfm2 – Activate Int. Model
Cfm4 – Display Int.Model
Cfm5 – Search for Int.Model
Cfm6 – Change Int.Model
Cfm7  - Delete Int.Model
Smq1 – Outbound Queue Monitor
Smq2 – Inbound Queue Monitor
Smqr – QIN Scheduler
Bd50 – Activate change pointers for message type
Bd52 – Define master data fields for message type.
Bd61 – Activate change pointers generally.
Bd22 – Delete Obsolete change pointers.
ALE customizing  - Transaction : SALE

APO
Slide 17
sapapo/c1 – BSG
Sapapo/c2 – Queue Types for BSGs
Sapapo/c3 – Application log
Sapapo/c4 – User specific settings for Queues 
/Sapapo/c5 - Change Pointer
sapapo/loc3 – Location
sapapo/mat1 – Product
sapapo/res01 – Resource
sapapo/scc05 – PPM
Sapapo/rrp3 – Product View
Sapapo/rrpcust1 – customizing for integration strategies.
Smq1 – outbound queue monitor
Smq2 – inbound queue monitor
Sapapo/cq – SCM Queue Manager
SALE – ALE Customizing
 

Tuesday, June 22, 2010

Note 511434 - Adding MARC fields to the material selection in CIF Integration Model

Summary

Symptom

When you generate the integration model, the selection conditions for materials do not meet your requirements. You require additional MARC fields as selection conditions.

Other terms

APOSFC, integration model, material, selection conditions

Solution

This modification note describes the procedure that you can use to enhance the selection conditions for the material master selection when you generate the integration model. You can add any MARC field as a selection criterion. The following example describes how to add the 'purchasing group' field (MARC-EKGRP). If you require a different MARC field, replace EKGRP with the MARC field of your choice in the following descriptions.

First, use transaction SE11 to create a new CIFEKGRP_RANGE structure with the name 'Range for purchasing group (MARC-EKGRP)'. Assign the development class MGSE to this structure and enter the following fields:
Component Component type
SIGN SIGN_RANGE
OPTION OPT_RANGE
LOW EKGRP
HIGH EKGRP
Save and activate the structure.

Add the optional table parameter IN_EKGRP_RANGE to the interface of the MATERIAL_KEY_SELECTION function module.
Parameter name Reference structure Optional
IN_EKGRP_RANGE CIFEKGRP_RANGE 'X'
Save and activate the module.

Add the optional table parameter MA0200 to the interface of the CIF_GEN_RIMOD_SELSCR function module.
Parameter name Reference structure Optional
MA0200 CIFEKGRP_RANGE 'X'
Save and activate the module.

Create the following table entry in the CIFSELOPT table:
IMTYP: T_MAT
SELNAME: ma_ekgrp (note lower case)
GROUPID:

CIFIPARNME: ma0200 (note lower case)
SELTYPID: S
SELPOS: 8
TABNAME: MARC
FIELDNAME: EKGRP
GRPTABNAME:
GRPFIELDNAME:
To distribute this entry to the connected systems, note that you must either make this entry manually in each connected system or include the entry manually into your transport request.

Then implement the source code corrections.

To display the new field on the new selection screen, use transaction SE51 to perform the following enhancements on screen 7998 of the SAPLCIFI program:

  • Enlarge the entire screen area, if necessary, to position the new field below the fields that already exist.
  • Select the option 'Goto->Secondary fields -> Dict./program fields (F6 function key). On the next screen, select the 'Retrieve from program' option and then select MA0200-LOW and place it in a suitable position. You then have to select MA0200-HIGH and also place it in a suitable position. Note that the LOW field is positioned in the same column as the remaining 'LOW' fields and the HIGH field in the same column as the remaining 'HIGH' fields.
  • Select the SELECT_0007 button, copy it and position it immediately to the left of the MA0200-LOW field. Rename the button SELECT_0200 and assign the S200 function code to the button.
  • Select the B1 text field, copy it and position it immediately to the left of the MA0200-HIGH field . Rename the field B200.
  • Select the CPLX_0007 button, copy it and position it to the right of the MA0200-HIGH field (below the buttons that exist there already). Rename the button CPLX_0200 and change the function code to M200.

Save and activate the screen. The new selection option is then available to you when you generate integration models.

If you would like to include more than one new selection option in the selection screen, consider the following:

  • Replace all occurrences of the name EKGRP with the new MARC field (both the occurrences described here in the text as well as those occurrences in the source code)
  • The numbering 200 in the fields mentioned here (SELECT_0200, S200, B200, CPLX_0200, M200, ma0200) and the fields mentioned in the source code (SELECT_0200(40), CPLX_0200(40), chk200c_icon(40) and the MA0200_PAI module) must be unique for each selection option added to the screen, that is, if you want to add an additional selection option, you have to rename the fields and variables accordingly (SELECT_201, S201, and so on). For the next selection option, you also have to rename the fields and variables accordingly (SELECT_202, S202, and so on). In addition, you must consider the corresponding table entries in the CIFSELOPT table. Furthermore, note that the new selection options are transferred to the form SELOPT_CHANGE in the corresponding modules (MA0201_PAI, MA0202_PAI, and so on).









Header Data



Release Status:Released for Customer
Released on:29.04.2002 12:05:55
Master Language:German
Priority:Correction with medium priority
Category:Special development
Primary Component:SCM-APO-INT-IMO Integration Model

Affected Releases

Software
Component
Release
From
Release
To
Release
And
subsequent
PI
2001.2
2001_2_31I
2001_2_46C

Corrections Instructions

Correction
Instruction
Valid
from
Valid
to
Software
Component
Last
Modifcation
2001_2_31I
2001_2_46C
PI
15.04.2002 08:35:23

Related Notes




507696 - MARC fields added to material selection in PI2002.1

360723 - Addition of MARA fields to material selection

360089 - Adding ARNB fieldsto material selection

Tuesday, June 1, 2010

Note 425825 - Consistency checks, /sapapo/om17, /sapapo/cif_deltareport

Summary

Symptom

Scope of functions of the consistency checks, /sapapo/om17 and /sapapo/cif_deltareport (/SAPAPO/CCR)

Other terms

Internal consistency, external consistency, comparison, compare, consistency check, CIF Compare & Reconcile Deltareport, refresh
/SAPAPO/TS_LCM_CONS_CHECK, /SAPAPO/TS_LCM_CONS_CHECK_ALL
/SAPAPO/TS_LCM_REORG

Solution

Internal consistency refers to the consistency between the liveCache data and the APO database.
External consistency refers to the consistency between the APO system and one or more dedicated R/3 Systems.
Before you check the external consistency and set it up again, if necessary, make sure that the internal consistency of the APO system is guaranteed.

In addition to the information contained in this note, you should refer to the document "Data Consistency between SAP R/3 and SAP APO 3.0/3.1".
This document was created as part of "SAP Best Practices for Solution Management mySAP SCM" and contains extensive information on the relevant consistency checks.
You can find the path for this document in note 572003.


----------------------------------------------------------------
Internal consistency checks
----------------------------------------------------------------

Internal consistency check - transaction /SAPAPO/OM17

Internal consistency refers to the consistency between the liveCache data and the APO database.
Inconsistencies may occur if the APO database data or the liveCache data can no longer be completely restored due to system crashes and inappropriate backup strategies.Since there is currently no logging for Demand Planning data, inconsistencies can still occur in this area following a recovery.To check the external consistency between the APO database and the liveCache and to set it up again, if necessary, use transaction /SAPAPO/OM17.

The following data is checked in particular:

  • Pegging areas, stocks, campaigns and planning versions are checked.
  • Master data:This data is saved redundantly in the APO database and in the liveCache, this means that data which is only on the APO DB, can be generated in the liveCache.If data still only exists in the liveCache, you can select this for deletion.
  • No resources are checked.The 'Resources' option is provided in older versions of the /SAPAPO/OM17 report, but you should avoid using this option as the results are inadequate.The results are not satisfactory.
Internal consistency check for resources - transaction /SAPAPO/REST02


(also in the initial screen of the resource maintenance under the menu Tools/liveCache check)
You can select different options on the selection screen of the report.

  • Check existence in the LC - liveCache check
    Only checks which resources do not exist in the liveCache and displays a list of these resources.
  • Save non-exist. res. LC - liveCache save
    This option checks the resources and creates missing resources in the liveCache.Resources, for which a backup is not possible in the liveCache, are assigned a red traffic light and a corresponding error message in the list of results.
  • Save selected res. LC - liveCache save
    This option saves all the resources in the liveCache that meet the selection conditions.
    A list with yellow traffic lights is displayed for those resources where there are differences between the database and the liveCache.The differences are highlighted.
    Resources, which could not be saved in the liveCache, are displayed with a red traffic light.Corresponding error texts are displayed in the list of results for these resources.

In the list of results, resources can be selected and saved in the liveCache.You can also navigate into the resource maintenance by selecting resources and the "Change resources" function.You can also display the time stream in the liveCache by clicking on the time stream GUID (times in UTC) and you can display the bucket vector in the liveCache by clicking on the green traffic light in the "Bucket vector" column.

Consistency checks for product allocations


To date, there is no consistency check for product allocations within transaction /SAPAPO/OM17 - the check tool is available in the menu tree for product allocations "Global ATP - Environment - Product Allocations - Repairs".
In the product allocation, the incoming order quantities can be directly updated in the liveCache during a direct connection to the planning area.Using the tool in the liveCache, you can reconcile the data with the product allocation assignment on the database.The tool allows you to check and then correct the data.

/SAPAPO/ATPQ_CHKUSG -Check product allocation assignment
Product allocation assignment without complete incoming order quantity
Product allocation assignment without order item
Product allocation assignment without allocation group

Inconsistent temporary quantity assignments after the LC recovery


Previously, there was neither a consistency check nor a repair option within transaction /SAPAPO/OM17 for inconsistent and incorrect temporary quantity assignments that may occur after an LC crash and a subsequent LC recovery.
These inconsistencies only occur for APO Release 3.0 if you are using a liveCache lower than Version 7.4. As of LC Version 7.4, the LC itself performs the correct data recovery.You can use the /SAPAPO/REBUILD_TQA report to eliminate the inconsistencies after an LC recovery for APO 3.0. This report deletes incorrect temporary quantity assignments and creates missing quantity assignments.
However, it is not possible to use the report to correct all inconsistencies automatically and you must perform this manually in some cases. For a detailed description of the procedure, see note 435827.

Demand Planning consistency check


The /SAPAPO/TS_LCM_CONS_CHECK_ALL report checks all existing time series networks of the Demand Planning.Any inconsistencies are displayed for each planning area and version without the option of being able to delete these.
The /SAPAPO/TS_LCM_CONS_CHECK report performs the same checks as the /SAPAPO/TS_LCM_CONS_CHECK_ALL report, but only for one planning area to be selected in each case and also for each planning version (if desired).You can also activate the 'repair' option.Any inconsistencies are then automatically eliminated during the run.If you select the 'Repair' option, no other processes may be active for the selected planning area and the selected planning version. To make sure that this is the case, you can set an optional lock after implementing note 543304 or as of Support Package 22. If you cannot set the optional block, execution of the report is terminated for this version and a list of system users who have already set a change lock for the planning version is displayed.

The following is checked:

  • Storage buckets profile in the liveCache:
    With the storage buckets profile the system checks, in addition to the existence, whether the start times of the time buckets and the weighting factors are correct.The system runs its checks on the basis of the settings of the planning area's storage buckets profile (cf. transaction /SAPAPO/TR32).Any inconsistencies here cannot be repaired.However, this case only occurs very rarely (for example, if the fiscal year variant has been subsequently changed).The inconsistencies can only be eliminated by creating (initializing) the time series again.
  • Time series
    With the time series, the system checks whether the corresponding liveCache anchors, and in turn all corresponding time series for these anchors, exist in the liveCache for all characteristics combinations in accordance with the planning object structure (DB).Missing anchors or time series are created.
    However, these time series are created with initial information.Therefore, if data is lost during a liveCache crash, this data must be produced again (for example, by restarting a planning run, reloading historical data from an InfoCube).
  • DP relationships
    With the DP relationships, the check starts from the planning object structure and the related aggregates to ascertain whether all the relationships exist. The check also verifies whether unnecessary relationships exist. Missing relationships are created and unnecessary relationships deleted.
    Provided the data still exists in the corresponding planning object structure, the DP relationships can be completely created again (except for firming information).If the time series of the planning object structure were created again with initial values in the case of a liveCache crash, this (initial) information is also copied to the DP relationships.When the time series of the planning object structure (see above) are recovered, the DP relationships are automatically adjusted.
  • DP-BOM relationships (only as of APO 3.0 Support Package 19/APO 3.1 Support Package 03 or note 458666)
    With the DP-BOM relationships, the system checks, on the basis of the existing characteristic combinations and the master data, whether all relationships exist in the liveCache between the dependent characteristic combinations.(Characteristic combinations are dependent if they show the same PPM and the same user-defined characteristics).The system also checks whether the BOM coefficients of the PPMs agree with the coefficients in the liveCache.The check for the DP BOM relationships assumes that all characteristic combinations exist.Missing BOM relationships are created and changed BOM coefficients are adjusted.


The report /SAPAPO/TS_LCM_REORG (supplied with note 542946 or Support Package 22) determines all liveCache time series and period patterns from a selected planning version that do not have any 'liveCache anchors', independently of planning areas.These objects do not have any reference to the application data and are therefore not inconsistent as such, but simply unnecessary objects which result in increased liveCache memory consumption.For this reason, you should only have to run the report approx.
If you have selected the 'Repair' option, any unnecessary time series and period patterns are deleted.
When you run the report /SAPAPO/TS_LCM_REORG, no other processes for a planning area (applies only to planning areas with key figures based on liveCache time series) should be allowed to run with the same planning version, since this would result in liveCache objects that are still required by the other parallel process being recognized as unnecessary (and then possibly deleted).For this reason, we recommend that you always run the report with the option 'Lock planning version'.In this case, all planning areas that use the planning version to be checked are locked for the relevant version.If you cannot activate the lock, report execution is interrupted and a list of system users is displayed, showing users who have already set a change lock for the planning version.

Supply Network Planning using time series

If time series are used in the Supply Network Planning in a SNP planning area, the /SAPAPO/TS_LCM_CONS_CHECK report can also be used to check this time series network and to eliminate inconsistencies if required.The report is used in exactly the same way as for Demand Planning.In addition you have the option to check and correct the SNP master data.
However, the /SAPAPO/TS_LCM_CONS_CHECK_ALL report is not available for SNP planning areas.
As of Support Package 17, and to a greater extent as of Support Package 19, the consistency can also be checked for SNP data stored in the time series. For more information, see notes 446360 and 441398.
If time series are used in the Supply Network Planning in an SNP planning area, you can also use the report /SAPAPO/TS_LCM_REORG.The report is used in exactly the same way as for Demand Planning.

TP/VS consistency check:Report /SAPAPO/VS_CONS_CHECK (transaction /SAPAPO/VSCC)


You can check the following data by making a selection on the initial screen:

  • APO master data relevant for TP/VS, such as vehicle resources, transportation lanes, locations
  • Customizing and optimization profiles
  • R/3 OLTP and APO TP/VS integration and carrier selection settings
  • Consistency between liveCache and TP/VS anchor tables (orders and transport requests)


Consistency means that a transport exists in the anchor tables for each transport in the liveCache, and vice versa.If inconsistencies are found, some of them can be repaired using the transaction.The relevant transports are deallocated (no entry in the anchor tables) or published/unpublished in the liveCache (the statuses are different in the liveCache and anchor tables).Inconsistent entries in the anchor tables are deleted.

Transaction /SAPAPO/VSCC was developed primarily to recognize possible inconsistencies.If an inconsistency is displayed and if it cannot be eliminated by forward navigation, open a problem message.

Consistency check for scheduling agreements

The /SAPAPO/PWB_KILL_INCO report corrects scheduling agreements and releases if they meet the following inconsistency criteria:

  • There is a different number of input and output nodes, but neither number is 0.
  • Orders that do not have any inputs but whose material is maintained in the vendor location and that are contained in a planning version.These orders would cause terminations in the future.
  • Orders whose quantity fields are different in the source and target.
  • The accumulated numbers of goods receipt and goods issue in the liveCache must agree with those in the database.
  • Cross-check with the set process:the order GUID in ordmap refers to the incorrect request type.Objects exist, even though the process makes no provision for them.
  • There are still APO scheduling agreement schedule lines even though the scheduling agreement in R/3 is already flagged as an OLTP scheduling agreement
  • There are still APO scheduling agreement schedule lines even though the scheduling agreement in R/3 is already flagged as an OLTP scheduling agreement
  • Neither a delivery nor a goods issue exists on the database, but they are allocated in the liveCache


Since the data is deleted and created again in the liveCache, you should proceed very carefully.You should only use the check if you notice inconsistencies or following a liveCache crash.In the first case, you should only consider this specific scheduling agreement and in the second case, all scheduling agreements should be checked.

Consistency check for operations

In the database table of /SAPAPO/OPR operations, operations may exist which have no orders in the liveCache or no orders for a simulation version or orders for deleted simulation versions or no external operation number.These operations place an unnecessary burden on the database table and may cause poor system performance.

To delete operations, which are no longer required, from the database, you should schedule the Z_CHECK_CONSISTENCY_OPERATIONS report on a weekly basis.
To create the above report, follow the instructions in note 458854.


----------------------------------------------------------------
External consistency checks ------------------------------

External consistency check CIF Compare/Reconcile function

External consistency refers to the consistency between the APO system and one or more dedicated R/3 Systems.
Inconsistencies may occur if at least one of the systems crashes and cannot be fully recovered again.In the same way, inconsistently deleting CIF queues or unwanted user settings can cause inconsistencies.

You can use transaction /SAPAPO/CCR to execute the CIF Compare/Reconcile function. Note:In APO 3.0, Version 3 is available after the downgrade using note 459402;you can only start the Compare/Reconcile function, Version 3, in APO 3.0 by executing the /SAPAPO/CIF_DELTAREPORT3 report.
/SAPAPO/CCR only checks the data of the active planning version (planning version 000) since R/3 data is only integrated through CIF with this planning version.
You do not need to check the external consistency after a complete recovery of the liveCache and/or of the APO-DB.

In particular, the following data of the active planning version 000 is checked:

  • Only transaction data is checked.
  • Only existence is checked in Version 2:A check is only performed on production and planned orders at header level, purchase orders, purchase requisitions and sales orders at schedule line level to see if they exist.The quantity is also checked but only for stocks.
  • In addition to the existence check, important quantities and dates are compared in Version 3. The level of detail distinguishes itself here with different compared transaction data.
  • If inconsistencies are found between the systems, these are not cleared automatically.You must select one or several of the objects in question on the detailed screen and initiate the transfer of the object in the required direction (APO, R/3) by selecting the corresponding button.

Header Data



Release Status:Released for Customer
Released on:30.05.2003 14:41:28
Master Language:German
Priority:Recommendations/additional info
Category:Consulting
Primary Component:SCM-TEC In Case of LiveCache Problems: Please use SCM-APO-LCA
Secondary Components:SCM-APO-MD-RE Resource

Affected Releases

Software
Component
Release
From
Release
To
Release
And
subsequent
SAP_APPL
46C
46C
46C

SAP_APO
30
30A
30A

SCM
400
400
400

SCM
410
410
410

SCM
500
500
500

Related Notes




744896 - Initialization/consistency check of an SNP planning area

676128 - Product allocations: Product allocation assignment check

669287 - Superfluous time series for SNP planning areas

634440 - /SAPAPO/OM_ORDKEY_ORDMAP_CHECK improvement

603593 - Deleting from check programs

572003 - SCM operating concept

542946 - Error message time series/period pattern does not exist

500843 - Composite SAP note for COM and SAP liveCache 7.2 or higher

458854 - Reorganizing the operation table

435827 - Recovery of temporary quantity assignments in the liveCache

434647 - Point-in-time recovery in an SAP system group

434645 - Point-in-time recovery: What must I be aware of?