Showing posts with label ABAP CODING FOR BETTER PERFORMANCE. Show all posts
Showing posts with label ABAP CODING FOR BETTER PERFORMANCE. Show all posts

Billing and Payment Process in ERP SAP for ABAP Programmer

Billing and payments are integral part of any business entity and words largest ERP SAP has inbuild process to run this business in a systematic way without any gaps.Being a person in the programming language to extract data from data source every ABAP person need to know about this.Here in this post we are going to deal about this aspects.

If you create a billing document, knowledge is copied from the sales order and the supply doc to the billing document. Delivery gadgets as well as order item scan be references for the billing document.The billing doc serves several vital functions:

1.It's the sales and distribution doc that helps you to generate invoices.

2.The billing doc serves as an information supply for financial accounting (FI) that will assist you to monitor and process buyer payments.

3.When you create a billing doc, the G/L accounts will usually be up to date automatically.During this process, the R/3 system carries out

4.a debit posting on the client receivables account and

5.a credit score posting on the revenue account.You may create an bill for one delivery or gross sales order.

6.You may group invoices utilizing choice criteria, similar to buyer, billing date and destination
country.

7.The SAP System can mix deliveries right into a billing document, provided these deliveries share some important billing traits, for example:

  • Payer
  • Billing date
  • Destination country

The SAP System can create invoices both on-line or as a background job to be executed during offpeak hours.A billing doc includes two levels: header and item. The information is distributed as follows:

Billing doc header

The data for the doc header is valid for all the document. This contains, for example, knowledge
concerning the payer and billing date.

Billing doc gadgets

Every item within the sales document comprises its own data. This contains, for example, particulars about the material, billing portions and net values for the items. Each billing doc can have a number of items.

To course of billing paperwork efficiently, the information may be read and processed in numerous views. The views are grouped into overview, header and item screens.


When you save the billing doc, the system robotically generates all the required paperwork for accounting. In accounting, the R/three system carries out a debit posting on the shopper receivables account and a credit posting on the income account.

The accounting doc accommodates all the finished postings in monetary accounting that refer back to pricing in SD, for instance, the receivable on the shopper account or the obtained net sales and taxes on the relevant G/L accounts.

When you save the billing doc, further documents for accounting will be robotically generated by the system, for example, for the elements Controlling (CO), profitability analysis, market segment evaluation (CO-PA) or consolidation (FI-LC). When the billing doc is posted, the following additionally occurs:

  • the status in all associated gross sales, supply and billing documents, is updated
  • the gross sales statistics in the gross sales info system are updated
  • the customer credit score account is updated



When you post an incoming fee, the relevant G/L accounts will most likely be up to date automatically.Throughout this course of, the R/3 system carries out.A debit posting to the money account and a credit memo to the customer receivables account.

The documents in a sales course of are linked to one another using the document flow. This permits you to entry the history and current standing of your gross sales processes at any time.

You'll be able to show the doc circulation as an inventory of linked documents. All previous and succeeding paperwork are displayed, depending on the document you call the listing from.

From this listing, you can display the related paperwork or name up status overviews for the documents.

This gives an overview of the development of your gross sales processes at any time, and you'll
reply customer questions quickly and reliably.

The document circulate is up to date on the document header and document line level.

Solely gross sales paperwork include schedule lines. Since each schedule line accommodates its personal supply date, every deliverable schedule line turns into an item in a delivery document. Subsequently delivery paperwork and billing documents do not need schedule lines.

Sales and Distribution integrates with a selection of different modules.Your organization manages buyer orders from preliminary request for product to the receipt and posting of customer cost as a half of the Buyer Order Management cycle.

To start the cycle, your company typically enters buyer orders which contain customer and product info, as nicely as delivery schedules. Order entry personnel use this information to advise clients about costs and delivery dates earlier than they confirm an order. Here Gross sales and Distribution integrates with Materials Administration for availability checking. For make to order product, Gross sales and Distribution integrates with Production Planning in order that the product is made to satisfy the customer order requirement. Supply and billing processing each combine with Mission Systems.

Following order entry, your company schedules and organizes buyer orders for optimal delivery.Product is picked in the Warehouse Management module and print the shipping documents. When the supply is released to the shopper stock quantities have to be decreased and the general ledger have to be up to date appropriately. Right here Sales and Distribution, via Posting Goods Situation, integrates with Supplies Management and Financial Accounting and possibly Controlling.

After you ship the product, an bill must be generated and the transaction posted to the final ledger. The Financial Accounting periodically evaluations the client’s open gadgets and posts the incoming funds when received.

Related Posts:


CODE INSPECTOR IN ABAP


The Code Inspector is a tool for checking static ABAP coding and DDIC objects (i.e. generally all objects of the Object Repository) under aspects of functional correctness, performance, security, reliability, and statistical information.

It helps developers to adhere to programming standards and guidelines by creating messages on less-than-optimal coding. The Code Inspector offers various possibilities to define object sets and to combine multiple single checks in so-called "check variants". These functions, and the tool's parallel processing framework, make the Code Inspector a flexible and effective development assistant.The Code Inspector can be used in various scenarios with different types of checks, thus providing insights into the code quality from various angles.

Usage scenarios

1. Single object checks from the Development Workbench

You can check a single object with the Code Inspector from the ABAP Editor (transaction SE38), the Function Builder (transaction SE37), the Class Builder (transaction SE24), or the ABAP Data Dictionary (transaction SE16). To do this, choose object Check Code Inspector from the menu, where object can be a program, function module, class, or table. The respective single objects are then checked with a default check variant.

2. Checks on transport objects from the Transport Organizer

You can invoke the Code Inspector from within the Transport Organizer (transaction SE09) to check objects in a transport request. To do this, choose Request/Task > Complete Check > Objects (Syntax Check).

3. Checks on sets of objects from transaction SCI

The Code Inspector (transaction SCI) itself enables you to create a wide range of object sets using standard selections via package, software and application component, source system, transport layer, responsible, object type, object name and so on.

In addition, special object collectors are available that allow you to read objects from a file, for example.An object set can be combined with a check variant to a so-called "inspection" that can be executed in a single process or in parallel.

Types of checks and check variants

Below is a short extract of the types of checks and functions that are offered by Code Inspector. New checks can be implemented if required, see for example Code Inspector - How to create a new check .

• Syntax

Syntax check; extended program check

• Performance

Analysis of WHERE clauses for SELECT, UPDATE and DELETE ; SELECT statements that bypass the table buffer , low-performance operations on internal tables; table attributes check

• Security

Usage of critical statements; dynamic and cross-client database accesses; use of ADBC-interface

• Robustness

Check of SY-SUBRC handling; suspect conversions; activation check for DDIC objects

• Programming Conventions
Naming conventions

• Search Functions

Search of ABAP tokens; search ABAP statement patterns; search for ABAP statements with regular expressions

• Metrics and Statistics

Program complexity test; statement statistics
You can combine any of these single checks into so-called "check variants", for example to check for the adherence to given programming guidelines.

Best Practices

Developers can use the Code Inspector to support their everyday work. For example, the search functions or metric checks of the tool can be a great help when restructuring the code.The Code Inspector allows developers to define which objects are to be checked and which quality aspect of the code is to be inspected (e.g. performance, security).It is also possible to define global check variants as general programming guidelines, to ensure standardized programming within a development community.

Check variants can prescribe for example naming conventions or other rules. The global check variants 'DEFAULT' and 'TRANSPORT' inspect objects in the development workbench and in transport requests, respectively. These check variants contain SAP-defined settings, but can be modified as needed.


Another global check variant delivered with every SAP system is 'PERFORMANCE_CHECKLIST' which helps to detect less-than-optimal coding with regard to application performance.

RELATED POSTS

ABAP OPTIMIZATION

Master Data Depreciation Areas 
Asset Allocation
 Information System
Legacy Data Transfer

EFFECTIVE CODING IN ABAP 2

In case of large statements, the R/3's database interface divides the statement into several parts and recombines the resulting set to one. The advantage here is that the number of transfers is minimized and there is minimal restrictions due to the statement size (compare with range tables).


SELECT * FROM TABLE
vs.

SELECT column(s) FROM TABLE


Use a select list or a view instead of SELECT *, if you are only interested in specific columns of the table. If only certain fields are needed then only those fields should be read from the database. Similarly, the number of columns can also be restricted by using a view defined in ABAP/4 Dictionary. Overall database and network load is considerably less.

