How to use DBMS_JOB to run the OWB scripts?

Can anyone pls explain how I can use the DBMS_JOB to run the scripts which are generated by OWB.
Suroop

CREATE OR REPLACE PACKAGE "LOAD_DATAMART"
AS
TYPE t_global IS RECORD
( plsql_map VARCHAR2(50) := 'transactions_map_exp', -- Default mapping plsql program
plsql_map_main VARCHAR2(50) := 'transactions_map_exp.main', -- Default mapping plsql main program
servers NUMBER(2) := 19, -- Default concurrent loading servers
max_reloads NUMBER(3) := 3 , -- Default maximum load retrys
mail_sender VARCHAR2(99) := '"Certegy Data Warehouse"', -- Default Mail Sender
mail_notice VARCHAR2(99) := '[email protected]', -- Default Recepient Notification
mail_error VARCHAR2(99) := '[email protected]' -- Default Recepient for Errors.
GLOBAL t_global ;
PROCEDURE start_monitor_load(p_date IN DATE);
PROCEDURE monitor_load( p_date IN DATE , p_dwh_load# IN NUMBER DEFAULT NULL, p_servers IN NUMBER DEFAULT GLOBAL.servers );
PROCEDURE start_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs IN VARCHAR2);
PROCEDURE create_job_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs VARCHAR2 DEFAULT 'batch01_rbs' );
FUNCTION dependency_on(p_type IN VARCHAR2, p_date IN DATE) RETURN BOOLEAN;
PROCEDURE send_mail (p_sender IN VARCHAR2, p_recipient IN VARCHAR2, p_subject IN VARCHAR2, p_message IN VARCHAR2);
PROCEDURE start_load_guard;
PROCEDURE load_guard(p_job IN INTEGER);
END load_datamart;
CREATE OR REPLACE PACKAGE BODY "LOAD_DATAMART"
AS
PROCEDURE start_monitor_load(p_date IN DATE) IS
v_plsql VARCHAR2(32000);
BEGIN
v_plsql := 'load_datamart.monitor_load(to_date('''||TO_CHAR(p_date,'DD-MON-YYYY HH24:MI:SS')||''',''DD-MON-YYYY HH24:MI:SS''));';
EXECUTE IMMEDIATE 'declare v_job integer; begin dbms_job.submit(v_job,:v_plsql); end;'
USING v_plsql;
END start_monitor_load;
PROCEDURE monitor_load( p_date IN DATE, p_dwh_load# IN NUMBER DEFAULT NULL , p_servers IN NUMBER DEFAULT GLOBAL.servers ) IS
TYPE t_server IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
v_server t_server;
v_dwh_load# NUMBER;
v_reload_limit NUMBER := 0;
v_plsql_error VARCHAR2(32000);
pending_jobs BOOLEAN;
p_batch VARCHAR2(20) := 'batch01_rbs';
FUNCTION job_server_running(p_dwh_load_seq NUMBER) RETURN BOOLEAN IS
CURSOR c1 IS SELECT * FROM DWH_LOAD_DETAIL
WHERE dwh_load# = v_dwh_load#
AND load_seq = p_dwh_load_seq;
r1 c1%ROWTYPE;
PROCEDURE try_resubmit_job(p_dwh_load_seq OUT NUMBER) IS
v_load_seq NUMBER;
BEGIN
SELECT COUNT(*) INTO v_load_seq
FROM DWH_LOAD_DETAIL
WHERE dwh_load# = v_dwh_Load#;
IF v_load_seq < v_reload_limit THEN
INSERT INTO DWH_LOAD_DETAIL(dwh_load#,load_seq,load_server,plsql_map,map_parameters)
VALUES(v_dwh_load#,v_load_seq+1,0,r1.plsql_map,r1.map_parameters||'| SEQ '||v_load_seq);
COMMIT;
               ELSE
               RAISE_APPLICATION_ERROR(-20000,'Maximum '||v_reload_limit||' retrys reached, load aborted.');
END IF;
END;
BEGIN
OPEN c1;
FETCH c1 INTO r1;
IF c1%NOTFOUND THEN
RETURN FALSE;
ELSIF c1%FOUND AND r1.job_end_time IS NULL THEN
RETURN TRUE;
ELSIF c1%FOUND AND r1.job_end_time IS NOT NULL THEN
IF r1.job_end_time = 'BROKEN' THEN
try_resubmit_job(r1.load_seq); -- Oracle Errors
END IF;
RETURN FALSE;
END IF;
CLOSE c1;
END job_server_running;
FUNCTION get_next_load_seq(p_dwh_load_server IN NUMBER) RETURN NUMBER IS
CURSOR c1 IS SELECT * FROM DWH_LOAD_DETAIL
WHERE dwh_load# = v_dwh_load#
AND load_server = 0
ORDER BY dwh_load#,load_seq
FOR UPDATE OF load_server;
r1 c1%ROWTYPE;
BEGIN
OPEN c1;
FETCH c1 INTO r1;
IF c1%FOUND THEN
UPDATE DWH_LOAD_DETAIL
SET load_server = p_dwh_load_server
WHERE CURRENT OF c1;
END IF;
CLOSE c1;
COMMIT;
RETURN r1.load_seq;
END get_next_load_seq;
BEGIN
v_dwh_load# := p_dwh_load#;
-- Defining the Max Retry to load
SELECT COUNT(*) + GLOBAL.max_reloads INTO v_reload_limit
FROM DWH_LOAD_DETAIL
WHERE dwh_load# = v_dwh_load#;
FOR i IN 1..99 LOOP
v_server(i) := NULL;
END LOOP;
LOOP
pending_jobs := FALSE;
FOR i IN 1..p_servers LOOP
IF NOT job_server_running(v_server(i)) THEN
v_server(i) := get_next_load_seq(i);
IF v_server(i) IS NOT NULL THEN
load_datamart.create_job_load(v_dwh_load#,v_server(i),p_batch);
IF p_batch = 'batch01_rbs' THEN
p_batch :='batch02_rbs';
ELSIF p_batch = 'batch02_rbs' THEN
p_batch :='batch03_rbs';
ELSIF p_batch = 'batch03_rbs' THEN
p_batch :='batch01_rbs';
END IF;
END IF;
END IF;
IF v_server(i) IS NOT NULL THEN
pending_jobs := TRUE;
END IF;
END LOOP;
EXIT WHEN NOT pending_jobs;
dbms_lock.sleep(05);
END LOOP;
COMMIT;
UPDATE DWH_LOAD_HEADER
SET plsql_error = 'Completed'
WHERE dwh_load# = v_dwh_load#;
COMMIT;
EXCEPTION WHEN OTHERS THEN
v_plsql_error := SUBSTR(SQLERRM,1,4000);
load_datamart.send_mail(load_datamart.GLOBAL.mail_sender,load_datamart.GLOBAL.mail_error,
'Load Datamart - Load '||TO_CHAR(p_date,'MM/DD/YYYY HH24:MI:SS')||' not completed',
v_plsql_error||CHR(10)||
':::::::::::::::::::::::::::::::::::::::::'||CHR(13)||
'- Parameter Date '||TO_CHAR(p_date,'MM/DD/YYYY')||CHR(13)||
':::::::::::::::::::::::::::::::::::::::::'||CHR(13)||
'- Transmission time '||TO_CHAR(p_date,'hh24:mi:ss')||CHR(13)||
'- Load Seq# '||TO_CHAR(v_dwh_load#)||CHR(13)||
':::::::::::::::::::::::::::::::::::::::::'||CHR(13));
v_plsql_error := SUBSTR(SQLERRM,1,4000);
UPDATE DWH_LOAD_HEADER
SET plsql_error = v_plsql_error
WHERE dwh_load# = v_dwh_load#;
COMMIT;
                    RAISE_APPLICATION_ERROR(-20000,v_plsql_error);
END monitor_load;
PROCEDURE start_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs IN VARCHAR2) IS
v_plsql_map VARCHAR2(200);
v_sqlerrm VARCHAR2(4000);
BEGIN
UPDATE DWH_LOAD_DETAIL
SET job_start_date = TRUNC(SYSDATE) ,
job_start_time = TO_CHAR(SYSDATE,'HH24:MI:SS')
WHERE dwh_load# = p_dwh_load#
AND load_seq = p_load_seq
RETURN plsql_map INTO v_plsql_map;
COMMIT;
EXECUTE IMMEDIATE 'set transaction use rollback segment '||p_rbs;
v_plsql_map := 'begin '||v_plsql_map||' end;';
EXECUTE IMMEDIATE v_plsql_map;
EXECUTE IMMEDIATE 'begin
UPDATE DWH_LOAD_DETAIL
SET job_end_date = SYSDATE,
job_end_time = TO_CHAR(SYSDATE,''HH24:MI:SS''),
rta_iid = '||global.plsql_map||'.get_runtime_audit_id,
rta_select = '||global.plsql_map||'.get_selected,
rta_update = '||global.plsql_map||'.get_updated,
rta_insert = '||global.plsql_map||'.get_inserted,
rta_errors = '||global.plsql_map||'.get_errors,
rta_delete = '||global.plsql_map||'.get_deleted
WHERE dwh_load# = :p_dwh_load#
AND load_seq = :p_load_seq;
UPDATE DWH_LOAD_HEADER
SET rows_inserted = NVL(rows_inserted,0) + NVL('||global.plsql_map||'.get_inserted,0)
WHERE dwh_load# = :p_dwh_load#;
END;' using p_dwh_Load#,p_load_seq;
COMMIT;
EXCEPTION WHEN OTHERS THEN
v_sqlerrm := SUBSTR(SQLERRM,1,3999);
EXECUTE IMMEDIATE ' begin
UPDATE DWH_LOAD_DETAIL
SET job_end_date = SYSDATE,
job_end_time = ''BROKEN'',
rta_iid = '||global.plsql_map||'.get_runtime_audit_id,
rta_select = '||global.plsql_map||'.get_selected,
rta_update = '||global.plsql_map||'.get_updated,
rta_insert = '||global.plsql_map||'.get_inserted,
rta_errors = '||global.plsql_map||'.get_errors,
rta_delete = '||global.plsql_map||'.get_deleted,
plsql_error = :v_sqlerrm
WHERE dwh_load# = :p_dwh_load#
AND load_seq = :p_load_seq;
UPDATE DWH_LOAD_HEADER
SET rows_inserted = NVL(rows_inserted,0) + NVL('||global.plsql_map||'.get_inserted,0)
WHERE dwh_load# = :p_dwh_load#;
END; ' using v_sqlerrm, p_dwh_load#,p_load_seq;
COMMIT;
END start_load;
PROCEDURE create_job_load(p_dwh_load# IN NUMBER, p_load_seq IN NUMBER, p_rbs VARCHAR2 DEFAULT 'batch01_rbs' ) IS
p_job INTEGER;
v_date DATE;
BEGIN
-- Submitting Job Load
DBMS_JOB.SUBMIT(p_job,'load_datamart.start_load('||p_dwh_load#||','||p_load_seq||','||''''||p_rbs||''');');
COMMIT;
END create_job_load;
FUNCTION dependency_on(p_type IN VARCHAR2, p_date IN DATE) RETURN BOOLEAN IS
CURSOR c1 IS SELECT * FROM DWH_DATA_LOADS
WHERE data_type = p_type
AND file_date >= TRUNC(p_date);
r1 c1%ROWTYPE;
BEGIN
OPEN c1;
FETCH c1 INTO r1;
IF c1%FOUND AND r1.status = 'Done' THEN
RETURN FALSE;
END IF;
CLOSE c1;
RETURN TRUE;
END;
PROCEDURE send_mail (p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_subject IN VARCHAR2,
p_message IN VARCHAR2) IS
* This procedure is usefull for sending e-mails for single or multiples recipients up to 50 *
* the limitation is Lotes Notes e-mail service. *
* Lewis Cunnigham Package is good also for massive distribuition to multiples e-mails, *
v_mailhost VARCHAR2(30) := '172.27.2.157'; -- Titan and Eagle available SMTP service, through the GATEWAY
v_mailhost    VARCHAR2(30) := 'STPMTA1ML';      old one
v_mailhost    VARCHAR2(30) := 'stpnh1ml';       Main SMTP, all other are replicated, not available.
v_mailhost    VARCHAR2(30) := 'STPMS6ML';       Replicated server, not available.
v_mail_conn utl_smtp.connection;
v_crlf VARCHAR2(2) DEFAULT CHR(13)||CHR(10);
v_date VARCHAR2(255) DEFAULT TO_CHAR( SYSDATE, 'MM/DD/YYYY hh24:mi AM' ); -- Lotus Notes default format.
--pragma autonomous_transaction;
PROCEDURE writeData( p_text IN VARCHAR2 ) AS
BEGIN
IF ( p_text IS NOT NULL ) THEN
utl_smtp.write_data( v_mail_conn, p_text || v_crlf );
END IF;
END;
BEGIN
v_mail_conn := utl_smtp.open_connection(v_mailhost, 25); -- Default port
utl_smtp.helo(v_mail_conn, v_mailhost);
utl_smtp.mail(v_mail_conn, p_sender);
utl_smtp.rcpt(v_mail_conn, p_recipient);
utl_smtp.open_data(v_mail_conn);
writeData( 'To: '|| p_recipient ); -- Redundant, but necessary to complete format
writeData( 'From: ' || p_sender); -- Redundant, but necessary to complete format
writeData( 'Date: ' || v_date ); -- Database completion time
writeData( 'Subject: ' || NVL( p_subject , '(no subject) ' ) ); -- Default Subject
     --writeData( 'Content-Type: text/html');
