05-10-2007 12:19 PM
Hi Experts,
I have a requirement to Suggest a Bin (in a custom program) similar to LT09 (which automatically assigns a Bin). I've read several threads and it says to use the FM L_TO_PREPARE_ITEM_INT. Unfortunately, I cannot make this FM work. There are too many parameters to pass and I don't know which parameters and specific fields are important.
I need to know if there are other FM's / techniques / logic that can help me to solve my problem. If L_TO_PREPARE_ITEM_INT is the only way to determine the suggested bin, I need someone to help me identify the parameters that are really required to run this FM properly. It would be better if someone can copy & paste their sample code.
Points will be rewarded ASAP.
Thanks and Best Regards,
Arman
05-10-2007 1:04 PM
Hi
you need to have following
I_LTAK = LTAK
I_LTAP = LTAP
I_MGEF = MGEF
I_MLVS = MLVS
I_RL03A = RL03A
I_T333 = T333
I_T334T = T334T
I_T340D = T340D
1) You will get SU details from LEIN table for SU(LENUM), using the same u can
fetch data from LQUA with condition WHERE LGNUM = I_LEIN-LGNUM
AND LGTYP = I_LEIN-LGTYP
AND LGPLA = I_LEIN-LGPLA
AND LENUM = I_LEIN-LENUM.
2) Fil LTAk with I_LQUA-LGNUM TO LTAK-LGNUM,
'999' TO LTAK-BWLVS,.
3) Copy the LQUA details to LTAP
4) Fill MVS with below code :
MOVE: 'MLVS' TO MTCOM-KENNG,
'MMSTA' TO MTCOM-T141_FELD,
I_LQUA-MATNR TO MTCOM-MATNR,
V_WERKS TO MTCOM-WERKS, " Plant user assigned
i_lein-LGNUM TO MTCOM-LGNUM,
SY-LANGU TO MTCOM-SPRAS.
CALL FUNCTION 'MATERIAL_READ'
EXPORTING
SCHLUESSEL = MTCOM
IMPORTING
MATDATEN = MLVS
RETURN = MTCOR
EXCEPTIONS
MATERIAL_NOT_FOUND = 1.
5) Data for MGEF:
Select region code from T300
SELECT SINGLE REGKZ FROM T300 INTO T300-REGKZ
WHERE LGNUM = i_lein-LGNUM.
Select single * statement is required here as whole structure is
passed to function module
SELECT SINGLE * FROM MGEF INTO MGEF
WHERE STOFF = MLVS-STOFF AND REGKZ = T300-REGKZ.
6) * passed to function module
SELECT SINGLE * FROM T333 WHERE LGNUM = i_lein-LGNUM
AND BWLVS = 999.
*Select single * statement is required here as whole structure is passed
*to function module
SELECT SINGLE * FROM T340D WHERE LGNUM = i_lein-LGNUM.
7) Keep T334T blank
This FM generates TO and also a proposed bin (NLTYP)
Thanks
Sandeep