How to execute the procedure in sap b1

Hai to all,
             I done a procedure in sql server .but i don't know how to execute that  procedure in sap b1?
can anyone help me immediately.
Regards,
Ramya.S

Dear Ramya.S,
You could execute the store procedure by using Recordset object in SDK DI code. It is like:
Dim myRecordSet As SAPbobsCOM.Recordset
myRecordSet =                                   
SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecord
set)
myRecordSet.Command.Name = "TestStoredProcedure"
myRecordSet.Command.Parameters.Item("@ItemLike").Value = "IT%"
myRecordSet.Command.Parameters.Item(2).Value = "C0001"
myRecordSet.Command.Execute()

Similar Messages

  • Can you tell me how to execute the procedure?

    create or replace get_dob
    (ss_number varchar2,dob out date)
    as
    begin
    select birth_dae
    into dob
    from person
    where soc_sec_num=ss_num;
    exception when no_data_found
    error_notify(ss_num);
    end;
    the question is that when i want to execute this procedure,how can I use the command?
    I try to use the "execute get_dob('wang');"in the sql/plus,but the system give me wrong information.

    Errors:
    1. You left out the word PROCEDURE after CREATE OR REPLACE.
    2. You used ss_number in one place and ss_num in two others. These must be the same name.
    3. You left out the word THEN after WHEN NO_DATA_FOUND.
    Possible errors:
    1. Is birth_dae spelled correctly? Or, should it be birth_date?
    2. Is error_notify a user-defined procedure?
    Additional suggestions:
    1. It is better to use table_name.column_name%TYPE instead of specifying NUMBER, VARCHAR2, DATE, etc. for your parameters. That way if the column data types are changed in the future, you don't have to change your code.
    2. You will need to SET SERVEROUTPUT ON and use DBMS_OUTPUT.PUT_LINE to display the contents of the variable that holds the value of the out parameter.
    3. Please see suggested code for creation of procedure and execution of procedure below. I have included one row of test data so that some output will be displayed. I commented out the exception section, in order to test it, since I don't have your error_notify procedure.
    SQL> -- test data:
    SQL> CREATE TABLE person
      2    (birth_dae   DATE,
      3     soc_sec_num NUMBER)
      4  /
    Table created.
    SQL> INSERT INTO person
      2  VALUES (SYSDATE, '123456789')
      3  /
    1 row created.
    SQL> SELECT * FROM person
      2  /
    BIRTH_DAE SOC_SEC_NUM
    06-DEC-02   123456789
    SQL>
    SQL>
    SQL> -- create procedure:
    SQL> CREATE OR REPLACE PROCEDURE get_dob
      2    (ss_number IN  person.soc_sec_num%TYPE,
      3     dob       OUT person.birth_dae%TYPE)
      4  AS
      5  BEGIN
      6    SELECT birth_dae
      7    INTO      dob
      8    FROM      person
      9    WHERE  soc_sec_num = ss_number;
    10  -- EXCEPTION
    11  --  WHEN NO_DATA_FOUND THEN
    12  --    error_notify (ss_number);
    13  END get_dob;
    14  /
    Procedure created.
    SQL> SHOW ERRORS
    No errors.
    SQL>
    SQL>
    SQL> -- execute procedure:
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
      2    v_dob DATE;
      3  BEGIN
      4    get_dob ('123456789', v_dob);
      5    DBMS_OUTPUT.PUT_LINE (v_dob);
      6  END;
      7  /
    06-DEC-02
    PL/SQL procedure successfully completed.

  • How to Execute the procedure?

    Hi,
    How to execute a below procedure with refcursor output parameter,
    in that procedure refcursor declare in package
    create or replace PROCEDURE prc_sam(
    P_LIST OUT pkg_sam.REF_CURSOR_TYPE) IS
    BEGIN
    OPEN P_LIST FOR
    SELECT 1+1 FROM dual;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,SQLERRM);
    END prc_sam;
    Regards,
    Fame

    SQL> create or replace PROCEDURE prc_sam(
    2 P_LIST OUT SYS_REFCURSOR) IS
    3 BEGIN
    4
    5 OPEN P_LIST FOR
    6 SELECT 1+1 FROM dual;
    7 EXCEPTION
    8 WHEN OTHERS THEN
    9 RAISE_APPLICATION_ERROR(-20001,SQLERRM);
    10 END prc_sam;
    11 /
    Procedure created.
    SQL> VARIABLE P_CURSOR REFCURSOR;
    SQL> EXEC prc_sam(:P_CURSOR);
    PL/SQL procedure successfully completed.
    SQL> PRINT P_CURSOR;
    1+1
    2
    Intead of SYS_REFCURSOR, you can use ur pkg_sam.REF_CURSOR_TYPE inside a package
    AND
    execute a procedure like EXEC pkg_sam.prc_sam(:P_CURSOR);
    like this, then you will get the result............................
    Thanks,
    Ann

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • How to execute the packaged procedure(having out param) in TOAD for Oracle

    Hi.
    Could you help me
    How to execute the packaged procedure having out parameters in TOAD for Oralce..
    Thanks..

    Use anonymous PL/SQL block to execute it.
    Example.
    DECLARE
      <out variable name> <out variable data type>;
    BEGIN
      <package name>.<procedure name>(<out variable name>);
    END;

  • How to execute a procedure in the same db session of the framework page

    i am using oaframework personalization to create a link. when the link is clicked i will execute a database procedure using /psl/DAD/procedurename. currently when the user clicks on the link it will get executed in separate database session.
    but i want execute the procedure in the db session on the current oa page. is there a way to achive this.
    Thanks
    sreekanth.g

    You can do this, create a simple stackLayout region, add an AM, Controller to it. Add a submit button or link with fireAction set on it. Write a method in your AM and call it from your controller's processFormRequest by capturing the button or link event. In the AM method you can invoke the procedure. Use personalization and attach the region to the page.

  • Database is Hanging after executing the Procedure ...

    Dear All i am using 10G.
    I Have a procedure . After executing the Procedure when i try to call that procedure it is hanging ...
    it is creating Locks .. As our DBA told..And told to check the code ...
    Can any one tell me how can i put mu codes with formatting ? When i copy paste my code it is showing properly but after POST MESSAGE it is showing like i have written history ...--*
    I am Executing the procedure like this ...
    EXEC simulator_validation ('0|BP-V1|20101004|01|1|2430962.89|27|2430962.89|MUR|20100928120106','04-SEP-2010',27,2430962.89,'MUR','000111111111');
    And my code is :-
    {Create Or Replace Procedure simulator_validation (lstring varchar2,ldate date,lno_item number,ltotal number,lcur varchar2,lac_no Varchar2)
    IS
      l_swift_code_acno number;
      l_ACno_Valid number;
      l_swift_code_others Number;
      lpcode varchar2(5);
      lCcode Varchar2(4);
      lval number;
      lacno varchar2(16);
      v_file varchar2(20);
      v_path varchar2(50);
      LToken   VARCHAR2(100) ;
      i        PLS_INTEGER := 2 ;
      lfirst_char  number;
      lvalue  Varchar2(100) ; 
      lcol number:= 1;
    Begin
      lfirst_char := Substr(lstring,0,1);
      Dbms_output.put_line(lfirst_char);
          IF lfirst_char  = '0' Then ------------------- For the 1st Line - Should be start from 0
                Loop
                  LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;  
                  lvalue := LToken;
                      IF lcol=1 then
                             If lvalue='BP-V1' THEN
                                   Dbms_output.put_line('1');
                             Else
                                 Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0003','Invalid file type and version number');
                                Dbms_output.put_line('2');
                            End if;
                      Elsif lcol=2 then
                              If lvalue=To_Char(ldate,'YYYYMMDD') THEN
                                 Dbms_output.put_line('3');                                                                                                                                                                                                                                       
                            Else
                                 Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0004','Due date differs from the value inputted in the loading screen');
                                 Dbms_output.put_line('4');
                            End if;
                      Elsif lcol=3 then
                                   Begin
                                         Select PAYMENT_PURPOSE_CODE into lpcode
                                         From MU_PURPOSE_CODE
                                         Where PAYMENT_PURPOSE_CODE = lvalue;
                                     IF lpcode = lvalue Then
                                           Dbms_output.put_line('5');
                                     Else
                                          Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0006','Invalid payment purpose code');
                                          Dbms_output.put_line('6');
                                     End If;
                                Exception
                                    When No_data_found Then
                                    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0006','Invalid payment purpose code');
                                End;
                      Elsif lcol=4 then
                                    If lvalue='1' THEN
                                         Dbms_output.put_line('7');
                                    Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0008','Total number of debit records in header does not tally with number                   debit records in the file.');
                                      Dbms_output.put_line('8');
                                   End if;
                      Elsif lcol=5 then
                                    If lvalue=ltotal THEN
                                          Dbms_output.put_line('9');
                                    Else
                                        Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0010','Total debit transaction amount in header does not tally with the sum of debit transaction amount in the file');
                                       Dbms_output.put_line('10');
                                  End if;
                     Elsif lcol=6 then
                                    If lvalue=lno_item THEN
                                         Dbms_output.put_line('11');
                                    Else
                                        Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0025','Number of credit records does not tally with credit records in the file.');
                                    End if;
                     Elsif lcol=7 then
                                    If lvalue=ltotal THEN
                                         Dbms_output.put_line('12');
                                    Else
                                         Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0026','Sum of credit records does not tally with total transaction amount as inputted in the loading screen');
                                    End if;
                    Elsif lcol=8 then                
                                    If lvalue=lcur  THEN
                                          Begin
                                                    Select Cur_CODE into lCcode
                                                      From Mu_currency_Code
                                                    Where Cur_CODE = lvalue;
                                                    Dbms_output.put_line('13');
                                          Exception
                                              When No_data_found Then--------------------
                                                 Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0014','Invalid Currency');
                                          End;
                                    Else
                                          Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0013','Currency differs from the value inputted in the loading screen');
                                   End if;
                     Elsif lcol=9 then
                                    If lvalue=Null  THEN
                                          Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0015','Timestamp should not be null');
                                    Elsif lvalue <> lvalue Then
                                         Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0046','Timestamp in header should be in the format YYYYMMDDHHMMSS');
                                    End if;
                       End IF;
                      EXIT WHEN LToken IS NULL ;
                         i := i + 1 ;
                         lcol:=lcol+1;
                       End LOOP;
              Else
                                      Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
              End if ;}
    -------------------- For the 2nd Line , should be start from 9 .-----------------------------
    {  lfirst_char := Substr(lstring,0,1);
    IF lfirst_char = '9' Then
    LOOP
    LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;
    lvalue := LToken;
    IF lcol=1 then
    If lvalue < 0 THEN
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0017','Amount should be greater than zero');
    Elsif lvalue = ltotal THEN
    Dbms_output.put_line('20');
    Else
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0018','Transaction amount differs from the value inputted in the loading screen');
    End if;
    ELSIF lcol = 2 THEN
    If lvalue = Substr(lac_no,4,9) THEN
    mcb_simulator_pkg.Acct_no_Validator(lvalue,1111,l_ACno_Valid);
    mcb_simulator_pkg.Swift_code_validator_for_ac_no(lvalue,1111,l_swift_code_acno);
    Else
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0020','Account number differs from the account number inputted in the loading screen');
    End if;
    ELSIF lcol = 3 THEN
    If lvalue is not null THEN
    mcb_simulator_pkg.Swift_code_validator_for_other(lvalue,1111,l_swift_code_others);
    Else
    Dbms_output.put_line('21');
    End if;
    END IF;
    EXIT WHEN LToken IS NULL ;
    i := i + 1 ;
    lcol:=lcol+1;
    End Loop;
    Else
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
    End IF; }
    -------------------- For the 3rd Line Should be start from 1.--------------------------
    { LOOP
    lfirst_char := Substr(lstring,0,1);
    IF lfirst_char = '1' Then
    Loop
    LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;
    lvalue := LToken;
    IF lcol=1 then
    If lvalue > 0 THEN
    Dbms_output.put_line('24');
    Else
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0017','Amount should be greater than zero'); End if;
    ELSIF lcol=2 then
    Mcb_simulator_pkg.Acct_no_Validator(lvalue,1111,l_ACno_Valid);
    Mcb_simulator_pkg.Swift_code_validator_for_ac_no(lvalue,1111,l_swift_code_acno);
    ELSIF lcol = 3 THEN
    If lvalue is not null THEN
    mcb_simulator_pkg.Swift_code_validator_for_other(lvalue,1111,l_swift_code_others);
    Else
    Dbms_output.put_line('26');
    End
    END IF;
    EXIT WHEN LToken IS NULL ;
    i := i + 1 ;
    lcol:=lcol+1;
    End Loop;
    Else
    Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
    End if;
    END LOOP;
    Commit;
    End;}
    Edited by: LuKKa on Oct 4, 2010 9:20 PM
    Edited by: LuKKa on Oct 4, 2010 9:25 PM

    Yes i gave {} but it is also coming like this ...Yes, since you should use {noformat}{noformat} before and after your example, and not putting your example between a '{' and a '}'.
    So, when you post/type/copypaste:
    {noformat}select *
    from emp;{noformat}
    on this forum, it will appear as:select *
    from emp;See the FAQ for more tags/tips:
    http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to execute the content of varchar  variable like a simple query

    Hi everyone!
    I did a PL/SQL region in apex, in this region I did the query which is storaged in a variable; it was did it concatenate several times,
    in the procedure I have several sentences.
    I thought that the command 'execute immediate' would get a good result but it do not print the result.
    declare
    variable varchar2(1000);
    begin
    --sentences
    --execute inmmediate( variable );
    --return variable
    end;
    I only want to how to execute the content of varchar variable.
    For example, suppose that the result of this procedure is
    'SELECT SYSDATE FROM DUAL'
    How and what do I must do for this query execute like a normal query that is in apex?
    I expect your prompt reply.
    Thank you for your help.
    Best regards

    Let us say your table containing SQL is
    t_sql_table
    and has two columns
    primary_key
    and
    sql_query.
    You would need to do the following:
    1. Create a Report of type "Function returning SQL Query"
    2. Put the following there:
    DECLARE
       v_query   VARCHAR2 (4000);
    BEGIN
       SELECT sql_query
         INTO v_query
         FROM t_sql_table
        WHERE primary_key = 1;
       RETURN v_query;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to execute the logical database.

    how to execute the logical database.

    There are two ways of using a logical database - either by linking it with the executable program(specify the LDB name in the program attributes) or by using the function module LDB_PROCESS.
    1.Data read by the logical database is passed back to the program using the interface work areas.Use GET statements in the report.
    GET events are implemented internally as FORM routines.
    2.If you call the logical database using the above function module, the selection screen of LDB is not displayed.It uses special subroutines called callback routines, which are called by the function module and filled with the required data.
    Please refer the following link for more details.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • How to execute private procedures in a package

    Hi
    I have created private procedures in a package.
    now i want to execute the private procedure. how to execute the private one

    Hi;
    Pelase see below which could be helpful for your issue:
    Private procedures in a package
    http://stackoverflow.com/questions/924490/how-do-i-execute-private-procedures-in-an-oracle-package
    Regard
    Helios

  • How to execute the content of varchar as query

    Hi everyone!
    I did a PL/SQL region in apex, in this region I did the query which is storaged in a variable; it was did it concatenate several times,
    in the procedure I have several sentences.
    I thought that the command 'execute immediate' would get a good result but it do not print the result.
    declare
    variable varchar2(1000);
    begin
    --sentences
    --execute inmmediate( variable );
    --return variable
    end;
    I only want to how to execute the content of varchar variable.
    For example, suppose that the result of this procedure is
    'SELECT SYSDATE FROM DUAL'
    How and what do I must do for this query execute like a normal query that is in apex?
    I expect your prompt reply.
    Thank you for your help.
    Best regards

    Erik,
    Try dropping this into a PL/SQL region
    DECLARE
      v_result VARCHAR2(500);
    BEGIN
      SELECT SYSDATE
        INTO v_result
        FROM DUAL;
      htp.prn(v_result);
    END;
    {code}
    use the htp.prn command to write html you want to display. In this case we are just writing the date to the screen.
    Good luck,
    Tyson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to execute the messages in status 'scheduled' automatically?

    Hi.
    I find some messages every day which have status 'scheduled' for a long time - more then several hours. These messages use http adapter. When http server is not working, the messages scheduled, but not executed after http server become working. How to execute the messages automatically?

    http://help.sap.com/saphelp_nw70/helpdata/en/96/8412417301ee6fe10000000a1550b0/content.htm
    Is yours a EOIO scenario?

  • How to execute the job from script ??

    How to execute the job from script ?? i have 2 jobs  A AND B . I want to execute job B  from job A'S Script ?? how can i ??

    Hi Kishore,
    Please refer the below link for BODS Job execution using Script
    Executing a job by another job in BODS 4.1 using simple script
    http://scn.sap.com/community/data-services/blog/2013/12/04/executing-a-job-by-another-job-in-bods-41-using-simple-script
    Steps for executing BODS job from Unix Script with user defined global parameters
    http://scn.sap.com/community/data-services/blog/2013/09/02/steps-for-executing-bods-job-from-unix-script-with-user-defined-global-parameters
    Executing a job using batch file
    http://scn.sap.com/thread/3503338
    How to add a schedule for job2 with a condition after job 1 is finished
    http://scn.sap.com/message/14523514#14523514
    Scheduling BODS Jobs Sequentially and Conditionally
    http://scn.sap.com/docs/DOC-34648
    Thanks,
    Daya

  • How to delete the Sites in SAP IS RETAIL

    hello ALL,
    can any one explain me how to delete the Sites in Sap Retail.
    thanks in advance

    Hello All,
    Delete the plant / Site complete details and put in one transport and do the import & export.
    Thanks.
    Edited by: krishna cherry on Jul 26, 2010 3:28 PM

  • How to get the last page  SAP Script form

    How to get the last page  SAP Script form.
    I want to print a specific information in the last page of SAP form (Script). Please tell me how to get the last page number.
    Regards

    Hi
    You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
    From SAP Help:
    This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
    Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
    /: IF &NEXTPAGE& = '0'
       Last page
    /: ENDIF
    Max

Maybe you are looking for