‎2008 Oct 28 3:22 AM
Hi,
i want to use the function module AVAILABILITY_CHECKin my program to display the atp quatity
please let me know the parameters to be passed to this function module
‎2008 Oct 28 3:27 AM
hi,
check this thread ,you will find the solution.
[https://forums.sdn.sap.com/click.jspa?searchID=17967950&messageID=749841]
‎2008 Oct 28 3:51 AM
hi,
Thanks for your response but i have passed the same parameters but iam getting the atp quantity (atpdsx) as 0 which is not correct .Please check the below code
FORM build_l_atpcs.
LOOP AT tbl_marc.
CLEAR: atpdsx,atpcs_r3,atpmatd,atpfieldx,advex,t441vx,atpdiax.
REFRESH: atpdsx,atpcs_r3,atpmatd,atpfieldx,advex,t441vx,atpdiax.
CLEAR l_atpcs.
REFRESH l_atpcs.
MOVE tbl_marc-matnr TO l_atpcs-matnr.
MOVE tbl_marc-werks TO l_atpcs-werks.
MOVE p_prreg TO l_atpcs-prreg.
MOVE sy-datlo TO l_atpcs-bdter.
MOVE 'VC' TO l_atpcs-delkz.
MOVE 'EXP' TO l_atpcs-chmod.
MOVE 1 TO l_atpcs-xline.
MOVE 'X' TO l_atpcs-resmd.
MOVE 'X' TO l_atpcs-chkflg.
MOVE 1 TO l_atpcs-idxatp.
MOVE 'A' TO l_atpcs-trtyp.
MOVE 0 TO l_atpcs-yline.
APPEND l_atpcs.
Fill in atpca.
MOVE 'A' TO l_atpca-rdmod.
MOVE 'T' TO l_atpca-azerg.
MOVE 8 TO l_atpca-anwdg.
MOVE 'N' TO l_atpca-xenqmd.
APPEND l_atpca.
get availability details
CALL FUNCTION 'AVAILABILITY_CHECK'
TABLES
p_atpcsx = l_atpcs
p_atpassx = atpassx
p_atpcsx_r3 = atpcs_r3
p_atpdsx = atpdsx
p_atpmatx = atpmatd
p_atpfieldx = atpfieldx
p_mdvex = advex
p_t441vx = t441vx
p_tmvfx = tmvfx
p_atpdiax = atpdiax
CHANGING
p_atpca = l_atpca
p_atpcb = atpcb
EXCEPTIONS
error = 1
OTHERS = 2.