How to use SQL() function while writing scripts in BODS 4.0

How to use SQL() function while writing scripts in BODS 4.0

Hello,
I think you want to post your question to the [Data Integration and Data Quality Management|Data Services and Data Quality; forum. This forum is for other BusinessObjects SDK development questions.
Sincerely,
Dan Kelleher

Similar Messages

  • 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);

  • How to use SQL function in Tabular Form

    Edited by: JuniorNewbi on 03-Nov-2009 08:15

    Hi
    I want to have a Tabular Form in which the Report Source sql statement is retrieved via an SQL function, so that the resulting report can show a variable number of columns and column names.
    The following great web site shows just the kind of thing i'm trying to do (Tabular Form Dynamic):
    http://htmldb.oracle.com/pls/otn/f?p=31517:195:518536699796436::NO:::
    However, as an Apex newbie, i don't know how to invoke the SQL function from within the page. The "Report Source" appears to only allow a static "select...." style of entry.
    I don't have access to the Denes Kubicek's workspace so don't know how he would have invoked his PL/SQL Function.
    Can anyone help?
    Thanks in advance!
    Edited by: JuniorNewbi on 03-Nov-2009 08:46

  • How to use SQL Functions (eg : GETDATE()) in Receiver JDBC XML message

    Hi,
    I am using receiver JDBC adapter.
    When record is updated in table, "Timestamp" field should be updated with Database timestamp.

    Hi Dipak,
    Check out below helpful links,
    MySQL :: MySQL 5.6 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME
    MySQL :: MySQL 5.0 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP
    Regards,
    Krupa

  • How can we use SX_OBJECT_CONVERT_OTF_INTO_PDF function module IN SCRIPT

    Hi Gurus,
    can any one inform me,how to use  SX_OBJECT_CONVERT_OTF_INTO_PDF  function module in script..
    how can we convert  the script output into pdf file format....
    i need your help......plz
    my mail id : [email protected] 
    Thanks,
    Rajkumar.A
    Edited by: rajkumar annadurai on Feb 19, 2008 10:25 AM

    Hi, Dear
    In XI 3.0 we are tyring to setup SAPconnect;
    1 Step; Create RFC connection for Mlunxsnd file, anyway!!! we download thease file and create RFC connection; fine working no error
    2 Step: Create Nodes T-code SCOT => connection INT => and support address type like Internet its just show only "PDF, HTM, TXT" thats it its not show some others format
    3. Step; When check email T-code SOST Getting an error messages: "Connot process message in node, parameters cannot be converted"
    4. In R3 RPD and Others system when I check format its ok its show some others format which is support to be such as "ALI, OBJ, OTF, SCR, URL" ...
    How may install these format in XI 3.0
    Please Advice I will be really appriciated
    Thanks a lot
    Travis

  • How to use goto function?

    how to use goto function in indesign javascript??
    my script starts with chekcing whether input files are present or not.. if any of the input files r not present, i want to skip the function n terminate the functioning with displaying the message tht file doesnt exisit.... i was wondering to use goto function for tht...so how to use it? or is there any other alternative to that??

    goto is generally frowned on by programmers.
    The only legitimate use of goto is when you need to escape a nested loop.
    If you need to skip part of a routine, use break, or simply return from the current function.
    The pattern commonly used by the SDK looks like this:
    do
         if(condition1 == false)
              break;
         if(condition2 == false)
              break;
         if(condition3 == false)
              break;
         doSomethingReallyCool();
    }while(false);
    "break" jumps to the end of the do/while loop which always exits when you reach the end of it (while(false))
    Harbs

  • How to use standard function keys as custom keys

    how to use standard function keys as custom keys.
    i have encountered that problem while developing a screen, there i'm supposed to use standard function key F2 ( which actually meant for choose) for clearing the screen fields where the cursor is present and f1 for saving data that entered in screen fields, etc...
    kindly help me out.

    Hi ,
    Solution to use SAP reserve function keys F1 .. F4 (mostly this requirement comes up for RF screens) can be acheived by assigning your new Function code using the Menu path Utilities --> F key Consistency in the Menu Painter (SE41) . Once you assign your cutom function code to the standard Fn keys the only remaining step is to make sure that you set a curson on any of the field on sceen by using the Key Word "SET CURSOR" .
    If you dont use the key word SET CURSOR in the PBO of the screen then you might not see any response for F4.
    Thanks

  • How to use complex function as condition in Oracle Rule Decision Table?

    How to use complex function as condition in Oracle Rule Decision Table?
    We want to compare an incoming date range with the date defined in the rules. This date comparison is based on the input date in the fact & the date as defined for each rule. Can this be done in a decision table?

    I see a couple of problems here.
    First, what you posted below is not a syntactically valid query. It seems to be part of a larger query, specifically, this looks to be only the GROUP BY clause of a query.
    Prabu ammaiappan wrote:
    Hi,
    I Have a group function in the Query. Below is the Query i have used it,
    GROUP BY S.FREIGHTCLASS,
    R.CONTAINERKEY,
    S.SKU,
    S.DESCR ||S.DESCRIPTION2,
    S.PVTYPE,
    RD.LOTTABLE06,
    R.WAREHOUSEREFERENCE,
    RD.TOLOC,
    R.ADDWHO,
    R.TYPE,
    S.CWFLAG,
    S.STDNETWGT,
    S.ORDERUOM,
    R.ADDDATE,
    C.DESCRIPTION,
    (CASE WHEN P.POKEY LIKE '%PUR%' THEN 'NULL' ELSE to_char(P.PODATE,'dd/mm/yyyy') END),
    NVL((CASE WHEN R.ADDWHO='BOOMI' THEN RDD.SUPPLIERNAME END),SS.COMPANY),
    RDD.BRAND,
    S.NAPA,
    RD.RECEIPTKEY,
    R.SUSR4,
    P.POKEY,
    RDD.SUSR1,
    r.STATUS, DECODE(RDD.SUSR2,' ',0,'',0,RDD.SUSR2),
    rd.SUSR3Second, the answer to your primary question, "How do I add a predicate with with a MAX() function to my where clause?" is that you don't. As you discovered, if you attempt to do so, you'll find it doesn't work. If you stop and think about how SQL is processed, it should make sense to you why the SQL is not valid.
    If you want to apply a filter condition such as:
    trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')you should do it in a HAVING clause, not a where clause:
    select ....
      from ....
    where ....
    group by ....
    having max(some_date) between this_date and that_date;Hope that helps,
    -Mark

  • How to use MAX function in SSAS MDX Query

    I want to run this Query with MAX Condition on LAST_DATA_UPDATE Column .

    Hi Ashishsingh,
    According to your description, you want to know how to use MAX function in SQL Server Analysis Services MDX Query, right? In this case, please refer to the link below which describe the syntax and sample of MDX function.
    http://technet.microsoft.com/en-us/library/ms145601.aspx
    http://www.mdxpert.com/Functions/MDXFunction.aspx?f=64
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to use TRUNC function with dates in Expression Builder in OBIEE.

    Hi There,
    How to use TRUNC function with dates in Expression Builder in OBIEE.
    TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
    Thanks in advance

    use this instead:
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE)

  • How to lock a function while it is in processing?

    i am using threads to write my game server side. anyone have any idea on how to lock a function while it is in process? then it wl continue after a process. appreciate very much

       public void run() {
            try {
                char charBuffer[] = new char[1];
                // --- while we have an incoming stream
                while(in.read(charBuffer,0,1) != -1) {
                    // --- create a string buffer to hold the incoming stream
                    StringBuffer stringBuffer = new StringBuffer(8192);
                    // --- while the stream hasn't ended
                    while(charBuffer[0] != '\0') {
                        // --- add the character to our buffer
                        stringBuffer.append(charBuffer[0]);
                        in.read(charBuffer, 0 ,1);
                    if(stringBuffer.toString().equals("IP")){
                        getMachineId(this.getIP());
                       } else{
                        // --- analysis the XML
                        parseReceivedXML(stringBuffer.toString());
            } catch(IOException ioe) {
                server.writeActivity("Client IP: " + ip + " caused a read error "
                        + ioe + " : " + ioe.getMessage() + "and has been disconnected.");
            } finally {
                killClient();
        }above is my run() code. i want to lock the function parseReceivedXML() and release it to the waiting thread after a thread finish process. i want the threads queue up to run in this function. please help

  • How to use HexToRef function?

    How to use HexToRef function?

    Exactly HexToRef!
    please, try this:
    create or replace
    TYPE "TOBJECT" as object
    Guid RAW(16)
    create table t$tobject of tobject;
    insert into t$tobject values (TOBJECT(SYS_OP_GUID()));
    select HEXTOREF(REFTOHEX(REF(t))) from t$tobject t;
    Error report:
    SQL Error: ORA-24360: 'Type Descriptor Object' не задан для 'Object Bind/Define'
    24360. 00000 - "Type Descriptor Object not specified for Object Bind/Define"
    *Cause:    Type Descriptor Object is a mandatory parameter for Object Types
    Binds and Defines.
    *Action:   Please invoke the OCIBindObject() or OCIDefineObject() call
    with a valid Type Descriptor Object.

  • How to use the function module /IRM/IPBB_AGREEMENT_CREATE.

    Hi all,
    Please help me how to use the function module /IRM/IPBB_AGREEMENT_CREATE.
    It is a Vistex fuction module which is used to create Sales contract in SAP-Vistex. If anyone has use the function module and do have the sample code please share it.
    Thanks.

    FORM create_agreement TABLES pt_agreement
                                           CHANGING po_agreement .
      CONSTANTS: c_strt_knumh TYPE knumh VALUE '0000000000'.
      DATA: lc_kona  TYPE /irm/s_gkona,
            lc_cbasp TYPE /irm/s_ipcbasp,
          lt_cbapr TYPE /irm/t_ipcbapr,         "Partners
          lc_cbapr TYPE /irm/s_ipcbapr,
          lt_cbadt TYPE  /irm/t_ipcbadt,        "Dates
          lc_cbadt TYPE  /irm/s_ipcbadt,
          lt_cbafs TYPE  /irm/t_ipcbafs,
          lc_cbafs TYPE  /irm/s_ipcbafs,
          lt_cbacn TYPE  /irm/t_ipcbacn,
          lc_cbacn TYPE  /irm/s_ipcbacn,
          lt_cbacl TYPE  /irm/t_ipcbacl,
          lc_cbacl TYPE  /irm/s_ipcbacl,
          lt_cbtpv TYPE  /irm/t_ipagtpv,
          lc_cbtpv TYPE  /irm/s_ipagtpv,
          lt_texts TYPE  text_lh,
          lc_texts TYPE  itclh,
          lt_cbasd TYPE  /irm/t_ipcbasd,
          lc_cbasd TYPE  /irm/s_ipcbasd,
          lc_agreement    TYPE  /irm/s_ipcbasp_doc,
          lc_e_log_number TYPE  balognr,
          lt_messages     TYPE  /irm/t_gprolog.
      DATA: lt_vake      TYPE  cond_vakevb_t,
            lc_vake      TYPE LINE OF cond_vakevb_t,
            lt_konh      TYPE  /irm/t_gkonh,
            lc_konh      TYPE LINE OF /irm/t_gkonh,
            lt_konp      TYPE  /irm/t_gkonp,
            lc_konp      TYPE LINE OF /irm/t_gkonp,
            lt_konw      TYPE  /irm/t_gkonwu,
            lc_konw      TYPE LINE OF /irm/t_gkonwu,
            lt_konm      TYPE  /irm/t_gkonmu,
            lc_konm      TYPE LINE OF  /irm/t_gkonmu,
            lt_komg      TYPE  /irm/t_gkomg_index,
            lc_komg      TYPE LINE OF /irm/t_gkomg_index,
            lt_user_data TYPE  /irm/t_gpraxfu_index,
            lc_user_data TYPE LINE OF /irm/t_gpraxfu_index.
      DATA: lc_updt(1) TYPE c.
      DATA: lc_knumh TYPE knumh.
      DATA: BEGIN OF lc_str_knumh,
             hd(2) TYPE c VALUE '$$',
             inc_num(8) TYPE c,
            END OF lc_str_knumh.
      DATA: blank_agree_key TYPE knuma VALUE '~~~~~~~~~~'.
      FIELD-SYMBOLS <konh_line> LIKE LINE OF lt_konh.
      FIELD-SYMBOLS <konp_line> LIKE LINE OF lt_konp.
      DATA: lc_rule TYPE type_key_rule.
      READ TABLE pt_agreement INTO lc_rule INDEX 1.
    SELECT SINGLE * FROM  kona
            WHERE  vkorg   = lc_rule-vkorg
            AND    vtweg   = '10'
            AND    spart   = '10'
            AND    boart   = 'ZPS1'
            AND    botext  = lc_rule-sap_agkey.
    IF sy-subrc = 0.
       lc_updt = 'U'.
    ELSE.
      lc_updt = 'I'.
    ENDIF.
      LOOP AT pt_agreement INTO lc_rule.
        MOVE sy-tabix TO lc_str_knumh-inc_num.
        CONDENSE lc_str_knumh-inc_num NO-GAPS.
        WHILE lc_str_knumh-inc_num+7(1) = ' '.
          CONCATENATE '0' lc_str_knumh-inc_num INTO lc_str_knumh-inc_num.
          CONDENSE lc_str_knumh-inc_num NO-GAPS.
        ENDWHILE.
        CONCATENATE '$$' lc_knumh INTO lc_knumh.
        MOVE lc_str_knumh TO lc_knumh.
       MOVE c_strt_knumh TO lc_knumh.
        CLEAR: lc_konh, lc_konp, lc_komg.
        MOVE: lc_rule-vkorg    TO lc_komg-komg-vkorg,
              '10'             TO lc_komg-komg-vtweg,
              '10'             TO lc_komg-komg-spart,
              p_waers          TO lc_komg-komg-waerk,
              '1300'           TO lc_komg-komg-bukrs,
              lc_rule-lifnr    TO lc_komg-komg-lifnr,
              lc_knumh         TO lc_komg-knumh,
              lc_knumh         TO lc_konh-knumh,
              lc_knumh         TO lc_konp-knumh,
              lc_rule-datab    TO lc_konh-datab,
              lc_rule-datbi    TO lc_konh-datbi.
        CASE lc_rule-tablnam.
          WHEN 'A701'.                   "Every Agreement will have a A701 rule -
            "Therefore we acn setup the header using A701
            MOVE: 'New       '  TO lc_kona-knuma,
                  lc_rule-vkorg TO lc_kona-vkorg,
                  '10'          TO lc_kona-vtweg,
                  '10'          TO lc_kona-spart,
                  'ZPS1'        TO lc_kona-boart,
                  'C'           TO lc_kona-abtyp,
                  'V'           TO lc_kona-kappl,
                  p_waers       TO lc_kona-waers,
                  lc_rule-knuma_ag TO lc_kona-abrex,
                  'ZPS2'        TO lc_kona-kobog,
                  lc_rule-datab TO lc_kona-datab,
                  lc_rule-datbi TO lc_kona-datbi,
                  lc_rule-sap_agkey TO lc_kona-botext,
                  '1300'        TO lc_kona-bukrs,
                  'I'           TO lc_kona-updkz.
            MOVE: 'New       '  TO lc_cbasp-knuma_ag,
                  'ZPS1'        TO lc_cbasp-boart_ag,
                  p_waers       TO lc_cbasp-waers,
                  'A'           TO lc_cbasp-setl_mth,
                  'B'           TO lc_cbasp-setl_typ,
                  'A2'          TO lc_cbasp-ident,
                  'E'           TO lc_cbasp-setlm,
                  'ZPDA'        TO lc_cbasp-pargr,
                  'X'           TO lc_cbasp-npric,
                  'LF'          TO lc_cbasp-stprl,
                  lc_rule-lifnr TO lc_cbasp-stpar,
                  lc_rule-contract_rev  TO lc_cbasp-rvnum,
                  'I'           TO lc_cbasp-updkz.
            CONCATENATE: blank_agree_key
                   lc_rule-lifnr        INTO lc_konh-vakey.
            MOVE: lc_rule-lifnr TO lc_konp-lifnr.
          WHEN 'A703'.
            CONCATENATE: blank_agree_key
                         lc_rule-kunnr      INTO lc_konh-vakey.
            MOVE lc_rule-kunnr TO lc_komg-komg-kunnr.
          WHEN 'A709'.
            CONCATENATE: blank_agree_key
            lc_rule-zzprodh1  lc_rule-zzprodh2  lc_rule-zzprodh3
                   lc_rule-zzprodh4  lc_rule-zzprodh5 INTO lc_konh-vakey.
            CONCATENATE: lc_rule-zzprodh1  lc_rule-zzprodh2  lc_rule-zzprodh3
                   lc_rule-zzprodh4  lc_rule-zzprodh5 INTO lc_komg-komg-prodh.
          WHEN 'A710'.
            CONCATENATE: blank_agree_key
                lc_rule-matkl   INTO lc_konh-vakey.
            MOVE lc_rule-matkl TO lc_komg-komg-matkl.
          WHEN 'A711'.
            CONCATENATE: blank_agree_key
                 lc_rule-matnr   INTO lc_konh-vakey.
            MOVE lc_rule-matnr TO lc_komg-komg-matnr.
            IF lc_rule-kschl = 'ZPPL'.
              MOVE: 'C'              TO lc_konp-krech,
                    'CAD'              TO lc_konp-konwa.
              lc_konp-kbetr = lc_rule-net_po_price * 1.
            ENDIF.
          WHEN 'A717'.
          WHEN 'A718'.
            CONCATENATE: blank_agree_key
                 lc_rule-zzextwg INTO lc_konh-vakey.
            MOVE lc_rule-zzextwg TO lc_komg-komg-zzextwg.
         WHEN 'A719'.
           CONCATENATE: blank_agree_key
                lc_rule-werks INTO lc_konh-vakey.
           MOVE lc_rule-werks TO lc_komg-komg-werks.
         WHEN 'A721'.
           CONCATENATE: blank_agree_key
                 lc_rule-kunnr lc_rule-werks INTO lc_konh-vakey.
           MOVE: lc_rule-kunnr TO lc_konp-kunnr,
                 lc_rule-kunnr TO lc_komg-komg-kunnr.
          WHEN 'A722'.
            CONCATENATE: blank_agree_key
                         lc_rule-vkbur INTO lc_konh-vakey.
            MOVE lc_rule-vkbur TO lc_komg-komg-vkbur.
          WHEN 'A724'.
            CONCATENATE: blank_agree_key
                          lc_rule-kunnr lc_rule-vkbur INTO lc_konh-vakey.
            MOVE: lc_rule-kunnr TO lc_konp-kunnr,
                  lc_rule-kunnr TO lc_komg-komg-kunnr,
                  lc_rule-vkbur TO lc_komg-komg-vkbur.
        ENDCASE.
        MOVE: 'A'                  TO lc_konh-kvewe,
              lc_rule-tablnam+1(3) TO lc_konh-kotabnr,
              lc_rule-kappl        TO lc_konh-kappl,
              lc_rule-kschl        TO lc_konh-kschl.
        REPLACE ALL OCCURRENCES OF '~' IN lc_konh-vakey WITH ' '.
        APPEND lc_konh TO lt_konh.
        CLEAR lc_konh.
    *--- Add in the KONP.Do we need to add
        MOVE: lc_rule-kappl        TO lc_konp-kappl,
              lc_rule-kschl        TO lc_konp-kschl,
              'G'                  TO lc_konp-krech.
        IF lc_rule-kschl+3(1) = '%'.
          MOVE: 'A'              TO lc_konp-krech,
                '%'              TO lc_konp-konwa.
          lc_konp-kbetr = lc_rule-rebate_perc * 1.
        ENDIF.
        APPEND lc_konp TO lt_konp. CLEAR lc_konp.
        APPEND lc_komg TO lt_komg. CLEAR lc_komg.
      ENDLOOP.
      IF  lc_updt = 'I'.
        CALL FUNCTION '/IRM/IPCB_AGREEMENT_CREATE'
          EXPORTING
          I_MESSAGES_DISPLAY        = ' '
          I_SAVE_MESSAGES           = ' '
          I_COMMIT_WORK             = 'X'
          I_CALL_FROM_WS            = ' '
            is_kona                   = lc_kona
            is_cbasp                  = lc_cbasp
            it_cbapr                  = lt_cbapr
            it_cbadt                  = lt_cbadt
            it_cbafs                  = lt_cbafs
            it_cbacn                  = lt_cbacn
            it_cbacl                  = lt_cbacl
            it_cbtpv                  = lt_cbtpv
            it_texts                  = lt_texts
            it_cbasd                  = lt_cbasd
          IMPORTING
            es_agreement              = lc_agreement
            e_log_number              = lc_e_log_number
          TABLES
            t_messages                = lt_messages
         CHANGING
          CT_VAKE                   = lt_vake
          ct_konh                   = lt_konh
          ct_konp                   = lt_konp
          CT_KONW                   = lt_konw
          CT_KONM                   = lt_konm
           ct_komg                   = lt_komg
          CT_USER_DATA              = lt_usr_data
          EXCEPTIONS
            no_documents_to_process   = 1
            no_authorization          = 2
            creation_failed           = 3
            new_pricing_not_maitained = 4
            OTHERS                    = 5.
        IF sy-subrc <> 0.
    Implement suitable error handling here
        ELSE.
          MOVE: lc_agreement-knuma_ag TO po_agreement,
                lc_agreement-knuma_ag TO lc_kona-knuma.
        ENDIF.
        APPEND LINES OF lt_messages TO gt_messages.
      ELSE.
        MOVE-CORRESPONDING kona TO lc_kona.
      ENDIF.
      LOOP AT lt_konh ASSIGNING <konh_line>.
        MOVE lc_kona-knuma TO <konh_line>-vakey+0(10).
       move '&'           to <konh_line>-knumh+0(1).
      ENDLOOP.
      LOOP AT lt_konp ASSIGNING <konp_line>.
       MOVE lc_kona-knuma TO <konp_line>-vakey+0(10).
        move '&'           to <konh_line>-knumh+0(1).
      ENDLOOP.
      lc_kona-updkz = 'U'.
      lc_cbasp-updkz = 'U'.
      CLEAR lt_messages.
      CALL FUNCTION '/IRM/IPCB_AGREEMENT_CHANGE'
        EXPORTING
        I_MESSAGES_DISPLAY      = ' '
        I_SAVE_MESSAGES         = ' '
        I_COMMIT_WORK           = 'X'
        I_INIT_DATA             = 'X'
          is_kona                 = lc_kona
          is_cbasp                = lc_cbasp
         it_cbapr                = lt_cbapr
         it_cbadt                = lt_cbadt
         it_cbafs                = lt_cbafs
         it_cbacl                = lt_cbacl
         it_cbacn                = lt_cbacn
        IT_FIELDS               =
         it_texts                = lt_texts
       IMPORTING
         e_log_number            = lc_e_log_number
         TABLES
           t_messages              = lt_messages
        CHANGING
          cs_agreement            = lc_agreement
        CT_VAKE                 = lt_vake
          ct_konh                 = lt_konh
          ct_konp                 = lt_konp
        CT_KONW                 = lt_konw
        CT_KONM                 = lt_konm
          ct_komg                 = lt_komg
        CT_USER_DATA            = lt_usr_data
        EXCEPTIONS
          no_documents_to_process = 1
          no_authorization        = 2
          change_failed           = 3
          agreement_locked        = 4
          OTHERS                  = 5.
    IF sy-subrc <> 0.
    Implement suitable error handling here
    ENDIF.
      APPEND LINES OF lt_messages TO gt_messages.
    ENDFORM.                    " CREATE_AGREEMENT

  • How to use Sql Tracer

    Hi ,
    How to use SQL Tracer..(ST05).
    Thanks,
    Subbu

    Hi,
    ST05: SQL trace
    1.create a small ABAP/4 program that contains only the select statement. Before proceeding, test it to ensure that it works.
    2.Open that program in the editor so that it is ready and waiting to execute.
    3.Open a new session using the menu path System->Create session.
    4.Run transaction ST05 (enter /nst05-zero-five, not oh-five-in the Command field, or choose the menu path System->Utilities->SQL Trace). The Trace SQL Database Requests screen is displayed.
    5.If the Trace SQL Status Information box reads Trace SQL is switched off, go to step 7.
    6.At this point, the Trace SQL Status Information box contains Trace SQL switched on by, followed by the user id who turned on the trace and the date and time it was started. You must switch it off before you can proceed. If the trace was started within the past hour, it is possible that it is still being used. Contact the indicated user or try again later. If the trace was started hours or days ago, the user probably left it on by mistake and it can be safely turned off. To turn off the trace, press the Trace Off pushbutton. The message in the Trace SQL Status Information box should now read Trace SQL is switched off.
    7.Press the Trace On pushbutton. The Trace SQL Database Requests dialog box is displayed. The DB-Trace for User field should contain your user ID. If your user ID is not in this field, enter it now.
    8.Press the OK button. You are returned to the Trace SQL Database Requests screen and the status information reads Trace SQL switched on by, indicating that you turned on the trace.
    9.Switch back to the window containing your editor session (the one with your program waiting to execute).
    10.Press F8 to run your program. (Only press F8, do not do anything else, do not even press the Back button.)
    11.When your program has run and the hourglass is no longer displayed, switch back to the trace window.
    12.Press the Trace Off pushbutton. The status information reads Trace SQL is switched off.
    13.Press the List Trace pushbutton. The Trace SQL Database Requests dialog box is displayed. The fields on this screen will already contain values.
    14.Press the OK button. You might need to wait a little while, at most a couple of minutes. The Trace SQL: List Database Requests screen is displayed.
    15.Type %sc in the Command field and press the Enter key. The Find dialog box is displayed.
    16.Type the name of the table you are tracing in the Search For field. (This is the table named in the select statement in your ABAP/4 program.)
    17.Press the Find button. A search results list should be displayed with your table name highlighted.
    18.Click on the first highlighted table name. You are returned to the Trace SQL: List Database Requests screen. Your cursor is positioned on the first line containing your table name. To the right of it, in the Operation column, should be the word PREPARE, OPEN, or REOPEN.
    19.Press the Explain SQL button on the Application toolbar. The Show Execution Plan for SQL Statement screen is displayed.
    20.Scroll down to the execution plan. The index used will be displayed in blue.
    Jogdand M B

  • How to use IF Conditon in SAP Scripts?

    Hi Guys,
                   I am having adoubt how to use IF conditon with multiple variables in SAp Scripts
    for ex If a>b and a>c and a>d
             Elseif b>a and b>c and b> d.
             Elseif .....
              endif.
              How to use above example in SAP Scripts.
    thanks,
    Gopi.

    hi Gopi,
    it is almost the same as normal ABAP, you only have to use & before and after the variable and the variable has to be in capitals and you have to make the line as command ( /: before the line )
    IF &A& > &B& AND ...
    text to print
    ELSEIF ...
    text to print
    ENDIF.
    hope this helps
    ec

Maybe you are looking for