Report for stock value at Warehouselevel
Hi
I need to generate a report of stock value at the warehouse level.
please let me know the tables to be linked to get the report.
Thanks
Hi Nainar,
You can use MB52 and if you get the list you can use 'sum' icon to get the total value (on the selection screen you can set wether SAP should display values or not).
You can also use MB5L, MC.A transactions. If you want to check the stock only for one material you can check it in material master record on Accounting1.
BR
Csaba
Similar Messages
-
Report for Stock Value Balances for previous periods
Hi, I would like to fing a standard report on SAP to provide the monthly stock balances per period the same way as MB5L, but with the functionality to inform the year
Hi
Try using report FS10N for all the balnces period wise for a specific year, you need to mention the G/L accounts from MB5L report.
Thanks & Regards
Kishore -
Reg : Z report for Stock on given date
Dear ABAP Guru's,
Iam in need of urgent report inorder to find Stock on given(particular) single date but not SAP standard report.That Stock Value should match the MC.9 value.Pls help meHi,
This code may help you.
*& Report ZDH_ITC_STOREP
REPORT ZDH_ITC_STOREP.
TABLES: T001L.
type-pools slis.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: GT_HEADER TYPE SLIS_T_LISTHEADER.
DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT.
TYPES: BEGIN OF TY_FINAL,
MATNR TYPE MCHB-MATNR,
MATDES TYPE MAKT-MAKTX,
BATNO TYPE MCHB-CHARG,
UMIL TYPE MCHB-CLABS,
UCFC TYPE MCHB-CLABS,
BMIL TYPE MCHB-CSPEM,
BCFC TYPE MCHB-CLABS,
TMIL TYPE MCHB-CLABS,
TCFC TYPE MCHB-CLABS,
END OF TY_FINAL.
TYPES: BEGIN OF TY_MCHB,
MATNR TYPE MCHB-MATNR, " Material Number
CHARG TYPE MCHB-CHARG, " Batch Number
CLABS TYPE MCHB-CLABS, " Valuated Unrestricted-Use Stock
CSPEM TYPE MCHB-CSPEM, " Blocked Stock
UCFC TYPE MCHB-CLABS,
bcfc TYPE MCHB-CLABS,
END OF TY_MCHB.
*TYPES: BEGIN OF TY_MARA,
* MATNR TYPE MARA-MATNR,
* END OF TY_MARA.
TYPES: BEGIN OF TY_MAKT,
MATNR TYPE MAKT-MATNR, " Material Number
MAKTX TYPE MAKT-MAKTX, " MATERIAL DESCRIPTION
END OF TY_MAKT.
TYPES:BEGIN OF TY_MARM,
MATNR TYPE MARM-MATNR, "MATERIAL NUMBER
UMREN TYPE MARM-UMREN, "Denominator for conversion to base units of measure
UMREZ TYPE MARM-UMREZ, "Numerator for Conversion to Base Units of Measure
END OF TY_MARM.
DATA: IT_FINAL TYPE STANDARD TABLE OF TY_FINAL,
WA_FINAL TYPE TY_FINAL.
DATA: IT_MCHB TYPE STANDARD TABLE OF TY_MCHB,
WA_MCHB TYPE TY_MCHB.
*DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA,
* WA_MARA TYPE TY_MARA.
DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
WA_MAKT TYPE TY_MAKT.
DATA: IT_MARM TYPE STANDARD TABLE OF TY_MARM,
WA_MARM TYPE TY_MARM.
data: atot, btot type MCHB-CLABS.
PARAMETERS: PA_FACT TYPE T001W-WERKS OBLIGATORY, "FACTORY
PA_DATE TYPE SY-DATUM OBLIGATORY. "DATE
SELECT-OPTIONS: SO_STLO FOR T001L-LGORT OBLIGATORY. " STORAGE LOCATION
* GETTING THE MATERIALS
SELECT MATNR CHARG CLABS CSPEM
FROM MCHB
INTO TABLE IT_MCHB
WHERE WERKS = PA_FACT
AND LGORT IN SO_STLO.
* GETTING THE BRAND DESCRIPTION FROM THE ABOVE SELECTED MATERIAL
SELECT MATNR MAKTX
FROM MAKT
INTO TABLE IT_MAKT
FOR ALL ENTRIES IN IT_MCHB
WHERE MATNR = IT_MCHB-MATNR
AND SPRAS = 'EN'.
* GETTING THE BATCH CODE FOR THE ABOVE MATERIAL AND BRAND
SELECT MATNR UMREN UMREZ
FROM MARM
INTO TABLE IT_MARM
FOR ALL ENTRIES IN IT_MCHB
WHERE MATNR = IT_MCHB-MATNR.
* CALCULATING THE TOTALS OF BLOCKED AND UNRESTRICTED QTY
LOOP AT IT_MCHB INTO WA_MCHB.
READ TABLE IT_MARM INTO WA_MARM WITH KEY MATNR = WA_MCHB-MATNR.
WA_MCHB-ucfc = ( ( WA_MARM-UMREN / WA_MARM-umrez ) * wa_mchb-clabs ).
WA_MCHB-bcfc = ( ( wa_marm-umren / wa_marm-umrez ) * wa_mchb-cspem ).
* WA_MCHB-ucfc = atot.
* WA_MCHB-bcfc = btot.
modify IT_MCHB from WA_MCHB TRANSPORTING ucfc bcfc WHERE MATNR = WA_MCHB-MATNR.
READ TABLE it_makt into wa_makt with key MATNR = WA_MCHB-matnr.
WA_FINAL-matnr = WA_MCHB-MATNR.
WA_FINAL-MATDES = wa_makt-maktx.
WA_FINAL-BATNO = wa_mchb-CHARG.
WA_FINAL-UMIL = wa_MCHB-CLABS.
wa_final-UCFC = WA_MCHB-ucfc.
wa_final-bcfc = WA_MCHB-bcfc.
wa_final-bmil = WA_MCHB-CSPEM.
WA_FINAL-tmil = WA_MCHB-clabs + WA_MCHB-CSPEM.
WA_FINAL-tcfc = WA_MCHB-ucfc + WA_MCHB-bcfc.
append wa_final to IT_FINAL.
ENDLOOP.
perform buildheader USING GT_HEADER[].
PERFORM FIELDCATINIT USING GT_FIELDCAT[].
perform alvdisplay.
PERFORM build_layout USING GS_LAYOUT.
*& Form buildheader
* text
* --> p1 text
* <-- p2 text
FORM buildheader USING RT_HEADER TYPE SLIS_T_LISTHEADER..
DATA: TP TYPE SLIS_LISTHEADER.
DATA: TEXT(20) TYPE C,
DT TYPE SY-DATUM.
TP-TYP = 'H'.
TP-INFO = 'STOCK REPORT '.
APPEND TP TO RT_HEADER.
CLEAR TP.
WRITE SY-DATUM TO DT DD/MM/YYYY.
CONCATENATE 'DATE :' DT INTO TEXT.
TP-TYP = 'S'.
TP-INFO = TEXT.
APPEND TP TO RT_HEADER.
CLEAR TP.
ENDFORM. " buildheader
*& Form alvdisplay
* text
* --> p1 text
* <-- p2 text
FORM alvdisplay .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZDH_ITC_STOREP'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alvdisplay
*& Form FIELDCATINIT
* text
* --> p1 text
* <-- p2 text
FORM FIELDCATINIT USING FINIT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
LS_FIELDCAT-KEY = 'X'.
LS_FIELDCAT-JUST = 'L'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MATDES'.
LS_FIELDCAT-SELTEXT_L = 'BRAND'.
LS_FIELDCAT-KEY = 'X'.
LS_FIELDCAT-JUST = 'L'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BATNO'.
LS_FIELDCAT-SELTEXT_L = 'BATCH NO'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'UMIL'.
LS_FIELDCAT-SELTEXT_L = 'RESTRICTED'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'UCFC'.
LS_FIELDCAT-SELTEXT_L = 'UCFC'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BMIL'.
LS_FIELDCAT-SELTEXT_L = 'BLOCKED'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BCFC'.
LS_FIELDCAT-SELTEXT_L = 'BCFC'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'TMIL'.
LS_FIELDCAT-SELTEXT_L = 'TOTAL MIL'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'TCFC'.
LS_FIELDCAT-SELTEXT_L = 'TCFC'.
APPEND LS_FIELDCAT TO FINIT.
CLEAR LS_FIELDCAT.
ENDFORM. " FIELDCATINIT
*& Form BUILDLAYOUT
* text
* -->P_GS_LAYOUT[] text
FORM BUILD_LAYOUT USING RS_LAYOUT TYPE SLIS_LAYOUT_ALV.
RS_LAYOUT-NO_INPUT = 'X'.
RS_LAYOUT-ZEBRA = 'X'.
RS_LAYOUT-COLWIDTH_OPTIMIZE = ' '.
RS_LAYOUT-NO_COLHEAD = ' '.
RS_LAYOUT-NO_VLINE = ' '.
RS_LAYOUT-INFO_FIELDNAME = 'WS_COLOR'.
ENDFORM.
" BUILDLAYOUT
HTH
Regards,
Dhruv Shah -
Report for stock in transit datewise
I need stock in transit datewise. Is there any report possible for that ? Which table and fields should I refer. please revert.
Regs,
AppieHi,
T.Code: MB5T can be used for Report for stock in transit, but date wise u can't get here. U have to develop areport or by querry u can develop a report.
U can get date (MKPF-BUDAT) wise details by giving movement type in MSEG table u get all the details in the tables.
Regards,
Chinna -
PR and PO should be display in IWBK report for stock item.
Hi Exterts,
Our client requirement is to display PR and PO number in IWBK report for stock item as well.
I know PR and PO can be display in IWBK report for non-stock item but how we can display PR and PO for stock item,as PR is generated through MRP for stock item.
Please share your ideas on this.
Regards
VishuVishu,
In typical MRP settings you "procure to stock" not "procure to order".
This means that there is no direct link between the PM/CS orders and any PR/POs created via MRP.
Subsequently you will not be able to show this data in IWBK.
However, we are currently designing a customer-specific report similar to IWBK that also counts the number of open POs for a given material on a PM/CS work order. The user can then navigate to ME2M (PO list) or MD04 (stock requirements list) to get further details.
PeteA -
MULTI LEVEL REPORT FOR STOCK TRANSPORT PURCHASE ORDER
Hi,
I will have lot of stock transport purchase orders,like md4c transaction where we get multilevel report for sale order/production order,is there any report for stock transport purchase orders.its urgent kindly helpgoto purchase order history tab
you can see all the details of PO-deluvery-GI, GR, imvoice. Click on delivery, you can see the billing document throughdocument flow button.
This function is not availilable for production order, hence we have MD4c. -
Report for stock transfer from plant to plant
Hi,
Is there any standard report for stock transfer from plant to plant .
If not is there any enhancements to get the above report.
Regards,
Ravindranath.Hi Ravi,
U can use the tcode MB51 and their u can give the input as 301 if it is 1 step in the mvt type or use 303 and 305 for 2 step transfer. and generate the report.
if u want the list of stock transport orders then use tcode ME2N and the input parameter as item category "U" and generate the report.
hope it wud have answered ur question
Reward if useful
Shawn -
Need to run the report for All Values when Null is passed in parameter
Hi All,
In my BIP report, I am using a parameter :asset with Type as Text, which means user will type the values for the parameter in the text box.
Now, this parameter can take multiple comma separated values. I have a requirement to run the report for All Values when user doesn't enter any value in the parameter text box and if user enters any value(s) then the report will run for those values . The way, I tried to handle that in the query using couple of ways was :
IMP : My Database is SQL Server
where
(table.asset = isnull((:asset), table.asset) or table.asset in (:asset))
Now this works fine when I give a single asset number but when I give multiple values separated by comma like 123, 345 in the text box, then the statement fails saying 'encountered ,'
I also tried simply
table.asset in isnull((:asset),table.asset) -- but this doesn't work as it doesn't allow me to use in operater while using isnull and if i will use = operater then it won't work in case of multiple values
Any suggestions on how can I handle this? Any help would be highly appreciated.
Thanks,
Ronnythanks for replying, but i tried this option too, it did not work for me, neither isnull nor coalesce. I mean, the solution work for single value but when i pass multiple values then separated by a comma then it doesn't work and shows me an error like "Incorrect Syntax ','". I am using SQL server as DB and bip is 10.1.3.4.1
also please share the SR number, so i can also check the same.
can there be any other work around to this?
thanks,
ronny -
Hi ,
Based on this link i have implemented this logic....
http://bischool.wordpress.com/2009/08/26/avoid-running-report-for-all-values-on-dashboard-when-using-multi-select-prompt/
But for the intermediate report its taking more time to run...nearly 4min...is there any way to reduce it.
Thankshi User,
Quick question
Why you are giving (-1) value's as per the doc we can give any value which has to give no results? Have u tried to give some other value ?
Next,Do u have left outer joins between those tables? If yes you should face the same problem with the main report because the filters to be same as intermediate report am i right ?
First tune-up the rpd and get the main report query ,run-it over DB
Due to huge data and the join taking more time....is there way any thing to add to reduce the time??Huge data ?? Intermediate report will not get any results i think it will not take more time to give a message,but due to join conditions only it is taking long time to run
Note :Before getting value from DB it will check the where condition( joins)
Thanks,
Saichand Varanasi -
How to remove asterix symbol which appears in report for empty values?
Hi Experts,
I have designed a querry wherein I am getting all the values correctly. But, for certain cells - I am getting the asterix symbol which the user does not wants.
Now, how to remove the asterix symbol which appears in report for empty values?
Thanking you in advance,
Waiting for your reply,
With Kind Regards,
Shreeem.check if following thread helps you;
# in report when null in the cube
Regards,
Gaurav -
hi guy's,
i am doing report for the stock statement .... my issue is in MB5B if i reverse some document it shows as it move's to issue QTY and my receipt is same but my closing stock is correct ...is there any std report avalible ....
thank's in advanceUse this code :
TABLES : MSEG,MKPF,MARA,MAKT,BEWART,MSLB,BSIM.
TYPE-POOLS : SLIS.
DATA : IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_LIST_HEADER TYPE SLIS_T_LISTHEADER,
IT_EVENTS TYPE SLIS_T_EVENT,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV,
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
REPID LIKE SY-REPID,
FRM_DATE(10),TO_DATE(10),
DISPTEXT(255),DISPTEXT2(255).
TYPES : BEGIN OF ST_OPBAL,
MATNR LIKE MSEG-MATNR,
MAKTX LIKE MAKT-MAKTX,
BATCH LIKE MSEG-CHARG,
BWART LIKE MSEG-BWART,
MENGE LIKE MSEG-MENGE,
ZEILE LIKE MSEG-ZEILE,
WERKS LIKE MSEG-WERKS,
SOBKZ LIKE MSEG-SOBKZ,
BUDAT LIKE MKPF-BUDAT,
SHKZG LIKE MSEG-SHKZG,
DMBTR LIKE MSEG-DMBTR,
MBLNR LIKE MSEG-MBLNR,
LGORT LIKE MSEG-LGORT,
END OF ST_OPBAL.
DATA : OPBAL TYPE ST_OPBAL OCCURS 0 WITH HEADER LINE,
TMP_OPBAL TYPE ST_OPBAL OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF BAL_NOREF OCCURS 0,
MATNR LIKE MARA-MATNR,
SHKZG LIKE MSEG-SHKZG,
DMBTR LIKE MSEG-DMBTR,
END OF BAL_NOREF.
DATA : BEGIN OF OPBAL2 OCCURS 0,
SNO(3) TYPE N,
MATNR LIKE MSEG-MATNR,
MAKTX LIKE MAKT-MAKTX,
OP_BAL LIKE MSEG-MENGE,
OP_STKVAL LIKE MSEG-DMBTR, "NEW
REC LIKE MSEG-MENGE,
T_OPBAL_REC LIKE MSEG-MENGE,
REC_STKVAL LIKE MSEG-DMBTR, "NEW
ISS LIKE MSEG-MENGE,
ISS_STKVAL LIKE MSEG-DMBTR, "NEW
SALES LIKE MSEG-MENGE,
T_ISS LIKE MSEG-MENGE,
CL_BAL LIKE MSEG-MENGE,
BATCH LIKE MSEG-CHARG,
SUBCON LIKE MSEG-MENGE,
CL_STKVAL LIKE MSEG-DMBTR,
END OF OPBAL2.
DATA SERNO(4) TYPE C.
DATA OPTOT TYPE P DECIMALS 3.
DATA RECTOT TYPE P DECIMALS 3.
DATA ISSTOT TYPE P DECIMALS 3.
DATA TOTALL TYPE P DECIMALS 3.
DATA FLG TYPE N.
DATA FLAG TYPE N.
DATA STOCKVAL TYPE MSEG-DMBTR.
DATA REC_STOCKVAL TYPE MSEG-DMBTR.
DATA ISS_STOCKVAL TYPE MSEG-DMBTR.
DATA CL_STKVAL TYPE MSEG-DMBTR.
SELECTION-SCREEN BEGIN OF BLOCK X WITH FRAME.
SELECT-OPTIONS: P_MATNR FOR MSEG-MATNR,
P_MGRP FOR MARA-MATKL,
P_DATE FOR MKPF-BUDAT,
P_PLANT FOR MSEG-WERKS DEFAULT 'NB01' OBLIGATORY NO INTERVALS
NO-EXTENSION .
SELECT-OPTIONS: P_STLOC FOR MSEG-LGORT NO INTERVALS NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK X.
INITIALIZATION.
REPID = SY-REPID.
PERFORM FILL_FLDCAT USING IT_FLDCAT.
PERFORM FILL_EVENTS USING IT_EVENTS.
PERFORM FILL_LAYOUT USING GS_LAYOUT.
START-OF-SELECTION.
CONCATENATE P_DATE-LOW6(2) '.' P_DATE-LOW4(2) '.' P_DATE-LOW+0(4)
INTO FRM_DATE.
CONCATENATE P_DATE-HIGH6(2) '.' P_DATE-HIGH4(2) '.' P_DATE-HIGH+0(4)
INTO TO_DATE.
CONCATENATE TEXT-003 FRM_DATE' TO : ' TO_DATE INTO DISPTEXT.
CONCATENATE TEXT-004 P_PLANT-LOW ' Storage Location : ' P_STLOC-LOW
INTO DISPTEXT2.
PERFORM FILL_HEADER USING IT_LIST_HEADER.
SELECT A~MATNR
F~MAKTX
A~CHARG
A~BWART
A~MENGE
A~ZEILE
A~WERKS
A~SOBKZ
D~BUDAT
A~SHKZG
A~DMBTR
A~MBLNR
A~LGORT
INTO TABLE OPBAL
FROM MKPF AS D JOIN MSEG AS A
ON DMBLNR = AMBLNR AND
DMJAHR = AMJAHR
JOIN MARA AS E
ON EMATNR = AMATNR
JOIN MAKT AS F
ON FMATNR = AMATNR
WHERE A~MATNR IN P_MATNR
AND A~WERKS IN P_PLANT
AND A~KZBEW IN (' ','B')
AND E~MATKL IN P_MGRP
AND A~BWART NOT IN ('541','542','321','322','121')
AND A~KZVBR NOT IN ('A')
AND D~BUDAT LE P_DATE-HIGH.
LOOP AT OPBAL WHERE BWART EQ '544' AND LGORT EQ ''.
TMP_OPBAL = OPBAL.
APPEND TMP_OPBAL.
ENDLOOP.
DELETE OPBAL WHERE ( BWART EQ '309' AND DMBTR EQ 0 ).
DELETE OPBAL WHERE ( BWART NE '543' AND LGORT EQ '' ).
LOOP AT TMP_OPBAL.
OPBAL = TMP_OPBAL.
APPEND OPBAL.
ENDLOOP.
STOCKVAL = 0.
SORT OPBAL BY MATNR BATCH BUDAT.
LOOP AT OPBAL.
SELECT SINGLE LBLAB INTO MSLB-LBLAB FROM MSLB
WHERE MATNR = OPBAL-MATNR.
IF OPBAL-BUDAT LT P_DATE-LOW.
IF OPBAL-SHKZG = 'H'.
OPTOT = OPTOT - OPBAL-MENGE.
ELSEIF OPBAL-SHKZG = 'S'.
OPTOT = OPTOT + OPBAL-MENGE.
ENDIF.
For the duration II part *****************
ELSEIF OPBAL-BUDAT IN P_DATE.
IF OPBAL-SHKZG = 'H'.
ISSTOT = ISSTOT + OPBAL-MENGE.
ELSEIF OPBAL-SHKZG = 'S'.
RECTOT = RECTOT + OPBAL-MENGE.
ENDIF.
ENDIF.
AT END OF BATCH. " modified for chek
READ TABLE OPBAL INDEX SY-TABIX.
CLEAR BAL_NOREF. REFRESH BAL_NOREF.
SELECT MATNR SHKZG SUM( DMBTR )
INTO TABLE BAL_NOREF
FROM BSIM
WHERE BUDAT LT P_DATE-LOW AND
MATNR EQ OPBAL-MATNR AND
BWTAR EQ OPBAL-BATCH AND
BWKEY IN P_PLANT AND
BLART IN ('RE','WE','WA','PR')
GROUP BY MATNR SHKZG.
LOOP AT BAL_NOREF.
IF BAL_NOREF-SHKZG = 'H'.
STOCKVAL = STOCKVAL - BAL_NOREF-DMBTR.
ELSE.
STOCKVAL = STOCKVAL + BAL_NOREF-DMBTR.
ENDIF.
ENDLOOP.
CLEAR BAL_NOREF. REFRESH BAL_NOREF.
SELECT MATNR SHKZG SUM( DMBTR )
INTO TABLE BAL_NOREF
FROM BSIM
WHERE BUDAT IN P_DATE AND
MATNR EQ OPBAL-MATNR AND
BWTAR EQ OPBAL-BATCH AND
BWKEY IN P_PLANT AND
BLART IN ('RE','WE','WA','PR')
GROUP BY MATNR SHKZG.
LOOP AT BAL_NOREF.
IF BAL_NOREF-SHKZG = 'H'.
ISS_STOCKVAL = ISS_STOCKVAL + BAL_NOREF-DMBTR.
ELSE.
REC_STOCKVAL = REC_STOCKVAL + BAL_NOREF-DMBTR.
ENDIF.
ENDLOOP.
" MSLB-LBLAB (STOCK WITH SUBCONTRACTOR).
CL_STKVAL = STOCKVAL + REC_STOCKVAL - ISS_STOCKVAL.
TOTALL = OPTOT + RECTOT - ISSTOT.
IF OPTOT = '0' AND RECTOT = '0' AND ISSTOT = '0'.
FLG = 1.
ENDIF.
IF FLG = 1.
CLEAR FLG.
ELSE.
SERNO = SERNO + 1.
OPBAL2-SNO = SERNO.
OPBAL2-MATNR = OPBAL-MATNR.
OPBAL2-MAKTX = OPBAL-MAKTX.
OPBAL2-OP_BAL = OPTOT.
OPBAL2-REC = RECTOT.
OPBAL2-T_OPBAL_REC = OPTOT + RECTOT.
OPBAL2-ISS = ISSTOT.
OPBAL2-T_ISS = ISSTOT.
OPBAL2-CL_BAL = TOTALL.
OPBAL2-BATCH = OPBAL-BATCH.
OPBAL2-SUBCON = MSLB-LBLAB.
OPBAL2-OP_STKVAL = STOCKVAL.
OPBAL2-ISS_STKVAL = ISS_STOCKVAL.
OPBAL2-REC_STKVAL = REC_STOCKVAL.
OPBAL2-CL_STKVAL = CL_STKVAL.
APPEND OPBAL2.
ENDIF.
OPTOT = 0.
RECTOT = 0.
ISSTOT = 0.
STOCKVAL = 0.
ISS_STOCKVAL = 0.
REC_STOCKVAL = 0.
CL_STKVAL = 0.
ENDAT.
ENDLOOP.
WA_SORT-SPOS = 1.
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = IT_FLDCAT
IT_EVENTS = IT_EVENTS
IS_LAYOUT = GS_LAYOUT
IT_SORT = IT_SORT
TABLES
T_OUTTAB = OPBAL2.
FORM FILL_FLDCAT USING P_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
PERFORM FILL_PARAM_FLDCAT USING 1 'SNo' 'SNO' ' ' 'X'
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 2 'Material No.' 'MATNR' ' ' 'X'
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 3 'Description' 'MAKTX' ' ' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 4 'Op.Bal' 'OP_BAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 5 'Op.Stock Val' 'OP_STKVAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 6 'Receipts' 'REC' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 7 'Total' 'T_OPBAL_REC' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 8 'Rect.Val.' 'REC_STKVAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 9 'Issues' 'ISS' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 10 'Iss. Val.' 'ISS_STKVAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 11 'Cl. Bal.' 'CL_BAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 12 'Cl.Stock Val' 'CL_STKVAL' 'X' ' '
'OPBAL2' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 13 'BATCH ' 'BATCH' ' ' ' '
'OPBAL2' P_FLDCAT.
ENDFORM.
FORM FILL_PARAM_FLDCAT USING VALUE(P_COL) VALUE(P_TEXT) VALUE(P_FLDNAME)
VALUE(P_DOSUM) VALUE(P_NOZERO) VALUE(P_TABNAME)
PP_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : WA_FLDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR WA_FLDCAT.
WA_FLDCAT-COL_POS = P_COL.
WA_FLDCAT-SELTEXT_M = P_TEXT.
WA_FLDCAT-FIELDNAME = P_FLDNAME.
WA_FLDCAT-TABNAME = P_TABNAME.
WA_FLDCAT-DO_SUM = P_DOSUM.
WA_FLDCAT-NO_ZERO = P_NOZERO.
APPEND WA_FLDCAT TO PP_FLDCAT.
ENDFORM.
FORM FILL_HEADER USING P_IT_LIST_HEADER TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-INFO = TEXT-002.
APPEND LS_LINE TO P_IT_LIST_HEADER.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-INFO = DISPTEXT.
APPEND LS_LINE TO P_IT_LIST_HEADER.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
LS_LINE-INFO = DISPTEXT2.
APPEND LS_LINE TO P_IT_LIST_HEADER.
ENDFORM.
FORM FILL_EVENTS USING P_IT_EVENTS TYPE SLIS_T_EVENT.
DATA LS_EVENT TYPE SLIS_ALV_EVENT.
MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
MOVE 'TOP_OF_PAGE' TO LS_EVENT-NAME.
APPEND LS_EVENT TO P_IT_EVENTS.
ENDFORM.
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LIST_HEADER.
ENDFORM.
FORM FILL_LAYOUT USING P_GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
P_GS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
P_GS_LAYOUT-ZEBRA = 'X'.
P_GS_LAYOUT-FLEXIBLE_KEY = 'X'.
ENDFORM.
FOR TESTING PURPOSE.
*SORT OPBAL BY BUDAT.
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = IT_FLDCAT
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = OPBAL.
*FORM FILL_FLDCAT USING P_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.
PERFORM FILL_PARAM_FLDCAT USING 1 'MBLNR' 'MBLNR'
'OPBAL' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 2 'CREDIT/DEBIT' 'SHKZG'
'OPBAL' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 3 'MOV.TYP.' 'BWART'
'OPBAL' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 4 'ST.LOC.' 'LGORT'
'OPBAL' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 5 'STOCK VAL' 'DMBTR'
'OPBAL' P_FLDCAT.
PERFORM FILL_PARAM_FLDCAT USING 6 'POS.DATE' 'BUDAT'
'OPBAL' P_FLDCAT.
*ENDFORM. -
Standard Report for stock Aging
Hello all,
can anyone plz let us know that is there any standard report in SAP for stock aging? actually i have to see the materials quantity whose 311 movement not done after 321 and also from how many days it is pending.
Kindly help and tell how can i find those materials quantity, while user also do 311 for partial quantity?
Regards.Hi @ABAP@
Check the followings...
MB24 - Reservations for Material
MB25 - Reservations for Account Assignment
MB51 - Material Document List
MB52 - List of Warehouse Stocks on Hand MB53 - Display Plant Stock Availability
MB54 - Consignment Stocks
MB56 - Analyze Batch Where-Used List
MB57 - Build Up Batch Where-Used List
MB58 - Consgmt and Ret. Packag. at Customer
MB59 - Material Document List
MB5B - Stocks for Posting Date
MB5C - Pick-Up List
MB5L - List of Stock Values: Balances
MB5M - ShL.exp/prod.date
MB5S - Display List of GR/IR Balances
MB5W - List of Stock Values
MB9A - Analyze Archived Material Documents
MBAL - Material Documents: Read Archive
MBGR - Display Material Documents by Movement Reason
MBSI - Find Inventory Sampling
MBSM - Display Cancelled Material Documents
MMBE - Stock Overview
MD07 - Current Material Overview
MR51 - Material Line Items
MRKO - Settle Consignment/Pipeline Liabilities
MB5T - Stock in transit CC -
Inventory report for stock category B
Hi everyone,
We are trying to generate a customer stock inventory report with stock category B. The table MARD is not displaying any values annwe also looked at table MKOL. Its not giving us any. How do i get the inventory report for this stock type B. Kindly Advise.it is customer owned stock. We receiver materials from customer for repair and we recondition them and we give it back. for this we maintain it in stock type B. it is specifically used in aerospace industries. We want to make an inventory report for this customer owned stock in our inventory . i am unable to get the table. Kindly advise
-
Asset Initial Upload & reporting for uploaded value
Hi SAP Gurus,
I have uploaded the asset data using AS91 and also updated the GL values in OASV.
The initial upload seems to be all correct in this manner since TB is tallying.
However when i view the FA reports for the date of upload i am finding discrepancies in the Accumulated Depreciation values as shown in the report & the values uplaoded in AS91.
Let me explain further, say for eg. the Cost of the asset was Rs. 10,000/- and Accumulated Depreciation as per legacy (as on date of upload) is Rs. 1858/-. However the actual Accumulated Depreciation should have been Rs. 1863 --- the diffference in legacy data was due to runding offs in previous months.
Now when i uploaded the intial data i used the legacy figures i.e. Rs. 10,000 & Rs. 1858 since trial balance had to be tallied.
However when i run reports in FA for the initial upload date, i find that the reports are showing the Acc. Depn (plan values) as Rs. 1863 & not the value that i have uploaded.
What possibly is the reason for this ?
Can anyone tell me any report to view only the uploaded information ?
Points will be awarded for useful answers.
Thanks & Regards
Piyush KothariHi,
There is an error appearing as below:
"Report date 31.08.2007 is invalid for this report.
Reports of this kind can only be run for the last day of the period in which the last depreciation posting run took place (or in a subsequent period) in the relevant fiscal year.
It is not possible to run a report on posted depreciation in a fiscal year in which no depreciation posting run has yet taken place."
My legacy upload date was 31.08.2007.
When i run for 31.12.2007 (last period in the fiscal year for which dep. run has taken place) then the results are ok.
But still i would like to assign some points to you since this would have helped indeed.
Thanks
Piyush Kothari -
SAP Standard Report for Stock Balances
Hi All,
Do we have a standard SAP report that gives the output in this format (or something close to this)
Date Stock Plant 1 Plant 2
Material 1 Material 2 Material 3 Material 1 Material 2 Material 3
1/1/2008 Opening Stock
GR
GI
Closing Stock
1/2/2008 Opening Stock
GR
GI
Closing Stock
1/3/2008 Opening Stock
GR
GI
Closing Stock
Regards
TomHi Jack,
As per your report requirement, there is no standard transaction available in SAP.
You have develop Z- Report for your requirement.
But keeping in mind the follwoing constarints
1) If it is a huge number of materials, Then the report will hours together. It may be lead to performance issue of the System. Because it has to get huge data from different tables as per you logic.
2) The report is not suitable for print. Because it will run pages together.Since you are including Opening balance, GR details, GI details and Closing balance for each materail.
Thanks & Best Regards
Girisha M S
Maybe you are looking for
-
Rating Widget - Update afterRating following rateHandler
In the rating widget I am implementing, I want to fade the stars out onclick, then fade them back in with the updated "average" value showing. I am using the rateHandler to call my fade function, and then the fade function calls another fade to handl
-
How to prevent changing DNS server address
I work for a public school district. We just purchased our first batch of Win 8.1 PCs, but they are not the Pro version, so there is no gpedit. I want to prevent students from accessing the TCP/IPv4 Properties dialog box in order to ensure that the
-
NOKIA N79 CANT BACKUP CONTACT DATA TO MEMORY CARD
hello, I am not able to backup the contact data of my nokia n79 to memory card. When performing the above function the progress bar progresses for sometime goes 50 % completed and then returns to the home screen. Tried formatting the phone/MC as well
-
Creating custom page size PDFs in Distiller 7
I've created a music document (in Finale) with pages that are 9x12. I have been trying to make high-resolution PDFs in Distiller (Acrobat Professional 7) for the printing company. The Distiller's page size is set to 9x12 and so is the Page Setup. But
-
Redirect URL rewriting in WLS8.1 and WLS9.2
Hi, I am looking for help to solve the redirect URL issue for the following configuration: A hardware load balancer sits between the web clients and a weblogic cluster (one managed server at this moment, will add more later). The web clients use HTTP