Item Stock Report
Hi
For Inventory Status/Inventory Stock report, system generates report Item Wise/ Warehouse Wise/Item Group Wise.
Customer generates Manual Report for inventory stock / Inventory Status for Item / Or Item Group logic mention below
Report From Date-xx/yy/zz to To Date xx/yy/zz
Item Description ItemOpening Balance ItemReceipts Item Consumption (Only Delivery Of Item as trading business) Item Closing Balance.
We want to generate Report in this way from System, how to generate this report is there any query based report available
or even if we need to designed report. Can i have logic to follow.
Hai satish tale
try this query, i included a purchase flow
SELECT T0.itemcode,min(T0.Dscription) as 'Item Description',
max(T1.InvntryUom) as UOM,W1.Whscode,W1.Location as 'Location Code',
C1.Location, (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (59,20,16,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (21,19,60,15,67,-2,13)),0) )as 'Opening Stock',
(isnull((Select sum(isnull(Transvalue,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (18,-2,67,59,20,16,14,15,13,21,19,60)),0)) as 'Opening Value',
(isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0)- isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0)) as 'OB Quantity',
isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0) as 'OB Value',
isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (20,18)),0) as 'Purchase Quantity',
isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>=0 and O1.transtype in (20,18,69)),0) as 'Purchase Rate',
isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>=0 and O1.transtype in (20,18,69)),0) as 'Purchase Value',
isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Quantity', isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Rate', isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Value', isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>0 and O1.transtype in (13,15)),0) as 'sale Quatity', isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>=0 and O1.transtype in (13,15)),0) as 'sale Rate', isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>=0 and O1.transtype in (13,15)),0) as 'sale Value', (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (59,20,16,14,19,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (21,19,60,15,67,-2,13)),0) )as 'Closing Stock', isnull((select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (18,-2,67,59,20,16,14,15,13,21,19,60,69,162)),0) as 'Closing Value' FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode INNER JOIN OLCT C1 ON W1.Location=C1.Code where ((B1.ItmsGrpNam>='[%2]' and B1.ItmsGrpNam<='[%3]') or ('[%2]'='' and '[%3]'='')) and ((W1.Whscode>='[%4]' and W1.Whscode<='[%5]') or ('[%4]'='' and '[%5]'='')) and ((C1.Location>='[%6]' and C1.Location<='[%7]') or ('[%6]'='' and '[%7]'='')) and W1.Whscode<>'SelectWH' Group by T1.itemcode,T0.Itemcode,W1.WhsCode,W1.Location,C1.Location
Similar Messages
-
Hi All,
There is is requirement to determine the quantity of the stock items in a BOM. This is a functionality that is requested quite often, and I was looking if someone has implemented this.
ThanksCS15, is a "Where used" list. It provides a list of BOM, for which the "Material" is a BOM item.
What I am looking for is a material availability check (stock check) for all materials in a BOM.
Thanks -
Items with zero stock quantity show negative stock value in Stock reports
When running Stock reports for controlling the stock value towards the GL accounts, some items appear with zero stock quantity, but the report still shows a stock value (negative value in my case)
How can this happen, and how can I correct this situation ?
System parameters are : negative stock is not allowed, Items with zero cost price not allowed. On item level average cost price method is used.
P.K.JohnsenHi Johnsen,
I believe you have checked the" Manage Inventory by warehouse". I have noticed this issue in SAP B1 2005B but this is rectified in 2007B. The system behaves in this way as the system maintains item cost for the item for all warehouses and even if the stock is not present in the warehouse, the system would still show you a value for the same. Hope this helps. please search the forum. You'll find related threads.
Thanks,
Joseph -
Please help to get onhand stock report with last purchase and billed date warehouse and item wise
please help to get onhand stock report with last purchase and billed date warehouse and item wise
Hi Rajeesh Ambadi...
Try This
SELECT distinct T0.ITEMCODE , t1.ItemName, T0.ONHAND as 'Total Qty',
T1.LASTPURDAT ,t1.LastPurPrc
FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode
WHERE
T0.ONHAND>0
AND T0.WhsCode ='[%0]'
Hope Helpful
Regards
Kennedy -
Material Stock Report for tcode MB5B
Hello Expert
I have a SAP report for stock posting date with T-Code as MB5B and
the report name is RM07MLBD.
When I enter Material no, plant code , Movement type (101) and selection
dates for a month, The report is displaying but not break by Movement type instead it is showing all the movement type....?
Can anyone have idea about this
REPORT RM07MLBD NO STANDARD PAGE HEADING MESSAGE-ID M7 LINE-SIZE 95.
REPORT RM07MLBD (Transaktionscode MB5B) *
correction June 2004 MM "n747306
wrong the assignment of the MM and FI documents for data "n747306
constellation : n MM doc items --> 1 FI doc item "n747306
ABAP-Preprocessor removed "n599218 A
- this version is for release 4.6C and higher "n599218 A
- process database table OBEW always "n599218 A
- IS-OIL specific functions : "n599218 A
- define IS-OIL workings fields "n599218 A
- transport and process these fields only when "n599218 A
structure MSEG comprise these fields "n599218 A
Improvements : Dec. 2003 MM "n599218
- print the page numbers "n599218
"n599218
- send warnings and error messages only when report is "n599218
launched / advoid warnings when user changes entries on "n599218
the selection screen "n599218
- send warning M7 689 when user does not restrict the "n599218
database in dialog or print mode "n599218
- send warning M7 393 when user deletes the initial "n599218
display variant "n599218
"n599218
- allow to process the fields MAT_KDAUF, MAT_KDPOS, and "n599218
MAT_PSPNR from release 4.5B and higher "n599218
"n599218
- show the current activity and the progress "n599218
"n599218
- error message 'programmfehler' improved "n599218
"n599218
- new categories for scope of list "n599218
"n599218
- use function module for database commit for the update "n599218
of the parameters in table ESDUS. This allows to record "n599218
this transaction for a batch input session using "n599218
transaction SHDB "n599218
"n599218
- reset the entries for plant when valuation level is "n599218
is company code and mode is valuated stock "n599218
"n599218
- enable this report to run in the webreporting mode "n599218
Dec. 2002 MM "n571473
the definition of the selection screen moved from include "n571473
RM07MLBP into this report "n571473
Sept 2002 MM "n555246
log function tax auditor "n555246
note 547170 : August 2002 MM "n547170
- representation of tied empties improved "n547170
active this function automatically in retail systems "n547170
- FORM routines without preprocessor commands and without "n547170
text elements moved to the new include reports "n547170
RM07MLBD_FORM_01and RM07MLBD_FORM_02 "n547170
- the function module FI_CHECK_DATE of note 486477 will "n547170
be processed when it exists "n547170
- function and documentation of parameter XONUL improved "n547170
- display MM documents with MIGO or MB03 depending from "n547170
the release "n547170
- get and save the parameters per user in dialog mode "n547170
only in release >= 4.6 "n547170
the following items were improved with note 497992 "n497992
- wrong results when remaining BSIM entries contain "n497992
an other quantity unit as material master MEINS "n497992
- improve check FI summarization "n497992
- the messages M7 390, M7 391, and M7 392 "n497992
- definition of field g_f_repid for all releases "n497992
- incomplete key for access of internal table IT134M "n497992
causes wrong plant selection "n497992
- the function "no reversal movement" did not surpress "n497992
the original movements; fields "SJAHR" was moved from "n497992
from report RM07MLBD_CUST_FIELDS to RM07MLBD "n497992
- process valuated subcontractor stock from database "n497992
table OBEW if it exists "n497992
- if FI summarization is active process warning M7 390 "n497992
for stock type = valuated stock "n497992
- the user wants to restrict the movement type : process "n497992
warning M7 391 "n497992
- the user wants to surpress the reversal movements : "n497992
process warning M7 392 "n497992
- consider special gain/loss-handling of IS-OIL "n497992
- automatic insert of field WAERS currency key into the "n497992
field catalogue : "n497992
- at least one ref. field is active -> WAERS active "n497992
- all reference fields are hidden -> WAERS hidden "n497992
- the length of sum fields for values was increased "n497992
- customizing for the selection of remaining BSIM entries "n497992
- customizing for the processing of tied empties "n497992
separate time depending authorization for tax auditor "n486477
additional fields are displayed in wrong format "n480130
report RM07MLBD and its includes improved Nov 2001 "n451923
- merging FI doc number into table G_T_MSEG_LEAN improved "n451923
- handling of the short texts improved "n451923
- some types and data definitions -> include RM07MLDD "n451923
error for split valuation and valuated special stock "n450764
process 'goods receipt/issue slip' as hidden field "n450596
error at start date : material without stock has value "n443935
wrong results for docs with customer consignment "W" "n435403
error during data selection for plants "n433765
report RM07MLBD and its includes improved May 10th, 2001 "n400992
!!! IMPORTANT : DO NOT CHANGE OR DELETE THE COMMENT LINES !!! *
- consider the material number during looking for FI documents
- field "g_cust_color" in include report "RM07MLBD_CUST_FIELDS"
allows the customer to activate or inactivate the colors in the
lines with the documents.
- error during calcuation of start stock for special stock "M"
- valuted stocks required : no documents found ? continue and
process empty document table
- the length of sum fields for quantities has been increased
to advoid decimal overflow
- table ORGAN is replaced by G_T_ORGAN
- it is filled by the following ways :
- at process time at selection screen if the
user wants the selection via cc or plant
- otherwise after the database selection of the stock
tables
- it contains less data fields
- it contains all entries twice, for binary search
with plant or valuation area
- selection of databases MKPF and MSEG in one SELECT
command with an inner JOIN
- authority checks after the database selections
- result of database selection from the both database tables
MSEG and MKPF in working table G_F_MSEG_LEAN instead of
the tables IMSEG and IMKPF
- the number of processed data fields was reduced
- the user has the possibility to increase the number of
the processed fields deleting the '*' in the types-command
in include report RM07MLBD_CUST_FIELDS
- the creation of the field catalog for the ALV considers
only the fields of structure G_S_MSEG_LEAN
- the new table G_T_BELEG contains the results for the ALV.
the number of fields of table G_T_BELEG corresponds with
the number of fields of table G_T_MSEG_LEAN.
- the functions "define breakdown" and "choose" are inactivated
in the menue, because they are are not carried out correctly
in all blocks of the list
Anzeige der Materialbestände in einem Zeitintervall *
Der Report gliedert sich im wesentlichen in folgende Verarbeitungs- *
blöcke: *
1) Definition des Einstiegsbildes und Vorbelegung einzelner *
Selektionsfelder, sowie Prüfung der eingegebenen Selektions- *
parameter und Berechtigungsprüfung *
2) Lesen der aktuellen Bestandswerte *
3) Lesen und Verarbeiten der Materialbelege *
4) Berechnung der Bestandswerte zu den vorgegebenen Datümern *
5) Ausgabe der Bestände und Materialbelege *
*eject
*# APP_CALL_DECLARE TEST
this definitions depend on the release
TYPE-POOLS: IMREP, " Typen Bestandsführungsreporting
SLIS. " Typen Listviewer
for the selection of the reversal movements only in release >=45B
DATA: BEGIN OF STORNO OCCURS 0,
MBLNR LIKE MSEG-MBLNR,
MJAHR LIKE MSEG-MJAHR,
ZEILE LIKE MSEG-ZEILE,
SMBLN LIKE MSEG-SMBLN,
SJAHR LIKE MSEG-SJAHR,
SMBLP LIKE MSEG-SMBLP,
END OF STORNO.
include: rm07mldd, " reportspezifische Datendefinitionen
rm07grid. " Gitternetz, Formatierung, Farbgebung
INCLUDE RM07APP1. "ABAP-PREPROCESSOR "TEST
"n571473
define the selection screen here "n571473
"n571473
SELECTION-SCREEN BEGIN OF BLOCK Database-selection
WITH FRAME TITLE TEXT-001.
Text-001: Datenbankabgrenzungen
SELECT-OPTIONS: MATNR FOR MARD-MATNR MEMORY ID MAT
MATCHCODE OBJECT MAT1,
BUKRS FOR T001-BUKRS MEMORY ID BUK,
WERKS FOR T001W-WERKS MEMORY ID WRK,
LGORT FOR T001L-LGORT,
CHARG FOR MCHB-CHARG,
BWTAR FOR MBEW-BWTAR,
BWART FOR MSEG-BWART.
PARAMETERS SOBKZ LIKE MSEG-SOBKZ.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS: DATUM FOR MKPF-BUDAT NO-EXTENSION.
Datumsintervall für Selektion
SELECTION-SCREEN END OF BLOCK Database-selection.
SELECTION-SCREEN BEGIN OF BLOCK BESTANDSART
WITH FRAME TITLE TEXT-002.
Text-002: Bestandsart
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS LGBST LIKE AM07M-LGBST RADIOBUTTON GROUP BART DEFAULT 'X'.
SELECTION-SCREEN COMMENT 4(50) TEXT-010 FOR FIELD LGBST.
Text-010: Lagerort-/Chargenbestand
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS BWBST LIKE AM07M-BWBST RADIOBUTTON GROUP BART.
SELECTION-SCREEN COMMENT 4(50) TEXT-011 FOR FIELD BWBST.
Text-011: bewerteter Bestand
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS SBBST LIKE AM07M-SBBST RADIOBUTTON GROUP BART.
SELECTION-SCREEN COMMENT 4(50) TEXT-012 FOR FIELD SBBST.
Text-012: Sonderbestand
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BESTANDSART.
improved definition of parameters for scope of list "n599218
SELECTION-SCREEN BEGIN OF BLOCK listumfang
with frame title text-003. "Listumfang
the following 3 parameters became obsolete do not use "n599218
anymor. They are still here to inform the user about "n599218
that he is using old variants or SUBMIT commands "n599218
PARAMETERS : "n599218
XONUL LIKE AM07M-XONUL no-display, "n599218
XVBST LIKE AM07M-XVBST no-display, "n599218
XNVBST LIKE AM07M-XNVBS no-display. "n599218
7 new categories for the scope of list "n599218
"n599218
cat. I docs I stock on I I stock on I Parameter "n599218
I I start date I I end date I "n599218
---+--+--------++------+-------- "n599218
1 I yes I = zero I = I = zero I pa_wdzer "n599218
2 I yes I = zero I <> I <> zero I pa_wdzew "n599218
3 I yes I <> zero I <> I = zero I pa_wdwiz "n599218
4 I yes I <> zero I <> I <> zero I pa_wdwuw "n599218
5 I yes I <> zero I = I <> zero I pa_wdwew "n599218
I I I I I "n599218
6 I no I = zero I = I = zero I pa_ndzer "n599218
7 I no I <> zero I = I <> zero I pa_ndsto "n599218
"n599218
definition of the pushbutton : show or hide the following "n599218
parameters for the scope of list "n599218
SELECTION-SCREEN PUSHBUTTON /1(20) PB_LIU "n599218
USER-COMMAND LIU. "n599218
"n599218
text line : materials with movements "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN COMMENT 1(55) TEXT-072 "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
with movements / start = zero = end = zero "n599218
1 I yes I = zero I = I = zero I pa_wdzer "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_wdzer LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
text-083 : no opening stock ; no closing stock "n599218
SELECTION-SCREEN COMMENT 5(70) text-083 "n599218
FOR FIELD pa_wdzer "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
with movements / start = zero = end <> zero "n599218
2 I yes I = zero I <> I <> zero I pa_wdzew "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_wdzew LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
text-084 : no opening stock ; with closing stock "n599218
SELECTION-SCREEN COMMENT 5(70) text-084 "n599218
FOR FIELD pa_wdzew "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
with movements / start stock <> 0 / end stock = 0 "n599218
3 I yes I <> zero I <> I = zero I pa_wdwiz "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_wdwiz LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
text-085 : with opening stock ; no closing stock "n599218
SELECTION-SCREEN COMMENT 5(70) text-085 "n599218
FOR FIELD pa_wdwiz "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
with movements / with start and end stocks / different "n599218
4 I yes I <> zero I <> I <> zero I pa_wdwuw "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_wdwuw LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
with opening stock ; with closing stock ; changed "n599218
SELECTION-SCREEN COMMENT 5(70) text-086 "n599218
FOR FIELD pa_wdwuw "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
with movements / with start and end stock / equal "n599218
5 I yes I <> zero I = I <> zero I pa_wdwew "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_wdwew LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
with opening stock ; with closing stock ; non-changed "n599218
SELECTION-SCREEN COMMENT 5(70) text-087 "n599218
FOR FIELD pa_wdwew "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
text line : materials without movements "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN COMMENT 1(55) TEXT-073 "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
materials without movements / stocks = zero "n599218
6 I no I = zero I = I = zero I pa_ndzer "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_ndzer LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
text-083 : no opening stock ; no closing stock "n599218
SELECTION-SCREEN COMMENT 5(70) text-083 "n599218
FOR FIELD pa_ndzer "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
materials without movements / with start or end stock "n599218
7 I no I <> zero I = I <> zero I pa_ndsto "n599218
SELECTION-SCREEN BEGIN OF LINE. "n599218
SELECTION-SCREEN POSITION 2. "n599218
PARAMETERS : pa_ndsto LIKE AM07M-MB5B_XONUL "n599218
modif id liu. "n599218
with opening stock ; with closing stock ; non-changed "n599218
SELECTION-SCREEN COMMENT 5(70) text-087 "n599218
FOR FIELD pa_ndsto "n599218
modif id liu. "n599218
SELECTION-SCREEN END OF LINE. "n599218
"n599218
SELECTION-SCREEN END OF BLOCK listumfang.
SELECTION-SCREEN BEGIN OF BLOCK EINSTELLUNGEN
WITH FRAME TITLE TEXT-068. "Settings
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS XSUM LIKE AM07M-XSUM.
SELECTION-SCREEN COMMENT 4(50) TEXT-019 FOR FIELD XSUM.
Text-019: nur Summen
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETERS XCHAR LIKE AM07M-XCHRG.
SELECTION-SCREEN COMMENT 4(50) TEXT-015 FOR FIELD XCHAR.
Text-015: nur chargenpflichtige Materialien
Das Kennzeichen 'xchar' bestimmt die Art der Listausgabe entweder
auf Material- oder Chargenebene.
SELECTION-SCREEN END OF LINE.
the function "No reversal movements" is only "n571473
available from relaese 4.5B and higher "n571473
( TEXT-026 : No reversal movements ) "n571473
SELECTION-SCREEN BEGIN OF LINE. "n571473
SELECTION-SCREEN POSITION 1. "n571473
PARAMETERS NOSTO LIKE AM07M-NOSTO. "n571473
SELECTION-SCREEN COMMENT 4(50) TEXT-026 "n571473
FOR FIELD NOSTO. "n571473
SELECTION-SCREEN END OF LINE. "n571473
SELECTION-SCREEN END OF BLOCK EINSTELLUNGEN.
SELECTION-SCREEN BEGIN OF BLOCK LISTE WITH FRAME TITLE TEXT-040.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK LISTE.
*eject
new data definitions
working fields for reading structures from DDIC "n599218 A
and check whether IS-OIL is active "n599218 A
types : stab_x031l type standard table of x031l "n599218 A
with default key. "n599218 A
"n599218 A
data : g_s_x031l type x031l, "n599218 A
g_t_x031l type stab_x031l. "n599218 A
"n599218 A
data : g_f_dcobjdef-name like dcobjdef-name, "n599218 A
g_flag_is_oil_active(01) type c, "n599218 A
g_cnt_is_oil type i. "n599218 A
contains the a structure with the max. number of fields of
the database table MSEG, but those lines are comment lines
with a '*'. The customer can achtivate those lines.
The activated fields will be selected from the database table
and are hidden in the list. With the settings in the display
variant the can be shown.
INCLUDE RM07MLBD_CUST_FIELDS.
common types structure for working tables
a) g_t_mseg_lean results form database selection
b) g_t_beleg data table for ALV
TYPES : BEGIN OF STYPE_MSEG_LEAN,
MBLNR LIKE MKPF-MBLNR,
MJAHR LIKE MKPF-MJAHR,
VGART LIKE MKPF-VGART,
BLART LIKE MKPF-BLART,
BUDAT LIKE MKPF-BUDAT,
CPUDT LIKE MKPF-CPUDT,
CPUTM LIKE MKPF-CPUTM,
USNAM LIKE MKPF-USNAM,
process 'goods receipt/issue slip' as hidden field "n450596
XABLN LIKE MKPF-XABLN, "n450596
LBBSA LIKE T156M-LBBSA,
BWAGR LIKE T156S-BWAGR,
BUKRS LIKE T001-BUKRS,
BELNR LIKE BKPF-BELNR,
GJAHR LIKE BKPF-GJAHR,
WAERS LIKE MSEG-WAERS,
ZEILE LIKE MSEG-ZEILE,
BWART LIKE MSEG-BWART,
MATNR LIKE MSEG-MATNR,
WERKS LIKE MSEG-WERKS,
LGORT LIKE MSEG-LGORT,
CHARG LIKE MSEG-CHARG,
BWTAR LIKE MSEG-BWTAR,
KZVBR LIKE MSEG-KZVBR,
KZBEW LIKE MSEG-KZBEW,
SOBKZ LIKE MSEG-SOBKZ,
KZZUG LIKE MSEG-KZZUG,
BUSTM LIKE MSEG-BUSTM,
BUSTW LIKE MSEG-BUSTW,
MENGU LIKE MSEG-MENGU,
WERTU LIKE MSEG-WERTU,
SHKZG LIKE MSEG-SHKZG,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
DMBTR LIKE MSEG-DMBTR,
DMBUM LIKE MSEG-DMBUM,
XAUTO LIKE MSEG-XAUTO,
KZBWS LIKE MSEG-KZBWS,
special flag for retail "n497992
retail(01) type c, "n497992
define the fields for the IO-OIL specific functions "n599218 A
mseg-oiglcalc CHAR 1 "n599218 A
mseg-oiglsku QUAN 13 "n599218 A
oiglcalc(01) type c, "n599218 A
oiglsku(07) type p decimals 3, "n599218 A
insmk like mseg-insmk, "n599218 A
the following fields are used for the selection of
the reversal movements
SMBLN LIKE MSEG-SMBLN, " No. doc
SJAHR LIKE MSEG-SJAHR, " Year "n497992
SMBLP LIKE MSEG-SMBLP. " Item in doc
additional fields : the user has the possibility to activate
these fields in the following include report
INCLUDE TYPE STYPE_MB5B_ADD.
TYPES : END OF STYPE_MSEG_LEAN.
TYPES: STAB_MSEG_LEAN TYPE STANDARD TABLE OF STYPE_MSEG_LEAN
WITH KEY MBLNR MJAHR.
data tables with the results for the ALV
TYPES : BEGIN OF STYPE_BELEGE.
INCLUDE TYPE STYPE_MSEG_LEAN.
TYPES : FARBE TYPE SLIS_T_SPECIALCOL_ALV.
TYPES : END OF STYPE_BELEGE.
TYPES : STAB_BELEGE TYPE STANDARD TABLE OF STYPE_BELEGE
WITH KEY BUDAT MBLNR ZEILE.
DATA : G_T_BELEGE TYPE STAB_BELEGE WITH HEADER LINE,
G_T_BELEGE1 TYPE STAB_BELEGE WITH HEADER LINE.
global working areas data from MSEG and MKPF
FIELD-SYMBOLS : TYPE STYPE_MSEG_LEAN.
DATA : G_S_MSEG_LEAN TYPE STYPE_MSEG_LEAN,
G_S_MSEG_UPDATE TYPE STYPE_MSEG_LEAN, "n443935
G_T_MSEG_LEAN TYPE STAB_MSEG_LEAN.
working table for the control break "n451923
types : begin of stype_mseg_work. "n451923
include type stype_mseg_lean. "n451923
types : tabix like sy-tabix, "n451923
end of stype_mseg_work, "n451923
"n451923
stab_mseg_work type standard table of "n451923
stype_mseg_work "n451923
with default key. "n451923
"n451923
data : g_t_mseg_work type stab_mseg_work, "n443935
g_s_mseg_work type stype_mseg_work. "n443935
working table for the requested field name from MSEG and MKPF
TYPES: BEGIN OF STYPE_FIELDS,
FIELDNAME TYPE NAME_FELD,
END OF STYPE_FIELDS.
TYPES: STAB_FIELDS TYPE STANDARD TABLE OF STYPE_FIELDS
WITH KEY FIELDNAME.
DATA: G_T_MSEG_FIELDS TYPE STAB_FIELDS,
G_S_MSEG_FIELDS TYPE STYPE_FIELDS.
working table for the requested numeric fields of MSEG
types : begin of stype_color_fields,
FIELDNAME TYPE NAME_FELD,
type(01) type c,
end of stype_color_fields,
stab_color_fields type standard table of
stype_color_fields
with default key.
data: g_t_color_fields type stab_color_fields
with header line.
DATA: BEGIN OF IMSWEG OCCURS 1000,
MBLNR LIKE MSEG-MBLNR,
MJAHR LIKE MSEG-MJAHR,
ZEILE LIKE MSEG-ZEILE,
MATNR LIKE MSEG-MATNR,
CHARG LIKE MSEG-CHARG,
BWTAR LIKE MSEG-BWTAR,
WERKS LIKE MSEG-WERKS,
LGORT LIKE MSEG-LGORT,
SOBKZ LIKE MSEG-SOBKZ,
BWART LIKE MSEG-BWART,
SHKZG LIKE MSEG-SHKZG,
XAUTO LIKE MSEG-XAUTO,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
DMBTR LIKE MSEG-DMBTR,
DMBUM LIKE MSEG-DMBUM,
BUSTM LIKE MSEG-BUSTM,
BUSTW LIKE MSEG-BUSTW, "147374
define the fields for the IO-OIL specific functions "n599218 A
mseg-oiglcalc CHAR 1 "n599218 A
mseg-oiglsku QUAN 13 "n599218 A
oiglcalc(01) type c, "n599218 A
oiglsku(07) type p decimals 3, "n599218 A
insmk like mseg-insmk, "n599218 A
END OF IMSWEG.
User settings for the checkboxes "n547170
DATA: oref_settings TYPE REF TO cl_mmim_userdefaults. "n547170
*eject
HAUPTPROGRAMM *********************************
F4-Hilfe für Reportvariante -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
"n599218
INITIALIZATION "n599218
"n599218
"n599218
pay attentions : this process time will not be processed "n599218
in the webreporting mode "n599218
INITIALIZATION.
PERFORM APP_PROCESS USING 'ME'. "TEST
PERFORM initialisierung.
get the parameters from the last run "n547170
perform esdus_get_parameters. "n547170
set flag when INITILIZATION is processed
move 'X' to g_flag_initialization.
"n599218
AT SELECTION-SCREEN "n599218
"n599218
Prüfung der eingegebenen Selektionsparameter, -
Berechtigungsprüfung -
AT SELECTION-SCREEN.
the following 3 parameters XONUL, XVBST, and XNVBST "n599218
became obsolete; send error when they should be filled. "n599218
This could be possible if the user works with old "n599218
selection variants or this report is launched by a "n599218
SUBMIT command "n599218
if XONUL is initial and "n599218
XVBST is initial and "n599218
XNVBST is initial. "n599218
ok, the old parameters are empty "n599218
else. "n599218
text-088 : note 599218 : obsolete parameter used "n599218
MESSAGE E895 with text-088. "n599218
endif.
did the user hit the pushbutton "Category" ? "n599218
case SSCRFIELDS-UCOMM. "n599218
when 'LIU '. "n599218
yes, the pushbutton "Category" was hit "n599218
IF g_flag_status_liu = C_HIDE. "n599218
show the 7 parameters on the selection srceen "n599218
MOVE C_SHOW TO g_flag_status_liu. "n599218
ELSE. "n599218
hide the 7 paramaters "n599218
MOVE C_HIDE TO g_flag_status_liu. "n599218
ENDIF. "n599218
ENDcase. "n599218
"n599218
go on only if the user wants to launch this report "n599218
check : sy-ucomm = 'ONLI' or "n599218
sy-ucomm = 'PRIN' or "n599218
sy-ucomm = 'SJOB'. "n599218
PERFORM eingaben_pruefen.
check whether FI summarization is active and other "n547170
restrictions could deliver wrong results "n547170
perform f0800_check_restrictions. "n547170
- the user wants to surpress the reversal movements : "n497992
process warning M7 392 "n497992
IF NOT NOSTO IS INITIAL. "n497992
emerge warning ? "n497992
CALL FUNCTION 'ME_CHECK_T160M' "n497992
EXPORTING "n497992
I_ARBGB = 'M7' "n497992
I_MSGNR = '392' "n497992
EXCEPTIONSPlease read the KBA document 2012912 - Changeablility of the field "material group" in purchasing documents
It clearly says that material group can't be changed in case you will use material master in purchase order.
So, it is clear that you can't use different material group for material master in purchase order.
For stock report, system will only show you the material group which is assigned to the material master (MARA-MATKL). System will not look into the purchase order section (like EKPO). -
Hello to ALL
I want stock report FIFO WISE
my Item valuation method is FIFO & Purchase & sale by batch wise,i want report to show that which quantity is remaining & what is the cost for that item
Suppose i purchase I01 qty 2 Price 10 & after i purchase I01 Qty 2 price 15
ie i have stock of I01 is 4 but i want it show bifurcated with coming price ie
ItemCode Qty Price STCK VALUE
I01 2 10 20
2 15 30
If i sale I01 1Qty then i have total stock qty is 3 then report must show that
ItemCode Qty Price STCK VALUE
I01 1 10 10
2 15 30hi Jaykumar,
use Inventory Audit Report instead. follow this path
Inventory -->> Inventory Report -->> Inventory Audit Report
regards,
Fidel -
Dear Gurus,
Good Afternoon!!
My user' requirement is,
he wants a BOM wise stock report.
He will just enter the Header Item, Plant and the storage location,
and system should list all its sub-items with the stock available in that plant & the storage location.
PLease tell me if this is possible.
Thanks & RegardsHi,
As per my knowledge, don;t have std report for this requirement, but you can customise this, use below tables and let your ABAPer can develop own customised tcode
MAST, STKO, STAS, STPO - BOM table's
MARD, MBEW, MCHB - Stock tables
Regards,
Sankaran -
Dear Gurus,
Good Morning !!
My user' requirement is,
he wants a BOM wise stock report.
He will just enter the Header Item, Plant and the storage location,
and system should list all its sub-items with the stock available in that plant & the storage location.
PLease tell me if this is possible.
Thanks & Regardsyou may have to get a custom development done for this:
If I understand coreectly, there are two major steps in this:
1) Get the detailed BOM
To do this, you may use teh data from transatcion CS03(display material BOM), or from CS13 (Display summarized BOM) based on teh requirement. You may have to read table like MAST/STKO/STPO. For summarized BOM, you may use the function module CS_BOM_EXPL_MAT_V2
2) Get the available quantity
If your requiremnt is simple with the avialable qty, you may get the read the unrestrcited qty availble in tables MARC and MARD for quantities of a materila/ sub-items at the plant and storage locations level respoectively. If the requiremnts is to get more poslished available stock, you may use the std availability check concept (where we specify whether other stocks like quality check, in transit, etc need to be considered, or not). In this case function module AVAILABILITY_CHECK may be used and teh paranmter may be material, plant, Checking rule, etc.
Hope it helps. -
Tables req to get date wise stock report
Hi
Pls advise, what are the tables req to get date wise stock report??? i don't want any t codes... i have to do with age analysis ,??
Anyone has answer? pls provide it.
Edited by: UJ on Mar 3, 2010 8:54 AMYou can take below details which help you to get the exact things..
*-- Tables delcaraion
TABLES : mkpf, " Header: Material Document
mseg, " Document Segment: Material
mara, " General Material Data
makt. " Material Descriptions
*-- Types declaration
TYPES: BEGIN OF ty_mkpf,
mblnr TYPE mblnr, " Number of Material Document
mjahr TYPE mjahr, " Material Document Year
blart TYPE blart, " Document type
budat TYPE budat, " posting date
END OF ty_mkpf.
TYPES: BEGIN OF ty_mseg,
mblnr TYPE mseg-mblnr, " Number of Material Document
mjahr TYPE mseg-mjahr, " Material Document Year
zeile TYPE mseg-zeile, " Item in Material Document
matnr TYPE mseg-matnr, " Material Number
bwart TYPE mseg-bwart, " Movement Type (Inventory Management)
dmbtr TYPE mseg-dmbtr, " Amount in Local Currency
menge TYPE mseg-menge, " Quantity
lgort TYPE mseg-lgort, " Storage Location
pbamg TYPE mseg-pbamg, " Quantity
werks TYPE mseg-werks, " Plant
ummat TYPE mseg-ummat, " Receiving/Issuing Material
umwrk TYPE mseg-umwrk, " Receiving/Issuing Plant
umlgo TYPE mseg-umlgo, " Receiving/Issuing Storage Location
END OF ty_mseg.
Further if you want you can play with Movement types. -
Hi Experts.
Material stock report (unrestricted, blocked, quality) with in date range.
getting information in T-CODE: MB52 but not in date range.
In mard table i did't find the date for unrestricted, blocked and quality.
from where can i get that information and how should i link all
Need a psudo code for it.
If any one worked on this kind of object plz send me the code.
Points assured..
Regards..
Ravi Reddy.Hi
Check this sample code hope it will helpfull for you
*DATA: ED TYPE F.
DATA : ED(15) TYPE N .
TABLES: EKKO, EKBE, EKPO, KONH , KONV ,LFA1 ,ESLL.
TYPE-POOLS: SLIS.
DATA: val1 like konh-vakey.
Data:GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_REPID LIKE SY-REPID,
G_GRID_TITLE TYPE LVC_TITLE.
Data:G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA:G_TABNAME TYPE SLIS_TABNAME VALUE 'ITAB1',
G_SAVE .
DATA:GS_VARIANT LIKE DISVARIANT.
DATA:LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA:GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
G_SAVE = 'A'.
DATA: BEGIN OF ITAB OCCURS 10,
EBELN LIKE EKKO-EBELN,
* LIFNR like p_vendor,
LIFNR LIKE EKKO-LIFNR,
NAME1 LIKE LFA1-NAME1,
NAME2 LIKE LFA1-NAME2,
* EBELP LIKE EKBE-EBELP,
BELNR LIKE EKBE-BELNR,
VGABE LIKE EKBE-VGABE,
GJAHR LIKE EKBE-GJAHR,
KNUMV LIKE EKKO-KNUMV,
EKORG LIKE EKKO-EKORG,
BEDAT LIKE EKKO-BEDAT,
* VAKEY LIKE KONH-VAKEY,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 10,
NAME1 LIKE LFA1-NAME1,
NAME2 LIKE LFA1-NAME2,
EBELN LIKE EKPO-EBELN,
LIFNR LIKE EKKO-LIFNR,
EBELP LIKE EKPO-EBELP,
* EBELP LIKE EKBE-EBELP,
KNUMH LIKE KONH-KNUMH,
BELNR LIKE EKBE-BELNR,
MATNR LIKE EKPO-MATNR,
TXZ01 LIKE EKPO-TXZ01,
PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
EXTROW LIKE ESLL-EXTROW,
SRVPOS LIKE ESLL-SRVPOS,
KTEXT1 LIKE ESLL-KTEXT1,
KOSTL LIKE EKKN-KOSTL,
NETPR LIKE EKPO-NETPR,
NETWR LIKE EKPO-NETWR,
ED1 TYPE p decimals 2,
KBETR2 LIKE KONV-KBETR,
KBETR1 LIKE KONV-KBETR,
KBETR LIKE KONV-KBETR,
* KBETR3 LIKE KONV-KBETR,
KWERT LIKE KONV-KWERT, " THIS IS FOR FREIGHT
KWERT1 LIKE KONV-KWERT, " THIS IS FOR PBXX OR PB00
KWERT2 LIKE KONV-KWERT, " THIS FOR OTHER CONDITION
MENGE LIKE EKPO-MENGE,
* TOTAL(15) type .
TOTAL TYPE p decimals 2,
VAKEY LIKE KONH-VAKEY,
WERKS LIKE EKPO-WERKS,
MWSKZ LIKE EKPO-MWSKZ,
PACKNO LIKE EKPO-PACKNO,
KNUMV LIKE KONV-KNUMV,
SUB_PACKNO LIKE ESLL-SUB_PACKNO,
GJAHR LIKE RSEG-GJAHR,
END OF ITAB1.
DATA: BEGIN OF ITAB2 OCCURS 10,
EBELN LIKE EKKN-EBELN,
EBELP LIKE EKKN-EBELP,
PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
KOSTL LIKE EKKN-KOSTL,
END OF ITAB2.
data: begin of itab3 occurs 10,
KNUMH LIKE KONH-KNUMH,
KSCHL LIKE KONH-KSCHL,
end of itab3.
data: begin of itab4 occurs 10,
KBETR LIKE KONP-KBETR,
end of itab4.
data: begin of itab5 occurs 10,
KPOSN LIKE KONV-KPOSN,
KNUMV LIKE KONV-KNUMV,
KSCHL LIKE KONV-KSCHL,
KBETR LIKE KONV-KBETR,
KWERT LIKE KONV-KWERT, " THIS IS FOR FREIGHT
* KAWRT LIKE KONV-KAWRT,
end of itab5.
DATA: BEGIN OF ITAB6 OCCURS 10,
* PACKNO LIKE EKPO-PACKNO,
SUB_PACKNO LIKE ESLL-SUB_PACKNO,
END OF ITAB6.
DATA: BEGIN OF ITAB7 OCCURS 10,
BELNR LIKE RSEG-BELNR,
GJAHR LIKE RSEG-GJAHR,
END OF ITAB7.
DATA: BEGIN OF ITAB8 OCCURS 10,
SUB_PACKNO LIKE ESLL-SUB_PACKNO,
SRVPOS LIKE ESLL-SRVPOS,
EXTROW LIKE ESLL-EXTROW,
KTEXT1 LIKE ESLL-KTEXT1,
END OF ITAB8.
*selection-screen
*SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
*SELECTION-SCREEN SKIP 2.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 25(23) text-002.
**SELECT-OPTIONS: s_lifnr FOR ekko-lifnr.
*PARAMETERS:p_lifnr LIKE ekko-lifnr obligatory.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
* PERFORM field_catalog.
* PERFORM display_data.
END-OF-SELECTION.
**& Form display_data
** text
*FORM display_data.
*data: new(15) TYPE N.
* CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
* EXPORTING
* i_callback_program = sy-repid
* it_fieldcat = int_cat[]
* TABLES
* t_outtab = int_out
* EXCEPTIONS
* program_error = 1
* OTHERS = 2.
*ENDFORM. "display_data
PERFORM GET_DATA.
PERFORM CALL_ALV_GRID.
FORM CALL_ALV_GRID.
PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_repid
I_CALLBACK_USER_COMMAND = G_USER_COMMAND
I_GRID_TITLE = G_GRID_TITLE
IT_FIELDCAT = GT_FIELDCAT[]
I_DEFAULT = 'X'
I_SAVE = G_SAVE
IS_VARIANT = Gs_VARIANT
TABLES
T_OUTTAB = ITAB1.
ENDFORM.
FORM FIELDCAT_INIT
USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-seltext_l = 'Vendo No'.
LS_FIELDCAT-FIELDNAME = 'LIFNR'.
LS_FIELDCAT-REF_FIELDNAME = 'LIFNR'.
LS_FIELDCAT-REF_TABNAME = 'EKKO'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Vendor Name'.
LS_FIELDCAT-FIELDNAME = 'NAME1'.
LS_FIELDCAT-REF_FIELDNAME = 'NAME1'.
LS_FIELDCAT-REF_TABNAME = 'LFA1'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-FIELDNAME = 'NAME2'.
* LS_FIELDCAT-REF_FIELDNAME = 'NAME2'.
* LS_FIELDCAT-REF_TABNAME = 'LFA1'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-seltext_l = 'Purchase Document No'.
LS_FIELDCAT-FIELDNAME = 'EBELN'.
LS_FIELDCAT-REF_FIELDNAME = 'EBELN'.
LS_FIELDCAT-REF_TABNAME = 'EKKO'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-FIELDNAME = 'VGABE'.
* LS_FIELDCAT-REF_FIELDNAME = 'VGABE'.
* LS_FIELDCAT-REF_TABNAME = 'EKBE'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Item No'.
LS_FIELDCAT-FIELDNAME = 'EBELP'.
LS_FIELDCAT-REF_FIELDNAME = 'EBELP'.
LS_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-FIELDNAME = 'BELNR'.
* LS_FIELDCAT-REF_FIELDNAME = 'BELNR'.
* LS_FIELDCAT-REF_TABNAME = 'EKBE'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Document Con'.
LS_FIELDCAT-FIELDNAME = 'KNUMH'.
LS_FIELDCAT-REF_FIELDNAME = 'KNUMH'.
LS_FIELDCAT-REF_TABNAME = 'KONH'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Service/Material No'.
* LS_FIELDCAT-FIELDNAME = 'MATNR'.
* LS_FIELDCAT-REF_FIELDNAME = 'MATNR'.
* LS_FIELDCAT-REF_TABNAME = 'EKPO'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Service / Material description' .
* LS_FIELDCAT-FIELDNAME = 'TXZ01'.
* LS_FIELDCAT-REF_FIELDNAME = 'TXZ01'.
* LS_FIELDCAT-REF_TABNAME = 'EKPO'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'WBS Element' .
* LS_FIELDCAT-FIELDNAME = 'PS_PSP_PNR'.
* LS_FIELDCAT-REF_FIELDNAME = 'PS_PSP_PNR'.
* LS_FIELDCAT-REF_TABNAME = 'EKKN'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Serial Number' .
* LS_FIELDCAT-FIELDNAME = 'EXTROW'.
* LS_FIELDCAT-REF_FIELDNAME = 'PACKNO'.
* LS_FIELDCAT-REF_TABNAME = 'ESLL'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Service Number' .
* LS_FIELDCAT-FIELDNAME = 'SRVPOS'.
* LS_FIELDCAT-REF_FIELDNAME = 'SRVPOS'.
* LS_FIELDCAT-REF_TABNAME = 'ESLL'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Dscription' .
* LS_FIELDCAT-FIELDNAME = 'KTEXT1'.
* LS_FIELDCAT-REF_FIELDNAME = 'KTEXT1'.
* LS_FIELDCAT-REF_TABNAME = 'ESLL'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'Cost Center'.
* LS_FIELDCAT-FIELDNAME = 'KOSTL'.
* LS_FIELDCAT-REF_FIELDNAME = 'KOSTL'.
* LS_FIELDCAT-REF_TABNAME = 'EKKN'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-FIELDNAME = 'NETWR'.
LS_FIELDCAT-FIELDNAME = 'NETPR'.
LS_FIELDCAT-reptext_ddic = 'Basic'.
* LS_FIELDCAT-SELTEXT_L = 'Basic'.
LS_FIELDCAT-REF_FIELDNAME = 'NETPR'.
LS_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-FIELDNAME = 'NETWR'.
* LS_FIELDCAT-FIELDNAME = 'NETPR'.
* LS_FIELDCAT-reptext_ddic = ''.
* LS_FIELDCAT-SELTEXT_L = 'Basic'.
LS_FIELDCAT-REF_FIELDNAME = 'NETWR'.
LS_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Excise'.
LS_FIELDCAT-FIELDNAME = 'ED1'.
LS_FIELDCAT-REF_FIELDNAME = 'ED1'.
* LS_FIELDCAT-REF_TABNAME = 'EKKN'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Insurance'.
LS_FIELDCAT-FIELDNAME = 'KBETR2'.
LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
LS_FIELDCAT-REF_TABNAME = 'KONV'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'Frieght'.
LS_FIELDCAT-FIELDNAME = 'KWERT'.
LS_FIELDCAT-REF_FIELDNAME = 'KWERT'.
LS_FIELDCAT-REF_TABNAME = 'KONV'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
* CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = '' .
* LS_FIELDCAT-FIELDNAME = 'KBETR1'.
* LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
* LS_FIELDCAT-REF_TABNAME = 'KONV'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
*CLEAR LS_FIELDCAT.
* LS_FIELDCAT-TABNAME = G_TABNAME.
* LS_FIELDCAT-SELTEXT_L = 'PBXX'.
* LS_FIELDCAT-FIELDNAME = 'KWERT1'.
* LS_FIELDCAT-REF_FIELDNAME = 'KWERT'.
* LS_FIELDCAT-REF_TABNAME = 'KONV'.
* APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'VAT/ST '.
LS_FIELDCAT-FIELDNAME = 'KBETR'.
LS_FIELDCAT-REF_FIELDNAME = "KBETR".
LS_FIELDCAT-REF_TABNAME = 'KONV'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'OTHER '.
LS_FIELDCAT-FIELDNAME = 'KWERT2'.
LS_FIELDCAT-REF_FIELDNAME = "KWERT".
LS_FIELDCAT-REF_TABNAME = 'KONV'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-TABNAME = G_TABNAME.
LS_FIELDCAT-SELTEXT_L = 'TOTAL'.
LS_FIELDCAT-FIELDNAME = 'TOTAL'.
LS_FIELDCAT-REF_FIELDNAME = 'TOTAL'.
* LS_FIELDCAT-REF_TABNAME = 'EKKN'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
ENDFORM. " FIELDCAT_INIT
FORM GET_DATA.
SELECT A~EBELN A~LIFNR A~EKORG A~KNUMV B~VGABE B~GJAHR B~BELNR
L~NAME1 L~NAME2
FROM EKKO AS A
INNER JOIN EKBE AS B ON B~EBELN = A~EBELN
INNER JOIN LFA1 AS L ON L~LIFNR = A~LIFNR
INTO CORRESPONDING
FIELDS OF TABLE ITAB.
* WHERE B~VGABE = '2'.
SELECT EKPO~EBELN EKPO~EBELP EKPO~MATNR EKPO~TXZ01 EKPO~WERKS
EKPO~NETWR EKPO~MENGE EKPO~MWSKZ EKPO~NETPR EKPO~PACKNO
FROM EKPO
INTO CORRESPONDING FIELDS OF TABLE ITAB1
FOR ALL ENTRIES IN ITAB
WHERE EKPO~EBELN = ITAB-EBELN and
EKPO~BUKRS = 'company code'.
SELECT EKKN~EBELN EKKN~EBELP EKKN~KOSTL EKKN~PS_PSP_PNR
FROM EKKN
INTO CORRESPONDING FIELDS OF TABLE ITAB2
FOR ALL ENTRIES IN ITAB1
WHERE EKKN~EBELN = ITAB1-EBELN AND
EKKN~EBELP = ITAB1-EBELP.
SELECT KONV~KNUMV KONV~KSCHL KONV~KBETR KONV~KWERT KONV~KWERT
KONV~KPOSN
FROM KONV
INTO CORRESPONDING FIELDS OF TABLE ITAB5
WHERE KONV~KNUMV = ITAB1-KNUMV AND
KONV~KPOSN = ITAB1-EBELP.
* SELECT LFA1~NAME1 LFA1~NAME2 FROM LFA1
* INTO CORRESPONDING FIELDS OF TABLE ITAB1
* WHERE LFA1~LIFNR = ITAB-LIFNR.
* SELECT ESLL~SUB_PACKNO ESLL~SRVPOS
* ESLL~EXTROW ESLL~KTEXT1 FROM ESLL
* INTO CORRESPONDING FIELDS OF TABLE ITAB6
* FOR ALL ENTRIES IN ITAB1
* WHERE ESLL~PACKNO = ITAB1-PACKNO .
** SELECT ESLL~SUB_PACKNO FROM ESLL
** INTO CORRESPONDING FIELDS OF TABLE ITAB6
** FOR ALL ENTRIES IN ITAB1
** WHERE ESLL~PACKNO = ITAB1-PACKNO.
* SELECT ESLL~SUB_PACKNO ESLL~SRVPOS
* ESLL~EXTROW ESLL~KTEXT1 FROM ESLL
* INTO CORRESPONDING FIELDS OF TABLE ITAB8
* FOR ALL ENTRIES IN ITAB6
* WHERE ESLL~PACKNO = ITAB6-SUB_PACKNO .
* SELECT RSEG~BELNR RSEG~GJAHR FROM RSEG
* INTO CORRESPONDING FIELDS OF TABLE ITAB7
* FOR ALL ENTRIES IN ITAB
* WHERE RSEG~BELNR = ITAB-BELNR AND
* RSEG~GJAHR = ITAB-GJAHR.
*LOOP AT ITAB1.
LOOP AT ITAB.
READ TABLE ITAB1 WITH KEY EBELN = ITAB-EBELN.
* IF ITAB1-EBELN = ITAB-EBELN.
IF sy-subrc eq 0.
* ITAB1-EBELN = ITAB-EBELN.
ITAB1-LIFNR = ITAB-LIFNR.
* ITAB1-EBELP = ITAB-EBELP.
ITAB1-BELNR = ITAB-BELNR.
ITAB1-KNUMV = ITAB-KNUMV.
ITAB1-NAME1 = ITAB-NAME1.
ITAB-NAME2 = ITAB-NAME2.
ITAB1-GJAHR = ITAB-GJAHR.
modify itab1 index sy-tabix.
ENDIF.
ENDLOOP.
*LOOP AT ITAB2.
* READ TABLE ITAB1 WITH KEY EBELN = ITAB2-EBELN.
* IF sy-subrc eq 0.
* ITAB1-EBELN = ITAB2-EBELN.
* ITAB1-PS_PSP_PNR = ITAB2-PS_PSP_PNR.
* ITAB1-KOSTL = ITAB2-KOSTL.
* modify itab1 transporting ps_psp_pnr kostl
* where ebeln = Itab2-ebeln AND EBELP = ITAB2-EBELP.
* ENDIF.
*ENDLOOP.
LOOP AT ITAB1.
**ON CHANGE OF ITAB1-ebeln or itab1-ebelp.
* concatenate itab1-werks itab1-lifnr itab1-matnr
* into val1.
* MOVE VAL1 TO ITAB1-VAKEY.
* MODIFY ITAB1.
* SELECT KONH~KNUMH KONH~KSCHL FROM KONH
* INTO CORRESPONDING FIELDS OF TABLE ITAB3
* FOR ALL ENTRIES IN ITAB1
* WHERE KONH~VAKEY = ITAB1-VAKEY.
**endon.
** sort Itab3 by kschl descending.
** Select konp-kbetr from konp into itab4 where
** KONP~KNUMH = ITAB3-KNUMH AND KONP~KSCHL = ITAB3-KSCHL.
**ON CHANGE OF ITAB1-ebelp.
**LOOP AT ITAB3
** ON CHANGE OF ITAB1-ebelp.
* itab1-knumh = itab3-knumh.
** SELECT KONP~KBETR FROM KONP INTO CORRESPONDING FIELDS
** OF TABLE ITAB4
** FOR ALL ENTRIES IN ITAB3 WHERE
** KONP~KNUMH = ITAB3-KNUMH AND KONP~KSCHL = ITAB3-KSCHL .
** IF ITAB3-KSCHL = 'JMOP' .
** ED = ITAB4-KBETR / 1000 * ITAB1-NETWR .
** ENDIF.
** IF ITAB3-KSCHL = 'JEC1'.
** Itab1-ed1 = ITAB4-KBETR / 1000 * ED.
** ADD ED TO ITAB1-ED1.
** modify ITAB1 transporting ed1.
** ENDIF.
* IF ITAB3-KSCHL = 'JMOP' .
* ED = 16 / 100 * ITAB1-NETWR .
* ENDIF.
* IF ITAB3-KSCHL = 'JEC1'.
* Itab1-ed1 = 2 / 100 * ED.
* ADD ED TO ITAB1-ED1.
* modify ITAB1 transporting ed1.
* ENDIF.
** ENDLOOP.
**endon.
modify ITAB1.
*endon.
LOOP AT ITAB5.
IF ITAB5-KSCHL = 'NAVS' OR ITAB5-KSCHL = 'NAVM'.
ITAB1-KBETR = ITAB5-KBETR.
modify ITAB1 transporting KBETR
where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP .
ELSEIF ITAB5-KSCHL = 'FRA1' OR ITAB5-KSCHL = 'FRC1' OR
ITAB5-KSCHL = 'FRB1'.
ITAB1-KWERT = ITAB5-KWERT .
modify ITAB1 transporting KWERT
where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
* IF ITAB5-KSCHL = 'FRA1'.
* ITAB1-KBETR1 = ITAB5-KBETR / 1000 * ITAB1-NETWR .
* modify ITAB1 transporting KBETR1
* where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
* ELSEIF ITAB5-KSCHL = 'FRC1' .
* ITAB1-KBETR1 = ITAB5-KBETR * ITAB1-MENGE .
* modify ITAB1 transporting KBETR1
* where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
* ELSEIF ITAB5-KSCHL = 'FRB1' .
* ITAB1-KBETR1 = ITAB5-KBETR .
* modify ITAB1 transporting KBETR1
* where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
* ENDIF.
* **THIS CODE IS FOR iNSURANCE CONDITION
ELSEIF ITAB5-KSCHL = 'ZGIN' OR ITAB5-KSCHL = 'ZIN2'.
ITAB1-KBETR2 = ITAB5-KBETR.
modify ITAB1 transporting KBETR2
where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
* **THIS CODE IS FOR PBXX OR PB00 CONDITION
* ELSEIF ITAB5-KSCHL = 'PBXX' OR ITAB5-KSCHL = 'PB00'.
* ITAB1-KWERT1 = ITAB5-KWERT1.
* modify ITAB1 transporting KWERT1
* where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
** ELSEIF ITAB5-KSCHL = 'JOCM' OR ITAB5-KSCHL = 'RA00' OR
** ITAB5-KSCHL = 'RA01' OR ITAB5-KSCHL = 'RB00' OR
** ITAB5-KSCHL = 'RC00' OR
**THIS CODE IS FOR OTHER CONDITION
ELSEIF ITAB5-KSCHL = 'RL01' OR ITAB5-KSCHL = 'ZA00' OR
ITAB5-KSCHL = 'ZA01' OR ITAB5-KSCHL = 'ZAE1' OR
ITAB5-KSCHL = 'ZAED' OR
ITAB5-KSCHL = 'ZAFR' OR ITAB5-KSCHL = 'ZB00' OR
ITAB5-KSCHL = 'ZBCH' OR ITAB5-KSCHL = 'ZBED' OR
ITAB5-KSCHL = 'ZC00' OR
ITAB5-KSCHL = 'ZCEX' OR ITAB5-KSCHL = 'ZCIF' OR
ITAB5-KSCHL = 'ZHC1' OR ITAB5-KSCHL = 'ZHC2' OR
ITAB5-KSCHL = 'ZHCT' OR
ITAB5-KSCHL = 'ZHCV' OR ITAB5-KSCHL = 'ZJOC' OR
ITAB5-KSCHL = 'ZOTH' OR ITAB5-KSCHL = 'ZOTP' OR
ITAB5-KSCHL = 'ZOTT' OR
ITAB5-KSCHL = 'ZPK1' OR ITAB5-KSCHL = 'ZPK2' OR
ITAB5-KSCHL = 'ZPK3' OR ITAB5-KSCHL = 'ZPK4' OR
ITAB5-KSCHL = 'ZRPO' OR
ITAB5-KSCHL = 'ZSE1' OR ITAB5-KSCHL = 'ZSED' OR
ITAB5-KSCHL = 'ZSFR' OR ITAB5-KSCHL = 'ZSTX' OR
ITAB5-KSCHL = 'ZTPI' OR
ITAB5-KSCHL = 'ZTPV' OR ITAB5-KSCHL = 'ZTRD' OR
ITAB5-KSCHL = 'ZWCT'.
ITAB1-KWERT2 = ITAB5-KWERT.
modify ITAB1 transporting KWERT2
where KNUMV = ITAB1-KNUMV AND EBELP = ITAB1-EBELP
modify itab1.
ENDIF.
ENDLOOP .
ITAB1-TOTAL = ITAB1-NETWR + ITAB1-KWERT2 + ITAB1-KWERT + ITAB1-KBETR.
* ITAB1-TOTAL = ITAB1-NETWR + ITAB1-ED1 + ITAB1-KBETR2 +
* ITAB1-KBETR1 + ITAB1-KBETR + ITAB1-KWERT .
modify ITAB1 transporting TOTAL.
LOOP AT ITAB6.
ITAB1-SUB_PACKNO = ITAB6-SUB_PACKNO.
* modify ITAB1.
ENDLOOP.
LOOP AT ITAB7.
ITAB1-BELNR = ITAB7-BELNR.
ITAB1-GJAHR = ITAB7-GJAHR.
ENDLOOP.
LOOP AT ITAB8.
ITAB1-SUB_PACKNO = ITAB8-SUB_PACKNO.
ITAB1-SRVPOS = ITAB8-SRVPOS.
ITAB1-EXTROW = ITAB8-EXTROW.
ITAB1-KTEXT1 = ITAB8-KTEXT1.
modify ITAB1.
ENDLOOP.
* SELECT ESLL~PACKNO ESLL~SUB_PACKNO ESLL~SRVPOS ESLL~KTEXT1
* FROM ESLL
* INTO CORRESPONDING FIELDS OF TABLE ITAB6
* WHERE ESLL~PACKNO = ITAB1-PACKNO.
** delete adjacent duplicates from itab1 comparing EBELN .
modify ITAB1.
endloop.
sort Itab1 by EBELN Ascending.
SELECT KONV~KBETR FROM KONV
INTO ITAB1-KBETR
WHERE KONV~KSCHL = 'NAVS' OR KONV~KSCHL = 'NAVM'.
ENDSELECT.
ITAB1-KBETR = ITAB5-KBETR.
*ENDLOOP.
*ENDLOOP.
*ENDLOOP.
ENDFORM.
Reward all helpfull answers
Regards
Pavan -
Stock report warehouse wise for a particular batch
Hi all,
How do you find out a stock report warehouse wise for a particular batch along with the same batch items sold to whom and with what quantity?
Thanks
SV ReddyHi SV Reddy
pls find the query for stock report
Select X.DocDate, X.ItemCode,
((Select isnull(sum(InQty-OutQty),'0')From OINM T0 Where T0.ItemCode=X.ItemCode And
(T0.DataSource='I' or T0.DataSource='N') And T0.DocDate < X.DocDate)) As [OpeningStock],
IsNull(sum(X.InQty),0)As[Received Qty],IsNull(sum(X.OutQty),0)As[Consumed Qty],
((Select isnull(sum(InQty-OutQty),'0')From OINM T0 Where T0.ItemCode=X.ItemCode And
(T0.DataSource='I' or T0.DataSource='N') And T0.DocDate < X.DocDate)+
(Select isNULL(sum(T0.InQty),'0')From OINM T0 Where T0.ItemCode=X.ItemCode And T0.DocDate<=X.DocDate And
(T0.DataSource='I' or T0.DataSource='N') And T0.DocDate = X.DocDate)-
(Select isNULL(sum(T0.OutQty),'0')From OINM T0 Where T0.ItemCode=X.ItemCode And T0.DocDate<=X.DocDate And
(T0.DataSource='I' or T0.DataSource='N') And T0.DocDate = X.DocDate))As [ClosingStock]
FROM OINM X Where ItemCode=X.ItemCode And
(X.DataSource='I' or X.DataSource='N')
Group by X.DocDate,X.ItemCode
Order by X.DocDate
regards
Jenny -
GRPO No. in stock report
Hi,
We need a stock report which would mention the GRPO No. and the vendor's name from whom the stock has been bought. If the same item has been bought from two different vendors, then we would like to know the quantity in hand out of the inwarded quantity from various GRPOs from different vendors. Also, for material received from production, we need to know the GRPO No. of the raw material it is composed of. The produced material generally comprises only one component.
Can anyone help?Try this query to start:
SELECT T1.DocNum, T1.CardCode, T1.CardName, T1.DocCur, T0.ItemCode, T0.Dscription, T0.Quantity, T0.Price
FROM dbo.pdn1 T0
INNER JOIN dbo.opdn T1 on T1.docentry = T0.docentry
WHERE T1.DocType = 'I' and T1.CANCELED <> 'Y' AND T0.ItemCode Like '[%0\]'
ORDER BY T1.DocNum Desc
Thanks,
Gordon -
Stock Report with Batch Number
Hi ,
My Client requires stock report with Batch numbers .required report format is
Item Code,BatchNumber,OpenQty,OpenVal,PurchaseQty,PurchaseVal,SalesQty,SalesVal,ClosQty,CloseVal
I tried using query on wiki for stock report but that query is written in 2007 and Batch tables and OINM table is changes in 8.81.
http://wiki.sdn.sap.com/wiki/display/B1/SAPB1SQLH-INItemInventoryOpeningandClosingStockper+warehouse
can any one help with stock report- batches.
Thanks,
PreetiHI,
use below query as basis and mofiy the fields required. it shows linking in batch and transaction tables:
SELECT distinct T0.ItemCode,T0.ItemName ,T0.DocDate ,T0.DocType ,T0.DocNum,T0.LocCode ,t4.DistNumber as [BatchNumber], T1.Quantity ,T5.CalcPrice as [Price]
FROM [OITL] T0
INNER JOIN [ITL1] T1 ON T1.[LogEntry] = T0.[LogEntry]
INNER JOIN OBTN T4 on T1.MdAbsEntry=T4.AbsEntry
INNER JOIN [OITM] T2 ON T2.[ItemCode] = T0.[ItemCode]
Inner JOin OINM T5 on T0.ItemCode =T5.ItemCode and T0.LocCode = T5.Warehouse and T0.AppDocNum = T5.BASE_REF
Thanks,
Neetu -
Stock report as per BOM level component
Hi All,
Is there any report for stock materials in sap which will give stock as per BOM component. Requirement is like if header material is A which is having component X, Y and Z, if i want to know what is the stock level of all this items as per mention in BOM.
Regards,
RajeshHi Rajesh,
If you check your FG in MD04 there's a button on the left, under the menu (I'm not before SAP I don't know its exact name). If you push that button you can get e tree-structure of the components and clicking on the components you can get their stock/requirement list. You can check them one-by-one...
As per my knowledge there's no BOM-component specific stock report that would display the stock level of all the components. Maybe this kind of stock report wouldn't be very useful because stock level itself doesn't give a full picture of the planning situation / availabilty of your component.
I mean you should know the whole planning situation of your component and it's very likely that stock level itself is not enough - you may have orders, reservations, etc for your goods and these MRP elements have an effect on material availabilty...
Additionally, you may have components that build not only into one BOM but into several ones...
Please try to use MD04 (there's a collective display tab as I remember).
But if you adhere to our idea, you can get the components e.g. via transaction CS12 and after ctrl+c you can insert them in MB52's apropriate selection field...or you can create an own query but my advice is to please check whether MRP-transactions are good for you.
BR
Csaba -
I am trying to wright a simple Stock report and i am running into difficulties - any expert advice would be appreciated:
The report should have the following fileds:
Item Group, Item Code, Item Description, In Stock Quantity, Stock Value.
The report should summarise by Item Group with Sub Totals.
I have tried several methods and I failed with all of them:
A Using Report Composer, I managed to Place the first 3 Fields and checked that this worked OK, and then converted this to an XL Reportt Definition. But, this Definition did not give any results when I ran it.
B. I started a new XL Definition using the Advanced Formula builder and managed to place all the fields but was not able to Group the records by using the XL Sub Total function.- this gave me only a total for all the records. I think I have done the procedure correctly but for some reason the SubTotal function within XL reporter does not give the expected result.
C. I have used the Grouping function within the Advanced Formula Builder but this did not work either
I wonder if anybody else experienced this type of problem because I suspect that something is wrong with the XL reporter?
Thank you
RobertHi Gordon
The reason I say that it might be a bug is the fact that when I get the #N/A in the cell I can go to another cell that has the COLUMN TOTAL formula and copy and paste and it seems to work OK. Also, I can put in the Formula manually (if I remember the syntax correctly...)
The frustration I have with the XL reporter is in the fact that it is a good product but to get the right result you need to "Experiment and guess" as to what the result will be. It is more of an "Art" then a preciese "Science". I can now write reports but I still do not understand when and why the report works. Perhaps SAP should give some guidlines of what "Kind" of combination may or may not work.
I do fully understand the construction of relational database tables and the links between them, but the XL reporter does not seem to have a logical approach for the end user to help construct a report so the only practical approach seems to be "trial and error"
One basic helpful hint seems to be that you need to have a Light Dimention Value field in order for a report to work - but I am not sure why this is the case.
Thanks for your remrks, they certaily point me in the right direction
Robert
Maybe you are looking for
-
Having a problem with Ipad2 IOS 7 itunes moving app icons
When trying to move or reposition app ICONS in iTunes for my iPad2 it is extremely sluggish or won't let me select a home screen or icon to work with. Sometimes all the home screens "disappear" from the window. Did not have this problem with previou
-
My coworker and I answer emails in 2 shared work emails and I have access to my personal email and her's to answer work questions. Lately when she answers an email in our orders inbox, and marks it off as answered with our assigned highlight, it won'
-
IPhone doesn't work with Sony Marine Receiver CDX-H910UI
My iPhone doesn't seem to be working with my Sony Marine Receiver CDX-H910UI. Whenever i plug my phone into my Marine Receiver it only says 'reading' for a really long time and does not load or allow me to play songs. I have only noticed this problem
-
Error adding file type item using portal api
We are using portal 3.0.8. I can add text and url type items fine but when i try to add a file type item, i get following error. ERROR at line 1: ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException: relative pathna
-
Integration of BI reports in wiki.
Hi All, Is it possible to integrate BW reports to Wiki, using SSO? If possible, it would be great if anyone can throw some light in this regard. Regards, Rajeev.