Procedure for Archive the data
Hello Experts,
I need to write a procedure for clean up the data base. Below is my rek.
User should be provided with options of entering the table name and also should be given option to select whether he wants to delete all the data or archive the table.
--> Program should provide the list of tables that are related to the table name that was given by the user. (This is not required if the table is stagging table, as they don't have constraints associated with them)
--> If user wants to archive then the data in the tables and its related table should be archived (exported) into a flat file and then delete the data from each table in a sequence. Else, we need to delete the data without archiving.
Can you Please let me know the procedure for the above rek and also I am not sure about the archiving the data. If you don't know the table name and the columns. so How can you define a cursor record to handle the record.
Can you please send me the complete code for the above rek to [email protected]
I appreciate help in this regard.
Thanks & Regards,
Sree.
Can you please send me the complete code for the
above rek to [email protected]
I appreciate help in this regard.The goal of this forum is not to make your job, but to assist you with guidelines, references, and concepts, on specific issues. If you want someone to code for you, then you should hire a programmer instead.
~ Madrid
Similar Messages
-
Lock NOT set for: Archiving the data from a data target
Dear Expert,
I try to archive one of my info cube, when i start to write the Archive file the Free Space in the Archive folder not enough and it make the process error.
Then i try to changes the Archive folder to another path with enough free space. But when i start to write the archive file with new variant this error message came up :
==============================================================
An archiving run locks InfoProvider ZICCPS810 (archivation object BWCZICCP~0)
Lock NOT set for: Archiving the data from a data target
InfoProvider ZICCPS810 could not be locked for an archiving session
Job cancelled after system exception ERROR_MESSAGE
==============================================================
Please Help Me.
Wawan SHi Wawan,
If the earlier archive session resulted in error, please try to invalidate the earlier session in archive management and try running archive job again.
Hope this helps,
Naveen -
What is the procedure to transfor the data to idoc.
Hi Abapers,
What is the procedure to transfor the data to idoc.
I have added some new fields in my program. so now i need to transfer those same filed into IDOC.
Can any body tell me the procedure.
Points will be given.Hi,
First of all, you have to find an EXIT in the driver program. In the exit, you have to populate the values to the new segments which you created.
Creation of custom idoc includes the following steps:
Create Segment ( WE31)
Create Idoc Type ( WE30)
Create Message Type ( WE81)
Assign Idoc Type to Message Type ( WE82)
Creating a Segment
Go to transaction code WE31
Enter the name for your segment type and click on the Create icon Type the short text Enter the variable names and data elements Save it and go back Go to Edit -> Set Release Follow steps to create more number of segments
Create IDOC Type
Go to transaction code WE30
Enter the Object Name, select Basic type and click Create icon Select the create new option and enter a description for your basic IDOC type and press enter Select the IDOC Name and click Create icon The system prompts us to enter a segment type and its attributes Choose the appropriate values and press Enter The system transfers the name of the segment type to the IDOC editor.
Create IDOC Type
Follow these steps to add more number of segments to Parent or as Parent-child relation
Save it and go back
Go to Edit -> Set release
Create Message Type
Go to transaction code WE81
Change the details from Display mode to Change mode After selection, the system will give this message The table is cross-client (see Help for further info). Press Enter Click New Entries to create new Message Type Fill details Save it and go back
Assign Message Type to IDoc Type
Go to transaction code WE82
Change the details from Display mode to Change mode After selection, the system will give this message The table is cross-client (see Help for further info). Press Enter.
Click New Entries to create new Message Type.
Fill details
Save it and go back -
Hi,
Iam new to the xml,
can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>.
Regards,
vikram.here is the your XML parse in 11g :
select *
from xmltable('//Entity' passing xmltype
'<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>
') columns
"dcode" varchar2(4000) path '/Entity/dcode',
"ddesc" varchar2(4000) path '/Entity/ddesc',
"reauthflag" varchar2(4000) path '/Entity/reauthflag'
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
Using this parser you can create procedure as
SQL> create or replace procedure myXMLParse(x clob) as
2 begin
3 insert into MyXmlTable
4 select *
5 from xmltable('//Entity' passing xmltype(x) columns "dcode"
6 varchar2(4000) path '/Entity/dcode',
7 "ddesc" varchar2(4000) path '/Entity/ddesc',
8 "reauthflag" varchar2(4000) path '/Entity/reauthflag');
9 commit;
10 end;
11
12 /
Procedure created
SQL>
SQL>
SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
PL/SQL procedure successfully completed
SQL> select * from MYXMLTABLE;
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
SQL>
Ramin Hashimzade -
Gui_download for transferring the data from internal table to excel sheet.
hi all,
i am using gui_download for transferring the data from internal table to excel sheet.
I have a internal table with 3 columns col1,col2,col3 and I am getting the file at the specified path,but my problem is that,in the excel sheet(path specified) all the 3 columns values are printed in one column.Please help me.
Thanks in advance.Hi Venkata,
plz use FM 'SAP_CONVERT_TO_XLS_FORMAT' :
call function 'SAP_CONVERT_TO_XLS_FORMAT'
exporting
* I_FIELD_SEPERATOR =
* I_LINE_HEADER =
i_filename = p_file
* I_APPL_KEEP = ' '
tables
i_tab_sap_data = t_mbew
* CHANGING
* I_TAB_CONVERTED_DATA =
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Hope this helps,
Erwan -
Query taking long time for EXTRACTING the data more than 24 hours
Hi ,
Query taking long time for EXTRACTING the data more than 24 hours please find the query and explain plan details below even indexes avilable on table's goe's to FULL TABLE SCAN. please suggest me.......
SQL> explain plan for select a.account_id,round(a.account_balance,2) account_balance,
2 nvl(ah.invoice_id,ah.adjustment_id) transaction_id,
to_char(ah.effective_start_date,'DD-MON-YYYY') transaction_date,
to_char(nvl(i.payment_due_date,
to_date('30-12-9999','dd-mm-yyyy')),'DD-MON-YYYY')
due_date, ah.current_balance-ah.previous_balance amount,
decode(ah.invoice_id,null,'A','I') transaction_type
3 4 5 6 7 8 from account a,account_history ah,invoice i_+
where a.account_id=ah.account_id
and a.account_type_id=1000002
and round(a.account_balance,2) > 0
and (ah.invoice_id is not null or ah.adjustment_id is not null)
and ah.CURRENT_BALANCE > ah.previous_balance
and ah.invoice_id=i.invoice_id(+)
AND a.account_balance > 0
order by a.account_id,ah.effective_start_date desc; 9 10 11 12 13 14 15 16
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
| 0 | SELECT STATEMENT | | 544K| 30M| | 693K (20)|
| 1 | SORT ORDER BY | | 544K| 30M| 75M| 693K (20)|
|* 2 | HASH JOIN | | 544K| 30M| | 689K (20)|
|* 3 | TABLE ACCESS FULL | ACCOUNT | 20080 | 294K| | 6220 (18)|
|* 4 | HASH JOIN OUTER | | 131M| 5532M| 5155M| 678K (20)|
|* 5 | TABLE ACCESS FULL| ACCOUNT_HISTORY | 131M| 3646M| | 197K (25)|
| 6 | TABLE ACCESS FULL| INVOICE | 262M| 3758M| | 306K (18)|
Predicate Information (identified by operation id):
2 - access("A"."ACCOUNT_ID"="AH"."ACCOUNT_ID")
3 - filter("A"."ACCOUNT_TYPE_ID"=1000002 AND "A"."ACCOUNT_BALANCE">0 AND
ROUND("A"."ACCOUNT_BALANCE",2)>0)
4 - access("AH"."INVOICE_ID"="I"."INVOICE_ID"(+))
5 - filter("AH"."CURRENT_BALANCE">"AH"."PREVIOUS_BALANCE" AND ("AH"."INVOICE_ID"
IS NOT NULL OR "AH"."ADJUSTMENT_ID" IS NOT NULL))
22 rows selected.
Index Details:+_
SQL> select INDEX_OWNER,INDEX_NAME,COLUMN_NAME,TABLE_NAME from dba_ind_columns where
2 table_name in ('INVOICE','ACCOUNT','ACCOUNT_HISTORY') order by 4;
INDEX_OWNER INDEX_NAME COLUMN_NAME TABLE_NAME
OPS$SVM_SRV4 P_ACCOUNT ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME ACCOUNT_NAME ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT CUSTOMER_NODE_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT ACCOUNT_TYPE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_ACCOUNT_TYPE ACCOUNT_TYPE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_INVOICE INVOICE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_PREVIOUS_INVOICE PREVIOUS_INVOICE_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_NAME ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 I_LAST_MODIFIED_ACCOUNT LAST_MODIFIED ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_INVOICE_ACCOUNT INVOICE_ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT ACCOUNT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT SEQNR ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_INVOICE INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA CURRENT_BALANCE ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ACCOUNT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_LMOD LAST_MODIFIED ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_PAYMENT PAYMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADJUSTMENT ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_APPLIED_DT APPLIED_DATE ACCOUNT_HISTORY
OPS$SVM_SRV4 P_INVOICE INVOICE_ID INVOICE
OPS$SVM_SRV4 U_INVOICE CUSTOMER_INVOICE_STR INVOICE
OPS$SVM_SRV4 I_LAST_MODIFIED_INVOICE LAST_MODIFIED INVOICE
OPS$SVM_SRV4 U_INVOICE_ACCOUNT ACCOUNT_ID INVOICE
OPS$SVM_SRV4 U_INVOICE_ACCOUNT BILL_RUN_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_BILL_RUN BILL_RUN_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_INVOICE_TYPE INVOICE_TYPE_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_CUSTOMER_NODE CUSTOMER_NODE_ID INVOICE
32 rows selected.
Regards,
Bathula
Oracle-DBAI have some suggestions. But first, you realize that you have some redundant indexes, right? You have an index on account(account_name) and also account(account_name, account_id), and also account_history(invoice_id) and account_history(invoice_id, adjustment_id). No matter, I will suggest some new composite indexes.
Also, you do not need two lines for these conditions:
and round(a.account_balance, 2) > 0
AND a.account_balance > 0
You can just use: and a.account_balance >= 0.005
So the formatted query isselect a.account_id,
round(a.account_balance, 2) account_balance,
nvl(ah.invoice_id, ah.adjustment_id) transaction_id,
to_char(ah.effective_start_date, 'DD-MON-YYYY') transaction_date,
to_char(nvl(i.payment_due_date, to_date('30-12-9999', 'dd-mm-yyyy')),
'DD-MON-YYYY') due_date,
ah.current_balance - ah.previous_balance amount,
decode(ah.invoice_id, null, 'A', 'I') transaction_type
from account a, account_history ah, invoice i
where a.account_id = ah.account_id
and a.account_type_id = 1000002
and (ah.invoice_id is not null or ah.adjustment_id is not null)
and ah.CURRENT_BALANCE > ah.previous_balance
and ah.invoice_id = i.invoice_id(+)
AND a.account_balance >= .005
order by a.account_id, ah.effective_start_date desc;You will probably want to select:
1. From ACCOUNT first (your smaller table), for which you supply a literal on account_type_id. That should limit the accounts retrieved from ACCOUNT_HISTORY
2. From ACCOUNT_HISTORY. We want to limit the records as much as possible on this table because of the outer join.
3. INVOICE we want to access last because it seems to be least restricted, it is the biggest, and it has the outer join condition so it will manufacture rows to match as many rows as come back from account_history.
Try the query above after creating the following composite indexes. The order of the columns is important:create index account_composite_i on account(account_type_id, account_balance, account_id);
create index acct_history_comp_i on account_history(account_id, invoice_id, adjustment_id, current_balance, previous_balance, effective_start_date);
create index invoice_composite_i on invoice(invoice_id, payment_due_date);All the columns used in the where clause will be indexed, in a logical order suited to the needs of the query. Plus each selected column is indexed as well so that we should not need to touch the tables at all to satisfy the query.
Try the query after creating these indexes.
A final suggestion is to try larger sort and hash area sizes and a manual workarea policy.alter session set workarea_size_policy = manual;
alter session set sort_area_size = 2147483647;
alter session set hash_area_size = 2147483647; -
Which Function Module is used for converting the DATE in BDC
HI,
Which Function Module is used for converting the DATE Format in BDC for Uploading purpose please help me.data : date like sy-datum.
data : odate(10) type c.
date = sy-datum. " in format YYYYMMDD
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = date
IMPORTING
OUTPUT = odate .
write:/ odate. "in ur format '.
1.
In ur itab make a field for date as 10 characters and use this Fm to store the date .
2. Pass the date as the charcter field to the screen and now check . -
PL SQL Procedure to validate the data before inserting
Hi All,
I have a PLSQL procedure that validates the data and also inserts the data into the table. That procedure must be run to validate each row to be inserted. My doubt is how to reference that procedure within the interface of ODI.
After reading some posts that mention the use of procedures, I think the best option is to call the procedure inside the knowledge module (inside a cursor that does a insert clause). Am I correct?
As the KM's do a lot of verification and use temporary tables, I don't know what are the steps to be modified. Also, I would like to know if it's necessary to modified only the IKM or the LKM too.
I'm using the IKM Oracle Incremental Update (PL SQL) and LKM Oracle to Oracle.
Thanks.
Lucieneby validating data you mean looking up some table and see if it exists?
If this is the case the you can implement this using a user function.
If validation fails then you may put a -1 into the mapping.
Then put a constraint on the target( say column is -1) and enable flow control. -
Are there any standard Idocs or Bapis for posting the data into transaction
Hi,
Are there any standard Idocs or Bapis for posting the data into transactions ME42N and IK11?
Thank You.Thank you.
Any idea of the other one? -
We collected data using NI in the Labview environment and created tdms document. Is there a reader for reading the data in Matlab environment?
A search will often turn up results.
Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software -
Does anyone know for sure the date that OS X Lion will be released?
I've heard rumours about Lion being released on the 14th/9th but I would like to know if anyone knows for SURE the date and if possible, time that OS X Lion will be released?
ThanksApple hasn't announced a specific date. Anything that you might find indicating a release date is speculation. The good thing is that, since Lion is a download, it will be available immediately after it is announced (providing Apple's servers can handle the demand).
-
Hello Sir I have an iPhone 4 and when i updated that it got updated but now for restore the data it is showing me the message The "iPhone" could not be activated because an unknown error occurred (0xE8000004). Please try again later. please help me.
Hello Amarchand Sharma,
Are you working with a Windows computer? If so, the resource below may help you troubleshoot the issue you are having restoring your iPhone.
iOS: Unknown error containing '0xE' when connecting to a Windows PC - Apple Support
http://support.apple.com/en-us/TS3221
Regards,
Judy -
Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date? We are facing a scenario where trx date is lower than the actual ship to which logically sounds incorrect.
Appreciate any quick response around this.Hi,
Transaction date will be your autoinvoice master program submission level date (If you haven't setup any logic.
Please check the program level default date, if user enter old date ststem will pick the same.
Customer is trying to set the value of the profile OM:Set receivables transaction date as current date for non-shippable lines at the responsiblity level. System does not set the transaction date to current date in ra_interface_lines_all.
CAUSE
Customer has used the functionality in R11i. But after the upgrade to R12, the system functions differently than R11i.
SOLUTION
1.Ensure that there are no scheduled workflow background process run.
2.Set the profile "OM: Set Receivables Transaction Date as Current Date for Non-Shippable Lines" at Responsibility level only as Yes.
3.Now switch the responsibility to which the profile is set.
4.Create order for Non-Shippable Lines and progress it to invoicing.
5.Ensure that the 'workflow background process' concurrent program is run in the same responsibility and this line is considered in it.
6.Now check if the 'SHIP_DATE_ACTUAL' is populated to ra_interface_lines_all -
Reg:Approval procedure for Employee Master Data
Hi,
My client wants approval procedure for Employee master data.
Is it a way do this?
Please let me know.Hi,
On Which action, do you required approval on Employee Master data ??
It may be through customization easily.
Regards
Rahul Singh -
FM for uploading the data in infotype
Dear Friends,
I need a example how i can use the FM(HR_MAINTAIN_MASTERDATA,HR_INFOTYPE_OPERATION) for uploading the data in multiple infotypes at a time.
I have a data in internal table now how i should pass the infotype no in the FM am not aware of that kindly help meee.
And also my personnal no is internal ,how i pass in the FM.
How i pass the remaning values .....
my code ......
Loop at it_employee into wa_employee.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = '00000000'
MASSN = wa_employee-MASSN
ACTIO = 'INS'
TCLAS = 'A'
BEGDA = SY-DATUM
ENDDA = '99991231'
OBJPS =
SEQNR =
SPRPS =
SUBTY =
WERKS = wa_employee-WERKS
PERSG = wa_employee-PERSG
PERSK = wa_employee-PERSK
PLANS = wa_employee-PLANS
DIALOG_MODE = '1'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = 'X '
NO_ENQUEUE = 'X'
IMPORTING
RETURN = t_return
RETURN1 =
HR_RETURN =
TABLES
proposed_values = it_employee.
MODIFIED_KEYS =
write : / t_return.
thanks
sandeepHi
you have to open one more gl account for intial upload.
E.g. If you have the debit balance of Gl alc 50000 in legacy system, then the entry should be:
Dr 50000alc $100
Cr initial Upload alc $100.
if you want futher explaination let me know, i will explain in detail.
Thanks & Regards,
Reva naik.
Maybe you are looking for
-
I know this is not a dreamweaver question but I'm sure someone will know.....how do i get the folder to open in thumbnail view instead of list view....... cant seem to work out how to get this to happen.......I open up the folders to import and its a
-
Reading/Parsing a CSV file in UTF-16 ?
Hello everyone, I'm in rush to modify my current CSV file parser that works fine for files in UTF-8 , to be able to parse the UTF-16 as well, as far as I checked the sample plugins, didn't find any code, Also how could have support for both encodings
-
Best FW800 card for G4 Mirror Door?
I've got a Dual 1.25, 1.5G Ram mirror door G4, and I've got a Cinwave card installed on it as well (don't know if that matters or not.) Anybody got any advice on which fw800 is going to be best for me? I'm planning on buying a G-Tech G-Raid for addit
-
Well, my internet that is connected through a router had worked at home consistently for almost a year. About two weeks after moving back home my internet just stopped working on my Macbook. I have ran the hardware check via the macdos disc to check
-
Hi All, Is there a way we can avoid Breadcrums in Pivot chart. We have a chart with X axis showing Fiscal year. When we drill down on it, it should only show the qtrs in that year but a pivot chart shows fiscal year, fiscal qtr. is there a way we can