cancel
Showing results for 
Search instead for 
Did you mean: 

cancel process order

Former Member
0 Kudos

how to cancel process order confirmed in z program

i mean details for cqancellation of process order phase wise and operation wise like tables, bapi

Accepted Solutions (0)

Answers (2)

Answers (2)

sjeevan
Active Contributor
0 Kudos

Get the confirmation number (RUECK) and confirmation counter (RMZHL) by plugging in order number in AUNFR in the table AFRU. Use the following BAPI to cancel confirmation.


CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL' "Cancel production order confirmation
 EXPORTING
  confirmation =              " bapi_pp_conf_key-conf_no  Confirmation
  confirmationcounter =       " bapi_pp_conf_key-conf_cnt  Confirmation Counter
  postg_date =                " bapi_pp_confirm-postg_date  Posting Date
  conf_text =                 " bapi_pp_confirm-conf_text  Confirmation Text
 IMPORTING
  return =                    " bapiret1      Return Parameter
  locked =                    " bapi_coru_param-locked  Indicator: Order is locked
  created_conf_no =           " bapi_pp_conf_key-conf_no  Confirmation of Cancellation Record
  created_conf_count =        " bapi_pp_conf_key-conf_cnt  Confirmation Counter for Cancellation Record
    .  

BAPI format courtesy:

http://www.se80.co.uk/sapfms/b/bapi/bapi_prodordconf_cancel.htm

Edited by: Jeevan Sagar on Feb 9, 2012 12:03 PM

Former Member
0 Kudos

okay but i am interested in how can i able to find which confirmation order should i take means i want only the orders which are not cancelled yet and i want to cancell the order phase wise so hw can i do that

sjeevan
Active Contributor
0 Kudos

You need to look up in table AFRU if phases have different confirmation number or something else different. You need to do that research. My system don't have PP-PI so I cannot look it up for you. But i can give you most of the logic though.

First you need to check if the order is confirmed and also it's not cancelled

You will see the entry in AFRU where AFRU-STOKZ u2260 'X' and AFRU-STZHL = ' '

For cancellation use the BAPI ( you need to get your values from AFRU to fill the entires in the input of this BAPI)

BAPI_PROCORDCONF_CANCEL <<< Test this function module for a few phases in SE37

and you need to commit this bapi using (in the abap program)

BAPI_TRANSACTION_COMMIT

former_member188931
Active Contributor
0 Kudos

Hi,

You can cancel it thorough CO13.

Find the tables order and operation wise AFRU, AFVC.

Please check and revert.

Thanks

Hrishi

Former Member
0 Kudos

actually i am developing that in z program

i got one bapi bapi_procordconf_getlist, how could i use that to find which orders are cancelled already so as to get orders wich are not cancelled yet and i would able to cancel it

former_member188931
Active Contributor
0 Kudos

Hi,

Pass the table AFRU from the BAPI and select the field name STZHL. This field gets activated (value 1)when you cancel the confirmation. Now apply the logic not to consider the orders which has STZHL value activated.

Please check and revert.

Former Member
0 Kudos

how can i find link between order no and phase of operation used against particular confirmation of process

order by using AFVC and AFRU tables and others, as i want to cancel confirmation order phase wise in my z program