Variables in Queries

Hi. I added an user's query in SAP BO using the Query Generator (but typing it myself). I used Left and Right Joins in the FROM clasue and a variable ( '[%0]' ) to select results in the WHERE clause. The variable in WHERE clause raises an error. I tried an easier query using Query Generator with an inner join and a Left join and using a variable:
SELECT T0.DocNum, T0.DocType, T1.ItemCode, T2.DocEntry FROM (ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry) LEFT JOIN DLN1 T2 ON T0.DocEntry=T2.BaseEntry WHERE T0.CardCode='[%0]'
And I get the same error. Variables can't be used with a Right/Left Join or I am missing something in the query (That isn't the problem because if I replace '[%0]' with a valid CardCode, it works)?
Please help!

Hello,
Just take the brackets away from your SQL. After that it worked for me!
SELECT T0.DocNum, T0.DocType, T1.ItemCode, T2.DocEntry FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN DLN1 T2 ON T0.DocEntry=T2.BaseEntry WHERE T0.CardCode='[%0]'
RGDS,
Zsolt

Similar Messages

  • How to use different iViews for variables and queries?

    Hi all!
    I need to use separtate iViews for storing variables and extracting queries.
    For example, I have one variable "Currency" for two different queries,  and I need that all of these queries (in separate iViews) would use the value of currency was put by user in the first iView with only one input.
    How can I do this task? Is it possible at all?
    Thanks for replies.

    Hello Alex,
    You have to use EP client framework (EPCF) in your development.
    I hope this idea will help you.
    Kind regards, Pino.

  • How to set variables that queries can use?(10g)

    I am using only ONE TABLE here for all queries. I have one query which pulls out a key and seven other queries that create seven different report sections based on that key. All queries access data in the same table.
    The first query ahould set a key so the other seven can use that key to get data. The key changes everytime all seven queries get executed and a report page is displayed, then the queries use the new key until all keys generated by the first query are used.
    Questions?
    How do I get the seven queries to check that key. Can you have (declare) variables in Reports Builder that you can assign a value in every iteration and then include a check (for that value)in a where clause of other queries? If yes how would I do that?
    In a programming language this is simple, you pass the same value as a parameter to several functions... Can you do something similar here and set a value that all queries can check against? Like a local or global variable.
    Thanks
    Mike

    Sorry, I guess there were a few typos in my last post!
    OK. All data is pulled from the same table. Here is how the report should look:
    KEY (a number)
    Data from query 1 that belongs to key above
    more Data from query 1 that belongs to key above
    more Data from query 1 that belongs to key above
    Data from query 2 that belongs to key above
    more Data from query 2 that belongs to key above
    more Data from query 2 that belongs to key above
    Data from query 3 that belongs to key above
    Data from query 4 that belongs to key above
    Data from query 5 that belongs to key above
    Data from query 6, same
    Data from query 7, same
    END OF PAGE 1
    (there is a maximum 45 possible data lines so data will not exceed the length of a page)
    Next Page:
    KEY (a different number)
    Data from query 1 that belongs to key above
    more Data from query 1 same
    more Data from query 1 same
    Data from query 2 same
    more Data from query 2...
    more Data from query 2....
    Data from query 3 same
    Data from query 4...
    Data from query 5.....
    Data from query 6....
    Data from query 7....
    END OF PAGE 2
    Other pages all look the same. Data from each query is based on the key on the first line and so on.
    Example:
    select ipseries from ipTable (possibly for query 1)
    select ipSeries,sum(ipvalue1+ipValue2+ipvalue3) from ipTable (query1) group by....
    select (sum(ipvalue1+ipValue2+ipvalue3)/3) from ipTable (query2)
    select (sum(ipvalue1*ipValue2*ipvalue3)) from ipTable (query3)
    and so on. Each query puills a set of values or sums a set of values.... etc.
    (please note that what I have not included is that somehow we need to relate each query with the key)
    Thanks a lot

  • Deleting variables and queries

    Apart from RSZDELETE what is the best alternative to delete variables and/or queries? Thanks

    Hi Niten,
    I am not sure about Tcode to delete variables....But you can delete all unnecessary variables from Query designer itself...But before deleting variables make sure you don't need them anymore and these varaibles are not being used in any other Queries...
    If you try to delete a variable which is being used in other Query,it will display a message 'Variable being still used...etc....if you click on details...it will show you where it is being used....
    To delete variables:
    Open any Query-->expand Characteristic->expand charactristi value variables->right click->delete.
    hope this helps

  • On Variables in Queries

    Hi,
    I have build a user selection variable on 0ACCOUNT and it has around 1000 characteristic values. I
    am using it in a web template in WAD with DROP DOWN box as web item. When they click on the variables drop down
    in the initial view there are able to see only 10 values, i want to enable it in such a way that they see all 1000
    values in the first instance itself instead of scrolling down. How can i achieve this either at the
    variable level or the web item level
    Thanks
    Rashmi.

    not sure..  MAX_ROWS = ?

  • Variables for Queries - Issue

    Hi,
    I have created a variable (single value) for Material Number. When I enter my material number in the variable screen...it says range values not permitted (of course it is single value). The issue is the material number uses external numbering and is of the type 400083-05. The moment the system sees the 'dash' it thinks that I am entering a range and rejects it. After some research I found the system will accept this value if I enter the material number like this: 400083\-05. Notice the back slash. Is there anyway to overcome this?
    Cheers
    Anand

    Anand,
    Did you find a solution to the backslash?
    We all of a sudden are getting this as well.  Not on material however we get it on 0GL_Account and also 0WBS_element - probably others too but have stopped looking for it now.
    As an example we now have displayed:
    I have an Account hierarchy that is called 1-TOT_ALL, this is how it should be displayed and is how it is represented in BW ABAP and Bex analyser, however in the JAVA front end it is displayed as 1\-TOT_ALL.  Everywhere that I have a "-" hyphon it is adding in the "\" backslash. 
    And unless you enter in the \ it doesn't work.
    Not happy.
    I cannot pinpoint any portal changes that could have caused this but have only just noticed it in the last week or so.
    James

  • I_step 3 for variables in Queries

    Hello Gurus,
    Can anyone please explain an instance where and how i_step 3 is used for variables in The reports. Any sample ABAP code is highly appreciated.
    How different is i_step 3 from 2 and 1.
    Thanks
    Simmi

    Hi Simmi,
    I_STEP = 3 - Called after all variable processing and gets called only
    once and not per variable. Here you can validate the user entries and throw an error message to get a correct input.
    I_STEP = 1 - Called prior to processing of variable pop-up and for
    each “customer exit” variables. Can be used to fill variable with
    default values.
    I_STEP = 2 - Called after the processing of the variable pop-up. Only
    for those variables that are not marked as “ready for input” or are
    set to “mandatory variable entry”.
    Useful to derive values for user entered variables to different variables. For example, user enters no. of days for variable ZNUM and in the user exit, you want to derive date based on number of days. For example, user entered 10 and you are deriving system date - 10 to get a past date. You cannot validate the user input and throw an error message as well you cannot change the user input value.
    Code Sample:
    IF i_step = 3.
      READ TABLE i_t_var_range WITH KEY vnam = 'ZUOM' INTO
      l_s_var.
      IF sy-subrc = 0.
          TRANSLATE l_s_var-low TO UPPER CASE.
    <b>           Write your code for validation based on your requirement.</b>
      IF <check is failed then trigger an error message as below>
        Error: Please enter a valid entry
          l_msgv1 = 'Unit of measure not exists:'.
          l_msgv2 = l_s_var-low.
          l_msgv3 = 'Please enter a valid unit of measure.'.
          CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
            EXPORTING
              i_class  = 'I9'
              i_type   = 'E'
              i_number = '000'
              i_msgv1  = l_msgv1
              i_msgv2  = l_msgv2                      
              i_msgv3  = l_msgv3
            EXCEPTIONS
              dummy    = 0
              OTHERS   = 0.
          CALL FUNCTION 'RRMS_MESSAGES_SHOW'.
          CALL FUNCTION 'RRMS_MESSAGES_DELETE'.
          sy-subrc = 4.
        ENDIF.
      ENDIF.
    Thanks
    Viswa
    (Assign points if helpful)

  • To find Queries by InfoObjects

    Hi SDN Community
    Here is a reversal of a post made by another developer
    List of infoobjects used in a Query
    This has the reverse logic... thanks for the tip.
    *& Report  ZBW_FIND_CHARACTERISTICS_QUERY
    SAP Consulting BW Tools:
    *& Find Characteristics in BEx Queries using ABAP
    *& List of infoobjects used in a Query
    *& Developer: WBHADS 07/06/2011
    REPORT  ZBW_FIND_CHARACTERISTICS_QUERY.
    PARAMETER:  CHARACT   LIKE rszrange-IOBJNM.
    DATA:  s_characteristic LIKE rszrange-IOBJNM.
    s_characteristic  = CHARACT.
    DATA: lv_count        TYPE i.
    DATA: lv_count1       TYPE i.
    DATA: lv_count2       TYPE i.
    Data Declaration
    DATA:  D_MSG_TEXT(50).
    DATA:  lc_DIRECTORY(30)         TYPE c.
    DATA:  P_FILE(128).
    DATA:  FILENAME(128).
    DATA:  lc_query(60)             TYPE c.
    DATA:  lc_date(30)              TYPE c.
    DATA:  lc_time(30)              TYPE c.
    DATA:  lc_start_time(60)        TYPE c.
    DATA:  lc_syst(30)              TYPE c.
    DATA:  lc_exception(120)        TYPE c.
    RSZELTDIR   Directory of the reporting component elements
    RSZELTTXT   Texts of reporting component elements
    RSZELTXREF  Directory of query element references
    RSRREPDIR   Directory of all reports (Query GENUNIID)
    RSZCOMPDIR  Directory of reporting components
    RSZRANGE    Selection specification for an element
    RSZSELECT   Selection properties of an element
    RSZELTDIR   Directory of the reporting component elements
    RSZCOMPIC   Assignment reuseable component <-> InfoCube
    RSZELTPRIO  Priorities with element collisions
    RSZELTPROP  Element properties (settings)
    RSZELTATTR  Attribute selection per dimension element
    RSZCALC     Definition of a formula element
    RSZCEL      Query Designer: Directory of Cells
    RSZGLOBV    Global Variables in Reporting
    data: gi_data like rszrange occurs 0 with header line.
    Determine the queries
    tables:
    RSZELTTXT,
    rszeltdir,
    rszeltxref,
    rszrange.
    data: begin of lt_line occurs 0,
            ELTUID  like RSZELTDIR-ELTUID,      "char 25
            MAPNAME like RSZELTDIR-MAPNAME,       "char 30
          end of lt_line.
    data: begin of lt_line1 occurs 0,
            SELTUID  like rszeltxref-SELTUID,      "char 25
            TELTUID  like rszeltxref-TELTUID,     "char 25
            LAYTP    like rszeltxref-LAYTP,       "char 30
          end of lt_line1.
    data: begin of lt_line2 occurs 0,
            ELTUID  like rszrange-ELTUID,      "char 25
            IOBJNM  like rszrange-IOBJNM,     "char 25
          end of lt_line2.
    data: lt_tab like standard table of lt_line initial size 0.
    data: lt_tab1 like standard table of lt_line initial size 0.
    data: lt_tab2 like standard table of lt_line initial size 0.
    data: lt_line20(128) TYPE c.  " LIKE RSZELTXREF-SELTUID.
    data: lt_line30(128) TYPE c.  " LIKE RSZELTXREF-SELTUID.
      clear lt_line.
      lv_count  = 0.
      lv_count2 = 0.
    Loop through all the queries
      select * from RSZELTDIR
               into corresponding fields of lt_line
               where DEFTP = 'REP'
               and OBJVERS  = 'A'.
             Filter by the Z Developed Queries
               IF lt_line-MAPNAME CP 'Z*'.
                clear lt_line20.
                Get the Query Long Name
                  select single * from RSZELTTXT
                    into lt_line20
                    where eltuid = lt_line-eltuid           "rszeltdir-eltuid
                    and objvers = 'A'
                    and langu = 'EN'.
                  Find all the query elements within the query
                    select * from rszeltxref
                     into corresponding fields of lt_line1
                      where seltuid = lt_line-eltuid        "rszeltdir-eltuid
                      and objvers = 'A'.
                      IF lt_line1-laytp = 'FIX' OR lt_line1-laytp = 'COL' OR lt_line1-laytp = 'ROW'.
                        Determine if the Query Element is matching to the characteristic
                          select * from rszrange             "appending table gi_data
                             into corresponding fields of lt_line2
                             where eltuid = lt_line1-teltuid    "rszeltxref-teltuid
                             and objvers = 'A'
                             and enum = 1.
                              Populate tables
                                IF lt_line2-IOBJNM = s_characteristic.
                                    append  lt_line-MAPNAME to lt_tab.
                                    lv_count = lv_count + 1.
                                ENDIF.
                          endselect.
                      ENDIF.
                   endselect.
               ENDIF.
      endselect.
        sort lt_tab by MAPNAME.
        delete adjacent duplicates from lt_tab comparing MAPNAME.
       DIRECTORY represents path where file is stored .
        lc_DIRECTORY = '/interfaces/EDW/data/CSM/'.
        CONCATENATE 'EDW Queries by Characteristic -' SY-DATUM
        '.txt' into P_FILE SEPARATED BY SPACE.
      CONCATENATE lc_DIRECTORY P_FILE into FILENAME.
    Opening the Log File
      OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
                           ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          WRITE: 'File cannot be opened. Reason:'.  ", D_MSG_TEXT.
          EXIT.
        ENDIF.
       CONCATENATE 'System Date -' SY-DATUM 'YYYYMMDD' into lc_date
              SEPARATED BY SPACE.
       CONCATENATE 'EDW System -' SY-SYSID into lc_syst
              SEPARATED BY SPACE.
          TRANSFER lc_date TO FILENAME.
          TRANSFER lc_start_time TO FILENAME.
          TRANSFER lc_syst TO FILENAME.
      Queries for the parameters
         loop at gi_data into lt_line.
          loop at lt_tab into lt_line.
             TRANSFER lt_line TO FILENAME.
          endloop.    "Query Loop
    Closing the Log File
      CLOSE DATASET FILENAME.

    We have successfully created an ABAP program to do this.
    Thank you.
    Simon
    *& Report  ZBW_FIND_CHARACTERISTICS_QUERY
    SAP Consulting BW Tools:
    *& Find Characteristics in BEx Queries using ABAP
    *& List of infoobjects used in a Query
    *& Developer: WBHADS 07/06/2011
    REPORT  ZBW_FIND_CHARACTERISTICS_QUERY.
    PARAMETER:  CHARACT   LIKE rszrange-IOBJNM.
    PARAMETER:  VARIABN   LIKE RSZGLOBV-VNAM.
    DATA: query_name TYPE RSZCOMPID.
    DATA: s_varname  TYPE RSZGLOBV-VNAM,
          s_varnameu TYPE RSZGLOBV-VARUNIID.
    DATA:  s_characteristic LIKE rszrange-IOBJNM.
    DATA: lv_count        TYPE i.
    DATA: lv_count1       TYPE i.
    DATA: lv_count2       TYPE i.
    Data Declaration
    DATA:  D_MSG_TEXT(50).
    DATA:  lc_DIRECTORY(30)         TYPE c.
    DATA:  P_FILE(128).
    DATA:  FILENAME(128).
    DATA:  lc_query(60)             TYPE c.
    DATA:  lc_date(30)              TYPE c.
    DATA:  lc_time(30)              TYPE c.
    DATA:  lc_start_time(60)        TYPE c.
    DATA:  lc_syst(30)              TYPE c.
    DATA:  lc_exception(120)        TYPE c.
    RSZELTDIR   Directory of the reporting component elements
    RSZELTTXT   Texts of reporting component elements
    RSZELTXREF  Directory of query element references
    RSRREPDIR   Directory of all reports (Query GENUNIID)
    RSZCOMPDIR  Directory of reporting components
    RSZRANGE    Selection specification for an element
    RSZSELECT   Selection properties of an element
    RSZELTDIR   Directory of the reporting component elements
    RSZCOMPIC   Assignment reuseable component <-> InfoCube
    RSZELTPRIO  Priorities with element collisions
    RSZELTPROP  Element properties (settings)
    RSZELTATTR  Attribute selection per dimension element
    RSZCALC     Definition of a formula element
    RSZCEL      Query Designer: Directory of Cells
    RSZGLOBV    Global Variables in Reporting
    data: gi_data like rszrange occurs 0 with header line.
    Determine the queries
    tables:
    RSZELTTXT,
    rszeltdir,
    rszeltxref,
    rszrange.
    data: begin of lt_line occurs 0,
            ELTUID      like RSZELTDIR-ELTUID,        "char 25
            MAPNAME     like RSZELTDIR-MAPNAME,       "char 30
            TXTLG(60)   TYPE c,
          end of lt_line.
    data: begin of lt_line1 occurs 0,
            SELTUID  like rszeltxref-SELTUID,      "char 25
            TELTUID  like rszeltxref-TELTUID,      "char 25
            LAYTP    like rszeltxref-LAYTP,
          end of lt_line1.
    data: begin of lt_line2 occurs 0,
            ELTUID    like rszrange-ELTUID,      "char 25
            IOBJNM    like rszrange-IOBJNM,
            LOW       like rszrange-LOW,
            LOWFLAG   like rszrange-LOWFLAG,
          end of lt_line2.
    data: begin of lt_line3 occurs 0,
            VARUNIID  like RSZGLOBV-VARUNIID,      "char 25
            VNAM      like RSZGLOBV-VNAM,
            IOBJNM    like RSZGLOBV-IOBJNM,
          end of lt_line3.
    data: lt_tab like standard table of lt_line initial size 0.
    data: lt_tab1 like standard table of lt_line1 initial size 0.
    data: lt_tab2 like standard table of lt_line2 initial size 0.
    data: lt_tab3 like standard table of lt_line3 initial size 0.
    data: lt_line20(128) TYPE c.  " LIKE RSZELTXREF-SELTUID.
    data: lt_line30(128) TYPE c.  " LIKE RSZELTXREF-SELTUID.
    type-pools:
          rs,   "BW global
          rrms, "message server
          rsz,  "Qry definition global
          rzx0, "Qry RFC interface
          rzd1. "Qry definition database
    DATA: l_target_compid   TYPE rszcompdir-compid,
          l_t_uid_server    TYPE rzx0_t_uid_server,
          l_s_uid_server    TYPE rzx0_s_uid_server_x,
          l_s_msg           TYPE rs_s_msg,
          l_s_compdir       TYPE rzx0_s_compdir,
          l_s_eltdir        TYPE rzx0_s_eltdir,
          l_s_elttxt        TYPE rzx0_s_elttxt,
          l_t_eltdir        TYPE rzx0_t_eltdir,
          l_t_eltprop       TYPE rzx0_t_eltprop,
          l_t_eltprio       TYPE rzx0_t_eltprio,
          l_t_eltattr       TYPE rzx0_t_eltattr,
          l_t_eltxref       TYPE rzx0_t_eltxref,
          l_t_compdir       TYPE rzx0_t_compdir,
          l_t_compic        TYPE rzx0_t_compic,
          l_t_select        TYPE rzx0_t_select,
          l_t_range         TYPE rzx0_t_range,
          l_t_calc          TYPE rzx0_t_calc,
          l_t_elttxt        TYPE rzx0_t_elttxt,
          l_t_cell          TYPE rzx0_t_cel.
    data: c_subrc LIKE sy-subrc.
    data:
      l_GENUNIID                  LIKE RSRREPDIR-GENUNIID,
      l_COMPID                  LIKE RSZCOMPDIR-COMPID,
      l_COMPUID                  LIKE RSZCOMPDIR-COMPUID,
      I_OBJVERS                  LIKE RSZCOMPDIR-OBJVERS,
      I_WITH_TEMPLATES         LIKE RSGENERAL-BOOL,
      I_BY_INFOCUBE           LIKE RSZCOMPIC-INFOCUBE,
      I_TEMPLATE_TYPE           LIKE RSZELTDIR-DEFTP,
      I_VARIABLE_TYPES           LIKE RSZHELP-VARTYPES,
      I_VARIABLE_INFOOBJECT    LIKE RSZGLOBV-IOBJNM,
      I_LANGUAGE                  LIKE SY-LANGU,
      I_USE_BUFFER           TYPE RS_BOOL.
    FIELD-SYMBOLS:
                   <l_s_eltdir>        TYPE rzx0_s_eltdir,
                   <l_s_compdir>       TYPE rzx0_s_compdir,
                   <l_s_compic>        TYPE rzx0_s_compic,
                   <l_s_eltxref>       TYPE rzx0_s_eltxref.
    DATA:
        l_t_eltxref_seltuid   LIKE rszeltxref-seltuid,
        l_t_eltxref_teltuid   LIKE rszeltxref-teltuid,
        l_t_eltxref_laytp     LIKE rszeltxref-laytp.
      s_characteristic  = CHARACT.
    Find instances of the Forecast/Budget Variable in queries
      s_varname  = VARIABN.  "'ZE_BFC01'.
      SELECT SINGLE VARUNIID from RSZGLOBV
          INTO s_varnameu where VNAM = s_varname.
      clear lt_line.
      lv_count  = 0.
      lv_count2 = 0.
    Loop through all the queries
      select * from RSZELTDIR
               into corresponding fields of lt_line
               where DEFTP = 'REP'
               and OBJVERS  = 'A'.
               l_COMPUID = lt_line-ELTUID.
               l_GENUNIID = lt_line-MAPNAME.
             Filter by the Z Developed Queries
               IF l_GENUNIID CP 'Z*'.
                clear lt_line20.
                Get the Query Long Name
                  select single * from RSZELTTXT
                    into lt_line20
                    where eltuid = lt_line-eltuid           "rszeltdir-eltuid
                    and objvers = 'A'
                    and langu = 'EN'.
                  Find all the query elements within the query using function module
                  Get the tables of source query and its components
                    CALL FUNCTION 'RSZ_X_COMPONENT_GET'
                      EXPORTING
                       i_genuniid   =
                       I_COMPID     =
                        I_COMPUID     = l_COMPUID
                      IMPORTING
                        e_subrc       = c_subrc
                      TABLES
                       c_t_eltdir    = l_t_eltdir
                       c_t_eltprop   = l_t_eltprop
                       c_t_eltprio   = l_t_eltprio
                       c_t_eltattr   = l_t_eltattr
                        c_t_eltxref   = l_t_eltxref.
                       c_t_compdir   = l_t_compdir
                       c_t_compic    = l_t_compic
                       c_t_select    = l_t_select
                       c_t_range     = l_t_range
                       c_t_calc      = l_t_calc
                       c_t_elttxt    = l_t_elttxt
                       c_t_cell      = l_t_cell.
                    LOOP AT l_t_eltxref ASSIGNING <l_s_eltxref>.
                      l_t_eltxref_seltuid = <l_s_eltxref>-seltuid.
                      l_t_eltxref_teltuid = <l_s_eltxref>-teltuid.
                      l_t_eltxref_laytp  = <l_s_eltxref>-laytp.
                      IF l_t_eltxref_laytp = 'FIX' OR l_t_eltxref_laytp = 'COL' OR l_t_eltxref_laytp = 'ROW' OR l_t_eltxref_laytp = 'AGG'.
                        Determine if the Query Element is matching to the characteristic
                          select * from rszrange
                             into corresponding fields of lt_line2
                             where eltuid = l_t_eltxref_teltuid        "rszeltxref-teltuid
                             and objvers = 'A'.
                        Determine the variable name or master data value
                              IF lt_line2-LOWFLAG = 1.
                                Populate tables if match for Characterisic
                                  IF lt_line2-IOBJNM = s_characteristic.
                                      move lt_line-ELTUID  to lt_line-ELTUID.
                                      move lt_line-MAPNAME to lt_line-MAPNAME.
                                      move lt_line2-LOW    to lt_line-TXTLG.
                                      append  lt_line to lt_tab.
                                      lv_count = lv_count + 1.
                                      clear lt_line2-LOW.
                                  ENDIF.
                              ELSE.
                                 select * from RSZGLOBV
                                   into corresponding fields of lt_line3
                                   where VARUNIID = lt_line2-LOW
                                   and objvers = 'A'.
                                  Populate tables if match for Characterisic
                                    IF lt_line2-IOBJNM = s_characteristic.
                                        move lt_line-ELTUID  to lt_line-ELTUID.
                                        move lt_line-MAPNAME to lt_line-MAPNAME.
                                        move lt_line3-VNAM   to lt_line-TXTLG.
                                        append  lt_line to lt_tab.
                                        lv_count = lv_count + 1.
                                        clear lt_line3-VNAM.
                                    ENDIF.
                                endselect.
                              ENDIF.
                          endselect.
                      ENDIF.
                      clear l_t_eltxref_seltuid.
                      clear l_t_eltxref_teltuid.
                      clear l_t_eltxref_laytp.
                    ENDLOOP.
               ENDIF.
               clear lt_line-ELTUID.
               clear lt_line-MAPNAME.
               clear lt_line-TXTLG.
      endselect.
        sort lt_tab by MAPNAME.
        delete adjacent duplicates from lt_tab comparing ELTUID MAPNAME TXTLG.
       DIRECTORY represents path where file is stored .
        lc_DIRECTORY = '/interfaces/EDW/data/CSM/'.
        CONCATENATE 'EDW Queries by Characteristic -' SY-DATUM
        '.txt' into P_FILE SEPARATED BY SPACE.
      CONCATENATE lc_DIRECTORY P_FILE into FILENAME.
    Opening the Log File
      OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
                           ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          WRITE: 'File cannot be opened. Reason:'.  ", D_MSG_TEXT.
          EXIT.
        ENDIF.
       CONCATENATE 'System Date -' SY-DATUM 'YYYYMMDD' into lc_date
              SEPARATED BY SPACE.
       CONCATENATE 'EDW System -' SY-SYSID into lc_syst
              SEPARATED BY SPACE.
          TRANSFER lc_date TO FILENAME.
          TRANSFER lc_start_time TO FILENAME.
          TRANSFER lc_syst TO FILENAME.
      Queries for the parameters
          loop at lt_tab into lt_line.
             TRANSFER lt_line TO FILENAME.
          endloop.    "Query Loop
    Closing the Log File
      CLOSE DATASET FILENAME.

  • Issue with variable values while adding report to Bookmarks/Favorites

    Hello All,
    I am able to save the reports from my portal as bookmarks with the appropiate navigation state & variable values for reports which do not have a mandatory value variable with no default value. For all other queries like queries with no mandatory variables or queries containing mandatory variables with default values, this is working fine. Any inputs is appreciated. We are in BI7.0 with SP12.
    Thanks,
    Danny

    What's your question, because from your statement, it seems like everything is fine ??
    Cheers,
    Andrew

  • Disable variants for specific queries or users

    Hi,
    We recently upgraded to NetWeaver 2004s and are now able to create and use multiple variants for variables for queries. Both analyzer and web support this feature. Is is possible to deactivate this option so that specific queries or users are no longer able to see or create these variants?
    With regards,
    Alex

    Is there anyone who can point me in the right direction? Do I have to change a web template or customizing or something else? Please help!

  • Use of Bind variables on Transparent Gateway

    Are there any known issues of using bind variables with queries using the Transparent Gateway? I've included two queries that access data from V_PERSON (alias r) which is a SQL Server 2000 table. We're using TG for MSQL 9.0.1 and calling from an Oracle 8.1.7.4 database.
    All help appreciated.
    - Scott
    SELECT r.lastname,r.email_addr1,MGM_.PHONESTR (r.hmph_ac,r.hmph_number, r.hmph_xten,r.hmph_input),r.hmph_ac,r.hmph_number,r.hmph_xten,r.maiden_name
    FROM V_PERSON r WHERE r.vmn_person_id=184468;
    213 msecs
    SELECT r.lastname,r.email_addr1,MGM_.PHONESTR (r.hmph_ac,r.hmph_number, r.hmph_xten,r.hmph_input),r.hmph_ac,r.hmph_number,r.hmph_xten,r.maiden_name
    FROM V_PERSON r WHERE r.vmn_person_id=:1;
    :1 = 184468
    23 secs

    Scott,
    We are not aware of any issues with bind variables. The time is takes to execute the query depends on the query that is sent over to the non-Oracle system.

  • Program Adding variable in query

    Hi,
    We have a new object which must be as variable in our queries (~100 queries).
    I need to know if someone has already developp a programm to add automatically an infoobject as variable in queries.
    I think that we should use Function module 'RSZ_X_COMPONENT_SET' but how do we fill correctly parameters?
    Thanks & regards

    Dear Darius,
    Instead of Variable why dont you restrict that Characteristic with ONE value ?
    If it is variable > create that with processing tyep Customer exit and write the code.
    Regards,
    Ramkumar.

  • Variable User Exits

    Previously I have only used CMOD to manipulate variables in queries. However, my current client has BW 3.5 and I have read that the direction now is to use the BADI RSU5_SAPI_BADI.
    Can anybody provide an example of a user exit using the BADI? I know enough ABAP to get by in the old user exit but I don't think my knowledge extends this far.
    I am on BW 3.5 SP13.
    Cheers,

    hi,
    sample code
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'CUMMONTH'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'MONTH'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.   "high value = input
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    sent doc also ...

  • Variable order in IP function pop-up

    Hi gurus,
    We've created a formula that requires many variable values to the usser in a pop-up (like 10 variables). The problem is that the variable apper in a order that we don't like.
    Do you know how to order the variables in the pop-up???
    Thanks in advance.
    Mr Joseph

    We already know how to order variables in queries. The problem is about ordering variables in IP formulas.
    The variables needed for the formula are different from the ones defined in the query. As it is possible to order the variables in queries, we want to do the same for the formulas but, we don't know where to do that.
    Does anybudy know how?
    Thanks in advance,
    Mr Joseph

  • Mass / Multiple entries in Web variables

    Hi experts,
    i am looking for a possibility to upload mass/multiple selection entries in variables (web queries). I didn't find standard functionality like in Excel to upload variable entries via .txt file or copy from clipboard.
    Does anyone know how to do it or how to enhance standard functionality?
    In addition to that is it possible to save selection entries as variants in web variables?
    We are currently working on SAP BW 3.5 and WAS.
    Thanks in advance for your help!
    regards Gunnar

    Unfortunately, there is no standard functionality in BW 3.5. Both issues are adressed with NW2004s:
    From SP 9 it is possible to save variants on the variable screen.
    With SP12 there should be a new function to upload text files into the selection.
    Regards,
    Beat

Maybe you are looking for

  • PI 7.1 Adapter Level Logging documentation

    Hello, I am pretty new at PI 7.1. We are working on a logging documentation which requires us to layout how logging works in PI 7.1 both in ABAP and Java Stacks. Also, If possible could someone point me into right direction on logging documenatation

  • Blank Page in PDF output with RTF Template

    Hi, In RTF template; I am printing static text based on certain conditions optionally. I am getting a blank page at the end of the report if the static text is ending in the last 3 lines of the page. Does anyone had this issue before?

  • How do I Network Multiple Peripherals on a Airport Extreme?

    I have a G4 PowerBook with AE card and an Airport Extreme/modem. I presently have a laser printer connected to the AEBS's USB port and I want to connect at least two USB1 printers (the laser & an inkjet), and an USB1 scanner to the AEBS. What do I ne

  • Itunes keeps launching automatically

    Any ideas why it's doing this and how I can stop it?! It's a little annoying. Powerbook G4 12 1.33 SD   Mac OS X (10.4.7)  

  • Program name starting with an exclamatory mark at runtime .

    Hi , Whenever we execute an abap program the first letter of the program name is being replaced by exclamatory mark at runtime .I like to know why this happen and is there any logic behind it that sap follows .