Batch Determination – Debug Tips

Source – https://archive.sap.com/documents/docs/DOC-54239

Issues with batch determination are very common. Sometimes only a simple customizing setting is missing which can impact the whole determination process.

The batch determination itself is not difficult to configure, however, we must have an extra attention, specially in the strategy, search procedure and the selection criteria.
It’s also easy to find the root cause of many common issues using the DEBUG, of course, if we know the right place to debug. This is idea of this document, give you some tips about the correct points and what information we can extract using the DEBUG tool.
First of all, there is one main function to execute the batch determination, it is called during in the production order, process order, sales order, delivery and a few other areas. The logic inside of the function is the same, what makes difference are the parameters used when it is called.
The Function Module name is VB_BATCH_DETERMINATION, it can be accessed using transaction SE37. I’ll go through the decisive points, where the important information can be found.

There are three main routines that are executed in sequence to make a proper batch determination:

1. SELECT_BATCH_DB – Select all the available batches;

2. SELECT_BATCH_CL – Sort and restrict according to the selection criteria;

3. SELECT_ BATCH_AC – Check the stock according to the availability check settings.

If you check in the source code, you’ll see that the sequence is not exactly the same as showed above. However, internal table XFS is the one that stores the sequence and executed the correct sequence.

SELECT_BATCH_DB

The first routine executed is to select the batches. It will select all batches available, it does not consider the batch stock but select all available batches according to the restrictions imposed by the business (sales order, process order, goods issue, etc). The parameters used to read the batches are mainly the material number (MATNR), plant (WERKS) and storage location (SLOC).
The internal function used to read the batches is VB_BATCH_READ.

If we check the source code in detail, we can see that there are many different SELECT statements for transparent table MCHB and also from V_CF_MCHB which is a view that contains three tables (MCHB, MCHA and MCH1).

It’s not difficult to conclude that performance issues can happen if table MCHB have a huge amount of data and the SELECT statements in VB_BATCH_READ do not use more parameters to restrict the selection.

This is the reason why we always recommend executing the archiving of the MCHB old records. It will improve the performance significantly. The object used to archive is MM_SPSTOCK (transaction SARA).

It’s also possible to create our own logic to select the batches. It can be achieved using BADI VB_BD_SELECTION. The methods PRESELECT_STOCKS and PRESELECT_BATCHES can be used to create a custom code to select only the batches wanted. It’s possible to suppress the VB_BATCH_READ if the BADI is active, it facilitate if a specific batch selection must be done.

The internal table that stores the result of the batch selection is YDB_MCHB.

SELECT_BATCH_CL

After the batch selection, the batch search strategy should “decide” which batches are selected according to characteristics defined in the classification data. If the batch is not classified (classification tab in batch master), it won’t be selected. So, it is very important to classify the batches many users forgot to do it.
The function modules that select the class and the characteristics don’t belong to the Batch Determination (LO-BM) itself but belong to classification (CA-CL). There are 2 key functions, one select the class and characteristics assigned to a batch (CTMS_DDB_HAS_VALUES) and the other select the values (CUSL_BATCHES_SELECTION).

It’s also possible to create your own logic for the selection criteria using BADI VB_BD_SELECTION_CRITERIA or the userexit EXIT_SAPLV01F_001. I always recommend using BADIs as Userexits have some particular problems, specially because the “freedom” we have to change the variable and internal tables resulting, sometimes, in corrupt entries saved in the database and incorrect data displayed. In the following screen, you can see the source code where both can be choose.

The internal table that stores the result of the batches after the selection criteria is YCL_MCHB.

SELECT_ BATCH_AC

If the Availability check is active, it will restrict the batches according to its customizing. If it’s not active, it will only exclude the batches with no stock and continue the VB_BATCH_DETERMINATION execution.
The Function module AVAILABILITY_CHECK_CONTROLER is the key for the availability check. If the function is executed, it means that availability check is active. We can check the result in internal table XATPCS, which stores the available quantity calculated inside of availability check. The field that must be checked is VMENG, if it’s zero, there is no available stock for a specific batch. It can also be checked in transaction CO09.

After the execution of AVAILABILITY_CHECK_CONTROLLER, the batches with stock zero will be excluded from the final result.

The table that stores the result of the batch selection after the availability check is YAC_MCHB. This internal table is the one that will contain the final result of the batch selection. It will not contain the batches sorted yet. The sort happens in Form SORT_BATCH.

Keep in mind that this document covers the most common batch determination scenarios, there are specific scenarios, for example, in Warehouse Management which uses specific routines and restrictions that are not covered by this document.

Publié dans PP

Job & timezone

The only thing is to make sure you have the correct time zone during the scheduling of the job.

Both user and system settings need to be taken as a reference.

During the scheduling of a job or process chain, the time is always the system time zone.

But during the process chain analysis (log), the system displays in user time zone.

