Create Data File for Inventory Count with Batch-Input Method
In this blogpost, I want to share my method and some tips on how to create the data file for Inventory Count with Batch-Input Method. Some of you might have read the tutorial from Jürgen Lins. If you haven’t, I highly recommend it. Here, I am using the MI39 transaction.
As the tutorial explained, we have to create text file respecting the field length of the BISEG structure. Natively, this cannot be done with Excel. But with some workaround, we can create it.
My objective here is to create a blank template file with guidance for users to input the inventory count data.
First, we need to know the field sequence and field length of structure BISEG. Check with SE11.
Copy and transpose this structure; the field name, field length, and description to an empty Excel file. These serves as table headings. We can use them to help adjusting the column width and later as field guidance when users want to input the data.
Adjust each column width with the respective field length from BISEG. For example here, BLDAT length is 8, so adjust the column width to 8. Do this to all fields.
At this point we have created a blank template inventory count file with the required field length. I recommend to protect the sheet before giving this file to users, so that they cannot change the column width. This is very important as the batch input method cannot work with incorrect column width / field length.
But checked/marked the “Delete Rows” option, because later we need to remove the headings, as it is only to be used for data input guidance.
Now, users can input the inventory count data in that file, with the help of the field description as guidance.
Tips: be sure to have the same/one pair of plant and storage location code in the table or data lines, or else SAP will automatically split the inventory count document when different code is detected between the lines.
When the file is completed and ready to be uploaded to SAP, the headings can be deleted, as it is no longer needed.
Then the data file is (almost) ready.
We need to export or save this file to formatted file with space delimited format, or PRN.
If you open this PRN file with Excel, it will lose the column width. But If you open this PRN file with notepad, it will have the field length needed for batch input.
Tips: you can also use Notepad++ to edit the file after it has been exported to PRN. Notepad++ can show you the cursor/pointer coordinate so you can check if any field’s starting position has been misplaced after editing.
Finally you can use this file in the batch input proses, by uploading it with CG3Z. Be sure to check the correct target name “phyinv39_40” and select “ASC” as format.
Check the message after the file upload is finished.
After that, proceed to execute the MI39. Be sure to check the maximum number of items not exceeding 333, as it is the limit of lines for each document. Here, I use 300. You can also use the “Test Data” option before the real execution.
A session will be created. The number of items will reflect the number of lines in the file. Proceed to process the session.
The rest of the process will be done similarly to any other batch input via SM35.
If all goes well, system will pop the completion message.
And it is done. Check the result as usual, from MI22, MI24, MB51, MB52. As I have mention in the beginning, this whole example is done for MI39 but I am sure it is applicable to other inventory count batch input method.
Leave a comment if you have any feedback, and check out the SAP MM Community for other inquires. Thank you.