Hi Ankush,
Put a break point at the beginning of the following statements:
if ip_qals-lgnum is initial.
select single lgnum from t320 into lv_lgnum
where
werks = ip_qals-werk
and lgort = ip_qals-lagortvorg.
Check what value is passing to ip_qals-lgnum, if it is initial, ip_qals-lagortvorg will also be initial, in this case lv_lgnum will get nothing.
Regards
Danny