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

ABAP

Former Member
0 Likes
477

I NEED HELP PLZ SEE FOR PARTICULAR MATERIAL I HAVE TO FIND QUANTITY AND BATCH NO HOW TO WRITE CODING

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
451

for quantity do like this:

data: l_labst type mard-labst.

select sum( LABST )

into l_labst

from mard

where matnr = p_matnr.

For batches, you have to use the bapi:

BAPI_MATERIAL_GETBATCHES

Regards,

ravi

I NEED HELP PLZ SEE FOR PARTICULAR MATERIAL I HAVE TO FIND QUANTITY AND BATCH NO HOW TO WRITE CODING

2 REPLIES 2
Read only

Former Member
0 Likes
452

for quantity do like this:

data: l_labst type mard-labst.

select sum( LABST )

into l_labst

from mard

where matnr = p_matnr.

For batches, you have to use the bapi:

BAPI_MATERIAL_GETBATCHES

Regards,

ravi

Read only

Former Member
0 Likes
451

Hi,

use tables mard-labst(stock quantity),mch1-charg

tables for

batch.

select matnr labst from mard into table i_mard

for all entries in i_mara

where matnr = i_mara-matnr.

if not i_mard[] is initial.

select matnr charg from mch1 into i_batch

for all entries in i_mard

where matnr = i_mard-matnr

charg in s_charg.

endif.

Regards

amole