Showing posts with label SAP. Show all posts
Showing posts with label SAP. Show all posts

Tuesday, 15 September 2015

Working with ALV ROW COLOR

Hi friends,

OBJECT : Display the Purchase order details in ALV report. If the cost of the material increases more than 1000 rs show in red color and cost of the material decreases less than 10 rs green color in ALV report.




Step 1 : execute SE38 T-Code in Command window.
Step 2 : Create a Executable program and it opens ABAP Editor.
Step 3 : See the code for following screen shots.








Wednesday, 5 August 2015

DATA DICTIONARY CONT....

Types of tables: -
  1. Transparent tables
  2. Cluster tables
  3. Pool tables

Transparent tables: - Transparent tables are one to one relationship. That is if you create one transparent table in the data dictionary, then it’ll store like only one data base table in the data base.














Cluster table: - This tables are many – one relationship. That is if you create the many clustered tables in DDIC then they will form like a table cluster & store in the data base.


  1. Buffering isn’t possible for clustered table. From this reason only fetching the data from clustered table take more time.
  2. Clustered table is suitable when you fetch the fewer amounts of data from more fields.

Pooled table: -
  1. Pooled tables are many – one relationship. That means if you create many pooled tables in DDIC, then they will form like a table pool & stored in the data base. 
  2. Pooled tables are suitable when we fetch the large amount of data from fewer fields.

    Note: - Joins aren’t possible for Clustered & Pooled tables

Index: -

Indexes are used to improve the performance of the select query. There are two types of indexes.
  1. Primary index
  2. Secondary index
Primary index: - Primary index is the primary fields. Without a primary index we can’t create the data base table. We can place up to 16 primary indexes per table. We can create the primary index only for custom tables. Not for standard tables.

Secondary index: -Secondary index is possible for other than primary fields. Without a secondary index we can create the data base table. We can create up to 9 secondary indexes per a table. We can create secondary index for both standard & custom tables.

Some of filed names in T001:
BUKRS à Company code
BUTXT à Company name
ORT01 à City
LAND1 à Country

Some of field names in KNA1: -
KUNNR à Customer number
NAME1 à Name
ORT01 à City
LAND1 à Country
SPRAS à Language

Some of the field names in LFA1 : -
LIFNR à Vendor number
NAME1 à Name
ORT01 à City
LAND1 à Country
SPRAS à Language

DATA DICTIONARY Cont......

Adding some additional fields to the database tables :


Differences between data base table and structure : 





Syntax of declaring the structure / table in ABAP editor: -



Internal table: -
  1. Internal table is the collection of records.
  2. Internal tables are temporary tables. That means the data in internal table won’t save any where in SAP.
  3. Internal tables are dynamic memory location. That means we no need to provide the size of the internal table.
  4. The scope of the internal table is up to that program.

  5. Placing the data to the internal table as well as getting the data from internal table is always record by record.

Differences between data base table & internal tables: -



Syntax of declaring the internal table : -

Data <internal table> like table of <work area>.

Syntax of accessing the fields from work area :-

<work area name> - <file name>
Ex: WA – Eid.

Sunday, 2 August 2015

BADI cont..


BADI (Business add ins)

Scenario 4 :


When ever we create a Purchase order the vendor supply's goods to the warehouse department.
The warehouse department check the goods against  the our purchase order whether the goods which we requested supplied or not if the goods are matched then the ware house people create goods receipt (GR) with MIGO transaction with 101 Movement type. The plant finance people physically verify the goods against the GR and prepare the IR(invoice receipt) document.
           Against IR document the account payable department pay the amount to the vendor with the deduction TDS of amount. After few days the vendor asks the Form 16A to finance people so that he can get (TDS) money back. At the time of generating form 16 the finance department must provide LR Number, Vehicle number, Transport name. These information is not  captured in the entire MM life cycle. Here we implement the BADI to attach additional subscreen which contains above fields to MIGO transaction.






So that we can easily save all these details in one Z_table and we can get these data any time we want. this will improve the performance and it is easy for maintain these details.

Scenario 5: -
            The warehouse people issue the goods against cost center by using MIGO or MB1A transaction code with 201 movement type. Some times they entered invalid cost center. To avoid this we implement the BADI to thrown an error message if they pass invalid cost center or cost center not belongs to that plant.