Delete order with output firm
Hi,
I am trying to delete few orders. In product view, I see that order as PPDS order and output firmed, PP firmed checked. Is it possible to delete the orders in this status? This order is also in the past.
I tried to delete the order using all the way suggested in this [post|Delete Purchase orders in APO Database] without any luck.
The thing that surprises me is my ORDKEY table is empty! Is that possible. I didn't give any selection in the table and just clicked on "Number of entries" and I got 0.
Please suggest me something.
Thanks.
Edited by: Visu Venkat on Aug 5, 2008 12:11 PM
Could delete using the report /SAPAPO/DELETE_PP_ORDER
Similar Messages
-
Controlling Delete Order with One-To-Many
I have a class that has six 1-M mappings. All of them have a 1-1 back reference. I would like to control the order of deletion to ensure that one of the child collections is always deleted last.
It was suggested to me to use an after-load method to call addConstraintDependencies on the parent descriptor to control the order. This method is being called (before login) but it did not change the order. I added the after-load to the parent descriptor, adding the constraint dependency of the class I want deleted last.
I also tried using "multi-table info" (in addition to the regular one-to-many mappings) but that seems to cause the valueHolder to retrieve the items from the table twice, giving me a list with "doubles" of every item.
What can I do to control the order of the deletes of the children?
Thanks,
AllenHi Don,
This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819��" regarding 1:M mapping insertion problem.(Same one)
Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
Can you suggest if I am missing something.
Your quick response will be appreciated.
Message was edited by:
user466708 -
Hi,
We have a background job with program delete_pp_order, that deleted a PPDS output firmed planned order and sends the deletion to R/3. I can see the planned order and qty. in the spool of the job.
Now when I looked at the product view,it reappeared. I checked the start date of the order and the order number. It is the exact same orders.
What can this be caused by?
I deleted a CIF block in SMQ1 (outbound queue) for other reason. may be this deletion was in the the same LUW as the other queue and go t deleted.
But does deleting the CIF queue bring back a deleted order?? I thought it should be only the deletion change pointer in SMQ1 that's deleted and should be caught up in CCR report. Isn't it???
Any suggestions please?
Thanks.Hi Visu,
When you delete the queue block those changes has not be transferred to R/3 and order is not deleted in R/3.
Whenever next CIF run or do any changes to order will bring back it to APO.
First run the CCR and put both the system in sync.
Delete order again in APO .
Than check order in R/3 whether it is deleted or not , if it is not deleted than check queue block and if any first analyse it by going to details by SLG1,/SAPAPO/C3 or /SAPAPO/CQ and CFG1 on R/3 side.
Take corrective action as per log and reactivate the queues.
Manish -
Error when creating planned orders with BAPI_POSRVAPS_SAVEMULTI3
Hello,
I am working on a program which duplicates planned orders from one planning version to another. To do this, I am using the BAPI BAPI_POSRVAPS_SAVEMULTI3.
When I run the program, I get this error messae from the BAPI: A different planning version is being used.
The flow of my program is the following:
- Reading target planning version
- Deleting orders with the same selection criteria than the orders to be duplicated
- Reading source planning version
- Creating read orders to target planning version (where it goes wrong)
I worked before on another program which does the same but with manufacturing orders, and I did not encounter such a problem.
Can someone help ?
Thanks in advance.Hello Babu,
I am facing the same error in BAPI_PIRSRVAPS_DELMULTI. Could you revert with the solution if you have got one.
Thanks,
Ankit -
Allow to create a purchase order with purchase requisiton item deleted
Dear all,
I have a question about creation purchase order process.
Firstly, I have a purchase requisition with 2 items, first of them is deleted.
If I try to create a purchase order thru transaction ME57N with the previous purchase requisition, I can only create it with one item (the one wich is not deleted)
However, if I try to create the purchase order thru transaction ME21N, with purchase requisition as reference, I can create the PO with item that was deleted in PR.
I don't understand why system allows to create a purchase order with an item that previously was deleted in PR.
Does anyone have a explanation about this issue?
Many thanks in advance
Best Regards.Hi,
In the document overview of ME21N you get all the items of the purchase
requisitions, no matter if they are deleted or not.
When you convert the deleted item into a Purchase Order you get message
06 050 stating that this item is deleted in the purchase requisition.
This message can be defined as an error message in the customizing
transaction OME0. This way, it will not be possible to order an item
which is deleted in the referenced purchase requisition.
BR
Nadia Orlandi -
Change production order with deletion indicator
Hello
We have some production order with deletion indicator, status 'DLT'. We want to reative them and do GR. How can we do, can we remove the status 'DLT'
Thanks
HailiangHailiang,
Its not possible to revoke the deletion flag.
so you need to create new orders, and thats why its being suggested that think twice before setting deletion flag.
if you are not sure with the orders you can set TECO , and it can ve easily revokeas and when required.
Regards
Ritesh -
How to delete planned orders with partial quantities -reg.
Dear Friends,
the issue is
we are not able to delete the old planned orders in MD16 for which partial quantities are existing.
we require to delete these planned orders which are partially serviced to avoid creation of schedule lines for excess quantities.
Is there any way to delete the planned orders for which partial quantities are existing ?
is there need to change any strategy to make MRP not to consider these planned orders with partial quantities for MRP run ?
thanks
Madhu Kiran.Hi Madhu,
Are you getting any error message from MD16? if yes then please send us the messsage number with class. if you do not want that MRP to consider the planned orders then change the startegy 11 for these parts with mixed MRP indicator 1.
try this deletion from MD12 also..planned order change mode. Let us know the fresh update.
Regards
TAJUDDIN -
How to get order, ( Output firmed ) ?
Hello Friends,
I have order id, and now I want to know the complete order details, because I have to check if the output firmed is set or not ?
So I would like to ask, is there any FM which determine the complete order, in against of orderid. ?
Many thanks in advance..
ShahHi Shah,
the FM you mention also works but does a lot more than reading only the order from LC - and in the end it also calls '/SAPAPO/OM_ORDER_GET_DATA' to retrieve the information.
If you only want to have the OUTPUT_FIXED indicator it would be faster if you use the FM I suggested and then only request ET_ORDKEY as an output table - this table contains the OUTPUT_FIXED indicator.
MFG,
Sebastian -
Master data deletion - text with compounding
HI All,
I have " 0PYMT_METH" Info object which is having "0PYMT_METH_TEXT" Data source. " 0PYMT_METH" Info object is having text and 0country with compounding attribute.
- First , I did not load this master data , I loaded transactional data. so some values for key are loaded without text and country in master data.
- Later i came to know we need text for paymnt method, then i loaded again master data. but i am not able to delete previous entries which have blank text.
-i deleted data with SIDS and deleted all the transactional data , still i am getting that entries with blanks.Because of this in report output i am getting # value for the text.
How to solve this? Is it because of compounding attribute ? If so can u please suggest regarding this ASAP?
Thanks in advance,
JoHi,
Please check the data load for the text as you must be loading
MAster Data CHAR , Country , LANGUAGE and TEXT as fields in your data source.
As the Text can be over written so if the porper key fields are matched the text should be modifyed everytime.
SO please check what combination you r loading .
ANyway if that is one time , and very less data you can manually maintain th text for master data .
In order to delete teh data you use SE14 use the text table there to delete the data. PS : This is not recommended solution . -
Order with CLSD status selected
Hey All
I am not sure if this is question in CO but While calculating variances the orders with status as CLSD are also being selected. The system in the output shows the orders with CLSD status which is causing long runtime issues. I am sure that orders with status as CLSD are excluded from processing . Can anyone help me on this
Thanks
AnkurHi ,
You need to regulary set the deletion flag in the closed process orders . Please refer Note 397110 - Performance: Archiving manufacturing orders.
Also refer Note : 393686 on other performance related issues in Cost Object Controlling..
Regards
Sarada -
HOW TO CONTROL ON CREATION OF SALES ORDER WITH REFERENCE TO EARLIER SO?
Dear All,
I want to contol on creation of Sales order with reference to earlier SO? While creation of sales order our enduser are creating sales order with reference to earlier month SO which I want to restrict. Recently I made changes in sales order like payment terms is grayed, system will atomatically pick pay terms from customer master.Now I am getting correct data also but enduser is using old SO no while creating new SO and old payment data is reflecting in fbl5n.
I want to restrict enduser while creating new SO with ref. to old SO. Only for returns they should be able to use Billing refrence. Pl. suggest how to control the with reference to ealier SO.
NikhilNikhil Deshpande,
If you dont want allow create a sales order in referent to other one, just delete the copy control between these sales order type, so when the user tries to create a SO in reference to other one a message is displayed that is not possible.
Thanks,
Mariano. -
How do I delete cascade with a PL/SQL procedure?
This script will create a PL/SQL procedure that deletes cascade. This is a post to contribute to the Oracle community. Take the code as is and test it before you use it in production. Make sure this is what you want.
Procedure Delete Cascade (prc_delete_cascade)
Description
=============
The principle is very simple. The procedure uses a table called TO_BE_DELETED to keep a list of records to be deleted. This
table keeps the table name and the rowid of those records that need to be deleted. The procedure also uses a function called
DELETE_BOTT_ROW which takes one record of the table and tries to delete it. If the deletion fails with a foreign key constraint
violation, the function parses the SQL error message (SQLERRM) to get the name of the constraint. With the name of the constraint,
the function finds the name of the child table, all the child records that have references to the parent table primary or unique key,
and the parent key primary or unique key column name. Once the child records of the failed delete are identified, the function takes their table name and rowids
and records them into the TO_BE_DELETED table by inserting records of their table name and their rowids. Al the records inserted also contain the level (which
is 1 for the original records, 2 for child records, 3 for granchild records, etc.) and the sequence number of the order in wich they
are recorded. This way, when the function picks up a record to be deleted, it takes the one with the highest level and the highest
inserted sequence, or the "bottom" record. Once all the child records of the failed delete are appended to the TO_BE_DELETED table, it calls itself
recursevely, and the function takes the record at the "bottom" of the table and tries to delete it. If it succeeds, it calls
itself recursevely to delete the next record. If it fails, it goes and finds the child records as described before and once they are
inserted into the TO_BE_DELETED table, it calls itself again recursevely to try to delete again the "bottom" record. All records
that are successfully deleted are flagged as deleted usig the flag_del column so they are not pickt up again. Once all the (parent,
child, grandchild, etc.) records are deleted, the procedure ends without commiting, giving the option to the user to commit or
rollback deletions. The table TO_BE_DELETED is, at the end of the procedure, a list of all the records that were deleted, including their table names
and the order in with they were deleted. The user then can review its content and decide to commit or rollback.
Restrictions
============
1. Single tables only. The procedure only takes one table name and a WHERE clause to identified the records to be deleted.
2. Single columns only. Ther procedure only works with single-column primary, unique and foreign key constraints.
3. Single schema only.
4. Unpredictable results with circular references.
drop table to_be_deleted purge;
create table to_be_deleted
(tname varchar2(30) -- table name
,rid rowid -- rowid
,lvl number -- level: 1=parent, 2=child, 3=grandchild, etc.
,seq_ins number -- sequence order of record inserted
,flg_del char -- flag deleted: Y=record deleted
,seq_del number -- global order of record deletion
set serveroutput on size 1000000
create or replace procedure prc_delete_cascade
(p_tname varchar2 -- table name
,p_where varchar2 -- where clause identifying records to be cascade deleted
is
dummy char;
v_sqlcode number;
v_sqlerrm varchar2(32767);
v_param_val integer := 0;
v_sql varchar2(4000);
v_ret_cde number;
e_bad_params exception;
v_iter number;
v_plvl number;
v_seq_del number;
v_max_iter number := 1000000000;
function delete_bott_row
return number
is
v_sql varchar2(4000);
v_ptname varchar2(30); -- parent table name
v_ppkname varchar2(30); -- parent primary key constraint name
v_ppkcname varchar2(30); -- parnet primary key column name
v_prowid rowid;
v_crowid rowid;
v_ctname varchar2(30); -- child table name
v_cfkname varchar2(30); -- child foreign key constraint name
v_cfkcname varchar2(30); -- child foreign key column name
v_ins number;
v_seq_ins number;
v_sqlerrm varchar2(4000);
v_sqlcode number;
e_const_viol exception;
pragma exception_init(e_const_viol, -2292);
e_max_iter_reached exception;
begin
v_iter := v_iter + 1;
if v_iter >= v_max_iter then
raise e_max_iter_reached;
end if;
dbms_output.put_line('- Iter '||to_char(v_iter));
dbms_output.put_line('----------');
dbms_output.put_line('- Starting function delete_bott_row');
v_sql := 'select tname, rid, lvl, seq_ins from (select * from to_be_deleted where flg_del = ''N'' order by lvl desc, seq_ins desc) where rownum=1';
-- dbms_output.put_line('- SQL: '||v_sql);
execute immediate v_sql into v_ptname, v_prowid, v_plvl, v_seq_ins;
dbms_output.put_line('- Selected row: table name: '||v_ptname||', level: '||v_plvl||', seq: '||v_seq_ins);
v_sql := 'delete from '||v_ptname||' where rowid='''||v_prowid||'''';
dbms_output.put_line('- SQL: '||v_sql);
execute immediate v_sql;
dbms_output.put_line('- Row deleted !!!');
v_ret_cde := 1;
v_seq_del := v_seq_del + 1;
dbms_output.put_line('- Mark the row deleted');
v_sql := 'update to_be_deleted set flg_del = ''Y'', seq_del = '||to_char(v_seq_del)||' where tname='''||v_ptname||''' and rid='''||v_prowid||'''';
-- dbms_output.put_line('- SQL: '||v_sql);
execute immediate v_sql;
-- dbms_output.put_line('- Updated table to_be_deleted, row marked deleted');
-- dbms_output.put_line('- End of iter '||to_char(v_iter));
dbms_output.put_line('----------');
-- call function delete_bott_row recursively
v_ret_cde := delete_bott_row;
return 0;
exception
when no_data_found then
dbms_output.put_line('- Table to_be_deleted is empty, delete cascade has completed successfully.');
v_ret_cde := 0;
return 0;
when e_const_viol then
v_sqlcode := SQLCODE;
v_sqlerrm := SQLERRM;
v_ret_cde := v_sqlcode;
dbms_output.put_line('>Constraint Violation. Record has children');
-- dbms_output.put_line('Error code: '||to_char(v_sqlcode));
v_cfkname := substr(v_sqlerrm,instr(v_sqlerrm,'.')+1,instr(v_sqlerrm,')') - instr(v_sqlerrm,'.')-1);
dbms_output.put_line('>Child FK name: '||v_cfkname);
select table_name, column_name
into v_ctname, v_cfkcname
from user_cons_columns
where constraint_name=v_cfkname;
dbms_output.put_line('>Child table name: '||v_ctname||'. FK column name: '|| v_cfkcname);
select constraint_name, column_name
into v_ppkname, v_ppkcname
from user_cons_columns
where constraint_name = (select r_constraint_name
from user_constraints
where constraint_name=v_cfkname);
dbms_output.put_line('>Parent PK/UK name: '||v_ppkname||'. Parent PK/UK column: '||v_ppkcname);
v_sql := 'insert into to_be_deleted(tname, rid, lvl, seq_ins, flg_del) '||
'select '''||v_ctname||''', rowid, '||to_char(v_plvl+1)||', rownum, ''N'' '||
'from '||v_ctname||' '||
'where '||v_cfkcname||' =any (select '||v_ppkcname||' from '||v_ptname||' where rowid =any (select rid from to_be_deleted where tname = '''||v_ptname||'''))';
-- dbms_output.put_line('- SQL: '||v_sql);
execute immediate v_sql;
select count(*)
into v_ins
from to_be_deleted
where lvl = v_plvl+1
and tname = v_ctname
and flg_del = 'N';
dbms_output.put_line('>Found '||to_char(v_ins)||' child records which were added to table to_be_deleted');
v_ret_cde := delete_bott_row;
return v_ret_cde;
when e_max_iter_reached then
dbms_output.put_line('Maximum iterations reached. Terminating procedure.');
raise;
when others then
raise;
end delete_bott_row;
begin
dbms_output.put_line('Beginning');
dbms_output.put_line('================================');
-- validate p_table
begin
select 'Y'
into dummy
from user_tables
where table_name=upper(p_tname);
exception
when no_data_found then
v_param_val := 1;
dbms_output.put_line('Table '||p_tname||' does not exist.');
raise e_bad_params;
end;
dbms_output.put_line('- Parameter p_tname validated');
-- validate p_where
begin
execute immediate 'select ''Y'' from '||p_tname||' where '||p_where INTO dummy;
exception
when no_data_found then -- where clause returns no records
dbms_output.put_line('Record(s) not found. Check your where clause parameter');
v_param_val := 2;
raise e_bad_params;
when too_many_rows then -- found multiple records means it is ok
null;
when others then -- any other records means where clause has something wrong.
dbms_output.put_line('Where clause is malformed');
v_param_val := 2;
raise e_bad_params;
end;
dbms_output.put_line('- Parameter p_where validated');
if v_param_val > 0 then raise e_bad_params; end if;
v_iter := 0;
v_plvl := 1;
v_seq_del := 0;
v_sql := 'insert into to_be_deleted(tname, rid, lvl, seq_ins, flg_del) select '''||upper(p_tname)||''', rowid, '||to_char(v_plvl)||', rownum, ''N'' from '||p_tname||' where '||p_where;
dbms_output.put_line('- Inserting initial record');
dbms_output.put_line('- SQL: '||v_sql);
execute immediate v_sql;
dbms_output.put_line('- Record(s) inserted');
dbms_output.put_line('- Calling function delete_bott_row to delete last row of table to_be_deleted');
dbms_output.put_line('-----------------------------------');
v_ret_cde := delete_bott_row;
-- dbms_output.put_line('- Back from function delete_bott_row');
-- dbms_output.put_line('Return code: '||to_char(v_ret_cde));
dbms_output.put_line('- End of procedure');
exception
when e_bad_params then
dbms_output.put_line('Bad parameters, exiting.');
end;
show errors
spool prc_delete_cascade.log
-- Call to the procedure
exec prc_delete_cascade('xent','xent_id between 1669 and 1670')
select tname "Table Name", count(*) "Rows deleted"
from to_be_deleted
group by tname;
spool off
set lines 120
select *
from to_be_deleted
order by seq_del;
prompt Now commit or rollaback deletions.
-- commit;
-- rollback;Edited by: Rodolfo4 on Mar 23, 2011 10:45 AMInteresting.
I see a few areas where this could be useful. Elimiating specific test records from a Test DB for example.
Some comments:
<li>Since this is a recursive logic you must add a stop criteria. In this case I would add a max iteration variable. If that one is reached, raise an error message and let the procedure stop with that error.</li>
<li>The when others exception at the end should be removed completely</li>
<li>The when others exception in the middle should be replaced by a specific exception that handles the -2292 error</li>
<li>A list of tables where no record should be deleted could be usefull. If the logic would encounter such a table, it should also stop. This would be to prevent that data from some system critical tables could be deleted per accident.</li>
<li>The reference from the FK constraint to the PK constraint should include the table name and if possible the owner (as long as you use user_* views the owner is always the same. But we could extend this to the ALL_* views). I never met a system where different tables have the identical FK constraint names, however just make this fool proof.</li> -
Report for Production orders with name of Customers
Dear Expert,
Kindly suggest to view the production orders with customer numbers for which the sales orders is created.
I tried in MB51 with layout settings but the customer number comes out be blank despite the sales order number is populated for an production order.
Kindly suggst a way or any report in the system to get the corresponding information of production order number and corresponding customer name mentioned in the sales order .
Thanks in advance for your help and inputs..
Best regards,
Nitish jainNitish,
MB51 is a Material Document list. Many production orders exist that have no entries in this report, so it would be an unlikely candidate to be a solution for your requirement..
The standard production order reporting tool is COOIS. The output for MTO orders can be configured to display Sales order and Item and Soldto.
Obviously, displaying even the customer order number in COOIS is impossible in a MTS scenario.
In addition, a user experienced in using SAP Query (SQVI or SQ01/SQ02/SQ03) could also create a production order report without having to know ABAP, by properly linking tables AFKO, AUFK, AFPO (production order data) with VBAK (sales order header data) to get customer number, and KNA1 to get customer name..
If you are not expert in SAP Query, I suggest you discuss this requirement with a local ABAPer.
If you are feeling like educating yourself in the wonders of SAP query, try this doc. Although old, SAP query hasn't changed very much since this document was written.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
Rgds,
DB49
Edited by: Dogboy49 on Apr 20, 2010 10:47 PM -
Report to Purchase Orders with Good Receipt and pending for Invioce Receipt
Hello,
I'm looking a report bring me Purchase Orders with Goods Receipt and waiting for Invioce Verificacion (MIRO).
I appreciate any help.
Regards,
HectorHi,
ME2N - In selection screen, enter Selection parameters as
WE102 i.e. Goods receipt exists and in output screen put a filter on "Still to be invoiced (qty)" and "Still to be invoiced (val.)" as not equal to zero OR greater than Zero.
OR use RECHNUNG i.e. Open invoices and execute the report
OR Use MB5S - GR/IR Balances -
Sale order with item category TAN not getting displayed in md04
Hi,
We have a sale order with item category TAN, Schedule line category CP, MRP type ND and availability check as 07. This is not getting reflected in md04. But item category TAB gets displayed under the PR number.
Please let me know what checks to be made or changes to be done for the sale order with item category TAN to get displayed in md04 screen
Thanks & RegardsHi all,
I changed the MRP type to PD, and from the next sale order, line item onwards, it was getting displayed in md04 screen. The already created one anyway dint get reflected. So I had to delete the line item and create a new one.
Thanks all for the help
Regards,
Jegashree
Maybe you are looking for
-
Does the DVI-to-video adapter work on 8600GT macbookpros?
I have the newest 15" macbook pro (rev 3,1) with the 8600GT nvidia gpu. I bought the dvi-to-s-video output adapter on the online store, and I cannot get it to work - all I get is scrambled looking video, like I'm trying to watch a premium channel I h
-
IPod Touch 4g internet conection works on and off
I got my new touch just a while ago after my classic died, it worked great. Then out of the blue the internet performes horribly. 99% of the time now I get the error that I cant connect to the itunes store or appstore when I open it. If I can get it
-
Enabling log4j for a single class or package
hi all If i use log4j for logging in my classes, is there a way for enabling it just for a single class or a packages? Considers that i use log4j.properties for configure it Regards Giovanni
-
The Brightness and Wallpaper setting of my iphone 5 will not open. All other settings open and work fine. What could be the problem?
-
Post data from one schema to another schema
hi all, i am using db10g. i have to get some data in one user and post those records into another user. what is the way to acheive it? Please help. Thanks..