Consumption report - material type/CC wise.
Hi,
Is there any standard report to view the consumption quantities with values?
Inputs are material type, cost centre and a particular period.
Regards,
Siva
Thanks...
This will be of helpful.
But, can you guide further?
The field is MTART & the table is MARA.
When I enter these in the config, system is not accepting.
May I have to take the help of an ABAPPER and incorporate anything in program?
Regards,
Siva
Similar Messages
-
Material consumption report for sales made artcle wise - help urgent
Hi Folks,
My client need a report which consist of
The raw material consumption report
1. Article wise (material group)
2. QTY
3. Value
4. or all sales made for foreign customers
5. Business area
Please help me
Thanks
NarasimHi,
Check COOIS report.
It will show the consumption order wise just filter Movement type 261.
Regards,
Shayam -
Purchase report on Material Type wise
Dear All,
Is there any tcode avl to take the report of Purchase orders material type wise.
RegardsHi,
You can get the report as you required by standard tcode ME2n, ME2M run any of tcode then press Shift+F4 than choose purchase document item > there you will see material type > click on that it will move to ME2N screen . Now enter select material type and provide further data as per your requirement and execute. -
Hello Friends,
i want to get the consumption report item wise.
IN GL Line item display i am not getting the same and through MB51 by using Movement Type 201 and 261 is not fruitfull.
Actly while preparing of Balance Sheet i need to give the Consumption Detail Item Wise.
Could any one please help me out on this issue.
Thanks
Nitin JindalHi Nitin,
You can develop SAP query T code SQ01 by joining Material and GL Account table to get consumption report output.
Regards,
Santosh -
Material yearly consumption report
Hi,
I have gone through many topics on getting the yearly consumption report of material but still could not get it.
We have just implemented SAP in our company and all transactions are being done from 1st Jan 2011. In Material Master we have added the consumption (under Forecast tab) month wise for the last four years.
Is there a way to see a report based on that, as I would like to accumulate the data year wise and see the last four years consumption.Hi ,
I would give you suggestion based on your question "Is there a way to see a report based on that, as I would like to accumulate the data year wise and see the last four years consumption."
1st , are you using any PP related Production order ?
This is very simple issue with movement type 261 if you are using PP.
Since you would like to see accumulate the date year wise for last four years consumption , my suggest is based on the plan date from the last 4 years with 261 movement type for the raw material / semi finished in those order.
Standard report
COOIS Report - with movement type 261 based on order also possible to view.
or
MCRP- exact material consumption datewise or order wise.
MC45 ,MCRE alternative report.
For customize solution with abap,
Please check with Table MVER - Material Consumption , MSEG (MENGE) and S026 (ENMNG)
Pls restrict the selection condition for material with movement type 261 in table MSEG.
If you using MRP area, perhaps you need check in table DVER - Material Consumption for MRP Area.
Hope is clear and can help you.
TQ -
Material Consumption Report all expert requested to check my code
Hi all guru
Plz
I am creating Material Consumption Report
so all expert are requested to check my code
bcz its giving me wrong value change if nessary
*& Report Z_MATERIAL_CONSUPTION
*&IEDK901096
REPORT Z_MATERIAL_CONSUPTION
LINE-COUNT 65(2)
LINE-SIZE 345
MESSAGE-ID zate_msg
NO STANDARD PAGE HEADING.
*T A B L E S
TABLES:MARC,
mara,
makt,
mard,
mbew,
mseg,
mkpf.
T Y P E S
Types for MARC
TYPES: begin of ty_marc,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
end of ty_marc.
********Types for T001W*****
TYPES:BEGIN OF ty_t001w,
werks LIKE t001w-werks,
name1 LIKE t001w-name1,
END OF ty_t001w.
********Types for MARA*****
TYPES:BEGIN OF TY_MARA,
matnr LIKE mara-matnr,
mtart LIKE mara-mtart,
matkl LIKE mara-mtart,
END OF ty_mara.
********Types for MAKT*****
TYPES:BEGIN OF ty_makt,
matnr LIKE makt-matnr,
spras LIKE makt-spras,
maktx LIKE makt-maktx,
END OF ty_makt.
********Types for MKPF*****
TYPES:BEGIN OF ty_mkpf,
mblnr LIKE mkpf-mblnr,
budat LIKE mkpf-budat,
END OF ty_mkpf.
********Types for MSEG*****
TYPES:BEGIN OF ty_mseg,
mblnr LIKE mseg-mblnr,
mjahr LIKE mseg-mjahr,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
END OF ty_mseg.
Types for main **************
TYPES: begin of ty_main,
matkl LIKE mara-mtart,
mtart LIKE mara-mtart,
matnr LIKE mara-matnr,
werks LIKE marc-werks,
name1 LIKE t001w-name1,
maktx LIKE makt-maktx,
budat LIKE mkpf-budat,
mblnr LIKE mseg-mblnr,
mjahr LIKE mseg-mjahr,
menge LIKE mseg-menge,
menge1 LIKE mseg-menge,
bwart LIKE mseg-bwart,
ret_qty LIKE mseg-menge,
ret_*** LIKE mseg-menge,
unit_qty LIKE mseg-menge,
unit_*** LIKE mseg-menge,
wip_qty LIKE mseg-menge,
wip_*** LIKE mseg-menge,
sub_qty LIKE mseg-menge,
sub_*** LIKE mseg-menge,
oth_qty LIKE mseg-menge,
oth_*** LIKE mseg-menge,
end of ty_main.
Types for main2 **************
TYPES: begin of ty_main2,
mblnr LIKE mseg-mblnr,
werks LIKE marc-werks,
mjahr LIKE mseg-mjahr,
menge LIKE mseg-menge,
bwart LIKE mseg-bwart,
matnr LIKE mara-matnr,
mtart LIKE mara-mtart,
matkl LIKE mara-mtart,
end of ty_main2.
*I N T E R N A L T A B L E S
DATA:it_mara TYPE ty_mara OCCURS 0 WITH HEADER LINE,
it_marc TYPE ty_marc OCCURS 0 WITH HEADER LINE,
it_t001w TYPE ty_t001w OCCURS 0 WITH HEADER LINE,
it_makt TYPE ty_makt OCCURS 0 WITH HEADER LINE,
it_main TYPE ty_main OCCURS 0 WITH HEADER LINE,
it_main2 TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_mkpf TYPE ty_mkpf OCCURS 0 WITH HEADER LINE,
it_mseg TYPE ty_mseg OCCURS 0 WITH HEADER LINE,
it_mseg TYPE ty_main OCCURS 0 WITH HEADER LINE,
it_dept TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_unit TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_WIP TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_subcon TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_others TYPE ty_main2 OCCURS 0 WITH HEADER LINE.
**********I N T E R N A L T A B L E S for Cumulative Calculation**********
DATA:it_mseg1 TYPE ty_main OCCURS 0 WITH HEADER LINE,
it_dept1 TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_unit1 TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_WIP1 TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_subcon1 TYPE ty_main2 OCCURS 0 WITH HEADER LINE,
it_others1 TYPE ty_main2 OCCURS 0 WITH HEADER LINE.
W O R K A R E A
DATA:wa_mara TYPE ty_mara,
wa_marc TYPE ty_marc,
wa_t001w TYPE ty_t001w,
wa_makt TYPE ty_makt,
wa_main TYPE ty_main,
wa_main2 TYPE ty_main2,
wa_mkpf TYPE ty_mkpf,
wa_mseg TYPE ty_mseg,
wa_mseg1 TYPE ty_mseg,
wa_dept TYPE ty_main2,
wa_ret_qty TYPE ty_main2,
wa_ret_*** TYPE ty_main2.
V A R I A B L E S D E C L A R A T I O N
DATA: MYDATE TYPE SY-DATUM,
per_qty TYPE p,
***_qty TYPE p ,
final_total TYPE p DECIMALS 2.
S E L E C T I O N S C R E E N
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
PARAMETERS:Plant LIKE marc-werks DEFAULT '1023'.
select-options:Mat_Grp FOR mara-matkl,
Mat_Type FOR mara-mtart,
MATERIAL FOR MARC-MATNR,
Period FOR mydate.
PARAMETERS:Year LIKE mseg-mjahr DEFAULT '2007'.
SELECTION-SCREEN:END OF BLOCK B1.
I N I T I A L I Z A T I O N
INITIALIZATION.
MATERIAL-LOW = '100'.
MATERIAL-HIGH = '200'.
APPEND MATERIAL.
*MAT_TYPE-LOW = 'ABF'.
*MAT_TYPE-HIGH = 'FERT'.
*APPEND MAT_TYPE.
*MAT_GRP-LOW = '100'.
*MAT_GRP-HIGH = '200'.
*APPEND MAT_GRP.
*PERIOD-LOW = '20071001'.
*PERIOD-HIGH = '20071031'.
*APPEND PERIOD.
S T A R T O F S E L E C T I O N
start-of-selection.
PERFORM it_mara_data.
PERFORM it_marc_data.
PERFORM it_t001w_data.
PERFORM it_makt_data.
PERFORM it_mseg_data.
PERFORM it_mseg1_data. "CUMULATIVE CALCULATION
PERFORM it_mkpf_data.
PERFORM it_dept_data.
PERFORM it_dept1_data. "CUMULATIVE CALCULATION
PERFORM it_unit_data.
PERFORM it_unit_data1. "CUMULATIVE CALCULATION
PERFORM it_wip_data.
PERFORM it_wip_data1. "CUMULATIVE CALCULATION
PERFORM it_sub_contract.
PERFORM it_sub_contract1. "CUMULATIVE CALCULATION
PERFORM it_main_data.
T O P O F P A G E
TOP-OF-PAGE.
WRITE: /1 'INOX AIR PRODUCTS LTD',plant,it_t001w-name1,
/1 'TOTAL CONSUMPTION FOR THE PERIODE:',Period-low,'To',period-high.
skip 2.
FORMAT COLOR 1.
ULINE.
WRITE: /1'|','CODE ' ,
15 'MATERIAL' ,
30 'DESCRIPTION',
90'CONSUMPTION' ,
135'RETURN FROM DEPT.' ,
170'INTER UNIT' ,
210'W.I.P' ,
240'SUB-CONTRACTOR' ,
275'OTHERS' ,
310'TOTAL',345'|' ,
/1'|',15 'TYPE',
85'FOR PERIOD' ,
100 ' CUMULATIVE' ,
130'FOR PERIOD' ,
145 'CUMULATIVE' ,
165'FOR PERIOD' ,
180 'CUMULATIVE' ,
200'FOR PERIOD' ,
215'CUMULATIVE' ,
235'FOR PERIOD' ,
250'CUMULATIVE' ,
265'FOR PERIOD' ,
280 'CUMULATIVE' ,
300'FOR PERIOD' ,
315' CUMULATIVE' ,
345'|' .
ULINE.
E N D O F S E L E C T I O N
end-OF-SELECTION.
PERFORM display_data.
FORM it_mara_data.
SELECT matnr
mtart
matkl
FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara
WHERE matnr IN material AND
mtart IN mat_type AND
matkl IN mat_grp.
ENDFORM. " it_mara_data
FORM it_marc_data .
select matnr
werks
from marc
into CORRESPONDING FIELDS OF TABLE it_marc
FOR ALL ENTRIES IN it_mara
WHERE MATNR eq it_mara-matnr AND
werks eq plant.
ENDFORM. " it_marc_data
FORM it_makt_data .
SELECT
matnr
maktx
FROM makt INTO
CORRESPONDING FIELDS OF TABLE it_makt
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr.
ENDFORM. " it_makt_data
FORM it_main_data .
*BREAK-POINT.
loop at it_mara.
wa_main-matnr = it_mara-matnr.
wa_main-mtart = it_mara-mtart.
wa_main-matkl = it_mara-matkl.
READ TABLE it_marc WITH KEY matnr = it_mara-matnr.
wa_main-werks = it_marc-werks.
READ TABLE it_t001w WITH KEY werks = it_marc-werks.
wa_main-name1 = it_t001w-name1.
READ TABLE it_makt WITH KEY matnr = it_mara-matnr.
wa_main-maktx = it_makt-maktx.
READ TABLE it_mseg1 INDEX sy-tabix.
wa_main-mjahr = it_mseg1-mjahr.
wa_main-menge1 = it_mseg1-menge.
READ TABLE it_mseg WITH KEY matnr = it_mara-matnr.
READ TABLE it_mseg INDEX sy-tabix.
wa_main-mblnr = it_mseg-mblnr.
wa_main-menge = it_mseg-menge.
READ TABLE it_dept WITH KEY mblnr = it_mseg-mblnr.
wa_main-ret_qty = it_dept-menge.
READ TABLE it_dept1 WITH KEY werks = it_marc-werks.
READ TABLE it_dept1 INDEX sy-tabix.
wa_main-ret_*** = it_dept1-menge.
READ TABLE it_mkpf WITH KEY mblnr = it_mseg-mblnr.
wa_main-budat = it_mkpf-budat.
READ TABLE it_unit1 WITH KEY werks = it_marc-werks.
READ TABLE it_unit1 INDEX sy-tabix. "BINARY SEARCH.
wa_main-unit_*** = it_unit1-menge.
READ TABLE it_unit WITH KEY mblnr = it_mseg-mblnr.
wa_main-unit_qty = it_unit-menge.
READ TABLE it_wip WITH KEY mblnr = it_mseg-mblnr.
wa_main-wip_qty = it_wip-menge.
READ TABLE it_wip1 WITH KEY werks = it_marc-werks.
READ TABLE it_wip1 INDEX sy-tabix.
wa_main-wip_qty = it_wip1-menge.
READ TABLE it_subcon WITH KEY mblnr = it_mseg-mblnr.
wa_main-sub_qty = it_subcon-menge.
READ TABLE it_subcon1 WITH KEY werks = it_marc-werks.
READ TABLE it_subcon1 INDEX sy-tabix.
wa_main-sub_*** = it_subcon1-menge.
READ TABLE it_others WITH KEY mblnr = it_mseg-mblnr.
wa_main-oth_qty = it_others-menge.
READ TABLE it_others1 WITH KEY werks = it_marc-werks.
READ TABLE it_others1 INDEX sy-tabix.
wa_main-oth_*** = it_others1-menge.
APPEND wa_main to it_main.
CLEAR : wa_main,
it_mseg1,
it_main.
ENDLOOP.
LOOP at it_mseg1.
READ TABLE it_mseg INDEX sy-index.
MOVE-CORRESPONDING it_mseg1 to it_main.
append LINES OF it_mseg1 TO it_main.
IF sy-subrc <> 0.
exit.
ENDIF.
ENDLOOP.
ENDFORM. " it_main_data
FORM display_data .
SORT it_main by matkl mtart maktx.
LOOP AT it_main ."WHERE menge eq it_mseg1-menge.
at NEW matkl.
FORMAT COLOR 2 INTENSIFIED ON.
WRITE:/5 it_main-matkl." COLOR 2.
ENDAT.
at NEW mtart.
FORMAT COLOR 3 INTENSIFIED ON.
WRITE:/15 it_main-mtart." COLOR 3.
ENDAT.
at NEW maktx.
FORMAT COLOR 4 INTENSIFIED OFF.
WRITE:/ it_main-maktx UNDER 'DESCRIPTION'.
ENDAT.
FORMAT COLOR 2 INTENSIFIED ON.
WRITE:/75 it_main-menge, "it_main-maktx UNDER 'DESCRIPTION',
95 it_main-menge1,
125 it_main-ret_qty,
140 it_main-ret_***,
160 it_main-unit_qty,
175 it_main-unit_***,
195 it_main-wip_qty,
210 it_main-wip_***,
225 it_main-sub_qty,
240 it_main-sub_***,
255 it_main-oth_qty,
270 it_main-oth_***.
FORMAT COLOR 2 INTENSIFIED OFF.
at END OF mtart.
sum.
uline.
WRITE:/30 'MAT. TYPE WISE SUB TOTAL' COLOR COL_GROUP,
60 IT_MAIN-MTART COLOR 2,
75 '*',it_main-menge,'*' COLOR 4,
95 it_main-menge1,
125 it_main-ret_qty,
140 it_main-ret_***,
160 it_main-unit_qty,
175 it_main-unit_***,
195 it_main-wip_qty,
210 it_main-wip_***,
225 it_main-sub_qty,
240 it_main-sub_***,
260 it_main-oth_qty,
270 it_main-oth_***.
uline.
ENDAT.
at END OF matkl.
sum.
uline.
WRITE:/30 'GROUPWISE SUB TOTAL ' COLOR 5,
60 IT_MAIN-MATKL COLOR 2,
75 '*',it_main-menge,'*' COLOR 4,
95 it_main-menge1,
125 it_main-ret_qty,
140 it_main-ret_***,
160 it_main-unit_qty,
175 it_main-unit_***,
195 it_main-wip_qty,
210 it_main-wip_***,
225 it_main-sub_qty,
240 it_main-sub_***,
260 it_main-oth_qty,
270 it_main-oth_***.
uline.
ENDAT.
at LAST.
sum.
uline.
WRITE:/30 'GROSS TOTAL' COLOR 6,
60 IT_MAIN-MATKL COLOR 2,
75 '*',it_main-menge,'*' COLOR 4,
95 it_main-menge1,
125 it_main-ret_qty,
140 it_main-ret_***,
160 it_main-unit_qty,
175 it_main-unit_***,
195 it_main-wip_qty,
210 it_main-wip_***,
225 it_main-sub_qty,
240 it_main-sub_***,
260 it_main-oth_qty,
270 it_main-oth_***.
uline.
ENDAT.
per_qty = it_main-menge.
***_qty = it_main-menge1.
final_total = per_qty + ***_qty.
at last.
WRITE:/95 sy-uline(30).
write:/65 'Final Cumulative Qty >>>>>>>>>',final_total color 6.
WRITE:/95 sy-uline(30).
ENDAT.
FORMAT INTENSIFIED off.
ENDLOOP.
ENDFORM. " display_data
" it_mkpf_data
FORM it_mseg_data .
SELECT
mblnr
matnr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_mseg
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
bwart eq 261." AND bwart eq 262.
CLEAR it_mseg.
ENDFORM. " it_mseg_data
FORM it_mkpf_data .
SELECT
mblnr
budat
FROM mkpf INTO CORRESPONDING FIELDS OF TABLE it_mkpf
FOR ALL ENTRIES IN it_mseg
WHERE mblnr eq it_mseg-mblnr." AND
budat BETWEEN Period-low AND period-high.
ENDFORM.
FORM it_t001w_data .
SELECT werks name1 FROM t001w INTO CORRESPONDING FIELDS OF TABLE it_t001w
FOR ALL ENTRIES IN it_marc
WHERE werks eq it_marc-werks.
ENDFORM. " it_t001w_data
FORM it_mseg1_data .
SELECT
mblnr
mjahr
ZEILE
matnr
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_mseg1
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
mjahr eq Year AND
bwart eq 261." AND bwart eq 262.
CLEAR it_mseg1.
ENDFORM. " it_mseg1_data
FORM it_dept_data .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_dept
FOR ALL ENTRIES IN it_mseg
WHERE mblnr eq it_mseg-mblnr AND
werks eq it_mseg-WERKS AND
bwart ge 291 AND bwart le 292.
ENDFORM.
" it_dept_data
FORM it_dept1_data .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_dept1
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
mjahr eq YEAR AND
bwart ge 291 and bwart le 292.
ENDFORM. " it_dept1_data
FORM it_unit_data .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_unit
FOR ALL ENTRIES IN it_mseg
WHERE mblnr eq it_mseg-mblnr AND
werks eq it_mseg-WERKS AND
bwart ge 301 AND bwart le 302.
ENDFORM. " it_unit_data
FORM it_unit_data1 .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_unit1
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
mjahr eq YEAR AND
bwart ge 301 AND bwart le 302.
ENDFORM. " it_unit_data1
FORM it_wip_data .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_wip
FOR ALL ENTRIES IN it_mseg
WHERE mblnr eq it_mseg-mblnr AND
werks eq it_mseg-WERKS AND
bwart ge 301 AND bwart le 302.
ENDFORM. " it_wip_data
FORM it_wip_data1 .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_wip1
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
mjahr eq YEAR AND
bwart ge 301 AND bwart le 302.
ENDFORM. " it_wip_data1
FORM it_sub_contract .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_subcon
FOR ALL ENTRIES IN it_mseg
WHERE mblnr eq it_mseg-mblnr AND
werks eq it_mseg-WERKS AND
bwart eq 541." AND bwart eq 542.
ENDFORM. " it_sub_contract
FORM it_sub_contract1 .
SELECT
mblnr
mjahr
ZEILE
werks
menge
bwart
FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_subcon1
FOR ALL ENTRIES IN it_mara
WHERE matnr eq it_mara-matnr AND
werks eq plant AND
mjahr eq YEAR AND
bwart eq 541." AND bwart eq 542.
ENDFORM. " it_sub_contract1Hi,
When ever you are using a read statement check sy-subrc is initial or not then only you move the data
and clear the work area after use.
The mistake you have done is not clearing the work areas after use and sy-subrc check after read.
If you fail to do so the data will be clubbed and wrong data will be shown.
Regards,
Siva
Pls reward points if usefull . -
Consumer category-wise consumption report
Hi all,
Please guide me in getting consumer category-wise consumption report.
There are 10 categories of consumers. I want to generate consumption report for these consumers.
Thanks and Regds.,
VijayHi,
Not sure i followed your question completely..
lets say that customers are classified as 'Residential' - RES
and 'Commercial' - COM.
For these customers.. there will be Contract Accounts and contracts and installations associated to it.
In the installation check the field 'Billing Class' , so based on the type whether 'RES' or 'COM' you need to hit the table ERDK to fetch the invoices for the corresponding Contract Account and
check again the tables DBERCHZ1 to extract the consumption by passing the same invoice number(in sap the 'Print document' number -field ERDK-OPBEL).
Based on the category selected by the user on the selection-screen either RES or COM. you can display in output report
Hope it helps.
Regards
Vinay -
Dump Error in MAterial Consumption Report
Hi all Gurus
[1] I need help from your side i am doing one material consumption report in that i did all thing but it is giving me dump error while i was using sort in to ALV
so please any one help me out this .......
[2] I am Printing sum of quantity in Header area of smartform it is printing with using comma e.x 43,000 but in body area it is showing with decimal point
e.x 43.000
Following is my ALV reports code please check it it is giving me short dump while using sort ..............
I am very much in neeed
Thanx for your suggestion in advanc.....
and god bless you............
*& Report ZCONSUM
REPORT ZCONSUM.
*& Report ZCONSUMPTION
TYPE-POOLS : SLIS.
TABLES:marc,
mara,
makt,
mard,
mbew,
mseg,
mkpf.
TYPES:
BEGIN OF s_mseg,
mblnr LIKE mseg-mblnr,
mjahr LIKE mseg-mjahr,
zeile LIKE mseg-zeile,
bwart LIKE mseg-bwart,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
menge LIKE mseg-menge,
budat LIKE mkpf-budat,
mtart LIKE mara-matnr,
matkl LIKE mara-matkl,
END OF s_mseg,
BEGIN OF s_t001w,
werks LIKE t001w-werks,
name1 LIKE t001w-name1,
END OF s_t001w,
BEGIN OF s_mara,
matnr LIKE mara-matnr,
mtart LIKE mara-mtart,
matkl LIKE mara-matkl,
END OF s_mara,
BEGIN OF s_makt,
matnr LIKE makt-matnr,
spras LIKE makt-spras,
maktx LIKE makt-maktx,
END OF s_makt,
BEGIN OF s_calc,
matnr LIKE mara-matnr,
mtart LIKE mara-mtart,
matkl LIKE mara-matkl,
maktx LIKE makt-maktx,
menge_t LIKE mseg-menge,
menge_t1 LIKE mseg-menge,
menge_con_261 LIKE mseg-menge,
menge_con_262 LIKE mseg-menge,
menge_con1_261 LIKE mseg-menge,
menge_con1_262 LIKE mseg-menge,
menge_ret_291 LIKE mseg-menge,
menge_ret1_291 LIKE mseg-menge,
menge_ret_292 LIKE mseg-menge,
menge_ret1_292 LIKE mseg-menge,
menge_unit_301 LIKE mseg-menge,
menge_unit1_301 LIKE mseg-menge,
menge_unit_302 LIKE mseg-menge,
menge_unit1_302 LIKE mseg-menge,
menge_sub LIKE mseg-menge,
menge_sub1 LIKE mseg-menge,
menge_oth LIKE mseg-menge,
menge_oth1 LIKE mseg-menge,
END OF s_calc,
BEGIN OF s_data,
matnr LIKE mara-matnr,
matkl LIKE mara-matkl,
mtart LIKE mara-mtart,
maktx LIKE makt-maktx,
menge_t LIKE mseg-menge,
menge_t1 LIKE mseg-menge,
menge_con LIKE mseg-menge,
menge_con1 LIKE mseg-menge,
menge_ret LIKE mseg-menge,
menge_ret1 LIKE mseg-menge,
menge_unit LIKE mseg-menge,
menge_unit1 LIKE mseg-menge,
menge_sub LIKE mseg-menge,
menge_sub1 LIKE mseg-menge,
menge_oth LIKE mseg-menge,
menge_oth1 LIKE mseg-menge,
END OF s_data.
DATA: w_mseg TYPE s_mseg,
i_mseg TYPE s_mseg OCCURS 0,
w_t001w TYPE s_t001w,
i_t001w TYPE s_t001w OCCURS 0,
w_mara TYPE s_mara,
i_mara TYPE s_mara OCCURS 0,
w_makt TYPE s_makt,
i_makt TYPE s_makt OCCURS 0,
w_calc TYPE s_calc,
i_calc TYPE s_calc OCCURS 0,
w_data TYPE s_data,
i_data TYPE s_data OCCURS 0.
DATA: line_cnt TYPE i,
v_temp TYPE p DECIMALS 2.
ALV DATA DECLERATION
DATA : IT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELD TYPE SLIS_FIELDCAT_ALV.
DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
IT_LAYOUT-ZEBRA = 'X'.
IT_LAYOUT-TOTALS_TEXT = 'Grand Total'.
IT_LAYOUT-SUBTOTALS_TEXT = 'Sub Total'.
IT_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
DATA: WA_COMMENTRY TYPE SLIS_LISTHEADER.
DATA: IT_COMMENTRY TYPE SLIS_T_LISTHEADER.
DATA: WA_COMMENTRY1 TYPE SLIS_LISTHEADER.
DATA: IT_COMMENTRY1 TYPE SLIS_T_LISTHEADER.
DATA: WA_EVENT TYPE SLIS_ALV_EVENT.
DATA: IT_EVENT TYPE SLIS_T_EVENT.
WA_EVENT-NAME = 'TOP_OF_PAGE'.
WA_EVENT-FORM = 'TOP'.
APPEND WA_EVENT TO IT_EVENT.
DATA : WA_SORT TYPE slis_sortinfo_alv,
IT_SORT TYPE SLIS_T_SORTINFO_ALV.
CLEAR WA_SORT.
WA_SORT-SPOS = '1'.
WA_SORT-FIELDNAME = 'MATKL'.
WA_SORT-TABNAME = 'I_DATA'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-SPOS = '2'.
WA_SORT-FIELDNAME = 'MTART'.
WA_SORT-TABNAME = 'I_DATA'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
DEFINE MAC1.
WA_FIELD-TABNAME = 'I_DATA'.
WA_FIELD-FIELDNAME = &1.
WA_FIELD-COL_POS = &2.
WA_FIELD-SELTEXT_L =&3.
WA_FIELD-DO_SUM = &4.
APPEND WA_FIELD TO IT_FIELD.
END-OF-DEFINITION.
MAC1 'MATKL' '1' 'MATERIAL GROUP' 'X'.
MAC1 'MTART' '2' 'MATERIAL TYPE' 'X'.
MAC1 'MATNR' '3' 'MATERIAL NO' 'X'.
MAC1 'MAKTX' '4' 'DESCRIPTION' 'X'.
MAC1 'MENGE_CON1' '5' 'CONSUMPTION FOR PERIOD' 'X'.
MAC1 'MENGE_CON' '6' 'CONSUMPTION FOR CUMULATIVE' 'X'.
MAC1 'MENGE_RET1' '7' 'RETURN FROM DEPT. FOR PERIOD' 'X'.
MAC1 'MENGE_RET' '8' 'RETURN FROM DEPT.CUMULATIVE' 'X'.
MAC1 'MENGE_UNIT1' '9' 'INTER UNIT FOR PERIOD' 'X'.
MAC1 'MENGE_UNIT' '10' 'INTER UNIT CUMULATIVE' 'X'.
MAC1 'MENGE_SUB1' '11' 'SUB CONTRACTOR FOR PERIOD' 'X'.
MAC1 'MENGE_SUB' '12' 'SUB CONTRACTOR CUMULATIVE' 'X'.
MAC1 'MENGE_OTH1' '13' 'OTHERS FOR PERIOD' 'X'.
MAC1 'MENGE_OTH' '14' 'OTHERS CUMULATIVE' 'X'.
MAC1 'MENGE_t1' '15' 'TOTAL FOR PERIOD' 'X'.
MAC1 'MENGE_t' '16' 'TOTAL CUMULATIVE' 'X'.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
PARAMETERS: p_werks LIKE t001w-werks DEFAULT '1023' OBLIGATORY.
select-options: s_matkl FOR mara-matkl,
s_mtart FOR mara-mtart,
s_matnr FOR mara-matnr,
s_budat FOR mkpf-budat OBLIGATORY.
PARAMETERS: year(4) DEFAULT '2007'.
SELECTION-SCREEN:END OF BLOCK B1.
START-OF-SELECTION.
SELECT lk~mblnr
lk~mjahr
lk~budat
lp~zeile
lp~bwart
lp~matnr
lp~werks
lp~menge
ma~mtart
ma~matkl
INTO CORRESPONDING FIELDs OF TABLE i_mseg
FROM MSEG AS lp INNER JOIN MKPF AS lk
ON lkmblnr EQ lpmblnr
AND lkmjahr EQ lkmjahr
INNER JOIN mara AS ma
ON mamatnr EQ lpmatnr
WHERE lp~werks EQ p_werks
AND lp~matnr IN s_matnr
AND lk~budat LE s_budat-high.
clear line_cnt. "Count line of i_table i_mseg
DESCRIBE TABLE i_mseg LINES line_cnt.
IF line_cnt GT 0. "If i_mseg has records
SELECT matnr "Collect material description
maktx
spras
INTO CORRESPONDING FIELDS OF TABLE i_makt
FROM makt
FOR ALL ENTRIES IN i_mseg
WHERE matnr EQ i_mseg-matnr
AND spras EQ 'E'.
CLEAR line_cnt.
DESCRIBE TABLE i_makt LINES line_cnt.
IF line_cnt GT 0.
SORT i_makt BY MATNR ASCENDING.
DELETE ADJACENT DUPLICATES FROM i_makt COMPARING matnr.
ENDIF.
SELECT werks "Collect plant name
name1
INTO CORRESPONDING FIELDS OF TABLE i_t001w
FROM t001w
FOR ALL ENTRIES IN i_mseg
WHERE werks EQ i_mseg-werks.
CLEAR line_cnt.
DESCRIBE TABLE i_t001w LINES line_cnt.
IF line_cnt GT 0.
SORT i_t001w BY werks ASCENDING.
DELETE ADJACENT DUPLICATES FROM i_t001w COMPARING werks.
ENDIF.
LOOP AT i_mseg INTO w_mseg. "Move recored into data i_tab
w_calc-matnr = w_mseg-matnr.
w_calc-mtart = w_mseg-mtart.
w_calc-matkl = w_mseg-matkl.
READ TABLE i_makt WITH KEY matnr = w_mseg-matnr INTO w_makt.
IF sy-subrc = 0.
w_calc-maktx = w_makt-maktx.
ENDIF.
IF w_mseg-bwart EQ '261' .
w_calc-menge_con_261 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_con1_261 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '262' .
w_calc-menge_con_262 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_con1_262 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '291' OR w_mseg-bwart EQ '201'.
w_calc-menge_ret_291 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_ret1_291 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '292' OR w_mseg-bwart EQ '202'.
w_calc-menge_ret_292 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_ret1_292 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '301'.
w_calc-menge_unit_301 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_unit1_301 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '302'.
w_calc-menge_unit_302 = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_unit1_302 = w_mseg-menge.
ENDIF.
ENDIF.
IF w_mseg-bwart EQ '543'.
w_calc-menge_sub = w_mseg-menge.
IF w_mseg-budat GE s_budat-low.
w_calc-menge_sub1 = w_mseg-menge.
ENDIF.
ENDIF.
COLLECT w_calc INTO i_calc.
ENDLOOP. "ENDLOOP of Move recored into data i_tab
LOOP AT i_calc INTO w_calc.
w_data-matnr = w_calc-matnr.
w_data-mtart = w_calc-mtart.
w_data-matkl = w_calc-matkl.
w_data-maktx = w_calc-maktx.
v_temp = w_calc-menge_con_261 - w_calc-menge_con_262.
w_data-menge_con = v_temp.
CLEAR v_temp.
v_temp = w_calc-menge_con1_261 - w_calc-menge_con1_262.
w_data-menge_con1 = v_temp.
CLEAR v_temp.
v_temp = w_calc-menge_ret_291 - w_calc-menge_ret_292.
w_data-menge_ret = v_temp.
CLEAR v_temp.
v_temp = w_calc-menge_ret1_291 - w_calc-menge_ret1_292.
w_data-menge_ret1 = v_temp.
CLEAR v_temp.
v_temp = w_calc-menge_unit_301 - w_calc-menge_unit_302.
w_data-menge_unit = v_temp.
CLEAR v_temp.
v_temp = w_calc-menge_unit1_301 - w_calc-menge_unit1_302.
w_data-menge_unit1 = v_temp.
CLEAR v_temp.
w_data-menge_sub = w_calc-menge_sub.
w_data-menge_sub1 = w_calc-menge_sub.
v_temp = w_data-menge_con + w_data-menge_ret + w_data-menge_unit + w_data-menge_sub.
w_data-menge_t = v_temp.
CLEAR v_temp.
v_temp = w_data-menge_con1 + w_data-menge_ret1 + w_data-menge_unit1 + w_data-menge_sub1.
w_data-menge_t1 = v_temp.
CLEAR v_temp.
APPEND w_data TO i_data.
ENDLOOP.
ENDIF. "ENDIf i_mseg has records
Display_ALV
END-OF-SELECTION.
DATA : DATE(85),
DATE_LOW(10),
DATE_HIGH(10),
MSK TYPE STRING,
DATE1(10),
date2(10).
WA_COMMENTRY-TYP = 'H'.
WA_COMMENTRY-INFO = 'Material Consumption Report'.
APPEND WA_COMMENTRY TO IT_COMMENTRY.
CLEAR WA_COMMENTRY.
CONCATENATE S_BUDAT-LOW6(2) '/' S_BUDAT-LOW4(2) '/' S_BUDAT-LOW+0(4) INTO DATE1.
CONCATENATE S_BUDAT-high6(2) '/' S_BUDAT-high4(2) '/' S_BUDAT-high+0(4) INTO DATE2.
CONCATENATE 'Material Consumption Report :' DATE1 'To' date2 INTO DATE SEPARATED BY SPACE.
WA_COMMENTRY-TYP = 'S'.
WA_COMMENTRY-INFO = DATE.
APPEND WA_COMMENTRY TO IT_COMMENTRY.
CLEAR WA_COMMENTRY.
*SORT I_DATA BY MTART MATKL .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_BACKGROUND_ID = 'ALV_BACKGROUNG'
I_GRID_TITLE = 'STOCK LEDGER SUMMARY'
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = IT_FIELD
IT_SORT = IT_SORT
I_SAVE = 'X'
IT_EVENTS = IT_EVENT
TABLES
T_OUTTAB = I_DATA.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM TOP .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_COMMENTRY
I_LOGO = 'INOXLOGO'
I_END_OF_LIST_GRID =
I_ALV_FORM.
REFRESH IT_COMMENTRY.
ENDFORM. " TOP-OF-PAGEIt is giving me error on sort statement
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_BACKGROUND_ID = 'ALV_BACKGROUNG'
I_GRID_TITLE = 'STOCK LEDGER SUMMARY'
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = IT_FIELD
IT_SORT = IT_SORT <<<<<<<<<<<<<<<<<<<<<<<<<<<
I_SAVE = 'X'
IT_EVENTS = IT_EVENT
TABLES
T_OUTTAB = I_DATA.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Annual Material consumption in accordance to material types
Hi all,
I am stuck in a report. Require ur ideas on this:
My client wants to see a report on how much quantity to be issued to production orders and how much actually issued.
He needs the break up of in form of Raw Material, Semi Finished , Trading goods and Service Material.All these data is to be fetched year wise (e.g. 2008,2009, 2010 etc).
I am aware of standard report MCRE. But this report does not gives us break in accordance to the material type.
Also the SME requires the list of all the materials whose stock has fallen below the safety stock .
Please advise us . Thanks in advance
Regards
Ayaz A KhanHi,
You can use report MCRE if you are using seperate material number ranges for each material type. In this case the material number range serves purpose of the filter for material type you are looking for .
If it doesn't serve the purpose then go with Custom developed report. You can use table S026 this table is updated using LIS & it will help you to improve performace of your report compare to using other database tables like RESB & MSEG.
Hope this will help you.
Regards,
Navin -
Material type wise Po ,gr value
Hi
Are there any standard reports available for Material type wise PO value ,gr value and invoice amount???Hi ,
Then try to get data like this
tables ->MARA->EKPO+EKKO-->EKBE.
regards
Prabhu -
SAP report for movement type and material type
Hi!
I would like to use a standard SAP report to give me a list of all the movement types (much like MB51) but instead of material I would like to select on Material type e.g. ROH. The result should for example be a list of the movement types 501 on material type ROH.
It is urgent, if you could help me I would be very greatful!
Sincerely
Anders ÖhrlingThanks for your answer!
I have managed to join the two tables and created a report that will work, except that the amounts in local currency that is given by movement type 201 is not negative (as in MB51). I need all movement types that generate a debit must be shown as a negative value. Wo when I summarize all the movement types I end up with the value of 101 minus 201.
Is that possible without ABAP programming?
Sincerely Anders Öhrling -
Sales Report Material Group-wise
I want to generate Sales Report Material Group-wise is there any standard report.
regards,
RajeshHi
Use the T.code: MCBK, this report tells you about Total stock received, total stock issue for sales order against the material group.
Reward if it helps
Regards
Prasanna R -
Excess Material Consumption Report - For a Particular Period
Hi,
For a particular Time Period, say 30 days, I require excess material consumption report. This report is for the materials ( say ROH, or HALB) that are confirmed through co11n. Taking MTS into consideration with Strategy Group 40, please suggest a standard report (if there is any).
Regards,
PavanThe T code for viewing the standard report for
Material Analysis - MCP5.
Production Order - MCP3.
Material Usage Analysis - MCRE.
Please try it.
Regards
R.Brahmankar -
All SAP Gurus,
Is there any Purchasing report available which gives the information regarding:
Plant, Purchasing group, material type, PO, GR No., vendor, amount (all in single report only).
Regards,Hi,
Refer following reports;
ME2N - List of PO Documents (In selection Screen use Scope of List - ALLES)
ME80FN - General Analysis (Here in Output, select option "PO History" by clicking on the button at extreme right) -
Material type Wise Opening /Closing
How Can I get a report of Material Type Opening/Closing Balance?
Hi Biswajit
R u not getting the desired result using MC.9.
and as for MB5B only option i can see is first we get a list of material for a material type from MARA, then select those material and enter into MB5B report.
regards
Yogesh
Maybe you are looking for
-
A lot of threads getting created on weblogic 10.3.2
Hi here is the thread dump. can you help me in solving this Full thread dump Java HotSpot(TM) Server VM (14.0-b16 mixed mode): "scheduledJobsListenerContainer-55" prio=6 tid=0x4e7aac00 nid=0x2fac waiting on condition [0x51aaf000] java.lang.Thread.Sta
-
Did you try the plugin ARC for Room auto correction ?
Hello everybody, i know it might off topic, but i would like to know if some of you out there use the ARC Room Correction plugin from IK Multimedia, and how is reliable ? I am asking cause i always wonder about my mixes, to people they sound great to
-
Problem downloading adobe flasher
I need help trying to install adobe flasher for my videos and pictures please email me to [removed]
-
How does one do a mass delete of recently backed up files?
-
I have a number of buttons in a tutorial that need to open specific urls when clicked. I've set them to open in new tabs as per other comments on this issue I've seen elsewhere but the links still do not open. The tutorial is saved on a web server. P