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

BAPI /AFS/BAPI_INDIVIDUAL_ARUN deallocation is incorrect

Former Member
0 Likes
958

Dear Gurus,

Our customer is using the above mentioned BAPI in a report for deallocating stock from a set of sale orders. But, the issue is when the report is executed,

not all the stock is getting deallocted. Some are left. Is that a problem with the BAPI or am I passing the data wrong.

Please find my code below.,

Firstly, all the sales orders for the given material/ plant combination is retrieved from table J_3ABDBS. They're consolidated into table lt_alloc with all required data. This data is passed on to the BAPI.

LOOP AT gt_allc INTO gs_allc.

    MOVE:gs_allc-vbeln      TO ls_allc-sales_doc_number,
         gs_allc-posnr     
TO ls_allc-itm_number,
         gs_allc-etenr     
TO ls_allc-sch_number,
         gs_allc-menge     
TO ls_allc-quantity,
         gs_allc-lgort     
TO ls_allc-stge_loc,
         gs_allc-j_3asize  
TO ls_allc-batch .
    ls_allc-action  = 
'D'.                                 " For deallocating
    ls_allc-mrp_status = p_mrpst.                  " default 'R' ( Reserved )
   
APPEND ls_allc TO lt_allc.
   
CLEAR:ls_allc.

CALL FUNCTION '/AFS/BAPI_INDIVIDUAL_ARUN'

       
EXPORTING

*          arun_type = ''

          arun_mode =
'N'

       
IMPORTING

         
return    = ls_return1

       
TABLES

          orders    = lt_allc

          RESULT    = lt_result

         
MESSAGE   = lt_return.

Please guide me on this.,

Thanks in advance.

~ Harish

Dear Gurus,

Our customer is using the above mentioned BAPI in a report for deallocating stock from a set of sale orders. But, the issue is when the report is executed,

not all the stock is getting deallocted. Some are left. Is that a problem with the BAPI or am I passing the data wrong.

Please find my code below.,

Firstly, all the sales orders for the given material/ plant combination is retrieved from table J_3ABDBS. They're consolidated into table lt_alloc with all required data. This data is passed on to the BAPI.

LOOP AT gt_allc INTO gs_allc.

    MOVE:gs_allc-vbeln      TO ls_allc-sales_doc_number,
         gs_allc-posnr     
TO ls_allc-itm_number,
         gs_allc-etenr     
TO ls_allc-sch_number,
         gs_allc-menge     
TO ls_allc-quantity,
         gs_allc-lgort     
TO ls_allc-stge_loc,
         gs_allc-j_3asize  
TO ls_allc-batch .
    ls_allc-action  = 
'D'.                                 " For deallocating
    ls_allc-mrp_status = p_mrpst.                  " default 'R' ( Reserved )
   
APPEND ls_allc TO lt_allc.
   
CLEAR:ls_allc.

CALL FUNCTION '/AFS/BAPI_INDIVIDUAL_ARUN'

       
EXPORTING

*          arun_type = ''

          arun_mode =
'N'

       
IMPORTING

         
return    = ls_return1

       
TABLES

          orders    = lt_allc

          RESULT    = lt_result

         
MESSAGE   = lt_return.

Please guide me on this.,

Thanks in advance.

~ Harish

2 REPLIES 2
Read only

Former Member
0 Likes
686

Closed..., Unanswered

Read only

0 Likes
686

Hi Harish,

Are you doing some processing after call of this BAPI?.. May be some changes did not get enough processing time to get committed to DB.

BR.