About 4 months ago I was trying out various things with SAPRrfc. To be more precise I was trying to mimick the the transaction code that most consultant refer to by its transaction code as opposed to the name of it. Yes (this is an easy one if you are an LO consultant) I’m talking about MD04 – the stock/requirements list.

In case you are not familiar with that transaction, this is what it looks like in SAP.

MD04 SAP
Nothing extraordinary – it has a material number, a plant code, a list of planning elements, associated dates, exception messages….Now the screen below is what I’ve been able to get in my internet browser (styled with a nice css file, it even looks a bit like SAP). MD04 broswer
By the way if anybody wants the php code to get that result, just leave a message and I will send it to you. You’ll notice that there is no selection made on the material number – that’s because it has been hard coded in the php file. I could of course load the material number (and associated plant) in a MySQL database but that is not geecky enough. Does anybody know how to get a material list in a Select List with the help of a BAPI? I’ve tried but it ain’t workin’.
What I want to build is a php file that first uses a BAPI to get a list of materials (and associated plant) – then a submit to the function module I’m using here in order to get the stock requirements list in my browser.

Thursday 26th January 2006 update SAPRfc – stock/requirements list in browser

As the code has been requested, I’ve put up a link to the .php file used in this example. Save it to your drive, rename it from .txt to .php extension, change the necessary variables and use it. All you then have to do is improve the code, make it better and distribute back to the community. The file is here.
Code is released under Creative Commons License:

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Monday 20th February 2006 update SAPRfc – stock/requirements list in browser

Thanks to Jako (Jopac) and his great suggestions I did some changes to the code and it works like a charm! Stay tuned as I will soon write a complete post just for retrieving mateial numbers (via php of course). I’ll later on whip up the complete code that combines retrieving material numbers and getting the stock requirements list

Privacy Preference Center