Skip to Content
0

passing storage bin to BAPI_GOODSMVMT_CREATE

Apr 30 at 06:02 AM

22

avatar image
Former Member

Hi,

I am writing a report for mass scrapping parts of our inventory given in an CSV-document.

As not all bins of a material should be scrapped, I want to make sure to just select the correct one.

At the moment I am trying to use BAPI_GOODSMVMT_CREATE to post the material document, and then L_TO_CREATE_TR to create the transfer order from the transportation request.

I do not find a possibility to specify the storage bin to be used. There is a STGE_BIN field in the structure BAPI2017_GM_ITEM_CREATE, but it seems to relate to the destination, not the source. The fields STGE_BIN_PC and STGE_BIN_ST in the same structure have no appearant effect in my case, or so it seems, as the TR looks exactly the same.

Do I miss something? Is there a better way to do it?

regards,

Kristian

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Jürgen L Apr 30 at 08:45 AM
1

L_TO_CREATE_TR works basically like a background creation or a TO from transaction LB10, here you also have no option to enter a storage bin, SAP uses the strategy to determine the bin.

So you might need to look for a different function module to achieve your goal of defining from which you want move the stock to the interim bin, see https://help.sap.com/erp2005_ehp_02/helpdata/en/9b/8ec95360267214e10000000a174cb4/content.htm?no_cache=true

I also believe the bin field in BAPI_GOODSMVMT_CREATE can be used for both directions, precondition is of course that the field is made available in the field selection of the movement type. And it may only work for very simplistic warehouses. Try in MIGO prior to do programming. It may also cause a kind of inconsistency, e.g. that the TR is still created and active while there is nothing to do in WM since you already removed the stock directly from the bin, which means you would need to remove the TR in an extra step. .

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 30 at 06:15 AM
0

I do not find a way to pass a bin to L_TO_CREATE_TR either. And as table LTBK contains field VLPLA (source storage bin) I assumed I would have to create the transfer requirement with the correct source bin.

What would be the correct way, then?

Share
10 |10000 characters needed characters left characters exceeded
Jürgen L Apr 30 at 06:07 AM
0

why would you need to pass a bin in BAPI_GOODSMVMT_CREATE if you are anyway doing a L_TO_CREATE_TR

BAPI_GOODSMVMT_CREATE will create a negative quant in the interim storage type, and L_TO_CREATE_TR will move the quantity from the bin to the interim storage type and make it nil.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 30 at 01:19 PM
0

Jürgens link got me in the right direction. The FM L_TO_CREATE_SINGLE filled with the correct fields was everything needed. Used with the correct movement type the call gets quite minimal.

Share
10 |10000 characters needed characters left characters exceeded