Automate

 View Only
  • 1.  MD04 extract - MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST

    Posted 12-08-2023 08:26

    Dear all,

    I am frequently asked about possibility extracting MD04 information into MS-Excel. Found function module and BAPI related to this MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST. Was anyone successful creating a script for downloading such details?

    Many thanks in advance looking forward to your replies.

    Cheers

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------


  • 2.  RE: MD04 extract - MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST

    Employee
    Posted 12-11-2023 14:51

    Hi Hans

    I have used both BAPIs to extract information:

    • For BAPI_MATERIAL_STOCK_REQ_LIST, you can list multiple material/plant combinations and get output.
    • For MD_STOCK_REQUIREMENTS_LIST it lists all of the requirements for a material/plant, so it's one material at a time.

    Simple examples attached.

    Can you use Query?  It's another option and would allow for a set of search criteria to pull information for the materials you want.

    FYI

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: MD04 extract - MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST

    Posted 12-11-2023 15:08

    Hello Sigrid,

    Many thanks for your very valuable files. Will try to adopt them to our SAP system.

    Yes, I'm also using QUERY, not so frequently like Transaction but have quite a number of them. Mainly for fetching data from SAP where SAP Query or InfoSets are not user friendly and much more because of the convenient way QUERY is extracting data packages. If you would also have a set QUERY files. It would be appreciated very much. 

    Many thanks again

    Kind regards

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 4.  RE: MD04 extract - MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST

    Posted 12-12-2023 04:23

    Hello Sigrid,

    Thanks it's working well. Remaining question, how do you determine length of the loop?

    Thanks and kind regards

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 5.  RE: MD04 extract - MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST

    Employee
    Posted 12-13-2023 10:04

    Hi Hans

    In Excel with a BAPI, you have to guess on a maximum number.  It's ok to have more detail lines than you need - you'll just have blank lines.

    I'll see if I can find a Query example later in the week.

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------