2013 Mar 21 6:40 AM
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
2013 Jun 28 1:38 PM
2013 Jun 28 6:55 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |