cancel
Showing results for 
Search instead for 
Did you mean: 

FM to check available stock with batch

Former Member
0 Kudos

Hi Gurus,

I am using BAPI_DELIVERYPROCESSING_EXEC to create a delivery against SO and STO via IDOC. I need FM which will do ATP check for a given plant and most importantly BATCH before delivery creation. Tried to use FM BAPI_MATERIAL_AVAILABILITY but it has no option to check batch stock.


Inputs with a correct FM name is highly appreciated.

Regards

Vishal...

Accepted Solutions (1)

Accepted Solutions (1)

former_member223981
Active Contributor
0 Kudos

BAPI_MATERIAL_AVAILABILITY also checks if there is available quantity in the batch:

Import Parameters:

PLANT LIKE BAPIMATVP-WERKS

MATERIAL LIKE BAPIMATVP-MATNR

UNIT LIKE BAPIADMM-UNIT

CHECK_RULE LIKE BAPIT441V-PRREG

STGE_LOC LIKE BAPICM61V-LGORT

BATCH LIKE BAPICM61V-CHARG  <<<<<<<<<<<<<<<<<<<<<<<<<

CUSTOMER LIKE BAPIKNVVKY-CUSTOMER

DOC_NUMBER LIKE BAPISDHEAD-DOC_NUMBER

This gets passed to the l_atpcs structure:

**************************************************

MOVE plant       TO l_atpcs-werks.


    MOVE stge_loc    TO l_atpcs-lgort.


    MOVE batch       TO l_atpcs-charg.  <<<<<<<<<<<


    MOVE check_rule  TO l_atpcs-prreg.


  MOVE 'X' TO l_atpcs-chkflg.

**************************************************

If a batch is filled, the system will check availability stock in the batch.

Former Member
0 Kudos

Hi Noel,

We have tried above parameters but still getting all available stock as a output. System is not restricting ATP stock with batch.

Vishal...

former_member223981
Active Contributor
0 Kudos

Hi Vishal,

Can you provide a CO09 screenshot that shows this batch is actually not available?

Former Member
0 Kudos

Hi Noel,

Adding screenshot for CO09

FM input and output

Vishal...

former_member223981
Active Contributor
0 Kudos

Hi Vishal,

I tested the same and saw the same behaviour. Actually, the field AV_QTY_PLT will only display the quantity available at plant level. If you want to check the available quantity according to the batch that you have entered, you should look at the field WMDVEX-COM_QTY. This should hold the available quantity according to the storage location / batch.

Hope this helps.

Former Member
0 Kudos

Thanks Noel.. indeed valuesare available in WMDVEX-COM_QTY

Vishal...

Answers (0)