2018年10月18日 星期四

SAP 的 Table 種類

What the different Types of Tables in SAP ? (Transparent, Pool and Cluster)



通透資料表(跟真實資料表一樣)

Transparent Table :
Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.

匯集資料表(真實表格可對應到很多SAP表格)
Pooled Table :

Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be cominied in a table pool. The data of these pooled tables are then sorted in a common table in the database.

重集表格(多個資料庫表格對應到同一 SAP表格)
Cluster Table :

Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.
difference between Standard tables, Pooled tables and Clusterd Tables
A transparent table is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement.
Transparent table is a one to one relation table i.e. when you create one transparent table then exactly same table will create in data base and if is basically used to store transaction data.
A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field.
One of the possible reasons is for instance that their content can be variable in length and build up. Database manipulations in Abap are limited as well.


But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is know as table pool.


All the pool table stored table in table pool does not need to have any foreign key relationship but in the case of cluster table it is must. And pool and cluster table is basically use to store application data.


Table pool can contain 10 to 1000 small pool table which has 10 to 100 records. But cluster table can contain very big but few (1 to 10) cluster table.


For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.

結構資料表(就是讓開發者引用複製本身是空表)
A structure is a table without data. It is only filled by program logic at the moment it is needed starting from tables.
A view is a way of looking at the contents of tables. It only contains the combination of the tables at the basis and the way the data needs to be represented. You actually call directly upon the underlying tables.

Types of Tables in SAP

SAP Transparent Tables

Contain a single table. Used to store master data
It has a one-to-one relationship with a table in the database
For each transparent table there is one associated table in the database
The database table has the same name, same number of fields and the fields have the same names
There is only a single table
Single table can have one or more primary key
Secondary indexes can be created
They can be accessed using open and native SQL

Use of Transparent Table in SAP

They are used to hold master data e.g. Table vendors or table of customers. Example of transaction data is orders placed by customers

Pooled Tables in SAP

They are used to hold a large number of very small tables(stores customizing data or system data)
It has a many-to-one relationship with a table in the database
It is stored with other pooled tables in a single table called table pool in the database
The database table has different name, different number of fields and fields have different names
Table pools contain more tables than table clusters
Primary key of each table does not begin with same fields or fields
Secondary indexes cannot be created
They can be accessed using open SQL only

Use of Pooled Tables in SAP
They reduce the amount of database resources needed when many small tables have to be opened at the same time

Types of Tables in SAP: Cluster

They are used to hold data from a few number of large tables.(stores system data)
It has a many-to-one relationship with table in the database
Many cluster tables are stored in a single table in the database called a table cluster
The database table has different name, different number of fields and fields have different names
Contains less tables than table pools
Primary key of each table begins with same fields or fields
Secondary indexes cannot be created
They can be accessed using open  SQL only

Use of Cluster Tables in SAP

They would be used when the tables have primary key in common and data in these tables are all accesses simultaneously

Types of SAP internal Tables

There is 5 types of SAP internal Tables:
  • Standard Table,
  • Sorted Table,
  • Index Table,
  • Hashed Table,
  • Any Table ( Generic type , used for generic ABAP Programming )


