Skip to Content
Technical Articles
Author's profile photo Rafael London

EWM – Physical Inventory PI_UPLOAD transaction

In this article, I will explain how to use /SCWM/PI_UPLOAD transaction.

The motivation to discuss this topic was a real life scenario: a customer did an annual physical inventory count outside SAP using excel spreadsheets and the challenge was to update this in SAP EWM. The first option proposed was to use /SCWM/PI_COUNTLIST – Create Phys. Inventory Count in List, but this was far from the best solution.

Prerequisites *

  • You have defined the physical inventory areas in Customizing for SCM Basis. Furthermore, you have made the settings for the low-stock physical inventory or zero-stock physical inventory and the putaway physical inventory, as required.
    For more information, see the Implementation Guide (IMG) under SCM Basis ® Physical Inventory ® Basic Settings ® Define Physical Inventory Area.
  • You have made the required settings in Customizing for EWM. If you want to use cycle counting, for example, you have set the Cycle Counting indicator under Configure Cycle Counting.
    For more information, see the IMG under Extended Warehouse Management ® Internal Warehouse Processes ® Physical Inventory.

* Source


First things first

  • Since in this example we are creating storage bin positions physical inventory documents, verifying if there are previous PI documents with status Active or Count is crucial.
  • Check batch managed products in MARA-XCHPF
  • Check split valuation product in MBEW-BWTTY
  • Check all products unit of measures


Configuration (specific):

IMG > SCM Extended Warehouse Management > Extended Warehouse Management > Internal Warehouse Processes > Physical Inventory > Physical-Inventory-Area-Specific Settings > Define Physical Inventory Area


Scenario 1: one storage bin with one product without handling unit

Storage bin RK01-02-05-07 stocks: 2100 EA of product KIPL-MAT-021

For each storage bin, at least two lines of data should exist in the spreadsheet depending on how many products exists to be counted – a HEADER and an ITEM line:


Hint: in my experience just .csv worked

In order to create the new PI document with count results, you need to select the header line and press the option Create.


Once the PI document was created with status Counted, you just need to Post to finish the PI process.


Scenario 2: one storage bin with several products without handling unit

* Several columns are hidden




Scenario 3: one storage bin with one product with handling unit



As expected, there are two line items for product with handling units


Scenario 4: one storage bin with several products with handling units

* Several columns are hidden



Lessons learned:

  • Before start, you should assure that all physical inventory settings are correct and working properly. Remember that when you have count differences, the Difference Analyzer (transaction /SCWM/DIFF_ANALYZER) should be used in order to correct differences between EWM and S/4.
  • The products should match exactly how they look in /SCWM/MAT1 – i.e. material 532 could be presented as 000000000000000532.
  • Batches should follow the same material rules regarding left zeros.
  • If you want to upload several storage bins count for bins with a unique product, two lines for each record should be populated. And when you have handling units, three lines for each record.
  • Be careful with the unit of measure – CUNI should be correct for your UoM
  • Using .xls did not work for me, just .csv


The transaction /SCWM/PI_UPLOAD is an awesome tool to create physical inventory documents with count results and upload them to the system. Although working properly, the error handling sometimes is not so clear. When uploading the file usually shows red, yellow and green signal as messages. After pressing the Create button to finish the upload process the system issue fuzzy messages like “Program: /LIME/SAPLPI_CORE//LIME/LPI_COREPII line: 1048”.

I hope you like this blog and be valuable for our EWM community.



C.K. Reddy, 2019: SCM Extended Warehouse Management – Configuration Guide with Process Flows

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Harsh Nama
      Harsh Nama

      nice one......can you please provide the xl sheets as well.

      Author's profile photo Rafael London
      Rafael London
      Blog Post Author

      Thanks Harsh Nama

      Please use this link to download the .xls file:


      Author's profile photo Manish Meshram
      Manish Meshram

      Hi Rafael,

      The google drive link is not working. Could you please share the .xls files once again.



      Author's profile photo s surakasi
      s surakasi

      HI Rafael,


      Thanks for posting the blog. Very detailed explaination. I have configured everything which is needed for PI and entered all the relevant fields as per your blog in the excel sheet but when i try to Upload throwing an below error. It does not specify the exact error. Warehouse number is already maintained too. Please put your inputs.




      Author's profile photo Balint Meszaros
      Balint Meszaros

      You need to enter the Warehouse number for all rows in your .csv file, for header rows as well as item rows. Have you done that?

      Author's profile photo Rafael London
      Rafael London
      Blog Post Author

      Thanks Balint for your answer - you are right.
      Please check also your source file field by field.

      Author's profile photo Ravinder R
      Ravinder R

      Hi Santosh,

      Is this issue resolved. I am also getting same error while uploading.


      If resolved can you please tell that how it got resolved.




      Author's profile photo Miranda Postma
      Miranda Postma

      I had warehouse number on all lines as expected, but I got the same error. It turned out that my csv file was using the wrong delimiters. I had commas, but for some reason my system expected semicolons.

      Luckily, this issue can be easily fixed with Notepad. Probably a niche case, but leaving it here just in case 🙂

      Author's profile photo Junaid Hashmi
      Junaid Hashmi

      Yes, also excel can be saved as CSV (with semicolon delimiters) by first changing your excel default decimal separators from '.' to ',' in File > Options > Advanced

      Author's profile photo Francesco Rossi
      Francesco Rossi

      HI Rafael,


      Thanks for posting this very detailed explaination. Do You know if it's possible create the pi document using material with serial number? Where do i can insert SN in file?




      Author's profile photo Martin Mathew
      Martin Mathew


      Were you able to find a solution for this?. We are also looking to create PI document with Serial numbers.


      Thank you


      Author's profile photo Mehmet Ozgur Unal
      Mehmet Ozgur Unal

      Hello Rafael London,

      Good effort, thanks for sharing. Waiting for news.


      M.Ozgur Unal

      Author's profile photo hakim fidan
      hakim fidan

      thansk Rafael London very good  efort..

      Author's profile photo Mangala Gowda
      Mangala Gowda

      Many Thanks for the detailed explanation Rafael

      Author's profile photo Soumik Mitra
      Soumik Mitra

      Good blog, wanted to know 2 points,

      1> As we are setting the tolerance group based on the value, like 10000 EUR etc. , can you confirm how system calculates the value of the difference.

      Is it coming from Material master Accounting 1 View and per unit price ?


      2> Also is there any place in Physical inventory document where we can see the difference amount after counting the document ?

      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham

      Anyone know the HU nested template for upload ? Any link to find that

      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham

      I DONT understand why long explain , consultant just need this template . Consultant already knows

      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham

      Part 2

      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham


      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham

      part  last thats it

      Author's profile photo James Paul Asirvatham
      James Paul Asirvatham

      any help need just mail me  instead giving irrelevant data