06-22-2010 10:11 AM
Hello Everyone,
i am stuck , i have to print the storage location where the stock is maximum .
My select program prints the storage location where the stock appears first .
Please help.
for example :
material :-xyz
plant :abc
storage location:- 0,0,3,7,0,4,8
What i want is to print storage location where the stock is 8 but it is printing the storage location where the stock is 3.
Any suggestions , I have to use in a smartform
BR
Sumit
06-22-2010 10:30 AM
Hi,
you need to trigger the Smartform when storage location is maximum i.e.
SORT internal table with Storage Location in ascending .
This will give first record as maximum storage location.
Read the first reocrd from internal table where storage location is populated.
If this is true then call FM SSF_FUNCTION_MODULE_NAME and pass the formname .
Thanks,
Pramod
06-22-2010 10:30 AM
Hi,
you need to trigger the Smartform when storage location is maximum i.e.
SORT internal table with Storage Location in ascending .
This will give first record as maximum storage location.
Read the first reocrd from internal table where storage location is populated.
If this is true then call FM SSF_FUNCTION_MODULE_NAME and pass the formname .
Thanks,
Pramod
06-22-2010 11:02 AM
Thanks pramod for the reply . I really don not know how to make this work.
My code is as follows:-
CLEAR: LOCATION .
SELECT SINGLE LGORT
FROM MARD
INTO LOCATION
WHERE matnr = viqmel-matnr
AND werks = viqmel-werk
and labst NE 0.
CHECK sy-subrc = 0.
I have to print the storage location that has the maximum stock .
BR
Sumit
Edited by: sumit123 on Jun 22, 2010 12:41 PM
06-22-2010 11:46 AM
Hello
Try this snippet:
data: imard like mard occurs 0 with header line.
select * from mard into table imard
where matnr = viqmel-matnr
and werks = viqmel-werk.
sort imard by labst descending.
read table imard index 1.
if sy-subrc = 0.
write: 'Maximum stock at', imard-lgort.
endif.
06-22-2010 1:05 PM