ATP behavior explanation - urgent

 
Hi,
could you please help me with understanding ATP strange behavior (in my opinion) . I'm working on missing components' list which will be updated everyday.
I've scheduled COMAC in order to recalculate stocks, reservations, PO's and update 'Missing Parts' indicator in production orders. The problem I faced is strange results of calculation. Below screenshot with highlighted line where confirmed qty doesn't cover requirement, but preceding and subsequent lines are covered. Please explain why does system act like that
Scope of check
thanks in advance
D.
     Former Member  
     
    •  
      replied
    The system may not necessarily execute the availability check in date order. It may be executed in a different order.
    Please see the following wiki which explains this:
    Maybe on your example, the reservation on 20th is the last reservation to be checked in the collective ATP check.
    I would check the orders on the screen to ensure they are displayed according to the sequence that you want them to be checked for availability.
     2View this answer in context 

    2018年10月17日 星期三

    Availability Check 允諾量計算 ....


    Availability Check
    允諾量計算

    Important Topics重要事項

    Topics                      
    Description       
    Availability check
    General Documentation on how ATP works 允諾交期一般文件
    ATP customizing
    Basic Customizing.基本客製化
    Transaction CO09
    How to read CO09 讀取允諾交期
    Transaction CO06
    Rescheduling
    Accumulation
    User Exits
    Userexits in ATP & SD 使用者界接
    Useful Notes
    Useful Notes in ATP 常用摘註

     

    • No labels

    6 Child Pages

    General Documentation

    Skip to end of metadata
    Go to start of metadata

    Use

    During sales order processing, the availability check enables you to tell the customer if the product can be delivered on time. You can control how the availability check is carried out by setting the Availability check field in the material master. When entering a sales order, confirmation of goods for delivery to the customer at a required delivery date is only possible if the goods are available for all the necessary processing activities, which take place before delivery. Scheduling is used ,To determine the actual date.

    Requirements and ATP-check in general

    Requirements are generated in SD which is equivalent to a material reservation . A requirement is a set of data, that includes the information, which quantity of which material at which date is required. On the basis of that requirement the MRP-run is able to react to the situation ,if the material is not in stock ,MRP can then initiate the procurement/Production of that material. Therefore requirements are planned outward-movements of stock (issues). The requirements are also used by the availability check to ensure that already promised reservations of stock are considered to give a realistic availability calculation. 

    ATP Check 

    Availibility Check takes the following three logics into account :-
    • Current Stock
    • Expected Receipts
    • Expected Issues

    Types of Availability check in SD

    There are three types of Availability checks. You can determine In the customizing of the requirements class (OVZG),whether an availability check is to be carried out against the ATP quantity,planning or product allocation Following are the three type that you can have.
    1. Check on the basis of the ATP quantities
    2. Check against planning
    3. Check against product allocation
    1. Check on the basis of the ATP quantities :
    The ATP quantity (ATP = Available To Promise) is calculated from the following :  
    1. Physical stock
    2. Planned inward movements of stock (= receipts), such as production orders, purchase orders, planned orders 
    3. Planned outward movements of stock (= issues), such as sales orders, deliveries and reservations.
    The types of issues and receipts that are taken into account for ATP, the ‘scope of check’ can be customized in transaction OVZ9.
    2. Check against planning
    The check against planning is performed against independent requirements which are usually created for an ‘anonymous’ market rather than being customer-specific The planned independent requirements result from demand planning (PP) and are used for planning expected sales quantities independent from individual sales-orders.
    3. Check against product allocation
    Product allocation facilitates period-based distribution of products for certain customers (or customer groups) or regions. This ensures, for example, that when production is low, the first customer does not get the full amount, resulting in following sales orders not being confirmed or being confirmed far too late. Avoid first-come first-serve situations 

    Controlling the Availability Check

    Availability check can be controlled in two ways
    1. General Control Features via
      • Material Master
      • Requirement Class. 
    2. SD Specific Control Features
      • Checking Group 
      • Checking Rule
      • Schedule Line Category

    Prerequisites for the Availability Check

    An availability check can only be carried out if the following prerequisites have been fulfilled.
    • The control elements described above, must be maintained in Customizing for Sales and the relevant assignments made to the sales transactions (Sched line category, requirementent type)
    • The availability check must be switched on at requirements class level and - for the availability check in the sales documents - at schedule line category level.
    • A requirements type must exist by which the requirements class can be found.
    • A plant must be defined. It can either be proposed from the customer or material master record or can be entered manually in the document.
    • A checking group must be defined in the material master record on the Sales/plant data screen in the Availability check field
    • ATP Customising

      Skip to end of metadata
      Go to start of metadata

      Purpose

      The purpose of this page is to explain how ERP ATP check is customized.

      Overview

      Essential steps and methods for customising ERP ATP Check.

      Requirement types and requirement class determination

      The system allows the standard search strategy and two alternate search strategies. This is helpful for the customers that wish to base their requirements type/class on the sales process (triggered by the item category) rather than being limited by using only the planning characteristics of the material (= production process).

      Standard search strategy

      The system uses a series of checks to determine the requirements type. The sequence of checks are called a search strategy.
       First, the system will look for a Strategy Group. This is maintained in the material master (MRP view). The requirements type is defaulted from the strategy group in OPPT. The details of the strategy group can be viewed within transaction OPPS.
       If there is no strategy group maintained, then the system looks at the MRP group, from the material master. The plant and the MRP group are used to determine the strategy group, which will determine the requirement type (using the method described above).  This configuration is found within transaction OPPU.
       If there is no strategy group and  no MRP group exists in the material master,  the system will then look at the material type as maintained within transaction OPPR. MRP group = Material type.  The system will use the MRP group information to derive the strategy group, etc, as described above.
       If there is no strategy group and no MRP group in the material master, and no MRP group equals the material type, then the system will look at the Item Category and MRP Type to find the Requirement Type. This is configured within transaction OVZI. It is also possible to have configuration with the Item category + BLANK = requirements type within the table.
       Finally, if the system has been unable to determine a requirements type by using the steps above, the system will leave the field blank in the sales document.

      Alternate search strategies


      Item category and MRP type (1)
       The standard search is performed and the entry from OVZI (Item category + MRP type) is used as the Requirements type even if this is not a valid requirements type from the standard search. It is still possible to enter different requirement types manually, since more than one valid requirement type is possible because there can be several Strategies within a Strategy Group.
      Item Category and MRP Type with validity check (2)
      The standard search is performed and then the Requirements Type from OVZI (Item Category + MRP type) is used ONLY if it is valid from the standard search method. If the entry from OVZI is not valid then the requirements type derived from the standard search method is used.
      If the Item Category + MRP type combination cannot be found on transaction OVZI, you can add a new entry on the customizing transaction VOV5. 
      Note: If you want to find the requirements class without checking the configuration, go to the schedule line screen and hit ‘/H’ and check contents of XVBEP. The fields are BDART and PLART. The fields must be combined to get the actual requirement class.
       Example
      BDART = 04
      PLART = 1
      Requirement class = 041

      Illustration of ERP ATP Customizing.

      1.Material Master: relevant fields: 
      • MRP1 View:  MRP type, MRP group.
      • MRP3 View :   Strategy Group.
      • Sales org. 2:  Item Category Group
      2.DEBUGGING: relevant fields:
      • xvbap-pstyv = Item Category
      • xvbap-bedae = Requirements Type
      • xvbep-bdart + xvbep-plart = together in this order show Requirements Class

      Detailed Customising for Required for Sales order

    2018年9月28日 星期五

    How to modify and extend SAP applications – Different approaches + Transaction codes

    如何修改及延伸 SAP 應用系統
    How to modify and extend SAP applications – Different approaches + Transaction codes

    This part of series is focused on transactions that allow an ABAP developer enhance the original SAP reports with his own modifications. You will find here the list of transactions – possibilities how to extend SAP reports, internal logic within function modules, classes or dictionary objects.

    This post is part of series about SAP transaction codes for ABAP Developers:
    1. Basic SAP transactions for ABAP developers
    2. How to modify and extend SAP applications
    3. Transaction codes for database and table handling
    4. How to analyse, debug and optimize your SAP programs with standard tools

    Introduction

    There are following options how to modify SAP’s standard code. Recommended approaches are BADI implementations and enhancement points.
    • BADI implementations – SE18, SE19
    • Enhancement points – implicit or explicit enhancements points – SE80
    • User exits – CMOD, SMOD
    • Modifications – SE95, SPAU, SPDD

    1. Business Add Ins (BADI)

    SE18 – BADI Builder – Definitions

    BADI stands for Business Add Ins which is an advanced way of implementing modifications. Developer can use BADI builder definition for creating or searching for possible places where he or his customers can modify ABAP logic using BADI or enhancement spots.

    SE19 – BADI Builder – Implementations


    When the developer knows which BADI or enhancement spot he wants to modify, he can manage BADI implementations and enhancement spots in se19.




    2. Enhancements

    SMOD – SAP Enhancements


    SAP Enhancements transactions is a former type of SAP’s way to modify programs using user exits. Anyway, it can still be handful for developer to know this transaction, since he may come across old solutions which used this technique. SMOD includes more type of user exits – menu, screen and function module exits.




    CMOD – Project Management of SAP Enhancements


    CMOD transaction is used for managing attributes, enhancement assignments, components and documentation of SAP Enhancement. Developer manages here Enhancement projects which are formed by Enhancements from SMOD.





    3. Enhancement points

    SE80 – ABAP Development Workbench

    SE80 transaction was already mentioned in the first article about essential transaction codes for ABAP development. The reason why it is included here is the fact, that the developer can manage enhancement points through this transaction. When the developer clicks on a highlighted icon, enhancement implementation tools will be available for him. He can choose either from explicit or implicit enhancement points in the source code where he can insert his own code or modify already implemented enhancement points.


    4. Modifications

    SE95 – Modification Browser

    When there is no other option, the developer can also create modifications in the source code using transaction se80. First he needs to obtain repair registration key from SAP OSS, then the modification will be possible. Be aware that this is the most painful way because the developer will have to take care about merging the changes after every service pack upgrade or note implementation using transactions SPAU and SPDD. Modification browser is the used by developer to manage all recent modifications in the system.

    SPAU – Modification Adjustment

    After every upgrade, modifications has to be rechecked. When there is a change in the standard code in the same place where is the modification, developer needs to adjust this modification.

    SPDD – Modification Adjustment for Dictionary

    The same approach must be used for dictionary objects. Whenever the dictionary object is changed, developer have to repeat the modification.









    SAP 資料庫 Transaction codes for Database and Table handling

    Transaction codes for Database and Table handling
    In this part of series, I am going to describe several original SAP transaction codes (reports and utilities) for handling tables and database.

    This post is part of series about SAP transaction codes for ABAP Developers:
    1. Basic SAP transactions for ABAP developers
    2. How to modify and extend SAP applications
    3. Transaction codes for database and table handling
    4. How to analyse, debug and optimize your SAP programs with standard tools

    Basic transactions for table management SE11 – ABAP Dictionary, SE16 – Data Browser, SE54 – Generate Table Maintenance are described in the first post of the series. Just to remind you, se11 is used for managing dictionary objects including database tables, se16 is used for browsing the data in a database table and finally se54 is used creating maintenance views where you can manage that data.
    Apart from these basic transaction codes, there are several more advanced utilities which are used for specific database operations. Those transaction codes(t-codes) are as following.

    SE14 – Database utility

    Whenever you change the structure of a table which is derived from ABAP dictionary object (transparent table, physical table pool, table cluster, indexes or database views) , you also need to run the database utility in order to synchronize changes between ABAP Dictionary and database layer. Moreover, this utility allows you to maintain terminated conversions, administer modification requests and manage incremental conversions.

    SE16n – Table display

    Transaction SE16N is actually an improved and more user-friendly data browser SE16 with ALV data grid. Until EHP5, it was possible to enter code &SAP_EDIT and edit data inside of tables, but due to security risk, this option is not available anymore. Anyway, there is still an option to turn on edit mode using debugger.




    SM30, SM31 – Generate table maintenance dialog

    Transaction SM30 allows you to run generated dialog where it is possible to view and change data in database tables and views. Those database objects must have set up the option Display/Maintenance allowed in ABAP Dictionary table management and have already generated table maintenance via SE54.

    Transaction SM31 refers to the same program which SM30 does, so there is no difference between this transaction. The old SM31 transaction is available as transaction SM31_OLD.

    DB02 – Database analysis


    DB02 is a database analysis tools which displays various statistics of database and database objects. The purpose of this tool is to check whether there are missing indexes in database tables and check consistency of database objects.  Moreover, this tool can give you overview of data area occupancy (available/occupied space) of the whole database.







    How to analyse, debug and optimize your SAP programs with standard tools
    There is a phase in development cycle when the programmer needs to optimize his final product. This post focuses on those transactions which help developers to analyse, debug and optimize already finished reports and programs.

    This post is part of series about SAP transaction codes for ABAP Developers:
    1. Basic SAP transactions for ABAP developers
    2. How to modify and extend SAP applications
    3. Transaction codes for database and table handling
    4. How to analyse, debug and optimize your SAP programs with standard tools

    SAP system offers several options how to analyze our programs. Let’s start with the debugger.

    Developer tools

    Debugger

    There are basically two options how to use a debugger. You can either start the debugger when you set a session break point in your code while using se80 or se38. When you run the program additional window with (new) debugger will show up.
    The other method to is enter one of these following codes into command field just before you run the report:

    • /h – basic and most used command which will run the debugger
    • /hs – start debugger and allow system debugging
    • /ha – start debugger, skip screen handling and start directly debugging ABAP code
    • /hmusa – start debugger and create memory snapshot which can be analysed in transaction S_MEMORY_INSPECTOR