avatar© Soft Metrics Consulting, February 5, 2021

SAP Automation and Integration

SAP accelerates business automation and integration

Cover Image

Growing companies need the powerful benefits and value that technology can offer to their business with automation and integration.

Business automation and Integration

We have the resources and the methodology to help businesses solving their challenges and reach for new opportunities, for growth and success.

Our solutions are based on advanced analytics and best Business Intelligence trends in the industry.

Our simple yet powerful solutions helps solving the most complex and challenging problems.

Together we can reach the peak of the intelligent enterprise of tomorrow.

Organizations start realizing that data and how they make use of the data is one of the most valuable assets.

PARAMETERS: p_matnr TYPE matnr,
p_lgort TYPE lgort_d.
 
SELECT mara~matnr,
mard~lgort,
COUNT( DISTINCT ( mard~matnr ) ) AS distinct_mat, " Unique Number of Material
COUNT( DISTINCT ( mard~werks ) ) AS distinct_plant, " Unique Number of Plant
SUM( mard~labst ) AS sum_unrest,
AVG( mard~insme ) AS avg_qlt_insp,
SUM( mard~vmspe ) AS sum_blocked
FROM mara AS mara INNER JOIN mard AS mard
ON mara~matnr EQ mard~matnr
INTO TABLE @DATA(lt_storage_loc_mat)
UP TO 1000 ROWS
WHERE mard~matnr = @p_matnr
AND mard~lgort = @p_lgort
GROUP BY mara~matnr,
mard~lgort.
 
IF sy-subrc = 0.
cl_demo_output=>display_data(
EXPORTING
value = lt_storage_loc_mat
name = 'New AGE SQL : 2' ).
ENDIF.
Using JOIN and COUNT / DISTINCT functions in SELECT