Posts

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

SQL Join

Image
  SQL Joining: Joins in SQL are used to query (retrieve) data from 2 or more related tables. In general tables are related to each other using foreign key constraints. In SQL there are different types of JOINS: 1. CROSS JOIN 2. INNER JOIN 3. OUTER JOIN Outer Joins are again divided into 3 types: 1. Left Join or Left Outer Join 2. Right Join or Right Outer Join 3. Full Join or Full Outer Join General Formula for Joins SELECT       ColumnList FROM            LeftTableName JOIN_TYPE   RightTableName ON                  JoinCondition CROSS JOIN: CROSS JOIN, produces the Cartesian product of the 2 tables involved in the join. Cross Join shouldn't have ON clause. CROSS JOIN Query: SELECT ColumnName1, ColumnName2, ColumnName3,ColumnName4 FROM tableName CROSS JOIN tableName2(joining...

Unique key constraint

Unique key constraint: We use UNIQUE constraint to enforce uniqueness of a column i.e the column shouldn't allow any duplicate values. We can add a Unique constraint thru the designer or using a query. To add a unique constraint using SQL server management studio designer: 1. Right-click on the table and select Design 2. Right-click on the column, and select Indexes/Keys... 3. Click Add 4. For Columns, select the column name you want to be unique. 5. For Type, choose Unique Key. 6. Click Close, Save the table. To create the unique key using a query: Alter Table Table_Name Add Constraint Constraint_Name Unique (Column_Name) Both primary key and unique key are used to enforce, the uniqueness of a column. So, when do you choose one over the other? A table can have, only one primary key. If you want to enforce uniqueness on 2 or more columns, then we use unique key constraint. What is the difference between Primary key constraint and Unique key constraint? ...

Group By & Difference between WHERE and HAVING clause

Group By: In SQL Server we have got lot of aggregate functions. Likes: 1. Count() 2. Sum() 3. avg() 4. Min() 5. Max() Group by clause is used to group a selected set of rows into a set of summary rows by the values of one or more columns or expressions. It is always  used in conjunction with one or more aggregate functions. Syntax look likes : SELECT COUNT (Column name), column name1 FROM table name GROUP BY column name1; Filtering Groups:   WHERE clause is used to filter rows before aggregation, where as HAVING clause is used to filter groups after aggregations. The following 2 queries  produce the same result. Filtering rows using WHERE clause, before aggregations take place: Select Column name, SUM (column name) from table name Where column name = condition group by column name (By which we want to filter our result) Filtering groups using HAVING clause, after all aggregations take place: Select Column name, SUM (column name) from t...

Where Clause with operators

Image
Where Operator Usage : In my last post I was talking about Where clause and its operators.Now I am going to describe its usage with Where clauses. There are different types of usage operators with our requirement. I will give all the operators usage process with some example. It is used with SELECT,INSERT,UPDATE & DELETE statement. I am giving it serially. Equal (=) :This operator is used when we comparing any value or characters with our required field. Like : SELECT * FROM table name WHERE column name= value. Where clause with AND : It is used when we have multiple condition.Just like:       SELECT column - names   FROM table - name    WHERE condition1 AND condition2            For Update : UPDATE table - name SET column - name = value WHERE condition1 AND  condition2.   Where clause with OR : It is used when any one value is acceptable, like: SELECT col...

SELECT DISTINCT Statement & OPerator

Image
Today I am talking about another Select Statement.That is Select DISTINCT Statement. The   SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values. The  SELECT DISTINCT statement is used to return only distinct (different) values. The statement look like : SELECT DISTINCT column1 , column2, column3,..... FROM table_name ;  Select statement likely : SELECT column1 , column2, column3,..... FROM table_name ;  For example I am showing you both of two queries. Hope it will help you to clear the concept. Difference between Select and Select DISTINCT : By using Select statement we get all the value if have any duplicate values in a table. On the other hand Select DISTINCT statement gives only single values.It's remove duplicate values. Query's are like:  SELECT Column name FRO...

About Programming & SQL query Introduction

Image
Hello Everyone !!! I am trying to help you for sharing some programming problem.Programming is a part of life.Sometimes its changed.Like life is valueless without programming.So,don't be upset. Don't be hopeless.There are lots of hope.If you can take it as a part of your life. I am talking too much.Now come to the point. if I asked anybody say something about programming language,I sure most of them give me a vast description about specific language.How many programming language we have,I am just mentioning some of these: C,C++,C#,Java,Python,Ruby,PHP,JavaScript,Perl,CSS and so and. I am trying to give some idea about a few of these. Today I am describing SQL query language. SQL is a standard language for storing, manipulating and retrieving data in databases. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases. SQL is an ANSI (American National Standards Institute) standard. What Can SQL do? SQL can execute querie...