Material document ,quantity and stock location for a given material
hello all,
i have a requirement like this.
in the selection screen i have,
material.....
plant....
posting document date.....
i need to get material document number,quantity,units and stock location for the above mentioned selection criteria...
what tables do i need to use..
do i need to use any BAPI or Function module..
thanks in advance...
Hi Vinay ,
Look into table MKPF & MSEG for material document
anf for quantity in MARD
Regards
Yogendra Bhaskar
Similar Messages
-
How to find out the plants and storage location for a given company code
hi
How to find out the plants and storage location for a given company codeHi
Check for Assignem,ent of Plant & compnay code in OX18
& for Combination of Plant & Storage location in OX09
The total org structure can be viewed in EC01 - Click on Structure -> navigation
& Continue, Click on the Compnay code & the wole structure can be viewed
Thanks & Regards
Kishore -
Material document problem and stock not appearing
Hi All,
I am doing goods receipt for production order through MB31.. after completion of goods receipt system is generating material document.. but when I go to MB03 to see the material document ,system throwing following error and stock is also not visible in MMBE....
can any body help me out why it is happening and how to resolve this...
Thanks
KumarI can see it is an SQL error about inserting duplicate record.
this just means that you have already a record with the same key in your data base.
I dont really think it is the material document number, otherwise you would not get the error in transaction MB03, you would get a material document just from an older process instead.
you have to analyze it in more detail. I hope you have an ABAPer or a basis guy or any other collegue that could help you to navigate through SM13 to find the right information. Or help you reading the dump.
if you can read some ABAP then click the icon for ABAP Editor (F5) and it will take into the program to the statement where it failed.
From this statement you can probably know which table is to be updated.
if you find the failed update module then you can check via the icon for VB-Data what the values are and you may find already a record in that table with the same values.
Then you have to analyze why it can have the same keys. -
Projected Stock for a given Material and Location (System: SCM-APO)
Hello Experts,
Appreciate, if anybody can help me in getting a time-series key-figure data (Stock-On-Hand for a given Material and Location) for a given period.
I am working on a report to display the projected stock (Material & Location are known) for a given period (1 month).
I am able to view the above data in my planning book.
Thanks in advance.
Regards,
Prasanna
Edited by: Prasanna Gunji on Apr 9, 2010 3:42 PMHi Prasanna,
9ASOQMQTY - Stock in quality inspection
9ASOTRSQTY - Stock in transit
9AAVLSTCK - Projected Stock
Hope this helps
Regards
R. Senthil Mareeswaran. -
Functional location for the respective material and equipment in a report
i want to show the functional location for the respective material and equipment in a report designed for plant maintenace module..how should i add a field in the report which already contains the order , material and equipment no ?..just have to add a field functional location in that report. Can anyone plzz tellme from which table should i fetch the data .?
From EQUI get the recent/valid EQUZ record.
From EQUZ get the ILOA record.
ILOA holds the TPLNR for the equipment.
And from ILOA you can get IFLOT.
edit: just noticed you can use V_EQUI as well.
Edited by: Maen Anachronos on Nov 26, 2010 12:40 PM -
Custom Report for the Stock and Stock value for a specific date
Hi SAP Gurus,
Is there any SAP standard t-code or any logic to get the transcations (additions (for example: Purchases) and subtractions (Sales) to the inventory) for a particular materials in a plant and with Total Stock and also Total Stock value when that particular transaction happened?
Our system is R/3 4.7
I looked at the MB5B, MBCE, MBCA, MC44, MB51 and some other standard T-codes but could not find the total stock value at the time of Transaction happened.
The history tables MBEWH and MARDH are updated after the month end closing procedures, right, which means I will have the inventory value changing every month if material has Price "S".
Thank you,
-HarterHi Harter,
Unfortunately, you cannot see in a single tcode the value of stock and stock quantity on a specific date. As you yourself have pointed out, we only have to make use of the history table MBEWH, MARDH for the month wise stock quantity and value. Along with that you should also make use of the table MBEW to take teh stock quantity and value. So the total value of stock on a particular date will be
Stock qnty = MBEWH value until the previous month (for teh specific valuation class, period etc) + MBEW value for the present date.
But this will nto work out if you want to find out teh stock quantity and stock value on a past date basis. For past data, only m onthwise data is available. For this anyway you can refer to MC.1 and so on reports. -
Regarding : Material document data and PO data do not match (Plant)
Hi Gurus,
Please go through this BAPI program.
While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
DATA: BEGIN OF it_itab OCCURS 100,
docdate(10),
postdate(10),
mvt_type(3), "Movement Type
plant(4), "Plant
lgort(4),
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
material(18), "Material Number
delnote(16),
erfmg(13),
uom(3),
lfmng(13), "Quantity
batch(10) TYPE c,
vfdat TYPE vfdat,
END OF it_itab.
DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01 INITIAL SIZE 100,
it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code INITIAL SIZE 100,
it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create INITIAL SIZE 100.
DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
DATA: w_mat_doc TYPE bapi2017_gm_head_ret-mat_doc,
w_year TYPE bapi2017_gm_head_ret-doc_year.
DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_errmsg_goodsmvt.
DATA : obj_type LIKE bapiache09-obj_type,
obj_key LIKE bapiache09-obj_key,
obj_sys LIKE bapiache09-obj_sys.
DATA: v_date1 TYPE sy-datum.
DATA: v_date2 TYPE sy-datum.
DATA: w_lines TYPE i.
DATA: errflag.
SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK bk1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
Start-of-selection processing
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = i_excel
i_filename = p_file
TABLES
i_tab_converted_data = it_itab[]
EXCEPTIONS
conversion_failed = 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.
LOOP AT it_itab.
REFRESH it_goodsmvt_head.
REFRESH it_goodsmvt_item.
CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
wa_goodsmvt_head-pstng_date = v_date2.
wa_goodsmvt_head-doc_date = v_date1.
wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
wa_goodsmvt_head-pr_uname = sy-uname.
APPEND wa_goodsmvt_head TO it_goodsmvt_head.
Maintain it_goodsmvt_code
wa_goodsmvt_code-gm_code = '04'.
Maintain it_goodsmvt_item
*LOOP AT it_itab.
IF wa_goodsmvt_item-po_number IS INITIAL.
wa_goodsmvt_item-po_number = it_itab-pur_doc.
wa_goodsmvt_item-move_type = it_itab-mvt_type.
wa_goodsmvt_item-MOVE_PLANT = it_itab-plant.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = it_itab-material
IMPORTING
output = it_itab-material.
wa_goodsmvt_item-material = it_itab-material.
wa_goodsmvt_item-stge_loc = it_itab-lgort.
wa_goodsmvt_item-po_item = it_itab-po_item.
wa_goodsmvt_item-entry_qnt = it_itab-erfmg.
wa_goodsmvt_item-ENTRY_UOM_ISO = it_itab-uom.
wa_goodsmvt_item-po_pr_qnt = it_itab-lfmng.
wa_goodsmvt_item-batch = it_itab-batch.
wa_goodsmvt_item-expirydate = it_itab-vfdat.
wa_goodsmvt_item-NO_MORE_GR = 'X'.
wa_goodsmvt_item-mvt_ind = 'B'.
APPEND wa_goodsmvt_item TO it_goodsmvt_item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_goodsmvt_head
goodsmvt_code = wa_goodsmvt_code
IMPORTING
materialdocument = w_mat_doc
TABLES
goodsmvt_item = it_goodsmvt_item
return = it_errmsg_goodsmvt.
Process of commit work
IF it_goodsmvt_head[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
ENDIF.
IF it_goodsmvt_item[] IS NOT INITIAL.
DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IMPORTING
RETURN =
CLEAR errflag.
READ TABLE it_errmsg_goodsmvt INDEX 1.
IF it_errmsg_goodsmvt-type EQ 'E'.
WRITE:/'Error in function', it_errmsg_goodsmvt-message.
errflag = 'X'.
ELSE.
WRITE:/ it_errmsg_goodsmvt-message.
ENDIF.
IF errflag IS INITIAL.
COMMIT WORK AND WAIT.
IF sy-subrc NE 0.
WRITE:/ 'Error in updating'.
EXIT.
ELSE.
WRITE:/ 'Material Document created successfully and the Document Number for the Material',
wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.Hey,
Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
Mine is solved....
Thanks -
Get the Stock for a given Material no
Hi,
I'm an ABAP consultant, new to MM.
I have a requirement - For a given Production Order I have to find the Material and respective BOM Explosion. Once that is done I have to get the Stock for those Materials [Child Materials].
I have used AUFK and AFPO to get the material from the Production Order and Used MAST table to get the other details and passed it to FM - 'CS_BOM_EXPL_MAT_V2' - This gives me the Child materials.
Now I want to know how can I find the Stock for a given Material. I want to get the Overall Unrestricted stock. Which Table do I have to use. Is there any standard Function Module [FM] or BAPI to get it.
Please help.
Thanks & Regards,
AshishI have gone through the MARD table. I want to confirm - for a Material no there are more than 1 plant and for each plant there are more than storage location. So I have to add the Unrestricted Stock of all those to get the Full Unrestricted Stock.
Please refer Transaction MMBE - I have to use that output. -
Error M7 311 "No Special stock defined for value only material"
I had this in the SD forum however someone suggested to go to the MM forum. Here is my issue
I am receiving an error when trying to receive our demo unit in as an inbound receipt off of an RMA (this is our normal process when we send a demo unit to customer).
The error message is "No special stock defined for value only material" I noticed that the MRP views were not extended so i tried to extend those and it still gives the same error message in our testing client and also created a new RMA to see if same error exists and it does, please advise
NOTE: In our Accounting 1 tab we are not utilizing the valuation category in the Accounting 1 tab of the material master. RMA is a Return of a material for service. Our Demo units after issued to customer for a demo come back using this method to check and service if needed before putting into stock. Material does not have a procurement tab as this is considered as an asset. No split valuation.Dear Kimberly
Issue:No special stock defined for value only material
This mesaage will come up when you have active the valuation category for the material in Accounting 1 view
but not extend the valuation type for that material, due to this reason syestem is not able to find out the exact valuation for the material, You can opt for 2 suggestion
1 Extend the material in t. code. MM01 for the right valuation type
2 If you dont want to use Valuation category ( if you dont want the split valuation for the material) you fst settle the all Open PO and quantity for that material and then archieve the material and recreate again
Please let me know if u have any query -
Material Confirmed quantity and Open quantity
Hi All,
I am working on a report where the user wants the material confirmed quantity and open quantity at the batch level. I know for open quantity VBBE-OMENG can work. Just need confirmation that this is the correct field. However for confirmed quantity I am not able to narrow it down to one field. I have the following fields as possibilities but not sure which is the right one.
1) VBBE-VMENG
2) VBEP-BMENG (This is the at the sales order level though. We need it at the batch level)
Can you please let me know if i have the right approach here? The report has Material, plant, sloc and batch along with a bunch of other fields.
Regards.
SidHello,
you should extract the quantities from all the deliveries selected for material and batch, and selecting only open deliveries.
Use a selection like this:
SELECT lips~MATNR lips~WERKS
lips~CHARG lips~LFIMG
INTO TABLE lt_lips
from lips as lips
INNER JOIN vbup as vbup
on lips~VBELN = vbup~VBELN AND
lips~POSNR = vbup~POSNR
WHERE lips~MATNR = p_matnr
AND lips~WERKS = P_WERKS
AND lips~CHARG = P_CHARG
AND ( vbup~WBSTA eq 'A' or
vbup~WBSTA eq 'B' ).
Best regards,
Andrea -
Status 51 material document data and po data do not match(vendor)
i am using we19 to try an inbound idoc mbgmcr(receipt for po)
i put in gm_code 01
movement indicator B(goods receipt for po)
vendor 3815
PO 4500015241
PO Order Item 00030
Movement type 101
qty in unit of entry 1
iso code unit of measurement pc
on the po screen i see the po item and qty to be delivered is 75
when i run the inbound idoc i get
status 51 material document data and po data do not match(vendor) but as i say on the po inquiry screen i see the po vendor item with 75 to be delivered
what am i missing????????????????thank you
i put in the leading zeros and got rid of that problem
now i am getting status 51
posting only possible in 2004/07 and 2004/06
but in the posting date i use 07/02/2004 i have tried several dates in the period but get the same error
any ideas?
thanks you -
Material document number and financial document number
Hai Friends,
How can i link material document number and financial document numberHi,
I did below for my requirement to get payment document number. It will useful to you
FORM GET_PAY_DOC .
data: wa_bkpf TYPE bkpf.
data: wa_obj_key TYPE bkpf-AWKEY,
wa_AUGBL TYPE bsak-AUGBL.
SELECT SINGLE belnr GJAHR from ekbe into (it_table-belnr, it_table-GJAHR)
where ebeln eq it_table-ebeln AND
ebelp eq it_table-ebelp AND
BEWTP eq 'Q' AND
XBLNR eq it_table-tknum.
CHECK sy-subrc eq 0.
CONCATENATE it_table-belnr it_table-GJAHR INTO wa_obj_key.
SELECT SINGLE bukrs belnr GJAHR from bkpf into CORRESPONDING FIELDS OF wa_bkpf
where awtyp = 'RMRP' AND
awkey = wa_obj_key.
CHECK sy-subrc eq 0.
SELECT SINGLE AUGBL from bsak into wa_AUGBL
where bukrs eq wa_bkpf-bukrs AND
lifnr eq it_table-tdlnr AND
belnr eq wa_bkpf-belnr AND
GJAHR eq wa_bkpf-GJAHR.
CHECK sy-subrc eq 0.
SELECT SINGLE belnr budat from bsak into (it_table-belnr1, it_table-Budat)
where bukrs eq wa_bkpf-bukrs AND
lifnr eq it_table-tdlnr AND
AUGBL eq wa_AUGBL AND
GJAHR eq wa_bkpf-GJAHR AND
blart eq 'KZ' and
belnr ne wa_bkpf-belnr AND
SHKZG eq 'S'.
ENDFORM. " GET_PAY_DOC -
FM/Class to find the class and characterstics for a given material
Hi All,
Is there any Class/FM to find the class and characterstics for a given material.I tried some BAPI_OBJCL* BAPI's but lot of the BAPI's need classnum as input parameter. But i need a BAPI or tables or class which can give the class and its characterstic values for a given material.Hi Ben
Try ..
BAPI_OBJCL_GETCLASSES
BAPI_OBJCL_CREATE -
How to get classification for a given material and material type in MM
Hello Friends,
One of my developer colleagues is struggling to find out : how to get classification for a given material and material type in MM?
He is looking for probable table and table fields to Select from.
I would appreciate seriously any help in this regard.
~Yours SincerelyHi
Below given the flow and table details for a given class and class type.
- Table KLAH --> This contains the "Internal class no" [ for the given Class & Class type ]
- Table KSML --> This contains the " internal character numbers " [ nothing but characteristics attached to the class ] , which can be fetched with the above fetched internal class no
- Table AUSP --> This table contains the objects ( material ) attached to the internal characters of that class
- Table CABNT --> This table contains the "Description" for the internal character numbers.
- award points if this is ok -
Billing Document and Material Document number and Date (Goods Issue)
Dear Experts,
Is there a way I can find the relationship between a billing document and a material document number and Goods issue date?
ThanksHi Abid
Is there a way I can find the relationship between a billing document and a material document number and Goods issue date?
You have to follow the flow from the billing document to the material document. This will only work if the billing document comes from a delivery note.
Billing document => Delivery
LIPS-VBELN = VBRP-VGBEL
and LIPS-POSNR-VBRP-VGPOS
So you have LIPS + LIKP with the LIKP-WADAT_IST as the goods issue date.
Delivery => Material Document Number
You can use the table VBFA with the delivery item as the preceding document number (VBFA-VBELV) and item (VBFA-POSNV) ; you will also have to define the preceding document type as J (delivery) and the document category of subsequent document as R (material document).
Because in SAP nothing is simple, there might more than one material document, because the goods issue (601) movement might have been canceled and issue again. So you will have to decide what to do in that case.
Best Regards,
Franck
Maybe you are looking for
-
How can i dynamically select columns based on the input parameter?
I have an input parameter which takes single numeric value. Based on this value i have to dynamically select table-columns . For eg: if i have following fields in my table : SEM_1 SEM_2 SEM_3 and SEM_4. And if i give numeric input as 2 , then i have
-
I installed CS6 and can not package a document in InDesign that I was able to package before. Pop up widow "Cannot copy nessessary linked file(s)"
-
I was wondering if you guys could help me out with this. I am trying to implement an art gallery to show just an image and a next and previous button and I have modified the gallery.js to exclude the thumbnails. The data loads succesfully but the ima
-
Downloading and storing pdf file in a Local holder
I generated a pdf file with desk top PC and uploaded it to Adobe Acrobat DC through the Acrobat.com. I can preview it in a Document Cloud by opening the Adobe Acrobat installed in the iPad. Question: How can I download the file and store it in a Loca
-
AcroForm FDF Template functionality broken by updates
We have many cases where we build an FDF file that went sent to the browser causes a PDF to be assembled (and form fields filled in) from multiple PDFs containing acroForm templates. Each time an Acrobat patch is applied by my company, this function