Loop Identification
I have installed a loop package that contains a lot of synth loops. They are all named MusicLoop_128bpm_001Cmaj.aiff, the number and keys change and there are about 40 of them.
The problem is I can't find any of these in the loop browser. I have turned off keyword browsing and have tried searching in all keys using search words like "music" or "loop". The loops exist in my home audio folder under user loops and I can drag them individually to the track pane and they work fine.
My question is why are they not showing in the loop browser. The package is called "Funk Producer" and I can select that in the loop menu. Other loops from the package are there but not these named "MusicLoop128bpm"
Any help would be appreciated.
Clambake wrote:
The loops exist in my home audio folder under user loops{...} why are they not showing in the loop browser.
http://www.bulletsandbones.com/GB/GBFAQ.html#missingloops
(Let the page FULLY load. The link to your answer is at the top of your screen)
Similar Messages
-
Issue with UTL FILE, does not read directory path
Hi Guys
I have created a procedure using a UTL_File, but when I execute that procedure, it comes with an invalid directory path.
create directory r_bmw as 'C:\BMW';
grant read, write on directory r_bmw to bmw;
The above have been created successfully. (r_bmw is the Directory Name. C:\BMW is the directory path.)
Below is my code:
create or replace
PROCEDURE DCA_BMW_OUT
IS
-- Declare all variables as reference
v_out_file UTL_FILE.FILE_TYPE;
v_row_Count NUMBER;
r_bmw NUMBER;
v_out_directory all_directories.directory_path%type;
v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
v_out_buffer varchar2 (32767);
v_records NUMBER;
body_output varchar2(32759 BYTE);
dictionary_guarantorsexist varchar2 (1 Char);
-- Text required within this part of the procedure
v_body varchar2(32767 BYTE);
v_header VARCHAR2(32759 BYTE);
BEGIN
--- Directories have been created
FOR r_bmw IN
( SELECT *
FROM dcaadditionaldata
WHERE directory_name IS NOT NULL
) LOOP
-- inner loop produces the rows in each file
-- outer loop identifies each of the dca's you want to generate a file for
BEGIN
-- Output file to be added into the directory specified
v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
-- The Header data which will be outputted to the file
v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
|G1Anrede|G1Titel|G1Name|G1Vorname|G1Straße|G1Hausnummer|G1PLZ|G1Ort|G1Land|G1Geburtsdatum|G1Telefonnr.Schuldner|G2Marktpartnernummer|G2Anrede|G2Titel|
G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
utl_file.PUT_LINE(v_out_file,v_header,TRUE);
-- Below will output a row of data which satisfy the requirements.
FOR body_output IN
( SELECT
AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
FROM AccountDetails
JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
WHERE EXISTS
( SELECT *
FROM Dcaaccountallocation
JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
WHERE Dcaaccountallocation.DCAID = 41
AND Dcaaccountallocation.status = 3
AND DebtEpisodes.DCASentDate IS NULL
AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
AND DebtEpisodes.DCAORLAWYER = 'DCA'
LOOP
UTL_FILE.PUT_LINE (v_out_file,
body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
END LOOP;
-- UTL_FILE.fclose (v_out_file);
-- EXCEPTION
--WHEN OTHERS THEN
--UTL_FILE.put_line (v_out_file, 'failed');
-- If any errors occur when closing the file, then we close the opened file.
IF utl_file.is_open(v_out_file) THEN
UTL_FILE.put_line (v_out_file, 'failed');
UTL_FILE.fclose (v_out_file);
END IF;
END;
UPDATE DebtEpisodes
SET handoverdate = null
WHERE DCAORLAWYER = 'DCA'
AND accountid IN
( SELECT accountid
FROM Dcaaccountallocation
WHERE Dcaaccountallocation.status = 3
AND Dcaaccountallocation.dcaid = 41
END LOOP;
END DCA_BMW_OUT;
-- It compiles successfully, but when executes, it provides me with the 'invalid directory path' error message.
Any help?
ThanksRam wrote:
DCAID DIRECTORY_NAME MPNO IN_DIRECTORY_NAME INVESTOR
4 DCA_PKFO_OUT 51950 DCA_PKFO_IN (null)
41 INV_ALTOR_OUT 488742 INV_ALTOR_IN Y
2 DCA_NIG_OUT 686007 DCA_NIG_IN (null)
3 DCA_RAF_OUT 777163 DCA_RAF_IN (null)
21 INV_INFOSCORE_OUT 3482400 INV_INFOSCORE_IN Y
22 INV_HOIST_OUT 2866813 INV_HOIST_IN Y
Above is the output when select * from dca additional data.
I have edited the r_bmw to varchar (32757 BYTE);
however, the same errors still appear. Would I need to change the select statement to a different table...and not dca additional data?
ThanksSo you have created a directory name r_bmw
create directory r_bmw as 'C:\BMW';
grant read, write on directory r_bmw to bmw;And your are querying select * from dca additional data, which doesn't return your recently created directory.... So... what to do what to do.... You should query the all_directories with directory_name = 'r_bmw'. -
How to avoid using bapi_commit inside a loop .
Hi ,
Need a help.
This is a program for uploading business partners in CRM.
The basic logic of the program is as below:
- There are two types of records in the upload file new/ old ones to be updated
- A new record is identified by checking if a BP exits based on the cust id
- In case it is a new record certain BAPIs are called to create a new BP, else the address details, identification etc are updated for the existing one.
- SQL analysis of the program showed that the maximum amount of time is taken in INSERT/UPDTAE/COMMIT processes.
When we raised the issue with SAP , they stated that the problem occurs due to the very high no of BAPI_COMMIT calls which is within the loop.
The standard BAPI available allows passing of one record at a time. Hence passing multiple records at a time and a single commit did not seem feasible.
Also while updating since there are different BAPIs for address and identification it is being called in a sequence and commit issued after each. If commit is excluded it gives a locking error since the first BAPI tends to lock the record and does not allow subsequent BAPI call
kindly suggest me with a solution of using a less commit for updating series of records.
The code is as follows:
*& Report ZBP_BDCP_ACCTRNSDATA_UPLOAD *
*& Created By : Radhu Shankar.G *
*& Purpose : Program to Create Investors with the transaction *
*& data received from the De-dupe Software. *
*& Note : Can be Executed or scheduled only in Background *
REPORT zbp_bdcp_acctrnsdata_upload LINE-SIZE 255 LINE-COUNT 65 NO STANDARD PAGE HEADING
MESSAGE-ID zcrm_upload.
TABLES : bbp_iu01.
Selection Screen
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE string LOWER CASE OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECT-OPTIONS:s_email FOR bbp_iu01-email NO INTERVALS.
SELECTION-SCREEN: END OF BLOCK blk2.
SELECTION-SCREEN: BEGIN OF BLOCK blk3 WITH FRAME TITLE text-003.
SELECTION-SCREEN COMMENT /1(72) text-004.
SELECTION-SCREEN COMMENT /1(72) text-006.
SELECTION-SCREEN COMMENT /1(72) text-007.
SELECTION-SCREEN COMMENT /1(72) text-005.
SELECTION-SCREEN: END OF BLOCK blk3.
Data Declaration
Main Upload structure and internal table
DATA : BEGIN OF i_main,
cust_id TYPE bu_bpext, " Customer ID
inv_type_code TYPE crmt_mktpfchr_atvalue, " Investor Type Code
insti_tag TYPE crmt_mktpfchr_atvalue, " Retail/Instituitional Tag
name TYPE char120, " Name
address1 TYPE ad_strspp1, " Address1
address2 TYPE ad_strspp2, " Address2
address3 TYPE ad_street, " Address3
city TYPE ad_city1, " City
state TYPE t005u-bezei, " Region/State
country TYPE landx50, " Country
pin_code TYPE ad_pstcd1, " Pin Code
off_phone1 TYPE ad_tlnmbr, " Office Telephone Number1
off_phone2 TYPE ad_tlnmbr, " Office Telephone Number2
res_phone1 TYPE ad_tlnmbr, " Residence Telephone Number1
res_phone2 TYPE ad_tlnmbr, " Residence Telephone Number1
mobile TYPE ad_mbnmbr1, " Mobile Number
email TYPE ad_smtpadr, " Email ID
birth_date TYPE bu_birthdt, " Birth Date
pan_no TYPE bu_id_number, " Pan Number
lob TYPE crmt_mktpfchr_atvalue, " Line of Business
fam_tag TYPE bu_id_number, " FAM Tag Number
mod_date TYPE sy-datum, " Modified Date
END OF i_main.
DATA : it_main LIKE i_main OCCURS 0 WITH HEADER LINE.
Error file structure and internal table
DATA : BEGIN OF i_error,
cust_id TYPE bu_bpext, " Customer ID
inv_type_code TYPE crmt_mktpfchr_atvalue, " Investor Type Code
insti_tag TYPE crmt_mktpfchr_atvalue, " Retail/Instituitional Tag
name TYPE char120, " Name
address1 TYPE ad_strspp1, " Address1
address2 TYPE ad_strspp2, " Address2
address3 TYPE ad_street, " Address3
city TYPE ad_city1, " City
state TYPE t005u-bezei, " Region/State
country TYPE landx50, " Country
pin_code TYPE ad_pstcd1, " Pin Code
off_phone1 TYPE ad_tlnmbr, " Office Telephone Number1
off_phone2 TYPE ad_tlnmbr, " Office Telephone Number2
res_phone1 TYPE ad_tlnmbr, " Residence Telephone Number1
res_phone2 TYPE ad_tlnmbr, " Residence Telephone Number1
mobile TYPE ad_mbnmbr1, " Mobile Number
email TYPE ad_smtpadr, " Email ID
birth_date TYPE bu_birthdt, " Birth Date
pan_no TYPE bu_id_number, " Pan Number
lob TYPE crmt_mktpfchr_atvalue, " Line of Business
fam_tag TYPE bu_id_number, " FAM Tag Number
mod_date TYPE sy-datum, " Modified Date
bp TYPE bapibus1006_head-bpartner, " BP
recno(4) TYPE c, " Record No
message(255) TYPE c, " Error Message
END OF i_error.
DATA : it_error LIKE i_error OCCURS 0 WITH HEADER LINE.
BP Telephone, Email & Role Details
DATA : w_bp_tel TYPE bapiadtel,
it_bp_tel TYPE bapiadtel OCCURS 0 WITH HEADER LINE,
it_bp_tel1 TYPE bapiadtel OCCURS 0 WITH HEADER LINE,
it_bp_email TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE,
it_bp_email1 TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE,
it_bapicomrem TYPE STANDARD TABLE OF bapicomrem WITH HEADER LINE,
it_bapicomrem_x TYPE STANDARD TABLE OF bapicomrex WITH HEADER LINE,
it_tel_x TYPE STANDARD TABLE OF bapiadtelx WITH HEADER LINE,
it_email_x TYPE STANDARD TABLE OF bapiadsmtx WITH HEADER LINE,
it_role TYPE bapibusisb990_bproles OCCURS 0 WITH HEADER LINE,
it_role_cp TYPE bapibusisb990_bproles OCCURS 0 WITH HEADER LINE.
BP Identication Details
DATA: BEGIN OF it_identification OCCURS 0,
idcategory TYPE bapibus1006_identification_key-identificationcategory,
idnumber TYPE bapibus1006_identification_key-identificationnumber,
END OF it_identification.
DATA : w_identification TYPE bapibus1006_identification.
BP Marketing Attributes
DATA : BEGIN OF it_crmt OCCURS 0,
crmt TYPE crmt_mktprof_keys-profile_template_id,
END OF it_crmt.
DATA : it_crmt1 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt2 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt3 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt4 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt5 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_bp_ret TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
BP Basic Details
DATA : v_partn_cat TYPE bapibus1006_head-partn_cat,
w_central TYPE bapibus1006_central,
w_central_x TYPE bapibus1006_central_x,
w_central_org TYPE bapibus1006_central_organ,
w_central_per TYPE bapibus1006_central_person,
w_central_group TYPE bapibus1006_central_group,
w_centralorg_x TYPE bapibus1006_central_organ_x,
w_centralperson_x TYPE bapibus1006_central_person_x,
w_centralgrp_x TYPE bapibus1006_central_group_x,
w_address TYPE bapibus1006_address,
w_addr_x TYPE bapibus1006_address_x,
v_bp TYPE bapibus1006_head-bpartner.
Declaration for Duplication Check
DATA : w_zacc_address TYPE zacc_address,
g_dup_status TYPE i.
DATA : it_dup_bp TYPE STANDARD TABLE OF zbuspartner WITH HEADER LINE.
CONSTANTS: c_pan TYPE bu_id_type VALUE 'ZID003',
c_fam_tag TYPE bu_id_type VALUE 'ZID011',
c_cust TYPE bu_id_type VALUE 'ZID009'.
Other Declarations
DATA : v_inv_type TYPE crmt_mktpfchr_atvalue, " Investor Type Code
v_file TYPE string,
v_firstname TYPE bu_nameor1,
v_filename1(14) TYPE c,
v_filename2(14) TYPE c,
v_lines TYPE int4,
v_cat TYPE bu_type,
recno TYPE int4,
loopno TYPE int4,
it_iden_ret TYPE bapiret2 OCCURS 0,
it_attr_ret TYPE bapiret2 OCCURS 0,
it_role_ret TYPE bapiret2 OCCURS 0,
wa_iden_ret TYPE bapiret2,
wa_attr_ret TYPE bapiret2,
it_iden_flag TYPE c,
it_attr_flag TYPE c,
flag_central TYPE c,
flag_addr TYPE c,
flag_bp TYPE c,
flag_suc TYPE c,
flag_exist TYPE c,
flag_exit TYPE c,
g_bp_msg TYPE string,
g_bp_msg1 TYPE string.
DATA : BEGIN OF i_success,
rec TYPE int4, "Record
name TYPE bu_nameor1, "Name
bp TYPE bapibus1006_head-bpartner, "Business Partner
END OF i_success,
it_success LIKE i_success OCCURS 0 WITH HEADER LINE,
it_upd_success LIKE i_success OCCURS 0 WITH HEADER LINE.
Data Declaration for converting spool request to PDF and to trigger mail
DATA : gd_recsize TYPE i.
Spool IDs
TYPES : BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES : END OF t_tbtcp.
DATA : it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA : gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA : w_recsize TYPE i.
DATA : gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA : gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA : BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA : END OF it_pdf_output.
DATA : v_email1 TYPE somlreci1-receiver,
v_sender TYPE somlreci1-receiver.
CONSTANTS: c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL',
c_delspl TYPE c VALUE 'X'.
DATA : BEGIN OF result OCCURS 0,
line(100) TYPE c,
END OF result.
DATA:i_id_tab TYPE STANDARD TABLE OF bapibus1006_id_details WITH HEADER LINE.
eliminting the error for convt page error
data: g_spl type c value ''.
eliminting the error for convt page error
Initialization
Renaming the target file daily
CONCATENATE '_' sy-datum '.txt' INTO v_filename1.
CONCATENATE '_' sy-datum '.TXT' INTO v_filename2.
START-OF-SELECTION
START-OF-SELECTION.
SELECT COUNT(*) FROM zbp_tax_status.
IF sy-subrc <> 0.
SKIP 2.
WRITE:/ text-011.
STOP.
ENDIF.
REFRESH : it_main.
Uploading the file from either presentatinon layer or application server
PERFORM file_upload.
Creating the BP number and assigning & adding up other attributes
LOOP AT it_main.
PERFORM data_fill. " Filling up global structures & variables
IF v_bp IS INITIAL.
PERFORM duplication_check. " Duplication check
ENDIF.
PERFORM bp_creation. " BP Creation
PERFORM return_fill. " Filling up Return Tables
CLEAR : v_bp, it_main, flag_exit, g_dup_status, it_identification, it_crmt, it_crmt1, it_crmt2, it_crmt3, it_crmt4, it_crmt5,
w_bp_tel,it_bp_tel,it_bp_tel1,it_bp_email,it_bp_email1,it_tel_x,it_email_x,w_addr_x,w_centralorg_x,w_centralperson_x,
w_centralgrp_x,flag_addr,flag_central,it_iden_flag,it_attr_flag,it_bapicomrem,w_central,w_central_x, v_inv_type,it_bapicomrem_x,
w_central_org,w_central_per,w_central_group,flag_bp,flag_suc,flag_exist,it_bp_ret,g_bp_msg,g_bp_msg1,v_cat,wa_attr_ret.
REFRESH :it_identification, it_crmt, it_crmt1, it_crmt2, it_crmt3, it_crmt4, it_crmt5,it_bapicomrem,
it_bp_tel,it_bp_tel1,it_bp_email,it_bp_email1,it_tel_x,it_email_x,it_bp_ret,it_bapicomrem_x.
ENDLOOP.
Downloading the file to be reprocessed to the application server
IF it_error[] IS NOT INITIAL.
PERFORM error_file_download.
ENDIF.
Constructing the Return Messages for the Job
PERFORM return_messages. " Return Message Construction
Converting the return messages into PDF file and trigerring a mail notification
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
PERFORM trigger_email.
ENDIF.
*& Form file_upload
FORM file_upload .
Data declatration
DATA: l_filestr TYPE string.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS: con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
REPLACE '.txt' WITH v_filename1 INTO p_file .
REPLACE '.TXT' WITH v_filename2 INTO p_file .
MOVE p_file TO v_file.
IF sy-batch EQ 'X'.
Uploading the file from application server if the job is scheduled in background
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
eliminting the error for convt page error
IGNORING CONVERSION ERRORS REPLACEMENT CHARACTER g_spl.
eliminting the error for convt page error
IF sy-subrc = 0.
DO.
READ DATASET p_file INTO l_filestr.
IF sy-subrc <> 0.
EXIT.
ELSE.
CLEAR it_main.
SPLIT l_filestr AT con_tab INTO:
it_main-cust_id it_main-inv_type_code
it_main-insti_tag it_main-name
it_main-address1 it_main-address2
it_main-address3 it_main-city
it_main-state it_main-country
it_main-pin_code it_main-off_phone1
it_main-off_phone2 it_main-res_phone1
it_main-res_phone2 it_main-mobile
it_main-email it_main-birth_date
it_main-pan_no it_main-lob
it_main-fam_tag it_main-mod_date.
APPEND it_main.
ENDIF.
ENDDO.
ELSE.
WRITE : / 'The file',
p_file,
'is not found.'.
STOP.
ENDIF.
CLOSE DATASET p_file.
ELSE.
WRITE : / 'The Program can only be executed in the background.'.
STOP.
ENDIF.
CLEAR : l_filestr, it_main.
ENDFORM. " file_upload
*& Form data_fill
FORM data_fill .
Filling up Partner Category (v_Partn_cat) ,workarea (w_central), workarea (w_central_org) & workarea (w_central_per)
SELECT SINGLE bp_category tax_status FROM zbp_tax_status
INTO (v_partn_cat,v_inv_type)
WHERE inv_code EQ it_main-inv_type_code.
Filling up the Authorization Group
IF it_main-lob EQ 'M' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZMFR'.
ELSEIF it_main-lob EQ 'M' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZMFI'.
ELSEIF it_main-lob EQ 'P' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZPMR'.
ELSEIF it_main-lob EQ 'P' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZPMI'.
ELSEIF it_main-lob EQ 'A' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZBOR'.
ELSEIF it_main-lob EQ 'A' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZBOI'.
ENDIF.
Filling up workarea (w_address)
IF it_main-address1 IS NOT INITIAL.
MOVE : it_main-address1 TO w_address-str_suppl1,
it_main-address1 TO w_zacc_address-address1,
'X' TO w_addr_x-str_suppl1 .
ENDIF.
IF it_main-address2 IS NOT INITIAL.
MOVE : it_main-address2 TO w_address-str_suppl2,
it_main-address2 TO w_zacc_address-address2,
'X' TO w_addr_x-str_suppl2 .
ENDIF.
IF it_main-address3 IS NOT INITIAL.
MOVE : it_main-address3 TO w_address-street,
it_main-address3 TO w_zacc_address-address3,
'X' TO w_addr_x-street.
ENDIF.
IF it_main-city IS NOT INITIAL.
MOVE : it_main-city TO w_address-city,
it_main-city TO w_zacc_address-city,
'X' TO w_addr_x-city.
ENDIF.
IF it_main-pin_code IS NOT INITIAL.
MOVE : it_main-pin_code TO w_address-postl_cod1,
'X' TO w_addr_x-postl_cod1.
TRANSLATE w_address-postl_cod1 TO UPPER CASE.
ENDIF.
IF it_main-country IS NOT INITIAL.
MOVE : 'X' TO w_addr_x-country.
ENDIF.
IF it_main-state IS NOT INITIAL.
MOVE: 'X' TO w_addr_x-region.
ENDIF.
Picking up Country & State Codes
SELECT SINGLE land1 FROM t005t INTO w_address-country
WHERE spras EQ 'E'
AND landx50 EQ it_main-country.
IF sy-subrc EQ 0.
SELECT SINGLE bland FROM t005u INTO w_address-region
WHERE spras EQ 'E'
AND land1 EQ w_address-country
AND bezei EQ it_main-state.
IF sy-subrc NE 0.
w_address-region = 'ZZ'.
ENDIF.
ELSE.
w_address-country = 'ZZ'.
SELECT SINGLE bland FROM t005u INTO w_address-region
WHERE spras EQ 'E'
AND land1 EQ w_address-country
AND bezei EQ it_main-state.
IF sy-subrc NE 0.
w_address-region = 'ZZ'.
ENDIF.
ENDIF.
w_zacc_address-country = w_address-country.
w_zacc_address-state = w_address-region.
Filling up the BP Role Detail
it_role-partnerrole = 'Z1INVS'.
APPEND it_role.
Finding out the BP number from the client ID
IF it_main-cust_id IS NOT INITIAL.
SELECT SINGLE partner FROM but0id INTO v_bp
WHERE type EQ 'ZID009'
AND idnumber EQ it_main-cust_id.
IF sy-subrc = 0.
SELECT SINGLE type FROM but000 INTO v_cat
WHERE partner = v_bp.
PERFORM name_processing USING v_cat.
ENDIF.
ENDIF.
IF v_bp IS INITIAL.
PERFORM name_processing USING v_partn_cat. " Processing the Name & Title depending on partner category
Filling up the Identication Number Details
IF it_main-cust_id IS NOT INITIAL. " Customer ID
it_identification-idcategory = 'ZID009'.
it_identification-idnumber = it_main-cust_id.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
IF it_main-pan_no IS NOT INITIAL. " Pan Number
it_identification-idcategory = 'ZID003'.
it_identification-idnumber = it_main-pan_no.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
IF it_main-fam_tag IS NOT INITIAL. " Family Tag Number
it_identification-idcategory = 'ZID011'.
it_identification-idnumber = it_main-fam_tag.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
Filling up the Marketing Attributes
IF v_inv_type IS NOT INITIAL. " Tax status
it_crmt1-atname = 'TAX_STATUS'.
it_crmt1-atwrt = v_inv_type.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
IF it_main-lob IS NOT INITIAL. " Product Tag
it_crmt1-atname = 'LOB'.
IF it_main-lob EQ 'M'.
it_crmt1-atwrt = 'MF'.
ELSEIF it_main-lob EQ 'P'.
it_crmt1-atwrt = 'PMS'.
ELSEIF it_main-lob EQ 'A'.
it_crmt1-atwrt = 'BOTH'.
ENDIF.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
IF it_main-insti_tag IS NOT INITIAL. " Retail/Instituitional Tag
it_crmt1-atname = 'ORGANISATION_STRUCTURE'.
IF it_main-insti_tag EQ 'N'.
it_crmt1-atwrt = 'RETAIL'.
ELSEIF it_main-insti_tag EQ 'Y'.
it_crmt1-atwrt = 'INSTITUTIONAL'.
ELSEIF it_main-insti_tag EQ 'F'.
it_crmt1-atwrt = 'INTERNATIONAL'.
ENDIF.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
it_crmt2-atname = 'VIP'.
it_crmt2-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt2.
CLEAR : it_crmt2.
it_crmt3-atname = 'PRIORITY'.
it_crmt3-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt3.
CLEAR : it_crmt3.
it_crmt4-atname = 'CONTACTBLE'.
it_crmt4-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt4.
CLEAR : it_crmt4.
it_crmt5-atname = 'SOURCE'.
it_crmt5-atwrt = 'CAMS'.
APPEND it_crmt5.
CLEAR : it_crmt5.
it_crmt-crmt = 'CENTALISED_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'GENERAL_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'MF_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'PMS_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'SOURCE'.
APPEND it_crmt.
CLEAR it_crmt-crmt.
ENDIF.
For Return Message
recno = recno + 1.
ENDFORM. " data_fill
*& Form duplication_check
FORM duplication_check .
DATA : l_lines TYPE i.
IF v_firstname IS NOT INITIAL.
CALL FUNCTION 'ZACC_DUPLICATIONCHECK'
EXPORTING
role = 'Z1INVS'
firstname = v_firstname
pan_no = it_main-pan_no
mobile = it_main-mobile
email = it_main-email
address = w_zacc_address
partnercategory = v_partn_cat
IMPORTING
status = g_dup_status
TABLES
buspartner = it_dup_bp.
DESCRIBE TABLE it_dup_bp LINES l_lines.
IF l_lines EQ 1.
IF g_dup_status EQ 1.
READ TABLE it_dup_bp INDEX 1.
MOVE it_dup_bp-partner TO v_bp.
ELSEIF g_dup_status EQ 2.
flag_exit = 'X'.
ENDIF.
ELSEIF l_lines GT 1.
flag_exit = 'X'.
ENDIF.
ENDIF.
CLEAR : l_lines, v_firstname.
ENDFORM. " duplication_check
*& Form name_processing
FORM name_processing USING uv_cat TYPE bu_type.
IF it_main-name IS NOT INITIAL.
If category is Person
IF uv_cat EQ 1.
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_per-firstname
middle = w_central_per-middlename
last = w_central_per-lastname.
w_centralperson_x-firstname = 'X'.
w_centralperson_x-middlename = 'X'.
w_centralperson_x-lastname = 'X'.
w_centralperson_x-birthdate = 'X'.
MOVE : it_main-birth_date TO w_central_per-birthdate,
w_central_per-firstname TO v_firstname.
ELSEIF uv_cat EQ 2.
If category is organisation
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_org-name2
middle = w_central_org-name1
last = w_central_org-name3.
w_centralorg_x-name1 = 'X'.
w_centralorg_x-name2 = 'X'.
w_centralorg_x-name3 = 'X'.
MOVE w_central_org-name2 TO v_firstname.
ELSEIF uv_cat EQ 3.
If category is group
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_group-namegroup2
middle = w_central_group-namegroup1.
w_centralgrp_x-namegroup1 = 'X'.
w_centralgrp_x-namegroup2 = 'X'.
MOVE w_central_group-namegroup2 TO v_firstname.
ENDIF.
MOVE : it_main-name+0(8) TO w_central-searchterm1,
'X' TO w_central_x-searchterm1.
ENDIF.
ENDFORM. " name_processing
*& Form bp_creation
FORM bp_creation.
DATA:l_identification TYPE bapibus1006_identification_key-identificationnumber.
BP Creation
IF v_bp IS INITIAL.
Filling up the Telephone Details
MOVE : w_address-country TO w_bp_tel-country.
IF it_main-off_phone1 IS NOT INITIAL. " Office Telephone1
w_bp_tel-r_3_user = '1'.
w_bp_tel-telephone = it_main-off_phone1.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE1'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-off_phone2 IS NOT INITIAL. " Office Telephone2
w_bp_tel-telephone = it_main-off_phone2.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE2'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-res_phone1 IS NOT INITIAL. " Residence Telephone1
w_bp_tel-telephone = it_main-res_phone1.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDENCE PHONE1'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-res_phone2 IS NOT INITIAL. " Residence Telephone2
w_bp_tel-telephone = it_main-res_phone2.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDENCE PHONE2'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-mobile IS NOT INITIAL. " Mobile Number
w_bp_tel-r_3_user = '3'.
w_bp_tel-telephone = it_main-mobile.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
ENDIF.
Filling up the E-Mail Details
IF it_main-email IS NOT INITIAL. " E-mail1
it_bp_email-e_mail = it_main-email.
APPEND it_bp_email.
CLEAR it_bp_email.
ENDIF.
BAPI for BP creation
CALL FUNCTION 'BAPI_BUPA_FS_CREATE_FROM_DATA2'
EXPORTING
partnercategory = v_partn_cat
centraldata = w_central
centraldataperson = w_central_per
centraldataorganization = w_central_org
centraldatagroup = w_central_group
addressdata = w_address
IMPORTING
businesspartner = v_bp
TABLES
telefondata = it_bp_tel
communicationnotes = it_bapicomrem
e_maildata = it_bp_email
roles = it_role
return = it_bp_ret.
IF v_bp IS NOT INITIAL.
flag_bp = 'X'.
ENDIF.
Commiting the transaction
PERFORM transaction_commit.
To add Identification details to BP
PERFORM add_details.
CLEAR : v_partn_cat, w_central, w_central_per, w_central_org, it_bp_tel, it_bp_email, it_role.
REFRESH : it_bp_tel, it_bp_email, it_role.
ELSE.
flag_exist = 'X'.
If BP exists,address,communication and ID details will be updated
CALL FUNCTION 'BAPI_BUPA_CENTRAL_CHANGE'
EXPORTING
businesspartner = v_bp
centraldata = w_central
centraldataperson = w_central_per
centraldataorganization = w_central_org
centraldatagroup = w_central_group
centraldata_x = w_central_x
centraldataperson_x = w_centralperson_x
centraldataorganization_x = w_centralorg_x
centraldatagroup_x = w_centralgrp_x
TABLES
return = it_bp_ret.
READ TABLE it_bp_ret WITH KEY type = 'E'.
IF sy-subrc = 0.
flag_central = 'E'.
g_bp_msg = it_bp_ret-message.
CLEAR:it_bp_ret.
REFRESH:it_bp_ret.
ELSE.
flag_suc = 'X'.
ENDIF.
PERFORM transaction_commit.
To get the existing communication details
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
EXPORTING
businesspartner = v_bp
TABLES
bapiadtel = it_bp_tel1
bapiadsmtp = it_bp_email1.
LOOP AT it_bp_tel1 WHERE r_3_user = '1' OR r_3_user = ' '.
it_bp_tel-consnumber = it_bp_tel1-consnumber.
it_tel_x-updateflag = 'D'.
APPEND:it_bp_tel,
it_tel_x.
CLEAR: it_bp_tel,
it_tel_x.
ENDLOOP.
IF it_main-mobile IS NOT INITIAL .
LOOP AT it_bp_tel1 WHERE r_3_user = '2' OR r_3_user = '3'.
it_bp_tel-consnumber = it_bp_tel1-consnumber.
it_tel_x-updateflag = 'D'.
APPEND:it_bp_tel,
it_tel_x.
CLEAR: it_bp_tel,
it_tel_x.
ENDLOOP.
ENDIF.
*Updating communication details
IF it_main-off_phone1 IS NOT INITIAL. " Office Telephone1
w_bp_tel-r_3_user = '1'.
w_bp_tel-telephone = it_main-off_phone1.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR: it_tel_x.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE1'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-off_phone2 IS NOT INITIAL. " Office Telephone2
w_bp_tel-telephone = it_main-off_phone2.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE2'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-res_phone1 IS NOT INITIAL. " Residence Telephone1
w_bp_tel-telephone = it_main-res_phone1.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDECE PHONE1'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-res_phone2 IS NOT INITIAL. " Residence Telephone2
w_bp_tel-telephone = it_main-res_phone2.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDECE PHONE2'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-mobile IS NOT INITIAL. " Mobile Number
w_bp_tel-r_3_user = '3'.
w_bp_tel-telephone = it_main-mobile.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
ENDIF.
IF it_main-email IS NOT INITIAL.
LOOP AT it_bp_email1.
it_bp_email-consnumber = it_bp_email1-consnumber.
it_email_x-updateflag = 'D'.
APPEND:it_bp_email,
it_email_x.
ENDLOOP.
it_bp_email-e_mail = it_main-email.
it_email_x-e_mail = 'I'.
it_email_x-updateflag = 'I'.
APPEND:it_bp_email,
it_email_x.
CLEAR:it_bp_email,
it_email_x.
ENDIF.
REFRESH:it_bp_ret.
BP Change
CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'
EXPORTING
businesspartner = v_bp
addressdata = w_address
addressdata_x = w_addr_x
TABLES
bapiadtel = it_bp_tel
bapicomrem = it_bapicomrem
bapiadtel_x = it_tel_x
bapiadsmtp = it_bp_email
bapiadsmt_x = it_email_x
bapicomre_x = it_bapicomrem_x
return = it_bp_ret.
READ TABLE it_bp_ret WITH KEY type = 'E'.
IF sy-subrc = 0.
flag_addr = 'E'.
g_bp_msg1 = it_bp_ret-message.
ELSE.
flag_suc = 'X'.
ENDIF.
PERFORM transaction_commit.
REFRESH it_bp_ret.
IF it_main-pan_no IS NOT INITIAL OR it_main-fam_tag IS NOT INITIAL OR it_main-cust_id IS NOT INITIAL.
Retreiving the existing Identification details
PERFORM id_get USING v_bp.
ENDIF.
PAN number addition
IF it_main-pan_no IS NOT INITIAL.
CLEAR l_identification.
MOVE it_main-pan_no TO l_identification.
TRANSLATE l_identification TO UPPER CASE.
READ TABLE i_id_tab WITH KEY identificationtype = c_pan.
IF sy-subrc = 0.
To remove existing PAN number
PERFORM id_remove USING v_bp c_pan i_id_tab-identificationnumber.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc = 'X'.
Performing transaction commit
PERFORM transaction_commit.
ENDIF.
ENDIF.
CLEAR:it_iden_ret[],it_iden_ret.
To add new PAN number
PERFORM id_add USING v_bp c_pan l_identification.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc = 'X'.
PERFORM transaction_commit.
ENDIF.
ENDIF.
Customer ID addition
IF it_main-cust_id IS NOT INITIAL AND ( g_dup_status = 1 ).
CLEAR l_identification.
MOVE it_main-cust_id TO l_identification.
TRANSLATE l_identification TO UPPER CASE.
READ TABLE i_id_tab WITH KEY identificationtype = c_cust.
IF sy-subrc = 0.
To remove existing Customer ID
PERFORM id_remove USING v_bp c_cust i_id_tab-identificationnumber.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
Performing transaction commit
PERFORM transaction_commit.
ENDIF.
ENDIF.
CLEAR:it_iden_ret[],it_iden_ret.
To add new Customer ID number
PERFORM id_add USING v_bp c_cust l_identification.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc ='X'.
PERFORM transaction_commit.
ENDIF.
ENDIF.
To add marketing attributes
IF it_main-insti_tag IS NOT INITIAL AND it_main-lob IS NOT INITIAL.
PERFORM add_makt_attr .
ELSE.
it_attr_flag = 'E'.Guy,i don't regard here is anybody wanna read so much code .For more constructive answers, you would distill core question from your program.
-
Hi,
I need to extract data from a given piece of XML. If I pass the xml to the procedure as clob and query it in a loop, it returns no rows. However if I include the actuall xml in the loop query it returns the data I'm looking for. Why doesn't it return data when using the clob?
1. Example code below works with xml included in the loop query:
BEGIN
FOR x IN ( SELECT x.*
FROM XMLTABLE (
xmlnamespaces (
'http://schemas.xmlsoap.org/soap/envelope' AS "x",
'http://www.w3.org/2001/XMLSchema-instance' AS "xsi"),
PASSING xmltype (
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<loadServiceListResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<loadServiceListReturn href="#id0"/>
</loadServiceListResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:ExternalSystemOutput" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="java:ExternalSystemOutput.TestIPA.nhsia.nhs">
<standardOutput href="#id1"/>
<systemData soapenc:arrayType="ns2:ExternalSystemData[2]" xsi:type="soapenc:Array" xmlns:ns2="java:ExternalSystemData.TestIPA.nhsia.nhs">
<systemData href="#id2"/>
<systemData href="#id3"/>
</systemData>
</multiRef>
<multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:ExternalSystemData" xmlns:ns3="java:ExternalSystemData.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="soapenc:string">Prescription</description>
<url xsi:type="soapenc:string">http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?sdwlhqw@5)vhuylfh@Suhvfulswlrq33509</url>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:StandardOutput" xmlns:ns4="java:StandardOutput.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<auditID xsi:type="soapenc:string"/>
<statusID xsi:type="soapenc:string">0</statusID>
<systemAvailability xsi:type="soapenc:string">Available</systemAvailability>
</multiRef>
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:ExternalSystemData" xmlns:ns5="java:ExternalSystemData.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="soapenc:string">Appointment</description>
<url xsi:type="soapenc:string">http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?vgzoktzC8,ykx|oikCGvvuotzsktz61409</url>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>').
EXTRACT (
'//multiRef',
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
COLUMNS description VARCHAR2 (30) PATH 'description',
url VARCHAR2 (250) PATH 'url') x)
LOOP
DBMS_OUTPUT.PUT_LINE('Rec: '||x.description||' '||x.url);
END LOOP;
END;
/Returns:
Rec:
Rec: Prescription http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?sdwlhqw@5)vhuylfh@Suhvfulswlrq33509
Rec:
Rec: Appointment http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?vgzoktzC8,ykx|oikCGvvuotzsktz614092. If I assign the XML to CLOB variable and reference the clob variable in loop query it returns no data:
DECLARE
resp CLOB :=
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<loadServiceListResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<loadServiceListReturn href="#id0"/>
</loadServiceListResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:ExternalSystemOutput" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="java:ExternalSystemOutput.TestIPA.nhsia.nhs">
<standardOutput href="#id1"/>
<systemData soapenc:arrayType="ns2:ExternalSystemData[2]" xsi:type="soapenc:Array" xmlns:ns2="java:ExternalSystemData.TestIPA.nhsia.nhs">
<systemData href="#id2"/>
<systemData href="#id3"/>
</systemData>
</multiRef>
<multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:ExternalSystemData" xmlns:ns3="java:ExternalSystemData.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="soapenc:string">Prescription</description>
<url xsi:type="soapenc:string">http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?sdwlhqw@5)vhuylfh@Suhvfulswlrq33509</url>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:StandardOutput" xmlns:ns4="java:StandardOutput.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<auditID xsi:type="soapenc:string"/>
<statusID xsi:type="soapenc:string">0</statusID>
<systemAvailability xsi:type="soapenc:string">Available</systemAvailability>
</multiRef>
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:ExternalSystemData" xmlns:ns5="java:ExternalSystemData.TestIPA.nhsia.nhs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="soapenc:string">Appointment</description>
<url xsi:type="soapenc:string">http://192.168.21.131:8080/nhsia/TestIPA/validate.jsp?vgzoktzC8,ykx|oikCGvvuotzsktz61409</url>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>';
BEGIN
FOR x IN ( SELECT x.*
FROM XMLTABLE (
xmlnamespaces (
'http://schemas.xmlsoap.org/soap/envelope' AS "x",
'http://www.w3.org/2001/XMLSchema-instance' AS "xsi"),
PASSING xmltype (resp).
EXTRACT (
'//multiRef',
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
COLUMNS description VARCHAR2 (30) PATH 'description',
url VARCHAR2 (250) PATH 'url') x)
LOOP
DBMS_OUTPUT.PUT_LINE('Rec: '||x.description||' '||x.url);
END LOOP;
END;
/I would appreciate any help this one.
Cheers,
Andy.Why do you have 4 rows? I don't understand why you have two rows for 100 bottles?
Building on Odie's answer and my example plus adding in the needed outer join we have, using Oracle's outer join syntax of (+)
SQL> with my_sample_table as (
2 select xmltype('<?xml version="1.0" encoding="UTF-8" ?>
3 <request>
4 <identification>
5 <requestid>12345</requestid>
6 <periodunit>DAY</periodunit>
7 <days>MONDAY</days>
8 </identification>
9 <product>
10 <productname>ABC PRODUCT</productname>
11 <brand>
12 <brandname>CELL</brandname>
13 <ndccode>A58048</ndccode>
14 <ndccode>A49210</ndccode>
15 </brand>
16 </product>
17 <product>
18 <productname>100 bottles</productname>
19 </product>
20 </request>') xmldoc
21 from dual
22 )
23 select x.*, y.*
24 from my_sample_table t
25 , xmltable(
26 'let $e := $d/request/identification
27 for $i in $d/request/product
28 return element r {
29 $e/requestid
30 , $e/days
31 , $e/periodunit
32 , $i/productname
33 , $i/brand/brandname
34 , $i/brand/ndccode
35 }'
36 passing t.xmldoc as "d"
37 columns requestid number path 'requestid'
38 , days varchar2(30) path 'days'
39 , periodunit varchar2(10) path 'periodunit'
40 , prductname varchar2(20) path 'productname'
41 , brandname varchar2(20) path 'brandname'
42 , ndccodexml xmltype path 'ndccode'
43 ) x,
44 xmltable('/ndccode'
45 PASSING x.ndccodexml
46 COLUMNS
47 ndccode VARCHAR2(10) PATH '.') (+) y;
REQUESTID DAYS PERIODUNIT PRDUCTNAME BRANDNAME NDCCODEXML NDCCODE
12345 MONDAY DAY ABC PRODUCT CELL <ndccode>A58048</ndccode><ndccode>A49210</ndccode> A58048
12345 MONDAY DAY ABC PRODUCT CELL <ndccode>A58048</ndccode><ndccode>A49210</ndccode> A49210
12345 MONDAY DAY 100 bottles If you prefer the ANSI syntax it would be (just showing changed section)
) x
LEFT OUTER JOIN
xmltable('/ndccode'
PASSING x.ndccodexml
COLUMNS
ndccode VARCHAR2(10) PATH '.') y
ON 1=1; -
To modify a field in a database table based record identification by primar
hi
i want to to modify a field in a database table based record identification by primary key filed and two more fields
ie customer (primary key
i want to modify record from intenal table the record existing with primary key field customer
the status field needs to be mofied as " value rolled"
the below code is happening
loop at it_record into wa_Record
wa_inv-customer (primary key) = wa_Record=custome
wa_inv-date = wa_Record-date
...so one
append wa_inv to it_invest
clear wa_inv
endloop.
if not it_invest is initial
modify TABle1 ( this table is data base table which needs to be mofified) based on the primary key field
and also date field and status field which is not primary key.
regards
aroraHi there.
Your requirement is to update a Z Database table from your internal table, right? You have several options:
LOOP AT it_invest INTO wa_inv.
UPDATE dbtable
SET date = wa_inv-date
WHERE prim_key = wa_inv-prim_key
AND any_field = wa_inv-any_field.
ENDLOOP.
or
LOOP AT it_invest INTO wa_inv.
UPDATE dbtable FROM wa_inv. "if wa_inv of same type of dbtable
ENDLOOP.
In the first example, I wrote any field because you can update dbase table, filtering for fields that don't belong to the primary key. However, remember that you will change all records that respect the key you used (so, in your case, use the primary key).
Regards.
Valter Oliveira. -
Graphs and parent-child with loops and duplicates
There is a parent-child relation in the table t(prnt, chld) which allows duplicates (A->B, A->B) and opposite paths (A->B, B->A), and complicated loops. Is there a way to identify rows that form any separate "connections network" and assign a "name" to them of any kind (letter, number, wahtever)? I try to use WITH recursive clause to identify and group rows belonging to one graph but with no luck. Any help would be appreciated.
thank youFrank, I posted inputs for all graphs (multiple inserts) and some allowable outputs for one graph. For all cases (ie. graphs) the rule is the same:
1. identify all nodes belonging to a graph
2. "name" that graph (min, max or whatever you like)
3. print the output in the form (node_belonging_to_a_graph, name_of_the_graph) for all identified graphs
And as you said, I am somewhat flexible. I don't want to constrain the problem with saying min, max because it's not important how you name it, but the way which is somehow natural and fits with requirements is the usage of nodes' values.
You ask me if (1,1),(2,1),(3,1) is also OK as an output for sample graph (1,2)+(2,3). Yes it is. It is one of those I posted but with additional node which is chosen as a name for a graph. But as you can guess it doesn't matter which node you choose, and the additional information about a node named with its own name is not as important and the information that all other nodes are named with that name but it is 100% acceptable. If you changed the naming convention and started to use letters instead of node values then yes, it would be a must to have the output in the form (1,a),(2,a),(3,a).
You also ask me about the result for 90x data inserted as 5 rows: (901,902)..(906,904) and present sample result:
901 902
905 902
906 902
And the answer is no, it is not good result. It misses the information about the nodes 904 and 903 which belong to this graph too. The correct result could be:
901 902
905 902
906 902
903 902
904 902
or any other "combination" which presents 5 nodes with the name of the sixth (in this case of 6-node graph). Just one have to be picked, it doesn't matter which one. The "vertical" order is also irrelevant.
As you can see there is a lot of room that gives acceptable result. I don't want to constraint it because it can influence performance which is important when dealing with graph structures in relational databases (RDBMS are not predestined to easily cope with that sort of information). It can also influence the chosen algorithm and I'd like to pick the fastest one which gives acceptable result.
Two numbers x and y are in the same group (graph) if (and only if) at least one of the following is true:
(1) they appear on the same row together (it doesn't matter which number is in which of the 2 columns), or
--(2) x appears on the same row with a third number, z, and z is in the same group as y--
(2) there are other edges (entries) in the table that form a "path" from x to y. And because the direction of the path is not important for the problem (ie. the parent-child table structure can be forgotten for a moment), the path means "there exists connection" between x and y aka "you can walk from x to y".
The output consists of 2 columns: id (which is unique in the result set) and grp (which identifies the group) *[correct]*
The id column will always be one of the numbers in the group *[correct]*
It doesn't matter what the grp column is, or even what data type, as long as it distinguishes between the different groups. *[correct, but as you noted using one, picked number from a graph is the prefferable way]*
If there are N distinct numbers in the group, I need N rows of output for that group, with id showing all those distinct numbers. *[correct, but if you choose your naming convention as naming a graph with the value of the node belonging to it you can ommit the node which is named for itself (but it doesn't hurt is such row appear in the result)]*
You ask me if the graph is directed. No it's not. Your example (x,y) and (y,x) is great, and it can be concluded from my first post when I say that "opposite paths" (A->B, B->A) exists. What matters is the connection between the nodes. The parent-child table somehow imposes that direction is important, but for this problem it is not.
One of the motivations for my post is to know what other people think without affecting their minds with my approach. I don't want to skew anybody's mind into my solution which works, but it's not effective. I don't mind showing it but I kindly ask you to think about the problem before I post it. Diversity of approaches helps to distill the best one.
As I said I did it with the usage of sys_connect_by_path. If it doesn't appear to you as possible usage then it is likely that I don't use it efficiently. Please understand, I will post it if you ask me one more time but if you can live for a while without my inefficient solution and suggest something with WITH clause I would appreciate it.
There is no exact result I expect. There are many results which are correct and acceptable. They all must follow the rules described at the beginning.
Thank you
Edited by: 943276 on Jun 28, 2012 1:32 AM -
Building Tree hierarchy Using nested loops and class cl_gui_column_tree
Hello gurus,
I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
I have done some coding for it.
FORM build_tree USING node_table TYPE treev_ntab
item_table TYPE zitem_table. " i created the zitem_table table type of mtreeitm in SE11.
DATA: node TYPE treev_node,
item TYPE mtreeitm.
node-node_key = root.
CLEAR node-relatkey.
CLEAR node-relatship.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = 'X'.
node-expander = 'X'.
APPEND node TO node_table.
item-node_key = root.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = 'Root'.
APPEND item TO item_table.
item-node_key = root.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = 'Amount'.
APPEND item TO item_table.
LOOP AT it_vbeln INTO wa_vbeln.
node-node_key = wa_vbeln-vbeln.
node-relatkey = root.
node-relatship = cl_gui_column_tree=>relat_last_child.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = 'X'.
node-expander = 'X'.
APPEND node TO node_table.
item-node_key = wa_vbeln-vbeln.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_vbeln-vbeln.
APPEND item TO item_table.
item-node_key = wa_vbeln-vbeln.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_vbeln-netwr.
APPEND item TO item_table.
LOOP AT it_posnr INTO wa_posnr.
node-node_key = wa_posnr-posnr.
node-relatkey = wa_vbeln-vbeln.
node-relatship = cl_gui_column_tree=>relat_last_child.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = ' '.
node-expander = ' '.
APPEND node TO node_table.
item-node_key = wa_posnr-posnr.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_posnr-posnr.
APPEND item TO item_table.
item-node_key = wa_posnr-posnr.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_posnr-netpr.
APPEND item TO item_table.
ENDLOOP.
ENDLOOP.
ENDFORM.
Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
Edited by: Yayati6260 on Jul 14, 2011 7:25 AMHello all,
Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
Regards
Yayati Ekbote -
Requirement:
Hourly EEs(EG-2) with TMS 9 should not be processed for any country.
except for above all the other EG & TMS combinations should be processed.
hence I have incorporated the logic in the schema:
started with a if loop, if NGE, then process pcr ZEG2, which does the hourly EE identification and erroring part.
but if its not hrly EE, then it should other steps b/w ELSE and ENDIF, which isn't happening.
please advise.
IF NEG
ACTIO ZEG2
Processing
Call rule ZEG2
ELSE
(other country rules which have to processed if the above condition fails)
ENDIF
ZEG2 Check not to process hourly EEs with TMS 9
OUTWPPERSG Employee group
LEAVE Stop with PC Rule
2
COLERE2E Errors
there is an operation called SCOND=T/F, which will help determine the PCR satisfies the condition in the loop or not.
but tried to use it in place of LEAVE above, it throws the below error:
" No entry in T52BO for these parameters of the operation "
unable to find that table, found T7UN_T52BO which is a cross client table.
Please advise on how to fix this T52BO issue, so that I can use operation SCONDHi, Sharath.
The table is a system table, I don't think it's a good idea you maintain this table.
I think what is happenning is that you're not returning the condition to IF function in your schema. Or you're using the SCOND operation without using the IF function. In the schema try to do the following. You can use the operation SCOND only with function IF. Check the example below.
SCHEMA----
IF NEG
IF NOT ZEG2
... (Process information)
ENDIF
ELSE
... (Process information)
ENDIF
SCHEMA----
Above, an example of the rule ZEG2.
RULE----
OUTWPPERSG Employee group
SCOND=F IF
* SCOND=F IF
EE SCOND=T IF
RULE----
Edited by: Luciano Arashiro on Feb 11, 2012 3:00 PM -
System identifica​tion for open loop unstable plant?
Hello,
I have been trying to use system identification on labview. My problem is that my plant is open loop unstable and none of the tutorials or examples I have found seem to cover this so I cannot get it to work. Does anyone have any suggestions as to how I should go about it? My plant has an RC servo so it needs a PWM signal to stimulate it.
Thanks
Adamadamkse wrote:
I want to control my plant with lead/lag control but I do not know the plant model which makes this very difficult. I cannot theoretically calculate it because the information I need to obtain a numerical transfer function or state space model is unavailable.
I have it controlled with PID at the moment but this is not ideal.
I am trying to use the system identification toolkit to obtain a transfer function but I do not know what to do because the examples do not work for open loop unstable plants.
Adam
Ok Open loop unstable functions cannot be predictably controlled (hence the terms; open loop and unstable,) Not being able to model the actions is a bit of a problem too.
Somehow, someway you need to get some kind of model or some kind of feedback to either provide stability in the plant or close the loop.
Adding hardware (sensors) is the most likely solution.
tell me more about the plant, I do this kind of thing for a living, so I could offer some ideas.
Jeff -
Calculate Days between same date field in multiple records, looping for each record
Be patient as I am a newbie to Sql Server (using 2008 R2) and SSIS. I have looked at multiple solutions in this and many other forums before submitting the question.
I am looking at records to identify the number of days between two dates. We review drug information. A member uses drug A (Code identifies this called GPI) and has refills throughout time. The goal is to calculate the days between Refill
1 and refill 2, then refill 2 to refill 3, etc. When that member record set is complete, we move to the next member record set.
The basic data would be as follows. Each record shown below would be a separate record in a single table :
Member
Drug Code
DateService
Days Between
1
A
3/1/2012
0
1
A
3/27/2012
27
1
A
4/21/2012
26
1
A
6/15/2012
56
1
F
2/25/2012
0
1
F
3/20/2012
25
1
F
4/17/2012
29
1
F
8/1/2012
107
5
B
2/15/2012
0
5
B
3/10/2012
25
5
B
4/10/2012
32
5
B
6/28/2012
80
5
B
7/10/2012
13
5
B
8/20/2012
42
The days between is the value I am looking to calculate. The First record for the grouping of Member and Drug Code will be zero ( 0 ) as there is no preceding date to calculate against. The process would then loop through the records at the grouping
(Member and Drug Code) until those records are calculated. It would then move on to the next group of Member/Drug records.
Any assistance would be greatly appreciated. Any clarification I can provide, I would be more than happpy too. Thank you in advance!TSQL- Finding the difference in days of multiple records in SQL ServerWITH OrderDates AS (
SELECT
ROW_NUMBER() OVER (ORDER BY OrderDate DESC) AS RowNumber,
OrderDate
FROM OrdersTable
WHERE SKU = 'AA0000'
SELECT
AVG(DATEDIFF(DD, O2.OrderDate, O1.OrderDate)) AS AverageFrequency
FROM OrderDates O1
LEFT JOIN OrderDates O2
ON O2.RowNumber = O1.RowNumber + 1
Fabio Bilicki -
Tkprof output.. identification
oracle 10.2.0.2.0
os : linux
What are the assumptions can be derived from the output
TKPROF: Release 10.2.0.2.0 - Production on Thu Jun 12 09:25:26 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: tld4_ora_5894.trc
Sort options: fchela
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+ ordered use_nl(pm) use_hash(pm) use_nl(sph) index(pm PER_RFX_ID_TY_LATEST)*/ pm.loc_id, pm.poc_user_id, pm.ID, pm.code,
pm.NAME, pm.rfx_cost_estimate_base,
pm.date_created, pm.status_id,
pm.version_number, pm.latest_ind,
pm.cat_id cat_id, pm.sponsored_by_org_id,
pm.project_manager_id,
(SELECT COUNT (props.ID)
FROM spm_proposal_rfx pr,
spm_proposals props
WHERE pr.rfx_id = pm.ID
AND pr.proposal_id = props.ID
AND props.status_id NOT IN (8101, 8108))
number_of_proposals,
ch.contract_id,
con.xref_contract xref_contract,
sph.item_property_id process_type
FROM spm_rfx pm,
spm_contracts_hub ch,
spm_contracts con,
spm_properties_hub sph
WHERE pm.ID > 0
AND pm.rfx_type = 'REQUEST'
AND pm.latest_ind = 'Y'
AND pm.ID = ch.rfx_id
AND pm.owner_id = 4000
AND pm.rfx_type = ch.type_of
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = con.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29
FROM DUAL))
AND con.ID = ch.contract_id
AND sph.rfx_id = pm.ID
AND sph.type_of = pm.rfx_type
ORDER BY pm.ID DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.65 0.64 1 130 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 9.55 29.16 10039 186553 0 31
total 6 10.20 29.80 10040 186683 0 31
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=186553 pr=10039 pw=0 time=29145812 us)
31 COUNT STOPKEY (cr=186553 pr=10039 pw=0 time=29145749 us)
31 FILTER (cr=186553 pr=10039 pw=0 time=29145727 us)
31 VIEW (cr=185329 pr=10037 pw=0 time=29114147 us)
31 SORT ORDER BY (cr=185329 pr=10037 pw=0 time=29113913 us)
29536 TABLE ACCESS BY INDEX ROWID SPM_PROPERTIES_HUB (cr=81535 pr=9636 pw=0 time=30161718 us)
59073 NESTED LOOPS (cr=70280 pr=2137 pw=0 time=350415773 us)
29536 HASH JOIN (cr=11107 pr=2078 pw=0 time=4575599 us)
29536 HASH JOIN (cr=1900 pr=1891 pw=0 time=3358329 us)
29536 TABLE ACCESS FULL SPM_RFX (cr=1068 pr=1066 pw=0 time=2287845 us)
30935 INDEX FAST FULL SCAN PF_TEST_CHUB_IDX (cr=832 pr=825 pw=0 time=2280408 us)(object id 32367)
181203 TABLE ACCESS FULL SPM_CONTRACTS (cr=9207 pr=187 pw=0 time=2356208 us)
29536 INDEX RANGE SCAN PROPERTY_TYPE_RFX_IDX (cr=59173 pr=59 pw=0 time=994586 us)(object id 30553)
31 NESTED LOOPS (cr=1224 pr=2 pw=0 time=47898 us)
242 VIEW VW_NSO_1 (cr=708 pr=1 pw=0 time=29700 us)
242 UNION-ALL (cr=708 pr=1 pw=0 time=29430 us)
242 NESTED LOOPS (cr=708 pr=1 pw=0 time=28870 us)
645 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=31 pr=1 pw=0 time=11764 us)(object id 30685)
242 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=677 pr=0 pw=0 time=6000 us)(object id 30691)
0 FAST DUAL (cr=0 pr=0 pw=0 time=0 us)
31 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=516 pr=1 pw=0 time=28952 us)(object id 30848)
Rows Execution Plan
0 SELECT STATEMENT MODE: CHOOSE
31 VIEW
31 COUNT (STOPKEY)
31 FILTER
31 VIEW
31 SORT (ORDER BY)
29536 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_PROPERTIES_HUB' (TABLE)
59073 NESTED LOOPS
29536 HASH JOIN
29536 HASH JOIN
29536 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_RFX' (TABLE)
30935 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PF_TEST_CHUB_IDX' (INDEX)
181203 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_CONTRACTS' (TABLE)
29536 INDEX MODE: ANALYZED (RANGE SCAN) OF
'PROPERTY_TYPE_RFX_IDX' (INDEX)
31 NESTED LOOPS
242 VIEW OF 'VW_NSO_1' (VIEW)
242 UNION-ALL
242 NESTED LOOPS
645 INDEX MODE: ANALYZED (RANGE SCAN) OF
'ROLE_TYPE_NDX' (INDEX)
242 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'ROLE_USERS_PK' (INDEX (UNIQUE))
0 FAST DUAL
31 INDEX MODE: ANALYZED (RANGE SCAN) OF
'UFD_CONTRACT_FK_I' (INDEX)
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+ FIRST_ROWS ordered use_nl(con) use_nl(vp)*/
vp.primary_contact_userid, con.ID, con.code,
con.type_of_sub_contract, con.NAME,
con.org_id, con.cat_id, con.ccy_code,
con.end_dt, con.start_dt, con.date_created,
con.xref_contract extrefrequestid,
con.vendor_id, con.status_id,
vp.NAME vendor_name, buyer.NAME AS org_name,
con.created_by,
contract_pcr.CHILD change_order_id,
NVL
(con.change_contract_status_id,
-1
) AS change_contract_status_id,
(SELECT approved_amount
FROM spm_order_summary sos
WHERE sos.contract_id = con.ID
AND sos.po_id = sos.master_po_id)
est_value,
(SELECT billable_amount
FROM spm_order_summary sos
WHERE sos.contract_id = con.ID
AND sos.po_id = sos.master_po_id)
invoicableamount
FROM spm_contracts con,
(SELECT contract_id_parent PARENT,
contract_id_child CHILD
FROM spm_contract_pcr cp
WHERE cp.type_of_relation =
'CONTR_NEW_VERSION') contract_pcr,
spm_vendor_profiles vp,
spm_contracts_hub hub1,
spm_orgs orgs,
spm_orgs buyer
WHERE con.owner_id = 4000 /* Change for GE env. : changed value from 100 to 4000 */
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = con.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29 /* Change for GE env. : changed value from 257698 to 29 */
FROM DUAL))
AND ( con.version_number = 1
OR NOT EXISTS (
SELECT /*+ use_nl(pcr) */ 1
FROM spm_contract_pcr pcr,
spm_contracts ord2
WHERE pcr.contract_id_child = con.ID
AND pcr.type_of_relation =
'CONTR_NEW_VERSION'
AND pcr.contract_id_parent =
ord2.ID
AND ( ord2.status_id = 2612
OR ( ord2.status_id = 2611
AND con.status_id NOT IN
(2612,
2604,
2611,
2609,
2610
AND con.contract_type_id = 322
AND con.ID = contract_pcr.PARENT(+)
AND con.ID = hub1.contract_id
AND hub1.type_of != 'PROJECT_CONTRACT'
AND orgs.ID = con.org_id
AND orgs.legal_org_id = buyer.ID
AND vp.vendor_id = con.vendor_id
AND con.status_id NOT IN (-1)
AND NLS_UPPER (con.NAME) LIKE NLS_UPPER ('%%')
ORDER BY con.date_created DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.74 0.71 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 24.29 28.98 1001 826860 0 31
total 6 25.03 29.69 1001 826860 0 31
Misses in library cache during parse: 1
Optimizer mode: FIRST_ROWS
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=826860 pr=1001 pw=0 time=28977412 us)
31 COUNT STOPKEY (cr=826860 pr=1001 pw=0 time=28977363 us)
31 VIEW (cr=826860 pr=1001 pw=0 time=28977339 us)
31 SORT ORDER BY STOPKEY (cr=826860 pr=1001 pw=0 time=28977308 us)
76885 FILTER (cr=482076 pr=426 pw=0 time=17625245 us)
76986 HASH JOIN (cr=430532 pr=160 pw=0 time=14013505 us)
1436 VIEW index$_join$_012 (cr=23 pr=0 pw=0 time=16833 us)
1436 HASH JOIN (cr=23 pr=0 pw=0 time=15394 us)
1436 INDEX FAST FULL SCAN ORG_PK (cr=9 pr=0 pw=0 time=511 us)(object id 30407)
1436 INDEX FAST FULL SCAN PF_ORG_NAME (cr=14 pr=0 pw=0 time=140 us)(object id 32369)
76986 HASH JOIN (cr=430509 pr=160 pw=0 time=13604330 us)
234 VIEW index$_join$_011 (cr=18 pr=0 pw=0 time=4429 us)
234 HASH JOIN (cr=18 pr=0 pw=0 time=4427 us)
234 INDEX FAST FULL SCAN SPM_ORGS_MHP1_IDX (cr=9 pr=0 pw=0 time=325 us)(object id 30398)
1436 INDEX FAST FULL SCAN ORG_PK (cr=9 pr=0 pw=0 time=62 us)(object id 30407)
76986 HASH JOIN (cr=430491 pr=160 pw=0 time=13360369 us)
76986 TABLE ACCESS BY INDEX ROWID SPM_VENDOR_PROFILES (cr=429740 pr=106 pw=0 time=12146037 us)
153973 NESTED LOOPS (cr=377498 pr=99 pw=0 time=105010507 us)
76986 HASH JOIN RIGHT OUTER (cr=300158 pr=99 pw=0 time=8281127 us)
7515 INDEX FAST FULL SCAN CONTRACT_PCR_PK (cr=643 pr=30 pw=0 time=46192 us)(object id 30115)
76986 NESTED LOOPS (cr=299515 pr=69 pw=0 time=7155318 us)
149239 VIEW VW_SQ_2 (cr=724 pr=0 pw=0 time=749186 us)
149239 HASH UNIQUE (cr=724 pr=0 pw=0 time=599938 us)
197161 NESTED LOOPS (cr=724 pr=0 pw=0 time=394773 us)
9 VIEW VW_NSO_1 (cr=100 pr=0 pw=0 time=1160 us)
9 UNION-ALL (cr=100 pr=0 pw=0 time=1138 us)
8 NESTED LOOPS (cr=100 pr=0 pw=0 time=1004 us)
97 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=1 pr=0 pw=0 time=368 us)(object id 30685)
8 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=99 pr=0 pw=0 time=964 us)(object id 30691)
1 FAST DUAL (cr=0 pr=0 pw=0 time=4 us)
197161 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=624 pr=0 pw=0 time=197535 us)(object id 30848)
76986 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=298791 pr=69 pw=0 time=6642668 us)
149238 INDEX UNIQUE SCAN CONTRACTS_PK (cr=149553 pr=0 pw=0 time=2335192 us)(object id 30085)
76986 INDEX RANGE SCAN VNDR_PROF_VNDR_FK_I (cr=77340 pr=0 pw=0 time=1613500 us)(object id 30959)
202239 INDEX FAST FULL SCAN CONT_HUB_CONTID_TYPEOF_IDX (cr=751 pr=54 pw=0 time=218580 us)(object id 30101)
101 NESTED LOOPS (cr=51544 pr=266 pw=0 time=2191923 us)
7515 TABLE ACCESS BY INDEX ROWID SPM_CONTRACT_PCR (cr=28999 pr=266 pw=0 time=1779904 us)
17120 INDEX RANGE SCAN CONTRACT_PCR_CHILD_FK_I (cr=19262 pr=80 pw=0 time=583382 us)(object id 30116)
101 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=22545 pr=0 pw=0 time=383707 us)
7515 INDEX UNIQUE SCAN CONTRACTS_PK (cr=15030 pr=0 pw=0 time=226188 us)(object id 30085)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: FIRST_ROWS
31 VIEW
31 COUNT (STOPKEY)
31 VIEW
31 SORT (ORDER BY STOPKEY)
76885 FILTER
76986 HASH JOIN
1436 VIEW OF 'index$_join$_012' (VIEW)
1436 HASH JOIN
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'ORG_PK' (INDEX (UNIQUE))
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PF_ORG_NAME' (INDEX)
76986 HASH JOIN
234 VIEW OF 'index$_join$_011' (VIEW)
234 HASH JOIN
234 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'SPM_ORGS_MHP1_IDX' (INDEX)
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'ORG_PK' (INDEX (UNIQUE))
76986 HASH JOIN
76986 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID)
OF 'SPM_VENDOR_PROFILES' (TABLE)
153973 NESTED LOOPS
76986 HASH JOIN (RIGHT OUTER)
7515 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'CONTRACT_PCR_PK' (INDEX (UNIQUE))
76986 NESTED LOOPS
149239 VIEW OF 'VW_SQ_2' (VIEW)
149239 HASH (UNIQUE)
197161 NESTED LOOPS
9 VIEW OF 'VW_NSO_1' (VIEW)
9 UNION-ALL
8 NESTED LOOPS
97 INDEX MODE: ANALYZED
(RANGE SCAN) OF 'ROLE_TYPE_NDX' (INDEX)
8 INDEX MODE: ANALYZED
(UNIQUE SCAN) OF 'ROLE_USERS_PK' (INDEX
(UNIQUE))
1 FAST DUAL
197161 INDEX MODE: ANALYZED (RANGE SCAN)
OF 'UFD_CONTRACT_FK_I' (INDEX)
76986 TABLE ACCESS MODE: ANALYZED (BY INDEX
ROWID) OF 'SPM_CONTRACTS' (TABLE)
149238 INDEX MODE: ANALYZED (UNIQUE SCAN)
OF 'CONTRACTS_PK' (INDEX (UNIQUE))
76986 INDEX MODE: ANALYZED (RANGE SCAN) OF
'VNDR_PROF_VNDR_FK_I' (INDEX)
202239 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'CONT_HUB_CONTID_TYPEOF_IDX' (INDEX)
101 NESTED LOOPS
7515 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACT_PCR' (TABLE)
17120 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONTRACT_PCR_CHILD_FK_I' (INDEX)
101 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
7515 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'CONTRACTS_PK' (INDEX (UNIQUE))
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+first_rows ordered use_nl(cont) use_nl(conthub) use_nl(sps) */
cont.ID AS workorderid,
cont.status_id AS statusid,
cont.code AS workordercode,
cont.NAME AS workordertitle,
cont.description AS workorderdescription,
cont.start_dt AS startdate,
cont.end_dt AS enddate,
cont.termination_dt AS terminationdate,
cont.user_id AS hiring_manager_user_id,
cont.org_id AS org_id,
conthub.user_id AS contractorid,
-- cand.last_name AS last_name,
cand.last_name
|| ', '
|| cand.first_name AS candidatename,
cand.became_userid AS became_userid,
su.display_name AS hiring_manager_name,
ord.cat_id AS cat_id, ord.ID AS order_id,
ord.code AS order_code,
ord.NAME AS order_name,
ord.version_number AS version_number
FROM spm_contracts cont,
spm_contracts_hub conthub,
spm_candidates cand,
spm_users su,
spm_pmt_sched_hub spsh,
spm_payment_schedule sps,
spm_contracts ord
WHERE cont.owner_id = 4000 /* Change for GE env. : changed value from 100 to 4000 */
AND cont.contract_type_id = 323
AND cont.status_id IN (8705, 8709, 8708, 8702)
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = cont.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29 /* Change for GE env. : changed value from 257698 to 29 */
FROM DUAL))
AND NOT EXISTS (
SELECT /*+ use_nl(pcr) */ 1
FROM spm_contract_pcr pcr,
spm_contracts ord2
WHERE pcr.contract_id_child = ord.ID
AND pcr.contract_id_parent = ord2.ID
AND ord2.status_id = 2612
AND pcr.type_of_relation IN
('CONTR_NEW_VERSION',
'CONTRACTOR_REENGAGED'
AND cont.ID = conthub.contract_id
AND conthub.type_of = 'CANDIDATE'
AND conthub.candidate_id = cand.ID
AND cont.user_id = su.ID
AND cont.ID = spsh.contract_id
AND spsh.pmt_sched_id = sps.ID
AND sps.contract_id = ord.ID
ORDER BY workorderid DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.60 0.57 1 148 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 12.70 21.37 3459 481585 0 31
total 6 13.30 21.94 3460 481733 0 31
Misses in library cache during parse: 1
Optimizer mode: FIRST_ROWS
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=481585 pr=3459 pw=0 time=21365544 us)
31 COUNT STOPKEY (cr=481585 pr=3459 pw=0 time=21365480 us)
31 FILTER (cr=481585 pr=3459 pw=0 time=21365455 us)
31 VIEW (cr=481491 pr=3459 pw=0 time=21366696 us)
31 SORT ORDER BY (cr=481491 pr=3459 pw=0 time=21366310 us)
32745 NESTED LOOPS (cr=481491 pr=3459 pw=0 time=19266638 us)
32745 NESTED LOOPS (cr=415999 pr=3459 pw=0 time=18415173 us)
32745 HASH JOIN (cr=350507 pr=2907 pw=0 time=16695622 us)
32745 HASH JOIN (cr=349756 pr=2823 pw=0 time=16056095 us)
32745 HASH JOIN (cr=349581 pr=2780 pw=0 time=16950617 us)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS_HUB (cr=347407 pr=610 pw=0 time=8351793 us)
65491 NESTED LOOPS (cr=332023 pr=338 pw=0 time=105243492 us)
32745 NESTED LOOPS (cr=299202 pr=298 pw=0 time=6616161 us)
149239 VIEW VW_SQ_2 (cr=724 pr=53 pw=0 time=1118731 us)
149239 HASH UNIQUE (cr=724 pr=53 pw=0 time=969487 us)
197161 NESTED LOOPS (cr=724 pr=53 pw=0 time=394854 us)
9 VIEW VW_NSO_1 (cr=100 pr=0 pw=0 time=1288 us)
9 UNION-ALL (cr=100 pr=0 pw=0 time=1269 us)
8 NESTED LOOPS (cr=100 pr=0 pw=0 time=1133 us)
97 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=1 pr=0 pw=0 time=514 us)(object id 30685)
8 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=99 pr=0 pw=0 time=1140 us)(object id 30691)
1 FAST DUAL (cr=0 pr=0 pw=0 time=4 us)
197161 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=624 pr=53 pw=0 time=197643 us)(object id 30848)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=298478 pr=245 pw=0 time=7787761 us)
149238 INDEX UNIQUE SCAN CONTRACTS_PK (cr=149240 pr=59 pw=0 time=2627776 us)(object id 30085)
32745 INDEX RANGE SCAN CONT_HUB_CONTRACT_FK_I (cr=32821 pr=40 pw=0 time=1129934 us)(object id 30106)
44590 TABLE ACCESS FULL SPM_CANDIDATES (cr=2174 pr=2170 pw=0 time=695935 us)
35864 INDEX FAST FULL SCAN SPM_USERS_SNZ1_IDX (cr=175 pr=43 pw=0 time=49486 us)(object id 30832)
44547 INDEX FAST FULL SCAN PMT_SCHED_HUB_IDX_1 (cr=751 pr=84 pw=0 time=101490 us)(object id 30474)
32745 TABLE ACCESS BY INDEX ROWID SPM_PAYMENT_SCHEDULE (cr=65492 pr=552 pw=0 time=3084181 us)
32745 INDEX UNIQUE SCAN PMT_SCHED_PK (cr=32747 pr=34 pw=0 time=512373 us)(object id 30427)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=65492 pr=0 pw=0 time=820633 us)
32745 INDEX UNIQUE SCAN CONTRACTS_PK (cr=32747 pr=0 pw=0 time=344850 us)(object id 30085)
0 NESTED LOOPS (cr=94 pr=0 pw=0 time=3048 us)
8 TABLE ACCESS BY INDEX ROWID SPM_CONTRACT_PCR (cr=70 pr=0 pw=0 time=2354 us)
8 INDEX RANGE SCAN CONTRACT_PCR_CHILD_FK_I (cr=62 pr=0 pw=0 time=1915 us)(object id 30116)
0 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=24 pr=0 pw=0 time=583 us)
8 INDEX UNIQUE SCAN CONTRACTS_PK (cr=16 pr=0 pw=0 time=328 us)(object id 30085)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: FIRST_ROWS
31 VIEW
31 COUNT (STOPKEY)
31 FILTER
31 VIEW
31 SORT (ORDER BY)
32745 NESTED LOOPS
32745 NESTED LOOPS
32745 HASH JOIN
32745 HASH JOIN
32745 HASH JOIN
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX
ROWID) OF 'SPM_CONTRACTS_HUB' (TABLE)
65491 NESTED LOOPS
32745 NESTED LOOPS
149239 VIEW OF 'VW_SQ_2' (VIEW)
149239 HASH (UNIQUE)
197161 NESTED LOOPS
9 VIEW OF 'VW_NSO_1' (VIEW)
9 UNION-ALL
8 NESTED LOOPS
97 INDEX MODE: ANALYZED
(RANGE SCAN) OF 'ROLE_TYPE_NDX' (INDEX)
8 INDEX MODE: ANALYZED
(UNIQUE SCAN) OF 'ROLE_USERS_PK' (INDEX
(UNIQUE))
1 FAST DUAL
197161 INDEX MODE: ANALYZED (RANGE
SCAN) OF 'UFD_CONTRACT_FK_I' (INDEX)
32745 TABLE ACCESS MODE: ANALYZED (BY
INDEX ROWID) OF 'SPM_CONTRACTS' (TABLE)
149238 INDEX MODE: ANALYZED (UNIQUE SCAN)
OF 'CONTRACTS_PK' (INDEX (UNIQUE))
32745 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONT_HUB_CONTRACT_FK_I' (INDEX)
44590 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_CANDIDATES' (TABLE)
35864 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'SPM_USERS_SNZ1_IDX' (INDEX)
44547 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PMT_SCHED_HUB_IDX_1' (INDEX)
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_PAYMENT_SCHEDULE' (TABLE)
32745 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'PMT_SCHED_PK' (INDEX (UNIQUE))
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
32745 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'CONTRACTS_PK' (INDEX (UNIQUE))
0 NESTED LOOPS
8 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACT_PCR' (TABLE)
8 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONTRACT_PCR_CHILD_FK_I' (INDEX)
0 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
8 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'CONTRACTS_PK'
(INDEX (UNIQUE))
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 3 1.99 1.93 2 278 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 12 46.54 79.51 14499 1494998 0 93
total 18 48.53 81.44 14501 1495276 0 93
Misses in library cache during parse: 3
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 45 0.11 0.09 0 0 0 0
Execute 460 0.08 0.10 0 0 0 0
Fetch 1571 0.13 0.17 6 2546 0 1135
total 2076 0.32 0.37 6 2546 0 1135
Misses in library cache during parse: 10
Misses in library cache during execute: 10
3 user SQL statements in session.
460 internal SQL statements in session.
463 SQL statements in session.
3 statements EXPLAINed in this session.
Trace file: tld4_ora_5894.trc
Trace file compatibility: 10.01.00
Sort options: fchela
1 session in tracefile.
3 user SQL statements in trace file.
460 internal SQL statements in trace file.
463 SQL statements in trace file.
13 unique SQL statements in trace file.
3 SQL statements EXPLAINed using schema:
TLADM01.prof$plan_table
Default table was used.
Table was created.
Table was dropped.
4374 lines in trace file.
214 elapsed seconds in trace file.
pl. help identification of solutions to the poorly performing sqlsTKPROF: Release 10.2.0.2.0 - Production on Thu Jun 12 09:25:26 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: tld4_ora_5894.trc
Sort options: fchela
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+ ordered use_nl(pm) use_hash(pm) use_nl(sph) index(pm PER_RFX_ID_TY_LATEST)*/ pm.loc_id, pm.poc_user_id, pm.ID, pm.code,
pm.NAME, pm.rfx_cost_estimate_base,
pm.date_created, pm.status_id,
pm.version_number, pm.latest_ind,
pm.cat_id cat_id, pm.sponsored_by_org_id,
pm.project_manager_id,
(SELECT COUNT (props.ID)
FROM spm_proposal_rfx pr,
spm_proposals props
WHERE pr.rfx_id = pm.ID
AND pr.proposal_id = props.ID
AND props.status_id NOT IN (8101, 8108))
number_of_proposals,
ch.contract_id,
con.xref_contract xref_contract,
sph.item_property_id process_type
FROM spm_rfx pm,
spm_contracts_hub ch,
spm_contracts con,
spm_properties_hub sph
WHERE pm.ID > 0
AND pm.rfx_type = 'REQUEST'
AND pm.latest_ind = 'Y'
AND pm.ID = ch.rfx_id
AND pm.owner_id = 4000
AND pm.rfx_type = ch.type_of
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = con.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29
FROM DUAL))
AND con.ID = ch.contract_id
AND sph.rfx_id = pm.ID
AND sph.type_of = pm.rfx_type
ORDER BY pm.ID DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.65 0.64 1 130 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 9.55 29.16 10039 186553 0 31
total 6 10.20 29.80 10040 186683 0 31
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=186553 pr=10039 pw=0 time=29145812 us)
31 COUNT STOPKEY (cr=186553 pr=10039 pw=0 time=29145749 us)
31 FILTER (cr=186553 pr=10039 pw=0 time=29145727 us)
31 VIEW (cr=185329 pr=10037 pw=0 time=29114147 us)
31 SORT ORDER BY (cr=185329 pr=10037 pw=0 time=29113913 us)
29536 TABLE ACCESS BY INDEX ROWID SPM_PROPERTIES_HUB (cr=81535 pr=9636 pw=0 time=30161718 us)
59073 NESTED LOOPS (cr=70280 pr=2137 pw=0 time=350415773 us)
29536 HASH JOIN (cr=11107 pr=2078 pw=0 time=4575599 us)
29536 HASH JOIN (cr=1900 pr=1891 pw=0 time=3358329 us)
29536 TABLE ACCESS FULL SPM_RFX (cr=1068 pr=1066 pw=0 time=2287845 us)
30935 INDEX FAST FULL SCAN PF_TEST_CHUB_IDX (cr=832 pr=825 pw=0 time=2280408 us)(object id 32367)
181203 TABLE ACCESS FULL SPM_CONTRACTS (cr=9207 pr=187 pw=0 time=2356208 us)
29536 INDEX RANGE SCAN PROPERTY_TYPE_RFX_IDX (cr=59173 pr=59 pw=0 time=994586 us)(object id 30553)
31 NESTED LOOPS (cr=1224 pr=2 pw=0 time=47898 us)
242 VIEW VW_NSO_1 (cr=708 pr=1 pw=0 time=29700 us)
242 UNION-ALL (cr=708 pr=1 pw=0 time=29430 us)
242 NESTED LOOPS (cr=708 pr=1 pw=0 time=28870 us)
645 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=31 pr=1 pw=0 time=11764 us)(object id 30685)
242 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=677 pr=0 pw=0 time=6000 us)(object id 30691)
0 FAST DUAL (cr=0 pr=0 pw=0 time=0 us)
31 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=516 pr=1 pw=0 time=28952 us)(object id 30848)
Rows Execution Plan
0 SELECT STATEMENT MODE: CHOOSE
31 VIEW
31 COUNT (STOPKEY)
31 FILTER
31 VIEW
31 SORT (ORDER BY)
29536 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_PROPERTIES_HUB' (TABLE)
59073 NESTED LOOPS
29536 HASH JOIN
29536 HASH JOIN
29536 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_RFX' (TABLE)
30935 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PF_TEST_CHUB_IDX' (INDEX)
181203 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_CONTRACTS' (TABLE)
29536 INDEX MODE: ANALYZED (RANGE SCAN) OF
'PROPERTY_TYPE_RFX_IDX' (INDEX)
31 NESTED LOOPS
242 VIEW OF 'VW_NSO_1' (VIEW)
242 UNION-ALL
242 NESTED LOOPS
645 INDEX MODE: ANALYZED (RANGE SCAN) OF
'ROLE_TYPE_NDX' (INDEX)
242 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'ROLE_USERS_PK' (INDEX (UNIQUE))
0 FAST DUAL
31 INDEX MODE: ANALYZED (RANGE SCAN) OF
'UFD_CONTRACT_FK_I' (INDEX)
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+ FIRST_ROWS ordered use_nl(con) use_nl(vp)*/
vp.primary_contact_userid, con.ID, con.code,
con.type_of_sub_contract, con.NAME,
con.org_id, con.cat_id, con.ccy_code,
con.end_dt, con.start_dt, con.date_created,
con.xref_contract extrefrequestid,
con.vendor_id, con.status_id,
vp.NAME vendor_name, buyer.NAME AS org_name,
con.created_by,
contract_pcr.CHILD change_order_id,
NVL
(con.change_contract_status_id,
-1
) AS change_contract_status_id,
(SELECT approved_amount
FROM spm_order_summary sos
WHERE sos.contract_id = con.ID
AND sos.po_id = sos.master_po_id)
est_value,
(SELECT billable_amount
FROM spm_order_summary sos
WHERE sos.contract_id = con.ID
AND sos.po_id = sos.master_po_id)
invoicableamount
FROM spm_contracts con,
(SELECT contract_id_parent PARENT,
contract_id_child CHILD
FROM spm_contract_pcr cp
WHERE cp.type_of_relation =
'CONTR_NEW_VERSION') contract_pcr,
spm_vendor_profiles vp,
spm_contracts_hub hub1,
spm_orgs orgs,
spm_orgs buyer
WHERE con.owner_id = 4000 /* Change for GE env. : changed value from 100 to 4000 */
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = con.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29 /* Change for GE env. : changed value from 257698 to 29 */
FROM DUAL))
AND ( con.version_number = 1
OR NOT EXISTS (
SELECT /*+ use_nl(pcr) */ 1
FROM spm_contract_pcr pcr,
spm_contracts ord2
WHERE pcr.contract_id_child = con.ID
AND pcr.type_of_relation =
'CONTR_NEW_VERSION'
AND pcr.contract_id_parent =
ord2.ID
AND ( ord2.status_id = 2612
OR ( ord2.status_id = 2611
AND con.status_id NOT IN
(2612,
2604,
2611,
2609,
2610
AND con.contract_type_id = 322
AND con.ID = contract_pcr.PARENT(+)
AND con.ID = hub1.contract_id
AND hub1.type_of != 'PROJECT_CONTRACT'
AND orgs.ID = con.org_id
AND orgs.legal_org_id = buyer.ID
AND vp.vendor_id = con.vendor_id
AND con.status_id NOT IN (-1)
AND NLS_UPPER (con.NAME) LIKE NLS_UPPER ('%%')
ORDER BY con.date_created DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.74 0.71 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 24.29 28.98 1001 826860 0 31
total 6 25.03 29.69 1001 826860 0 31
Misses in library cache during parse: 1
Optimizer mode: FIRST_ROWS
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=826860 pr=1001 pw=0 time=28977412 us)
31 COUNT STOPKEY (cr=826860 pr=1001 pw=0 time=28977363 us)
31 VIEW (cr=826860 pr=1001 pw=0 time=28977339 us)
31 SORT ORDER BY STOPKEY (cr=826860 pr=1001 pw=0 time=28977308 us)
76885 FILTER (cr=482076 pr=426 pw=0 time=17625245 us)
76986 HASH JOIN (cr=430532 pr=160 pw=0 time=14013505 us)
1436 VIEW index$_join$_012 (cr=23 pr=0 pw=0 time=16833 us)
1436 HASH JOIN (cr=23 pr=0 pw=0 time=15394 us)
1436 INDEX FAST FULL SCAN ORG_PK (cr=9 pr=0 pw=0 time=511 us)(object id 30407)
1436 INDEX FAST FULL SCAN PF_ORG_NAME (cr=14 pr=0 pw=0 time=140 us)(object id 32369)
76986 HASH JOIN (cr=430509 pr=160 pw=0 time=13604330 us)
234 VIEW index$_join$_011 (cr=18 pr=0 pw=0 time=4429 us)
234 HASH JOIN (cr=18 pr=0 pw=0 time=4427 us)
234 INDEX FAST FULL SCAN SPM_ORGS_MHP1_IDX (cr=9 pr=0 pw=0 time=325 us)(object id 30398)
1436 INDEX FAST FULL SCAN ORG_PK (cr=9 pr=0 pw=0 time=62 us)(object id 30407)
76986 HASH JOIN (cr=430491 pr=160 pw=0 time=13360369 us)
76986 TABLE ACCESS BY INDEX ROWID SPM_VENDOR_PROFILES (cr=429740 pr=106 pw=0 time=12146037 us)
153973 NESTED LOOPS (cr=377498 pr=99 pw=0 time=105010507 us)
76986 HASH JOIN RIGHT OUTER (cr=300158 pr=99 pw=0 time=8281127 us)
7515 INDEX FAST FULL SCAN CONTRACT_PCR_PK (cr=643 pr=30 pw=0 time=46192 us)(object id 30115)
76986 NESTED LOOPS (cr=299515 pr=69 pw=0 time=7155318 us)
149239 VIEW VW_SQ_2 (cr=724 pr=0 pw=0 time=749186 us)
149239 HASH UNIQUE (cr=724 pr=0 pw=0 time=599938 us)
197161 NESTED LOOPS (cr=724 pr=0 pw=0 time=394773 us)
9 VIEW VW_NSO_1 (cr=100 pr=0 pw=0 time=1160 us)
9 UNION-ALL (cr=100 pr=0 pw=0 time=1138 us)
8 NESTED LOOPS (cr=100 pr=0 pw=0 time=1004 us)
97 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=1 pr=0 pw=0 time=368 us)(object id 30685)
8 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=99 pr=0 pw=0 time=964 us)(object id 30691)
1 FAST DUAL (cr=0 pr=0 pw=0 time=4 us)
197161 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=624 pr=0 pw=0 time=197535 us)(object id 30848)
76986 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=298791 pr=69 pw=0 time=6642668 us)
149238 INDEX UNIQUE SCAN CONTRACTS_PK (cr=149553 pr=0 pw=0 time=2335192 us)(object id 30085)
76986 INDEX RANGE SCAN VNDR_PROF_VNDR_FK_I (cr=77340 pr=0 pw=0 time=1613500 us)(object id 30959)
202239 INDEX FAST FULL SCAN CONT_HUB_CONTID_TYPEOF_IDX (cr=751 pr=54 pw=0 time=218580 us)(object id 30101)
101 NESTED LOOPS (cr=51544 pr=266 pw=0 time=2191923 us)
7515 TABLE ACCESS BY INDEX ROWID SPM_CONTRACT_PCR (cr=28999 pr=266 pw=0 time=1779904 us)
17120 INDEX RANGE SCAN CONTRACT_PCR_CHILD_FK_I (cr=19262 pr=80 pw=0 time=583382 us)(object id 30116)
101 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=22545 pr=0 pw=0 time=383707 us)
7515 INDEX UNIQUE SCAN CONTRACTS_PK (cr=15030 pr=0 pw=0 time=226188 us)(object id 30085)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: FIRST_ROWS
31 VIEW
31 COUNT (STOPKEY)
31 VIEW
31 SORT (ORDER BY STOPKEY)
76885 FILTER
76986 HASH JOIN
1436 VIEW OF 'index$_join$_012' (VIEW)
1436 HASH JOIN
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'ORG_PK' (INDEX (UNIQUE))
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PF_ORG_NAME' (INDEX)
76986 HASH JOIN
234 VIEW OF 'index$_join$_011' (VIEW)
234 HASH JOIN
234 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'SPM_ORGS_MHP1_IDX' (INDEX)
1436 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'ORG_PK' (INDEX (UNIQUE))
76986 HASH JOIN
76986 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID)
OF 'SPM_VENDOR_PROFILES' (TABLE)
153973 NESTED LOOPS
76986 HASH JOIN (RIGHT OUTER)
7515 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'CONTRACT_PCR_PK' (INDEX (UNIQUE))
76986 NESTED LOOPS
149239 VIEW OF 'VW_SQ_2' (VIEW)
149239 HASH (UNIQUE)
197161 NESTED LOOPS
9 VIEW OF 'VW_NSO_1' (VIEW)
9 UNION-ALL
8 NESTED LOOPS
97 INDEX MODE: ANALYZED
(RANGE SCAN) OF 'ROLE_TYPE_NDX' (INDEX)
8 INDEX MODE: ANALYZED
(UNIQUE SCAN) OF 'ROLE_USERS_PK' (INDEX
(UNIQUE))
1 FAST DUAL
197161 INDEX MODE: ANALYZED (RANGE SCAN)
OF 'UFD_CONTRACT_FK_I' (INDEX)
76986 TABLE ACCESS MODE: ANALYZED (BY INDEX
ROWID) OF 'SPM_CONTRACTS' (TABLE)
149238 INDEX MODE: ANALYZED (UNIQUE SCAN)
OF 'CONTRACTS_PK' (INDEX (UNIQUE))
76986 INDEX MODE: ANALYZED (RANGE SCAN) OF
'VNDR_PROF_VNDR_FK_I' (INDEX)
202239 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'CONT_HUB_CONTID_TYPEOF_IDX' (INDEX)
101 NESTED LOOPS
7515 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACT_PCR' (TABLE)
17120 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONTRACT_PCR_CHILD_FK_I' (INDEX)
101 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
7515 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'CONTRACTS_PK' (INDEX (UNIQUE))
SELECT *
FROM (SELECT elance_paginated_data.*, ROWNUM elance_current_row_number
FROM (SELECT elance_original_data.*
FROM (SELECT /*+first_rows ordered use_nl(cont) use_nl(conthub) use_nl(sps) */
cont.ID AS workorderid,
cont.status_id AS statusid,
cont.code AS workordercode,
cont.NAME AS workordertitle,
cont.description AS workorderdescription,
cont.start_dt AS startdate,
cont.end_dt AS enddate,
cont.termination_dt AS terminationdate,
cont.user_id AS hiring_manager_user_id,
cont.org_id AS org_id,
conthub.user_id AS contractorid,
-- cand.last_name AS last_name,
cand.last_name
|| ', '
|| cand.first_name AS candidatename,
cand.became_userid AS became_userid,
su.display_name AS hiring_manager_name,
ord.cat_id AS cat_id, ord.ID AS order_id,
ord.code AS order_code,
ord.NAME AS order_name,
ord.version_number AS version_number
FROM spm_contracts cont,
spm_contracts_hub conthub,
spm_candidates cand,
spm_users su,
spm_pmt_sched_hub spsh,
spm_payment_schedule sps,
spm_contracts ord
WHERE cont.owner_id = 4000 /* Change for GE env. : changed value from 100 to 4000 */
AND cont.contract_type_id = 323
AND cont.status_id IN (8705, 8709, 8708, 8702)
AND EXISTS (
SELECT 1
FROM spm_user_folder_details ufd
WHERE ufd.contract_id = cont.ID
AND ufd.user_id IN (
SELECT ru.role_id
FROM spm_role_users ru,
spm_roles r
WHERE ru.user_id = 29 /* Change for GE env. : changed value from 257698 to 29 */
AND ru.role_id = r.ID
AND r.type_of =
'ROLE_GROUP_TYPE'
UNION ALL
SELECT 29 /* Change for GE env. : changed value from 257698 to 29 */
FROM DUAL))
AND NOT EXISTS (
SELECT /*+ use_nl(pcr) */ 1
FROM spm_contract_pcr pcr,
spm_contracts ord2
WHERE pcr.contract_id_child = ord.ID
AND pcr.contract_id_parent = ord2.ID
AND ord2.status_id = 2612
AND pcr.type_of_relation IN
('CONTR_NEW_VERSION',
'CONTRACTOR_REENGAGED'
AND cont.ID = conthub.contract_id
AND conthub.type_of = 'CANDIDATE'
AND conthub.candidate_id = cand.ID
AND cont.user_id = su.ID
AND cont.ID = spsh.contract_id
AND spsh.pmt_sched_id = sps.ID
AND sps.contract_id = ord.ID
ORDER BY workorderid DESC) elance_original_data) elance_paginated_data
WHERE ROWNUM <= 31)
WHERE elance_current_row_number >= 1
call count cpu elapsed disk query current rows
Parse 1 0.60 0.57 1 148 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 4 12.70 21.37 3459 481585 0 31
total 6 13.30 21.94 3460 481733 0 31
Misses in library cache during parse: 1
Optimizer mode: FIRST_ROWS
Parsing user id: 21 (TLADM01)
Rows Row Source Operation
31 VIEW (cr=481585 pr=3459 pw=0 time=21365544 us)
31 COUNT STOPKEY (cr=481585 pr=3459 pw=0 time=21365480 us)
31 FILTER (cr=481585 pr=3459 pw=0 time=21365455 us)
31 VIEW (cr=481491 pr=3459 pw=0 time=21366696 us)
31 SORT ORDER BY (cr=481491 pr=3459 pw=0 time=21366310 us)
32745 NESTED LOOPS (cr=481491 pr=3459 pw=0 time=19266638 us)
32745 NESTED LOOPS (cr=415999 pr=3459 pw=0 time=18415173 us)
32745 HASH JOIN (cr=350507 pr=2907 pw=0 time=16695622 us)
32745 HASH JOIN (cr=349756 pr=2823 pw=0 time=16056095 us)
32745 HASH JOIN (cr=349581 pr=2780 pw=0 time=16950617 us)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS_HUB (cr=347407 pr=610 pw=0 time=8351793 us)
65491 NESTED LOOPS (cr=332023 pr=338 pw=0 time=105243492 us)
32745 NESTED LOOPS (cr=299202 pr=298 pw=0 time=6616161 us)
149239 VIEW VW_SQ_2 (cr=724 pr=53 pw=0 time=1118731 us)
149239 HASH UNIQUE (cr=724 pr=53 pw=0 time=969487 us)
197161 NESTED LOOPS (cr=724 pr=53 pw=0 time=394854 us)
9 VIEW VW_NSO_1 (cr=100 pr=0 pw=0 time=1288 us)
9 UNION-ALL (cr=100 pr=0 pw=0 time=1269 us)
8 NESTED LOOPS (cr=100 pr=0 pw=0 time=1133 us)
97 INDEX RANGE SCAN ROLE_TYPE_NDX (cr=1 pr=0 pw=0 time=514 us)(object id 30685)
8 INDEX UNIQUE SCAN ROLE_USERS_PK (cr=99 pr=0 pw=0 time=1140 us)(object id 30691)
1 FAST DUAL (cr=0 pr=0 pw=0 time=4 us)
197161 INDEX RANGE SCAN UFD_CONTRACT_FK_I (cr=624 pr=53 pw=0 time=197643 us)(object id 30848)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=298478 pr=245 pw=0 time=7787761 us)
149238 INDEX UNIQUE SCAN CONTRACTS_PK (cr=149240 pr=59 pw=0 time=2627776 us)(object id 30085)
32745 INDEX RANGE SCAN CONT_HUB_CONTRACT_FK_I (cr=32821 pr=40 pw=0 time=1129934 us)(object id 30106)
44590 TABLE ACCESS FULL SPM_CANDIDATES (cr=2174 pr=2170 pw=0 time=695935 us)
35864 INDEX FAST FULL SCAN SPM_USERS_SNZ1_IDX (cr=175 pr=43 pw=0 time=49486 us)(object id 30832)
44547 INDEX FAST FULL SCAN PMT_SCHED_HUB_IDX_1 (cr=751 pr=84 pw=0 time=101490 us)(object id 30474)
32745 TABLE ACCESS BY INDEX ROWID SPM_PAYMENT_SCHEDULE (cr=65492 pr=552 pw=0 time=3084181 us)
32745 INDEX UNIQUE SCAN PMT_SCHED_PK (cr=32747 pr=34 pw=0 time=512373 us)(object id 30427)
32745 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=65492 pr=0 pw=0 time=820633 us)
32745 INDEX UNIQUE SCAN CONTRACTS_PK (cr=32747 pr=0 pw=0 time=344850 us)(object id 30085)
0 NESTED LOOPS (cr=94 pr=0 pw=0 time=3048 us)
8 TABLE ACCESS BY INDEX ROWID SPM_CONTRACT_PCR (cr=70 pr=0 pw=0 time=2354 us)
8 INDEX RANGE SCAN CONTRACT_PCR_CHILD_FK_I (cr=62 pr=0 pw=0 time=1915 us)(object id 30116)
0 TABLE ACCESS BY INDEX ROWID SPM_CONTRACTS (cr=24 pr=0 pw=0 time=583 us)
8 INDEX UNIQUE SCAN CONTRACTS_PK (cr=16 pr=0 pw=0 time=328 us)(object id 30085)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: FIRST_ROWS
31 VIEW
31 COUNT (STOPKEY)
31 FILTER
31 VIEW
31 SORT (ORDER BY)
32745 NESTED LOOPS
32745 NESTED LOOPS
32745 HASH JOIN
32745 HASH JOIN
32745 HASH JOIN
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX
ROWID) OF 'SPM_CONTRACTS_HUB' (TABLE)
65491 NESTED LOOPS
32745 NESTED LOOPS
149239 VIEW OF 'VW_SQ_2' (VIEW)
149239 HASH (UNIQUE)
197161 NESTED LOOPS
9 VIEW OF 'VW_NSO_1' (VIEW)
9 UNION-ALL
8 NESTED LOOPS
97 INDEX MODE: ANALYZED
(RANGE SCAN) OF 'ROLE_TYPE_NDX' (INDEX)
8 INDEX MODE: ANALYZED
(UNIQUE SCAN) OF 'ROLE_USERS_PK' (INDEX
(UNIQUE))
1 FAST DUAL
197161 INDEX MODE: ANALYZED (RANGE
SCAN) OF 'UFD_CONTRACT_FK_I' (INDEX)
32745 TABLE ACCESS MODE: ANALYZED (BY
INDEX ROWID) OF 'SPM_CONTRACTS' (TABLE)
149238 INDEX MODE: ANALYZED (UNIQUE SCAN)
OF 'CONTRACTS_PK' (INDEX (UNIQUE))
32745 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONT_HUB_CONTRACT_FK_I' (INDEX)
44590 TABLE ACCESS MODE: ANALYZED (FULL) OF
'SPM_CANDIDATES' (TABLE)
35864 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'SPM_USERS_SNZ1_IDX' (INDEX)
44547 INDEX MODE: ANALYZED (FAST FULL SCAN) OF
'PMT_SCHED_HUB_IDX_1' (INDEX)
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_PAYMENT_SCHEDULE' (TABLE)
32745 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'PMT_SCHED_PK' (INDEX (UNIQUE))
32745 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
32745 INDEX MODE: ANALYZED (UNIQUE SCAN) OF
'CONTRACTS_PK' (INDEX (UNIQUE))
0 NESTED LOOPS
8 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACT_PCR' (TABLE)
8 INDEX MODE: ANALYZED (RANGE SCAN) OF
'CONTRACT_PCR_CHILD_FK_I' (INDEX)
0 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'SPM_CONTRACTS' (TABLE)
8 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'CONTRACTS_PK'
(INDEX (UNIQUE))
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 3 1.99 1.93 2 278 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 12 46.54 79.51 14499 1494998 0 93
total 18 48.53 81.44 14501 1495276 0 93
Misses in library cache during parse: 3
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 45 0.11 0.09 0 0 0 0
Execute 460 0.08 0.10 0 0 0 0
Fetch 1571 0.13 0.17 6 2546 0 1135
total 2076 0.32 0.37 6 2546 0 1135
Misses in library cache during parse: 10
Misses in library cache during execute: 10
3 user SQL statements in session.
460 internal SQL statements in session.
463 SQL statements in session.
3 statements EXPLAINed in this session.
Trace file: tld4_ora_5894.trc
Trace file compatibility: 10.01.00
Sort options: fchela
1 session in tracefile.
3 user SQL statements in trace file.
460 internal SQL statements in trace file.
463 SQL statements in trace file.
13 unique SQL statements in trace file.
3 SQL statements EXPLAINed using schema:
TLADM01.prof$plan_table
Default table was used.
Table was created.
Table was dropped.
4374 lines in trace file.
214 elapsed seconds in trace file. -
System identification of a "complex" system
I would like to use labview to extract the transfer function of a closed loop control system. This system uses a PID loop to control the amplitude and phase of a radio frequency cavity.
I can easily excite the real world system with a step response (or any arbitary excitation).
The step response from the system has both amplitude and phase, and in labview is an array of type "extended complex".
Is the NI system identification toolkit capable of extracting the transfer function in both amplitude and phase? I have an evaluation version and have been unable to get this working.
Pete.System Identification uses frequency response based on "bode" graphs. This means that it has two graphs: one representing the magnitude over the frequency range and the second is the phase against frequency (http://en.wikipedia.org/wiki/Bode_plot)
If you see the literature, on complex numbers (http://en.wikipedia.org/wiki/Complex_number), the polar form describes how you can convert Real +/- imaginary to magnitude and phase. Notice that, in general, the magnitude is expressed in log scale and special care is necessary to allow you to use the functions. Fortunately for you, System Identification allow you to use "linear" scale in the conversion. You define this on the "FRF format".
Also, notice that the SI Estimate FRF function is only used when you have the time-domain data (input and output over time) and the other functions in the frequency domain Model Estimation palette are used to convert bode responses into a polynomial in the S-domain or Z-domain.
Please let me know if you still can't configure the functions.
Barp - Control and Simulation Group - LabVIEW R&D - National Instruments -
Pass continuous discrete averages out of loop
Hi,
I have a DAQ that's acquiring 1 sample at 1 Hz. I am trying to get the program to continuously acquire samples but to output the average of every 10 samples, which I use at a later point in the program for calculations. I have found a lot of topics on the NI forums that discuss running averages but this is not what I am looking for. I have also found this link that shows a labview program that can acquire a given number of samples, average them and write to a file (2nd diagram from the top). This is very similar to what I need except for the part where it displays the mean within the case structure.
http://forums.ni.com/t5/LabVIEW/How-to-make-labview-program-to-get-average-value-of-200-reading/td-p...
I am able to write the averages to a file or display them within the loop. However, I need to pass the average of every 10 samples out of the loop. In other words, the DAQ acquires continuously but at the end of every 10 seconds, the algorithm outputs the average of the data from those 10 seconds. Can anyone tell me if this is possible in Labview 2010 and what function will help me achieve this?
Thanks for reading!
av10You are very close. Look at your Consumer loop -- you dequeue one element from the Queue, then pass it into a "Do Forever" loop that shows the single value. Put the Dequeue also inside the loop, and you'll have what you want.
The Producer loop will continue to put Means on the Queue. The Queue "wire" is a bit unusual in that data can pass "backwards" through the wire (it doesn't really -- the wire just identifies a conduit in which the data travels). Once the data is on the Queue, any Dequeue element (like the one you will move into the Consumer loop) will have access to the "conduit" and will be able to remove the data and do whatever you want with it (like display it on the Numeric indicator -- consider renaming that something more mnemonic, like "Mean Value").
One question that comes up with multiple loops is How Do I Shut Them All Down? Here, again, Queues are your Friends. Inside the Consumer Loop, wire the output of the Error Line coming from the Dequeue to the Stop indicator (this Consumer loop is so simple you don't need to worry about an Error Case statement). When you Release the Queue after exiting the Producer Loop (in response to pushing the Stop control), the Queue itself will disappear, and the Dequeue function in the Consumer Loop, which is waiting for a new value, will instead throw an error. Well, this error you will interpret as "The Queue Is Dead, Time to Stop Consuming", and by wiring the Error Line to the Consumer's Stop terminal, this will stop the second loop, and your program will exit.
Let us know if this answers your questions, and solves the problem you were raising.
BS -
In logic 9 if there is a looped position, when I press the return button second tim it goes to the looped position. But in Logic X it is not working like that. If I press the space bar it starts playing from the looped position. How do I go the looped positon, is there any short cut for it. Help appreciated.
The issue has come up several times lately.. it will self correct in a few months.. more or less.. it is unknown but the old registration of the unit to its old IP will not be updated in world IP maps for several weeks. Eventually it does..
Apple provide no help.. and you cannot even move your place of identification to Brazil. This is why automatic systems without manual override is such a pain.. most routers allow you to spoof the MAC address of the WAN. Until apple do that it won't work.
Buy an airport in Brazil if it bothers you. -
I am creating a BP with BAPI_BUPA_CREATE_FROM_DATA, then I add an employee role with BAPI_BUPA_ROLE_ADD. My question is how do I fill out Identication for BP Employee?
Example will be appreciated.Hi,
Here is the example
l_identcateg LIKE bapibus1006_identification_key occurs 0 with header line,
l_identif LIKE bapibus1006_identification occurs 0 with header line,
FORM identification.
l_identcateg-identificationcategory = 'NRIC'.
l_identcateg-identificationnumber = 'B0123456'.
APPEND l_identcateg.
l_identif-country = 'MY'.
l_identif-region = 'KUL'.
APPEND l_identif.
l_identcateg-identificationcategory = 'NRIC'.
l_identcateg-identificationnumber = 'B0167778'.
APPEND l_identcateg.
l_identif-country = 'MY'.
l_identif-region = 'KUL'.
APPEND l_identif.
ENDFORM.
IF l_bpartner IS NOT INITIAL.
loop at l_identcateg.
CALL FUNCTION 'BAPI_IDENTIFICATION_ADD'
EXPORTING
BUSINESSPARTNER = l_bpartner
IDENTIFICATIONCATEGORY = l_identcateg-identificationcategory
IDENTIFICATIONNUMBER = l_identcateg-identificationnumber
IDENTIFICATION = l_identif
TABLES
RETURN = l_returnval2.
Smita.
Maybe you are looking for
-
Ho to change the old Logical System in the new Client?
Hi All, after a Client copy, I've to change the old Logical System in all the relevant SAP tables in the new client. In the Co tables too, such as CSKS. Could anyone tell me hoq to do it? Thanks G.Rossi
-
Export to camera crashes iMovie 06
We've been running 10.3.9 and iMovie 05 sucessfully for a while now, but after upgrading to 10.4.4, iMovie 06 and Quicktime 7 we started getting numberous problems with iMovie. I'm not sure if this is 100% iMovies fault or some combination of the upg
-
Inter company transaction between USA1 & USA2 company codes
Hi, I want to create Inter company transactions between USA1 & USA2 company codes. Will you pls tell me where is this configuration has to set up.what is the procedure... Company code USA1 has a customer #42209 with trading partner USA2 & the vendor
-
Validation before posting an idoc
Hello Friends, I need to post an Orders Idoc into SAP System via XI, but before I post an idoc into R/3 is there any ways to validate some of the fields like customer number,etc. Please let me how to validate this in XI. Thanks in advance Regards, Ja
-
URGENT HELP-CONFIGURE SWITCH 3560
Dear All, I have here in my company 25 Cisco Switch 3560 . as i know, i will configure the Switch with the Basic configuration like Hostname & IP-Address - & Gateway. My 2 question is :- 1- if i configure the switch with the Basic Configuration like