2005 Apr 21 8:02 AM
Hello,
How can i get the plant(s) against a material number??
- Umair
Hello,
How can i get the plant(s) against a material number??
- Umair
2005 Apr 21 8:07 AM
2005 Apr 21 8:12 AM
Hi Umair,
You will have to go to MARC table to do that.
If u want to find out that a plant has been created for a material number, select matnr( material number), werks ( plant code ) from marc table in your select statement and comapare matnr in where clause with ur select option material number or the material taken from MARA table.
And check sy-subrc = 0 condition after ur select statement.
Try it out and u will get the desired results.
Regards,
Hitanshu
2005 Apr 21 8:14 AM
Isnt there any BAPI thorugh which we can get the plants in which a specific material is produced??
Secondly could you guide me how do we query a specific tabel to get the information though BAPIs like in this scenario??
2005 Apr 21 8:18 AM
Hi,
A slightly more non-technical answer -
Go to the transaction MM03, enter the material number and select the <i>Sales: General/Plant Data</i> view. In the pop-up, hit F4 for the plant field. You will get all the plants for which the material has been maintained.
Regards,
Anand Mandalika.
2005 Apr 21 1:20 PM
Doesn't look like there is a BAPI for this, but you can just use the following code.
Data: begin of itab occurs 0,
matnr type marc-matnr,
werks type marc-werks,
end of itab.
Select matnr werks into corresponding fields
of table itab from marc
where matnr = Your_material_Number.
check sy-subrc = 0.
Regards,
Rich Heilman
2005 Apr 21 1:51 PM
Thanks guyz for the replies but i am afraid i cannot directly query the table from db as i have to do this through my win Application and its discouraged to query the table there through .Net connector!!!
I actually have to get a mterial's price through Material.GetDetail BAPI and it requires the plant number in case of dealing with the valuation. All i have with me is the material number.
Though i know this is the pure ABAP forum but will be glad to know if somebody knows any wprkaround.
Thanks,
Umair
2005 Apr 21 2:01 PM
2005 Apr 21 2:08 PM
Hi Umair,
You can use the RFC function RFC_READ_TABLE. You need to pass it the following:
<b>Parameters</b>
QUERY_TABLE = 'MARC'
<b>Tables</b>
OPTIONS - One row with the following entry:
TEXT = 'MATNR = <zero padded material number>'
FIELDS - One row with the following entries:
FIELDNAME = 'WERKS'
OFFSET = '000000'
LENGTH = '000004'
TYPE = 'C'
FIELDTEXT = 'Plant'
The result table DATA will have all the plants for the given material.
This should get you exactly what you need. You can use this function for getting data from any SAP table without going to the database directly.
Hope that helps.
Cheers,
Brad
Message was edited by: Brad Williams
2005 Apr 21 2:48 PM
Hi Umair,
a price determination is something totally different!
You need much more (process) definition, before you can get (and display) correct price.
Do you look for a purchase price / sales price / value of stock? That will be 3 different values.
In case of purchase or sales, it's generally amount dependent (scales: 10 cost 1,90 each, 1 cost 1,99).
Date! Tomorrow it might be more expensive.
Who is asking? Are you looking as customer? There might be special customer agreements...
If several vendors / sites can deliver, who will be source of supply -> different transport costs...
Get a more detailed definition and you will get a better answer for your problem.
With all these explanations for MARC selects (e.g. via own RFC-function, that's good) you can't get nearer to your solution.
Regards,
Christian
2005 Apr 21 4:27 PM
Hi Umair,
Use RFC MATERIAL_READ_PLANTS to read all the plants for a material.
Then use CK_RFC_GET_PRICE to get the material price.
Now if you are talking about a sales item price, then that will be a whole different set of FMs.
Let us know how it goes.
Regards,
Srinivas
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |