‎2009 Sep 02 1:21 PM
hi all ...
Fetch total invoice cost as VBRK-NETWR+VBRK-MWSBK ..
now can i write it one select select querry ??
select ( netwr + mwsbk ) as abc from vbrk . ??
can this be done??
please help ..
‎2009 Sep 02 1:27 PM
>
hi,
you can try this way..
select sum(netwr) sum(mwsbk) from vbrk into ( w_netwr , w_mwsbk)
where <condition>.
if sy-subrc = 0.
w_total = w_netwr + w_mwsbk.
endif.
regards,
Prabhudas
‎2009 Sep 02 1:27 PM
Hi,
This is not possible....Get the data into an internal table and then loop it and modify the record..
Regards,
Nagaraj
‎2009 Sep 02 1:27 PM
>
hi,
you can try this way..
select sum(netwr) sum(mwsbk) from vbrk into ( w_netwr , w_mwsbk)
where <condition>.
if sy-subrc = 0.
w_total = w_netwr + w_mwsbk.
endif.
regards,
Prabhudas
‎2009 Sep 02 1:29 PM
Hi,
Thats not possible in a single select statement in ABAP. You cannot sum multiple fields of the same table in a single select query.
Only this is possible.
SELECT SUM ( netwr ) SUM (mwsbk )
into ( v_netwr, v_mwsbk )
from vbrk.
Regards,
Vikranth
‎2009 Sep 02 1:32 PM