SELECT without table buffering support
vs.

SELECT with table buffering support

For all frequently used, read-only(few updates) tables, do attempt to use SAP-buffering for improved
performance response times. This would reduce the overall Database activity and Network traffic.

Single-line inserts
LOOP AT INT-TAB
INSERT INTO TABLE VALUES INT-TAB
ENDLOOP
vs.

Array inserts

Whenever possible, use array operations instead of single-row operations to modify the database tables Frequent communication between the application program and database system produces considerable overhead


Single-line updates
SELECT * FROM TABLE
COLUMN-UPDATE STATEMENT
UPDATE TABLE
ENDSELECT

vs.


Column updates
UPDATE TABLE SET COLUMN-UPDATE STATEMENT


Wherever possible, use column updates instead of single row updates to update your database tables


DO....ENDDO loop with Field-Symbol
vs.


Using CA operator


Use the special operators CO, CA, CS instead of programming the operations yourself If ABAP/4 statements are executed per character on long strings, CPU consumption can rise substantially


Use of a CONCATENATE function module
vs.

Use of a CONCATENATE statement

Some function modules for string manipulation have become obsolete, and should be replaced by ABAP statements or functions

STRING_CONCATENATE... --- CONCATENATE
STRING_SPLIT... --- SPLIT
STRING_LENGTH... --- strlen()
STRING_CENTER... --- WRITE..TO. ..CENTERED
STRING_MOVE_RIGHT --- WRITE...TO...RIGHT-JUSTIFIED


Moving with offset
vs.


Use of the CONCATENATE statement

Use the CONCATENATE statement instead of programming a string concatenation of your own


Use of SEARCH and MOVE with offset

vs.


Use of SPLIT statement


Use the SPLIT statement instead of programming a string split yourself


Shifting by SY-FDPOS places
vs

Using SHIFT...LEFT DELETING LEADING...


If you want ot delete the leading spaces in a string use the ABAP/4 statements SHIFT...LEFT DELETING LEADING... Other constructions (with CN and SHIFT... BY SY-FDPOS PLACES, with CONDENSE if possible, with CN and ASSIGN CLA+SY-FDPOS(LEN) ...) are not as fast


Get a check-sum with field length
vs

Get a check-sum with strlen ()

Use the strlen () function to restrict the DO loop to the relevant part of the field, eg. when determinating a check-sum


Quick Note on Design of secondary database indexes

First it must be stated that table design is a more logical work while index design is rather technical. In table design it might make sense to place certain fields (client, company code, ...) in the beginning. In index design, this is not advisable. Very important for an index is that it contains very selective fields in the beginning. Those are fields like object numbers. Not selective are client, company code, ...

• Indexes should be small (few fields). The Database optimizer can combine two or more indexes to execute a query.

• Indexes of one table should be disjoint (have few common fields), in order not to confuse the optimizer which index to use.

Note that each index slows the inserts into the table down. Updates are only slowed down if indexed fields are updated. In general, heavy inserted tables should have only few indexes while heavy selected tables might have more.

Quick Note on Design of logical databases

Using logical databases is a good method to write reports. Logical databases can be optimized centrally. But ensure that the structure of the logical database fits well to your report. Otherwise the effect can be the opposite.


RELATED POSTS


EFFECTIVE CODING IN ABAP PART 1

SAP Financial Part Two 
Customer Vendor Accounts 
EnjoySAP Financial Invoice  Entry
Automatic Payments
General Ledger Accounts

 Customer and Vendor Accounts

EFFECTIVE CODING IN ABAP 1


ABAP/4 (Advanced Business Application Programming 4GL) language is an "event-driven", "top-down", well-structured and powerful programming language. The ABAP/4 processor controls the execution of an event. Because the ABAP/4 language incorporates many "event" keywords and these keywords need not be in any specific order in the code, it is wise to implement in-house ABAP/4 coding standards.

SAP-recommended customer-specific ABAP/4 development guidelines can be found in the SAP-documentation. This page contains some general guidelines for efficient ABAP/4 Program Development that should be considered to improve the systems performance on the following areas:-

• Physical I/O - data must be read from and written into I/O devices. This can be a potential bottle neck. A well configured system always runs 'I/O-bound' - the performance of the I/O dictates the overall performance.
• Memory consumption of the database resources eg. buffers, etc.
• CPU consumption on the database and application servers
• Network communication - not critical for little data volumes, becomes a bottle neck when large volumes are transferred.


Policies and procedures can also be put into place so that every SAP-customer development object is thoroughly reviewed (quality – program correctness as well as code-efficiency) prior to promoting the object to the SAP-production system.

CLASSIC GOOD 4GL PROGRAMMING CODE-PRACTICES GUIDELINES


Avoid dead-code
Remove unnecessary code and redundant processing
Spend time documenting and adopt good change control practices
Spend adequate time anayzing business requirements, process flows, data-structures and data-model

Quality assurance is key: plan and execute a good test plan and testing methodology


SELECT * FROM TABLE
CHECK: CONDITION
ENDSELECT
vs.

SELECT * FROM TABLE
WHERE CONDITION
ENDSELECT


In order to keep the amount of data which is relevant to the query the hit set small, avoid using SELECT+CHECK statements wherever possible. As a general rule of thumb, always specify all known conditions in the WHERE clause (if possible). If there is no WHERE clause the DBMS has no chance to make optimizations.

Always specify your conditions in the Where-clause instead of checking them yourself with check-statements. The database system can also potentially make use a database index (if possible) for greater efficiency resulting in less load on the database server and considerably less load on the network traffic as well.


Also, it is important to use EQ (=) in the WHERE clause wherever possible, and analyze the SQL-statement for the optimum path the database optimizer will utilize via SQL-trace when necessary.

Also, ensure careful usage of "OR", "NOT" and value range tables (INTTAB) that are used inappropriately in Open SQL statements.



SELECT *
vs.


SELECT SINGLE *

If you are interested in exactly one row of a database table or view, use the SELECT SINGLE statement instead of a SELECT * statement. SELECT SINGLE requires one communication with the database system whereas SELECT * requires two.


SELECT * FROM TABLE INTO INT-TAB
APPEND INT-TAB
ENDSELECT
vs.


SELECT * FROM TABLE INTO TABLE INT-TAB

It is usually faster to use the INTO TABLE version of a SELECT statement than to use APPEND statements


SELECT ... WHERE + CHECK
vs.


SELECT using aggregate function

If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates within the program. The RDBMS is responsible for aggregated computations instead of transferring large amount of data to the application. Overall Network, Application-server and Database load is also considerably less.


SELECT INTO TABLE INT-TAB + LOOP AT T
…………
SELECT * FROM TABLE INTO TABLE INT-TAB.
LOOP AT INT-TAB.
ENDLOOP.

vs.


SELECT * FROM TABLE
……….
ENDSELECT


If you process your data only once, use a SELECT-ENDSELECT loop instead of collecting data in an internal table with SELECT ... INTO TABLE. Internal table handling takes up much more space


Nested SELECT statements:
SELECT * FROM TABLE-A
SELECT * FROM TABLE-B
……..
ENDSELECT.
ENDSELECT
vs.

Select with view
SELECT * FROM VIEW
ENDSELECT

To process a join, use a view wherever possible instead of nested SELECT statements.Using nested selects is a technique with low performance. The inner select statement is executed several times which might be an overhead. In addition, fewer data must be transferred if another technique would be used eg. join implemented as a view in ABAP/4 Repository.


• SELECT ... FORM ALL ENTRIES
• Explicit cursor handling


Nested select:
SELECT * FROM pers WHERE condition.
SELECT * FROM persproj WHERE person = pers-persnr.
... process ...
ENDSELECT.
ENDSELECT.

vs.

SELECT persnr FROM pers INTO TABLE ipers WHERE cond. ……….
SELECT * FROM persproj FOR ALL ENTRIES IN ipers
WHERE person = ipers-persnr
………... process .……………
ENDSELECT.


In the lower version the new Open SQL statement FOR ALL ENTRIES is used. Prior to the call, all interesting records from 'pers' are read into an internal table. The second SELECT statement results in a call looking like this (ipers containing: P01, P02, P03):

(SELECT * FROM persproj WHERE person = 'P01')
UNION
(SELECT * FROM persproj WHERE person = 'P02')
UNION
(SELECT * FROM persproj WHERE person = 'P03')


RELATED POSTS

EFFECTIVE CODING IN ABAP PART 2