Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

need help

Former Member
0 Likes
318

hi i am new to abap..got a small doubt..

SELECT labst INTO mard-labst

FROM mard

WHERE matnr = lips-matnr

AND werks = likp-vstel.

ADD mard-labst TO stock.

ENDSELECT.

mard-labst = stock.

i need to subtract stock in one particular location from total stock ..from above select statement i could get total stock avaable in all storage locations..but how can i get stock qty in a particular storage location.do i need to use read statement..can any gimme sample coding..

storge location is FG3..the qty in this location needs to be subtracted.. got field LIPS-LGORT.how can i do this

2 REPLIES 2
Read only

Former Member
0 Likes
297

Hi,

SELECT labst lgort INTO mard-labst l_lgort

FROM mard

WHERE matnr = lips-matnr

AND werks = likp-vstel.

if l_lgort >< 'FG3'.

ADD mard-labst TO stock.

else.

stock = stock - mard-labst.

endif.

ENDSELECT.

mard-labst = stock.

Thanks

Read only

Former Member
0 Likes
297

Make the highlighted change

SELECT labst INTO mard-labst

FROM mard

WHERE matnr = lips-matnr

AND werks = likp-vstel

<b>AND LGORT <> 'FG3'</b>.

ADD mard-labst TO stock.

ENDSELECT.

mard-labst = stock.