Thursday, August 13, 2015

Group By

Group By clause categorizes and summarizes the lines of database table based on a single field. That single field is mentioned in the group by clause. We can use multiple fields in the group by clause also. Here the database table records will be summarized according to those fields.

The fields mentioned in the group by clause cannot be specified for the aggregate function. We have to use other fields which are not specified in group by clause to calculate the aggregate function. Now we have the a PO with the following quantity.

















REPORT  zabap_gui.

DATA:
      ebeln  TYPE ekpo-ebeln,
      po_max TYPE p DECIMALS 2,
      po_min TYPE p DECIMALS 2,
      tq_max TYPE p DECIMALS 2,
      tq_min TYPE p DECIMALS 2.

WRITE:/    'PO No',
        15 'Max PO Quantity',
        35 'Min PO Quantity',
        55 'Max Target',
        70 'Min Target'.

SELECT ebeln
       MAX( menge ) MIN( menge )
       MAX( ktmng ) MIN( ktmng )
  FROM ekpo
  INTO (ebeln,
        po_max, po_min,
        tq_max, tq_min)
  GROUP BY ebeln.

  WRITE:/   ebeln,
         15 po_max,
         35 po_min,
         55 tq_max,
         70 tq_min.

ENDSELECT.

Here is the output:


10 comments:

Rahul said...

It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

Bhavya Kumar said...

Best blog.Got to learn new things.Thanks for this Blog SAP Success Factors Training in Chennai

Shalini said...


Hi, This is shalini from Chennai learned SAP Training in Chennai from mr.karthick. The training really was good and i got selected in leading mnc company as SAP Consultant.

You can contact 8122241286 for Best SAP Training in Chennai or reach www.thecreatingexperts.com

sushma said...

SAP Success Factors Real Time Hands on Training in Chennai...

Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trainer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

Shruti Ramalingam said...


From My search…Creating Experts provides Best SAP Training with real time projects assistance.

Most of the modules are equipped with advance level topics which the student can learn from the basics to the advance level stage.

They also provide placement assistance in leading MNC companies across the globe according to the current requirements.

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

And these are the Best SAP training institute which provides Real Time Hands on Training…

codedion Technologies-9003085882

creating Experts-8122241286

http://thecreatingexperts.com/sap-mm-training-in-chennai/

Shalini said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

kavi kalyan said...

Best SAP Success Factor Training in Chennai

http://thecreatingexperts.com/sap-training-in-chennai/
http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
http://thecreatingexperts.com/sap-mm-training-in-chennai/
http://thecreatingexperts.com/sap-fico-training-in-chennai/

Priya Kannan said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Unknown said...


Best SAP MM Material Managemnt Real time hands on Training in chennai

http://thecreatingexperts.com/sap-mm-training-in-chennai/

sushma said...

Informative Blog...For a long time I was craving for a career growth in programming and then I came to know that THE CREATING EXPERTS is the one who provide training with hands on training and real time scenarios

http://thecreatingexperts.com/sap-abap-training-in-chennai/

contact 8122241286