sort descending for MARD
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 .
for example :
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
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.