cancel
Showing results for 
Search instead for 
Did you mean: 

Availability check for SO without VA02

Former Member
0 Kudos

Hi Gurus,

I need help for a solution to perform availability check in sales orders without explicitly going to VA02 (avoiding va02 as using Va02 triggers the SO approval workflow).

I am aware of V_V2 but V_v2 has and issue that it is run for a plant/material combination which includes all orders for these. I need to perform availability check for a specific SO (all line items).

So I would be thinking of creating a Z T-Code where I can call any FM or BAPI to impact/change the SO. My Workflow can be prevented since the T-Code will not be VA02 (background change is acceptable).

Please help if there is any standard method for this or if my idea is the correct choice, then please help with FM/BAPI for the same.

Accepted Solutions (0)

Answers (6)

Answers (6)

ahmed_mansour
Explorer
0 Kudos

You can Check Availability using V_V1 for Specific sales order.

n_soni
Participant
0 Kudos

Sachin,

You can check Function module

BAPI_SALESORDER_SIMULATE

Sales Order: Simulate Sales Order

Functionality

This method has the same interface definition as the BAPI_SALESORDER_CREATEFROMDAT1 function but differs from it in that here the sales order is not updated.

Here you can determine availability and pricing. This data is displayed in the ORDER_ITEMS_OUT table.

Hope this helps.

Thank,

NRS

former_member223981
Active Contributor
0 Kudos

"So I would be thinking of creating a Z T-Code where I can call any FM or BAPI to impact/change the SO. My Workflow can be prevented since the T-Code will not be VA02 (background change is acceptable)."

You are thinking along the correct lines in my opinion. See note 549064, Q2. This note explains why it was not possible to include every selection field for the V_V2 program. You could just enhance it with the selection of the VBELN.

0 Kudos

Use below FM to perform Availability check for the material and plant

  CALL FUNCTION 'AVAILABILITY_CHECK_CONTROLLER'

    TABLES

      p_atpcsx    = li_atpcs

      p_atpfieldx = li_atpfield

      p_atpmatx   = li_atpmatx

      p_mdvex     = li_mdvex

      p_tmvfx     = li_tmvfx

    CHANGING

      p_atpca     = k_atpca

    EXCEPTIONS

      error       = 1

      OTHERS      = 2.

VeselinaPeykova
Active Contributor
0 Kudos

If the result of ATP check means more products will be delivered, does it not make sense to have somebody review the order again?

I am not a workflow expert, but it is not a must to have workflow start conditions bound to a TCODE.

No idea what your workflow does exactly, but considering that you can perform changes to sales documents also from other transactions (change materials, delivering plant, repricing from VA05, plenty of stuff with MASS), there is definitely a way to abuse your design.

sez41
Active Contributor
0 Kudos

This does not look very promising. At the very least, think about calling function AVAILABILITY_CHECK which initiates the handling of availability check, but bear in mind that populating all the parameters needed for this function will become a real burden.