During the job (SM37), the system displays in System Settings time zone

So, you just have to check the system time zone and during the scheduling of a job of process chain do the settings with reference to the system time zone.

KP26 – Budget des activités

Lorsque la déclaration des ordres n’est pas possible car l’activité sur centre n’est pas budgeté sur l’année. Fréquent en dev et qual. sur l’année:

KP26 – Saisir l’ordre et le/les type(s) d’activité,

Version 0, Période 1 à 12 sur l’année en cours.

Mettre un nombre d’heure (1) et un prix fixe (1).

 

Publié dans CO, PP

Ecarts sur ordres – Production order variances

http://scn.sap.com/community/erp/manufacturing-pp/blog/2012/03/13/understanding-production-order-variance–part-1

Understanding Production Order Variance – Part 2 The SAP Perspective

Author: Ranjit Simon John

Every PP, FI and CO user in any Manufacturing Industry will be having a tough time while processing month-end activities. Production Order Variance posted against each process orders will have to be examined, explained & investigated thoroughly. Major questions arising will be;

  • Origin of Variance has come
  • How to Categorize the variance
  • How to cut down the variance.
  • Impact of variance on COGM, COGS & Closing Stock.

Answering these will be really tough.

We have faced all these scenarios and after months of deep research in this field I came across few conclusions.

Continuer la lecture

Publié dans CO, PP

Account Assignment Of Production Order

Account Assignment Of Production Order
Where does the account assignment of the planned orders get generated from?
 
In our case, we have a make to order scenario-20, where by default, the account assignment for planned orders is « E ». i.e. sales order.—Normally this account assignment flows from Account assignment category defined in the Requirement Class. This Requirement class then assigned to Requirement type. This Requirement type is assigned to Strategy and this Strategy assigned Strategy group. Finally this strategy group is then linked to your material master.

For your case, I think this is coming from the Strategy Group 20.Check this by the following path:

1. Check the strategy assigned to strategy group 20 in T code OPPT or by path IMG -> Production -> Production Planning -> Demand Management -> Planned Independent Requirements ->Planning Strategy -> Define Strategy Group.

2. Then check which Requirement type is assigned to that Strategy in T Code OPPS or by path IMG -> Production -> Production Planning -> Demand Management -> Planned Independent Requirements -> Planning Strategy -> Define Strategy.

3. Now if this strategy you are using is 20 that is Make to order, then you will find settings for those Requirement type in Sales. For that you can take help from your SD consultant. Also providing you path for the same as below.

4. Check the assignment of Requirement class to requirement type in T Code OVZH or by path IMG -> Sales and Distribution -> Basic Functions -> Availability Check and Transfer of Requirements -> Transfer of Requirements -> Define Requirements Types.

5. At the end you have to check the settings and assignment of ‘Account Assignment Category’ for your Requirement Class in T Code OVZG or by path IMG -> Sales and Distribution -> Basic Functions -> Availability Check and Transfer of Requirements -> Transfer of Requirements -> Define Requirements Class.

6. Here check the ‘Account Assignment Category’ under ‘Account Assignment’ tab.

Requirement Class in T-code OVZG

Note:

Also, check the settings of Individual/coll. in MRP4 view for Semi-FG and Raw material in Material master.

Normally according to standard settings, it will be blank and you keep it as blank then it will take ‘Individual and collective requirements‘ which means it will take FG’s requirement. If You keep it as ‘1-Individual requirements only’ then it will take Individual requirement every time means it will be « E » for every requirement if your FG has « E ». And if you don’t want to follow the FG’s requirement plan then you have to keep it as ‘2-Collective requirements only‘.

See also
Production Order External Operation ProcessingGet help for your SAP PP Problems
SAP PP Forum – Do you have a SAP PP Question?SAP Production Planning Books
SAP PP Certification, Interview Questions and Configuration Books

SAP PP Tips
SAP PP Tips and Production Planning/Control Discussion Forum

Main Index
SAP Basis, ABAP Programming and Other IMG Stuff

All the site contents are Copyright © www.erpgreat.com and the content authors.
 
Publié dans PP

Création d’ordre APO – « Invalid time interval »

– La PDS doit avoir au moins une opération de production (pas uniquement du setup)

– La PDS ne doit avoir qu’une seule opération de Setup

– La PDS ne doit pas contenir un fantôme dont les composants ne sont pas envoyés à APO. La Bom du fantôme doit être envoyée –> Ne pas transférer dans le CIF les fantômes ou transférer les composants et la BOM)

– Les composants doivent être assignés à la phase de production (et pas à la phase de Setup)

– Les opérations doivent avoir des relationships entre elles.

– L’ordre termine avant de commencer, ou la livraison est reçue avant d’être envoyée. (soit le problème de 24:00:00 = 00:00:00, soit un time-zone différent).