Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bapi_material_get_all for multiple materials?

Former Member
0 Likes
2,408

Hi guys,

Is there any bapi that helps me read valuationdata for more than 1 material at a time?

I want to get the price and the valuation class for about 500 materials at a time.

9 REPLIES 9
Read only

former_member189779
Active Contributor
0 Likes
1,913

I dont think there is any BAPI which suits your need. may be you need to do it in LOOP ENDLOOP

Read only

0 Likes
1,913

That's what I did and it doesn't help me because it takes about 2 seconds/material... and I have more than 81.000

Read only

0 Likes
1,913

There isn't something like in RFC_READ_TABLE where you can add more fields or options?

Set RfcCallTransaction = Functions.Add("RFC_READ_TABLE")
       Set strExport1 = RfcCallTransaction.exports("QUERY_TABLE")
       Set strExport2 = RfcCallTransaction.exports("DELIMITER")
       Set tbloptions = RfcCallTransaction.tables("OPTIONS")
       Set tblData = RfcCallTransaction.tables("DATA")
       Set tblFields = RfcCallTransaction.tables("FIELDS")

    
       strExport1.Value = "MARD"
       strExport2.Value = ";"

       tbloptions.Appendrow
       tbloptions(1, "TEXT") = "WERKS EQ '0001' AND LABST NE '0'"
       tbloptions.Appendrow
       tbloptions(2, "TEXT") = "OR UMLME NE '0' OR EINME NE '0'"
       tbloptions.Appendrow
       tbloptions(3, "TEXT") = "OR SPEME NE '0' OR RETME NE '0'"
      
       tblFields.Appendrow
       tblFields(1, "FIELDNAME") = "MATNR"
       tblFields.Appendrow
       tblFields(2, "FIELDNAME") = "LGORT"
       tblFields.Appendrow
       tblFields(3, "FIELDNAME") = "LABST"
       tblFields.Appendrow
       tblFields(4, "FIELDNAME") = "UMLME"
       tblFields.Appendrow
       tblFields(5, "FIELDNAME") = "INSME"
       tblFields.Appendrow
       tblFields(6, "FIELDNAME") = "EINME"
       tblFields.Appendrow
       tblFields(7, "FIELDNAME") = "SPEME"
       tblFields.Appendrow
       tblFields(8, "FIELDNAME") = "RETME"

There isn't something similar that works with BAPI_MATERIAL_GET_ALL?

Read only

0 Likes
1,913

Did you tried selecting direclty from databse table MBEW using for all entries on your materials table?

Read only

0 Likes
1,913

I don't have access to MBEW... that's why I was using bapi_material_get_all.

Read only

0 Likes
1,913

May be you can ask to create a small custom function module to solve your purpose.

Read only

Former Member
0 Likes
1,913

or can I pass multiple materials at once to bapi_material_get_all?

Read only

Former Member
0 Likes
1,913

So there is no way to check the valuation data for more than 1 material at a time?

Read only

anup_deshmukh4
Active Contributor
0 Likes
1,913

Hello Andrei,

I think You Could write a Wrapper Function module in Which you would call a bapi inside a loop and get your thing done.

You can try for MATERIAL_READ_MABW or check with MATERIAL_READ*

                      MATERIAL_PRE_READ_MBEW

Hope this helps,

Anup