Thursday, February 14, 2013

How to read an internal table?


1. READ TABLE itab FROM wa [additions].
2. READ TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn
[ additions].
3. READ TABLE itab WITH KEY k1 = v1 ... kn = vn
[BINARY SEARCH] [ additions].
4. READ TABLE itab INDEX i [additions].

Obsolete Variants

In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Short forms of line operations not allowed.

Effect

Reads an entry from an DS:ABEN.ITAB>internal table, using either its key or its index. The return code SY-SUBRC specifies whether an entry could be read. If you specify a non-unique key (the table must have a NON-UNIQUE key for this to be valid) , the system returns the entry with the lowest index from the set of entries that meet the condition.

Source-http://www.saptechies.com/how-to-read-an-internal-table/

SAP Query - STEP BY STEP GUIDE


SAP Query enables data from multiple tables to be extracted in one report, as long as at least one
field of data can be linked from one table to another e.g. by Document Number.
Unlike table browser (SE16), reports from SAP Query can be saved.
You will need the required tables and fields before running SAP Query (if not known, refer to the
list of tables PDF within the Data Extraction section).

For more details visit,
http://www.saptechies.com/sap-query-step-by-step-guide/

ABAP REPORTING


The main purpose of a list is to output data in a manner that can be easily understood by the user ; this output often takes on the form of a table.
Lists in R/3 take into account special business data requirement:
1. They are language-independent.Text and headers appear in the logical language whenever the appropriate translation is available.
2. They can output monetary values in numerous currencies.
3. You can output list data in the following ways:
to the screen: here you can add colors and icons.
to the printer
to the internet/intranet:Automatic conversion to HTML
we can also save list in the R/3 System or output them for processing by external commercial software applications like spreadsheet prog.
Each list have a list header and up to four lines of column headers.There are two different ways to go about these tools:
1.from within the Editor using the text-element maintenance functions
2. From within the list itself.If you save your program ,activate it and then run it to create the list, you can enter both list and column headers by choosing the menu path
System -> List -> List headers.
The main advantage of this method is that the list is still displayed on the screen.This makes it easier to position column headers.
The next time we start the program , the new header will appear in the list automatically.
When no header text is entered, the program title is inserted in the header.
Titles and Headersare part of a program’s text elements.We can translate all text elements into other languages.The logon language setting on the logon screen determines which language text elements will be displayed.
Text Symbols are another kind of text elements. These are special text literal data objects.Compared to normal text literals ,text symbols have the advantage that they can be translated into different languages without having to change a program’s source code.Text symbols allow you to create lists independent of language.
In executable programs (type 1) , lists are automatically displayed after their corresponding event blocks have been processed.These processing must , however, contains a list creation statement.These are WRITE,SKIP and ULINE.
Events blocks are called in a sequence designed for list processing:
Prior to sending the selection screen: INITIALIZATION.
After leaving the selection screen : START-OF-SELECTION.
All output from START-OF-SELECTION event blocks, subroutines and function modules that is processed before a list is displayed is temporarily stored in a list buffer.
Once all list creation processing blocks (for example START-OF-SELECTION) have been processed, all data from the list buffer is output in the form of a list.
In executable programs,you can use the event block AT LINE-SELECTION to create detail lists.
The ABAP runtime system:
1. Displays the basic list after the appropriate event blocks have been processed (for example, after START-OF-SELECTION).In this case, system field sy-lsind contains the value zero.
2. Processes the event block ,AT LINE-SELECTION each time we double click on an entry.If we are using a standard status ,this happens automatically every time we choose the Choose icon,the Choose menu item in the EDIT menu, or the function key F2.
3.Displays detailed list after the AT LINE-SELECTION event block has been processed and increases the value contained in sy-lsind by one.
4.Display the detail list from the previous level in the list hierarchy(n-1) every time we choose the green arrow icon from the current detail list(n)
For more details visit,
http://www.saptechies.com/abap-reporting/

Production order BOM

SAP table STPO is where you will find the Details for BOM components but Table RESB is mainly for reservations and will not necessarily contain information about all BOMS in the system but Will only contain BOMs for PO agaisnt which reservations for stock/materials have been raised
The difference in the number of items is partly due to the presence of Alternative BOMs.
if two or more BOMs exit for the same material then all the items are stored under the same BOM number in table STPO. But in RESB usauly only one the BOMs will be used
hence showing lesser items.

For more details visit,
http://www.saptechies.com/production-order-bom/

Order BOMs in Production
Use

The automatically use order BOMs in production if you create a production order with reference to a sales order with an order BOM. In this case, during the transfer of master data to the production order, the order BOM is chosen as a matter of priority. Since there can only be one order BOM per material and sales order, no selection mechanisms are required, as they are for the selection of material BOMs (see   Selecting a bill of material).

If you, as a make-to-order manufacturer, want to monitor the production order links over several levels, you may also be interested in direct production with collective orders (see   Collective order).

Integration

Changes to an order BOM are treated as master data changes, in the context of order change management for production orders (OCM) (see   Order change management for production orders,   Creation of initiating objects).

Features

The transfer of an order BOM into a production order takes place without any special preparation being necessary in production control. The transfer takes place by carrying out the following actions:

   Planned order conversion
The conversion of planned orders into production orders can be carried out as   individual conversion,   collective conversion and   partial conversion. If the components have been fixed in the planned order, they are transferred from the planned order and no transfers of the order BOM into the production order take place.

   Creating a production order with a sales order
You can create production orders (avoiding requirements planning) with direct reference to a sales order.

   Reading master data
If an order BOM exists it is transferred to the production order when the master data is read

For more details visit,
http://help.sap.com/saphelp_erp60_sp/helpdata/en/a5/a26f37eb997866e10000009b38f8cf/content.htm