Automate

 View Only
  • 1.  MB51 - Material Document List

    Posted 01-11-2021 10:34
    Hello Team!

    I've created QUERY script based on MB51 SAP transaction, so most of the tables are related to material master data. (Tables: MKPF, MSEG and MAKT)

    When I compared data downloaded directly from SAP with the script I notice that WS skips lines which have no material number.
    Some of the lines in MB51 report are for different kind of services (e.g. transport, rental, freight etc.) and have no material number in master data.
    As the services lines in SAP have most of required data in my script (e.g. Number of Material Document, PO, Posting Date, Loc.curr.amount etc.) I assumed that they could be downloaded using WS. Maybe I'm missing something.

    I've tried to use different criteria to download lines with no material number, but with no results.
    Below you can find used criteria and  output fields.

    Maybe someone could advise if it's possible to download lines with no material number using below criteria?
    Or WS is possible to download only data with created material number.

    Thank you in advance for any comment and suggestion.




    ------------------------------
    Katarzyna Szymczewska | Accounting and Reporting Senior Data Analyst
    Owens Illinois | 123
    ------------------------------


  • 2.  RE: MB51 - Material Document List

    Employee
    Posted 01-11-2021 14:46
    Hi Katarzyna 

    The default join is INNER join, which means all of the tables must have values that match.

    I think you're likely going to need a left outer join on anything that is related to a specific material number - probably MAKT if those are the 3 tables you're using.

    Right click on the join and convert to left outer join.  In query, you're limited to one:


    Hope that helps,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 3.  RE: MB51 - Material Document List

    Posted 01-14-2021 05:34
    Thank you Sigrid for the advice!
    It helped with the lines which have material number.
    Material Description lines without material number remain empty in the output, but are available in SAP. I've checked that it's possible, because description for empty material number lines is stored in Material Short Text with Field Label "material". Unfortunately I'm not able to find table for this position. I tried to join table with Short Text, but it's giving me the wrong output.


    ------------------------------
    Katarzyna Szymczewska | Accounting and Reporting Senior Data Analyst
    Owens Illinois | 123
    ------------------------------



  • 4.  RE: MB51 - Material Document List

    Employee
    Posted 01-14-2021 08:53
    Hi Katarzyna 

    I don't have any output without a material number.  I would think if there's no material number, there's no description.  I clicked F1 and looked at the tech details, and it shows material description from MAKT, so that would mean empty if no material number.

    I do know tcodes like PO's pull in a material description at creation, but you can overtype them and thus they are no longer tied to the MM record.  But I'm not sure with MB51/2.  

    Best Regards,
    Sigrid


    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------