Skip to Content

Function module to determine next empty storage bin


I have a program that creates transfer order with multiple items for putaway using FM L_TO_CREATE_MULTIPLE.

The program needs to transfer the stocks to one storage bin per TO, therefore I need to determine the next empty bin for a given storage type before the call to L_TO_CREATE_MULTIPLE. Do you have a suggestion on what function module to use? If there is no function, any table or logic you can recommend to look for the next empty bin for a given storage type?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2015 at 04:44 PM

    Finding an empty bin in a storage tye is easy to implement by a few queries.

    1. step, select entries from table LAGP into intrnal table IT_LAPG, where LGTYP is your storage type.
    2. sort internal table IT_LAGP by storage bin ascending
    3. loop at IT_LAGP into WA_LAGP

    4. select single from LQUA where LGPLA eq WA_LAGP-LGPLA

    5. if sy-subrc NE 0 => you found your bin, it's WA_LAGP-LGPLA
    Make sure you exit the loop after finding the bin so you don't waste CPU time.

    That's it.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2015 at 03:01 PM

    I am not very much clear on your requirement however as an alternate of L_TO_CREATE_MULTIPLE you can useL_TO_CREATE_Single

    Add a comment
    10|10000 characters needed characters exceeded

    • If I create the TO through LT06 and assign the same destination bin to all items, it saves it perfectly and no warning (except for "Check you entries") or error is displayed. For your 3rd question, I really can't say because I am not a WM functional and I am not familiar with the settings they did. As far as I know, the storage type is determined by the storage type indicator from the material master and I just need the next empty bin of this S. type.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.