cancel
Showing results for 
Search instead for 
Did you mean: 

passing storage bin to BAPI_GOODSMVMT_CREATE

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

JL23
Active Contributor

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_cac...

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. .

Former Member
0 Kudos

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.

Former Member
0 Kudos

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?

JL23
Active Contributor
0 Kudos

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.