08-27-2008 1:06 AM
Can someone comment on using this BAPI for a 415 movement type? I am able to post a 411 and a 412 which achieves the same net effect when I want to move stock from one WBS element to another.
However, our WM system requires a single transfer order as if we posted 415Q via transaction MB1B.
Thanks for suggestions or code snippets if you have them.
>Ray Mannion
08-27-2008 2:43 AM
Well, it's 9:30 at night and I managed to figure it out so I thought the least I could do is to post it to the group here.
In this code, PWA_MAIN is my main work area and lwa_items has the structure asked for in BAPI_GOODSMVT_CREATE.
lwa_items-move_mat =
lwa_items-material = pwa_main-matnr.
lwa_items-move_plant =
lwa_items-plant = pwa_main-werks.
lwa_items-move_stloc =
lwa_items-stge_loc = pwa_main-lgort.
lwa_items-move_batch =
lwa_items-batch = pwa_main-charg.
lwa_items-move_type = '415'.
lwa_items-spec_stock = c_q.
The key is knowing how to populate the WBS elements. In this case, I have the "old" or "from" WBS as PAPSPNR1 and the "new" or "to" WBS as PAPSPNR2.
lwa_items-wbs_elem = papspnr2. lwa_items-val_wbs_elem = papspnr1.
lwa_items-entry_qnt = pwa_main-verme.
lwa_items-entry_uom = pwa_main-meins.
We use a combination of T333 and T320 to determine the storage type and storage bin. (stge_type_pc, stge_bin_pc)
Incidently, I tried using XSTOB = 'X' which added a 416 movement record.
I recommend playing with it in SE37 and creating test variants until you get it right before trying to add the call to your program!
Cheers,
Ray