Hi, my name is Pascal and I am a SAP & Supply Chain specialist. I work for PLAUT and I do things others can't.
This blog only contains my personal views, thoughts and opinions. It is not endorsed by my employer nor does it constitute any official communication of PLAUT. You can contact me via email at pascal[at]renet-web.net or use the contact form that you will find by following the 'Contact' link and you can follow me on twitter here.
Posted on August 6, 2009 | Category: SAP
You only need to go through the forums on SDN to realise that there are people out there that actually write programs or develop LSMW’s to upload Planned Independent Requirements (PIR) into SAP. Whilst I am sure that there are many valid reasons for wanting to develop your own upload programs, it is a shame to do so especially in light of the fact that SAP offers standard methods for you to do this. I know of at least two:
In this post, I shall explore the second option. The aim of this is to have PIR figures uploaded in SAP’s demand management – i.e data populated in the table below, such that it can be taken into account by the MRP run (or not if you do not set the active indicator):

To illustrate this scenario, I’ll work through a simple case but it should give you all the tools you need to do further exploration on your own. So I will show you here how you can upload PIR quantities for multiple schedule lines for multiples materials – all in one go. Also we will want for these requirements to be active such that they are immediately taken into account during the next MRP run.
To start of let’s try and execute the program to see how it presents itself. Using transaction SE38, execute the program RM60IN01.

In the next screen you will see this.

SAP defaults the sequential file name to PP_INDEP_REQMTS_DIRECT_INPUT. I.e that is the logical filename that SAP will read to upload your PIR’s. That logical filename is transparent to the user, but it is actually mapped to a specific location – the one where the physical file will need to reside if SAP is going to be able to read it.
By default PP_INDEP_REQMTS_DIRECT_INPUT maps to a filename called RM60IN00 in SAP’s DIR_TEMP directory. If that is not a convenient place for you, that is something that you can always change. To do so go into customizing (based on ECC6.0) and follow the path SAP NetWeaver / Application Server / System Administration / Platform Independent File Names / Cross-client Maintenance of file names and paths (the corresponding transaction code is conveniently called FILE).
So at this point what we are missing is the file format expected by SAP and in order to get that information, the easiest way is to let SAP do the work for us!
Go to transaction MD61 and create some demand for anyone of your products.

Add some requirements in your planning table and save your changes.

Now go to transaction SXDB. You will come to a screen that looks like the one below (maybe some projects will be there).

Select the menu entry Goto / DX tools. This will take you to the Data transfer – tools screen. In that screen type the information as it is indicated below.

From this screen we are going to generate a template upload file. You’ll be able to use that file to get a feel for what data has to be uploaded, where it fits in the file and how it has to be formatted if you want to successfully upload your planned independent requirements.
So the next step is to generate that file by populating it with some demo data. To do that, click the “From Test Program” button located at the top of the screen. In the next screen that comes up, type the data that corresponds to the material for which we created some requirements earlier on and just click execute.

What this has done, is to create a ready for upload file using the data we created earlier on. If all goes well, you should have a message coming up, such as the one below.

If we use transaction AL11 to navigate to the logical file name PP_INDEP_REQMTS_DIRECT_INPUT which is DIR_TEMP/RM60IN00) we have should see:

So there we have it – a template with live data!
If you go back to the DX tools screen and additional feature here, is that you can edit the file you just generated. To do so, go click on the “change” button.

SAP shows you the template file you generated in a different light.

What you can also do here is to edit existing segment as well as delete or add some – just double click on a segment to do so. Any changes you do can be saved to the template file.
I also suggest that you look at every segment so as to see what other information could be contained in them. Note that if you are using configurable materials additional segments can be used to populate characteristics and their associated values. If that is your case, use the B60C1 structure segment to hold that information (as shown below).

At this point, I would like to point what seems to be a bug. If you change a record B60BL (the one that contains the material number) and save your changes and then try to process that file you will get an error message saying Number :61262 ‘Project and/or WBS element does not exist’. If you run across that problem, apply OSS note 594774 and you should be right after that.
What you can now do, is to download your file onto your PC so as to further study the file structure.
To do so, from the transfer tools menu, click the “copy” button.

Indicate the source file (the template we generated) and the target file (the one we’ll save on the PC). Note that you can use the same method to upload your file onto the server (switching the target and the source of course).

There we go – we have our template file in notepad.

We’ll now try to upload a new file. This one will have two materials and for the second material, we’ll upload not monthly but weekly buckets.

So let’s upload our new file and process it.
Note that you can, execute the program in test mode first if you prefer.

If things work out without a hitch, you will just get an information message appear at the bottom of your screen:

You might also get warning messages (especially if requirements already existed).

So let’s see what has happened.
If we look at the first material Z127 this is the material we uploaded in monthly buckets.

And if we have a quick look at the stock and requirements list, we see the requirements are ready to be planned:

If we now look at the other material Z126, this was the material we uploaded in weekly buckets.

Enjoy.
» Filed Under SAP
October 12th, 2009 at 7:38 am
HI,
I have tried the steps as mentioned. For the first part its happening fine.But when I try to change the notepad file to add a new material.The system system is not uploading the data. Moreover for the first material If I change the planning data as like you have done there is no change in my case.
Please advice.
Should I contact my Basis Guy.
Regards,
Vivek
January 20th, 2010 at 7:41 pm
Hey there,
I’ve tried the steps you’ve shown but I’m having a little trouble with the Copying Planned Independent Reqmt data using Direct Method step. When I execute the program a message pops out saying “Schedule line has already been transferred” and I find out that my data hasn’t been uploaded, even when I’m in Test Mode. What did I do wrong?
Hope you can help
Regards,
oscar
April 23rd, 2010 at 8:05 pm
Hi,
very good article to illustrate the process of loading PIR via the SXDB. however there is an issue on pratical massive data loading.the format of the flat file is hard to use for real business.
But i abtained the some valubale information like the mandatory fileds to be populated in fields of structures of B60BL and B60ET. I used it to correct the error experienced in LSMW when i handle the same data object-PIR.
December 2nd, 2010 at 9:55 am
“Schedule line has already been transferred” message appears if you are uploading duplicate line with same date.I experienced it today.
December 2nd, 2010 at 9:57 am
Caution While using the program and formatting data :
Project must be entered as “00000000″ for Record type 2.
Do not repeat a line for same date.
Material must be padded with leading zeroes.It should be 18 char no.
December 2nd, 2010 at 11:31 am
Pravin,
Thanks or the comment – I am aware of the comment you make and it is a good thing, because it does make sense to upload duplicate lines!
January 7th, 2011 at 5:03 am
This is a really nice post. I was able to set this up with only one problem. I am getting the error “Number :61262 ‘Project and/or WBS element does not exist’. If you run across that problem, apply OSS note 594774 and you should be right after that.” However this note currently has OSS status “under rework… released internally only. Is there a replacement note? I encountered this because I am unable to use notepad to trasnfer data. The Wordpad format, using the Internal > external format converstion looks like a workable solution, but it generates the WBS error. Any assistance would be appreciated.
Thank you
Brian
January 9th, 2011 at 9:04 pm
Brian,
Thanks for the comment. I’ll try an dig up for you an excel macro I had that writes the texts file in the expected format.
~p
October 31st, 2011 at 8:06 pm
Hi,
When I run program in test mode everything is ok. But when I uncheck test mode I get message „Error at insert Table PBHI. RC= 4. Key= 000000000002“. Do you know what happens?
November 28th, 2011 at 10:05 pm
Have you checked to see if you have duplicate records in your file?
December 2nd, 2011 at 7:33 pm
Yes I suppose so. I have LSMW upload file which have one line format
STYPE MATNR BEDAE VERSB VERVS PBDNR WERKS MCINC STFNA VRSIC KNTTP SOBKZ KZVBR PSPEL KDPOS KDAUF APROG DATLP UHRLP KZBWS BERID OPLKZ STYPE1 ENTLU EDATU PLNMG
So for one material I can have few lines based on requirement plan and date. Some requirement plans have same dates and some of them same quantities. System reads it well, but when convert it for each line from upload file he create B60BL and B60ET level, so for one material and one requirement plan I have few B60BL and B60ET level. I suppose that in this case I need to have just one B60BL level and few B60ET levels in converted file. But I don’t know how to manage it without any development. Do you have some idea?