utl_smtp.write_data(v_mail_conn, '' || v_crlf );
utl_smtp.write_data(v_mail_conn, p_message ); -- Message body
utl_smtp.close_data(v_mail_conn );
utl_smtp.quit(v_mail_conn);
--commit;
EXCEPTION WHEN OTHERS THEN null;                                Since we are just sending e-mails,
-- We don't care about mail errors like when server down, only when needed.
END;
PROCEDURE start_load_guard IS
v_job INTEGER;
BEGIN
DBMS_JOB.SUBMIT(v_job,'load_datamart.load_guard(100);',SYSDATE+100);
     DBMS_JOB.CHANGE(v_job,'load_datamart.load_guard('||v_job||');',SYSDATE,'sysdate+((1/60)*1/24)');
     COMMIT;
END start_load_guard;
PROCEDURE load_guard(p_job IN INTEGER) IS
v_job INTEGER;
     CURSOR c1 IS SELECT * FROM DWH_DATA_LOADS
     WHERE file_date BETWEEN TRUNC(SYSDATE) AND TRUNC(SYSDATE)+(86399/86400);
did_PAYC_load BOOLEAN := NULL;
did_ARMS_load BOOLEAN := NULL;
did_CLMS_load BOOLEAN := NULL;
did_STAT_load BOOLEAN := NULL;
did_TRAN_load BOOLEAN := NULL;
did_VCOM_load BOOLEAN := NULL;
did_BCRD_load BOOLEAN := NULL;
did_PNET_load BOOLEAN := NULL;
BEGIN
FOR i IN c1 LOOP
     NULL;
     --if i.status in ('Ready','Done') then
     --if i.data_type = 'PAYC' then
     END LOOP;
     IF NOT ( SYSDATE >= TO_DATE(TO_CHAR(SYSDATE,'DD-MON-YYYY')||' 13:35:00','DD-MON-YYYY HH24:MI:SS') )THEN
send_mail('"Load Datamart"','[email protected]','I am the guard','This is my body messaje at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS')||'.');
ELSE
send_mail('"Load Datamart"','[email protected]','I am the guard, this is the last message.','This is my body messaje at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS')||'.');
DBMS_JOB.SUBMIT(v_job,'begin dbms_job.next_date('||p_job||',to_date('''||TO_CHAR(SYSDATE+1,'DD-MON-YYYY')||' 03'||''',''DD-MON-YYYY HH24'')); commit; exception when others then null; end;',TRUNC(SYSDATE));
     END IF;
COMMIT;
EXCEPTION WHEN OTHERS THEN
load_datamart.send_mail('"Load Datamart"','[email protected]','I am the guard, I break at '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'),SQLERRM);
END load_guard;
END load_datamart;

Similar Messages

  • Question: how to use JAVAEE to run the WAP program of mobile phone  on web?

    I want to develop a web program by JAVAEE. It uses the simulator of mobile phone to run the WAP program of mobile phone on web. You can operate the program on the page just as do on mobile phone. tell me how to develop on details soon. show the code, please.

    Haha, there's no way in hell you can do that. And nobody in their right mind would write the code for you, at least for free.
    Jesus with you people these days..."Java_Researcher". I bet you've never written a single line of Java.

  • How to run the perl script from java ?

    Hi , I need to run the pearl script from the server and to get the result of the script thro' java using SSH
    Is there any 3rd party SSH API in java ?
    Please help me out
    thanks in advance
    karthik

    This seems like a very strange thing to want to do.
    What is the perl script doing?
    Do other programs (not some shell script) access this server-side perl script from a different machine?
    If so how do they do it?
    What currently triggers the perl script to execute?
    What currently handles the output from the perl script?
    If you can answer these questions (and understand the answers) you should be able to come up with a different approach to this.
    You do not really want to call a remote perl script from a Java program, you want to achieve the effect you think that would have if you could do it.
    So find the answers to the above questions, write them on 3" x 5" cards and lay them out on your desk.
    What flow of control needs to happen? Which piece of code needs to produce or consume which piece of data?
    If that fails, ask you self or who ever is making you do this what are the use-cases?
    If you do not know what use-cases are or do not understand them well enough try reading
    Use Case Modeling (The Addison-Wesley Object Technology Series) by Kurt Bittner and Ian Spence (Paperback - Aug 30, 2002)
    http://www.amazon.com/s/ref=nb_ss_gw/002-7908514-4043267?url=search-alias%3Dstripbooks&field-keywords=use+cases&x=0&y=0
    It is a short and easy to read book on the subject and also one of the best.
    You MUST understand WHAT you are trying to achieve before you can decide HOW you are going to achieve it.

  • How do i unzip and run the newly downloaded Adobe Encore trial version on a windows computer?

    how do i unzip and run the newly downloaded Adobe Encore trial version on a windows computer?

    First, there is no such thing as an Encore trial, due to licensing of 3rd party program modules
    Second, Encore is installed as a bundle with Premiere Pro CS6
    Third, the CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 will help
    The bottom section of the link above has several Adobe links, and other information, on downloading Premiere Pro CS6 and the bundled Encore CS6, and the TWO ADDED downloads for the Encore library content, to author a DVD or BluRay... and the tutorial list includes learning how to use Encore... pay particular attention to the picture in reply 3 at this link - https://forums.adobe.com/thread/1516173 (picture first posted by Ann Bens and reposted by Stan Jones)

  • Using automater to run the daily maintenance scripts

    I like to put my computer to sleep over night but the problem is that when I do that it doesn't run the maintenace scripts. Does anyone know how to do this with automater so that I can quickly run it before I put my powerbook to sleep?

    Derek
    I have my iMac go to sleep after an hour of non-use so it is shut down all night, usually.
    I downloaded the freeware program Anacron which runs the cron daily, weekly and monthly processes automatically when you wake your computer. I never have to worry about maintenance that way.

  • How many times should I run the APPLE TEST HARDRIVE/DRIVE on my macbook?

    how many times should I run the APPLE TEST HARDRIVE/DRIVE on my macbook?

    Do you mean your hardware tester or Disk Utility?
    -Bmer
    Mac Owners Support Group - Join us @ MacOSG.com
      Mac611 Mobile Mac Support - about.Mac611.com
       iTunes:MacOSG Podcast | YouTube.MacOSG.com
                       An Apple User Group 
    Have an iPhone or iPod touch? Enter Mac611.com in Safari on it for 'mobile Mac support.'

  • I've downloaded CS6 Master Collection but only see The Photoshop icon.  I can't seem to find the other programs, except on "uninstall programs" How do I open and run the others?

    I've downloaded CS6 Master Collection but only see The Photoshop icon.  I can't seem to find the other programs, except on "uninstall programs" How do I open and run the others?

    How about you give us some real information.
    Did you install the software? What operating system?

  • How to solve that error in primavera p6 version 8.4 installation???????upgarding Data Base((missing permissions: DBMS_REPUTIL. Run the manual script first -- manual_script_before_upgrade.sql)

    please advice how to solve that problem (in steps):
    after completing p6 installation and during upgrading the old Data Base from p6 v8.3 to P6 v8.4 I'm facing that error
    ((missing permissions: DBMS_REPUTIL. Run the manual script first --> manual_script_before_upgrade.sql)

    for more help this image is much helpful
    1. Open cmd prompt >> Type sqlplus / as sysdba; >> connect sys/oracle@XE as sysdba;
    2. Type @ <path>\manual_script_before_install.sql
    thanks for      Pablo Oyarzo - Oracle    for his help as the above answer related to him

  • Any one knows how to use Axis Framework in the SOAP Adapter Modules

    How to use Axis Framework in the SOAP Adapter?
    How to add custom handler modules?
    http://help.sap.com/saphelp_nw04/helpdata/en/45/a4f8bbdfdc0d36e10000000a114a6b/frameset.htm
    I went through the above link on help.sap.com. But still could not create a working example.
    I have created a wc on some 3ed party app server using apaches axis. I am trying to call that web service from XI using SOAP receiver? I need to add some security related headers to the soap message, SO I am trying to use a handler.  I want to know how to configure this handler in SOAP axis adapter module.
    Thank you
    Moni

    Ravi ,
    I am trying exactly the same. Hers is the scenario.
    ABAP Proxy --> PI (7.0) SP 12 ---> WebService.
    Since This is service is secured, means it is using OASIS web servie securyty user name token,
    I am trying to use AXIS adapter. and I want to configure HandlerBean in which I want to use apache wss4j api to add the userNameToken. I am looking for some documentation on this.
    I need to add SOAP action element too as I can not configure this one on the communication channel.
    Thanks for any inputs in this regard.
    Moni

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • [Forum FAQ] How to use parameter to control the Expand/Collapse drill-down options in SSRS report?

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

  • How to add a report into the SAP-SCRIPT .using PERFORM ......ENDPERFORM

    My question is that How to add a report into the SAP-SCRIPT .
    by using PERFORM ......ENDPERFORM
    I don't know how to used it .

    Hi Sandeep,
    Please check this link
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
    http://www.allinterview.com/showanswers/37425.html
    Calling ABAP Subroutines: PERFORM
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Best regards,
    raam

  • I need to program a Hittite Fractional​-N Synthesize​r Evaluation Kit with a HMC702LP6C​E an external YIG oscillator​. Not sure how to use Labview to control the PLL.

    I need to program a Hittite Fractional-N Synthesizer Evaluation Kit with a HMC702LP6CE an external YIG oscillator.  Not sure how to use Labview to control the PLL.

    Here is how to use the PLL. But I don't know of how to interact with that device
    http://zone.ni.com/devzone/cda/tut/p/id/3781
    And for thouse who don't know what a PLL is a free bonus link is here:
    http://digital.ni.com/public.nsf/allkb/07BC8D77D4E​9AE258625708B007CE74F?OpenDocument
    and a second one on what that device is: http://www.hittite.com/products/view.html/view/HMC​702LP6CE
    Now we are all caught up to speed.
    Sam S
    Applications Engineer
    National Instruments

  • How to use bexweb analyser in the webbrowser

    Hi ALL,
    Suggest me .how to use bexweb analyser in the webbrowser?
    Regards,
    Suman

    Hi,
    A useful link for you..!!
    http://help.sap.com/saphelp_nw04s/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
    -Pradnya

Maybe you are looking for

  • ITunes no longer working after Song Upgrade.

    I got onto iTunes store, was offered to upgrade 32 of my songs, I said "Yes". After the upgrading completed, iTunes main window pane no longer worked for anything but the iTunes store. It will play my music if I manually select it from the disk (via

  • Install aborts on iWeb install - can't bypass/reboot into Mac OS

    During a re-install of Mac OS 10.4 on new iMac4 (Intel), the install halts on DVD2, iWeb install (just 1minute left!!). Now when I restart it keeps retrying the install and dies at same spot every time. Log shows "no such process" for iWeb install. I

  • Flash Video Encoder Version Update

    I have version 1.0 of the Flash Video Encoder. This came bundled with Adobe Web Bundle (Macromedia Studio 8 - including Flash Professional 8 and Adobe Creative Suite 2). I need version 1.2 or above in order to include metadata so my .flv files will p

  • Using digital projector with macbook

    A basic question from an escaped PC user. What keystroke is used to tell my macbook to send the display output to an external projector? I need the equivalent of the F8 key I used on my work supplied PC laptop I have purchased the link cable so the h

  • ALV Report coloring columns

    In my ALV report I am displaying SO & DN as separate columns. I want to give them each a different color. In my BUILF_FIELDCATALOG, I tried the following but that gives them the same color i.e. blue. I would like to give them different colors. Also i