User exit in bex query

Hi Gurus,
I am not so good in abap so can anyone help me with the coding for the logic which i have mentioned below. I want to do it in EXIT_SAPMRSRU_001. This exit for th virtual characteristics.
Create TEMP table with temp field A , Temp field B
Get Field A,  pass it to temp A,
Do a search in TEMP-temp field A
if not found in temp A,  copy field to temp field A , assign temp B =1
if found in temp A, copy field to temp field A , assign temp B =0
Put the above logic in a loop until final record is read.
Edited by: Alvaro Tejada Galindo on Feb 28, 2008 1:55 PM

TYPES: BEGIN OF TY_TEMP,
       FIELD_A TYPE STRING,
       FIELD_B TYPE STRING,          
       END OF TY_TEMP.
DATA: T_TEMP TYPE STANDARD TABLE OF TY_TEMP.
FIELD-SYMBOLS: <FS_TEMP> LIKE LINE OF T_TEMP.
LOOP AT T_TEMP ASSIGNING <FS_TEMP>.
IF <FS_TEMP>-FIELD_A NE PARAM_A.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 1.
ELSE.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 0.
ENDIF.
MODIFY T_TEMP FROM <FS_TEMP>.
ENDLOOP.
Modify it, according to your needs...And next time, try the code yourself first -;)
Greetings,
Blag.

Similar Messages

  • User exit for bex query

    Hi ,
    My requirement is like this :
    When i put 20 ath week in calender week field the report has to calculate last  13 weeks data and do SUMUP .
    I have created Customer exit variable .
    I wrote user exit but it is not calculating for last 13 weeks and my code is like below :
    WHEN 'ZUEXIT' .
       IF  I_STEP EQ '2'.
        LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZWK11'.
       LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZWEEKVR'.
        CLEAR L_S_RANGE.
        L_S_RANGE-LOW = LOC_VAR_RANGE-LOW - 13 .
         CONDENSE L_S_RANGE-LOW .
        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 .
    Please can anybody suggest me .

    Hi Venkat
    what if u enter a value between 1 to 12  for the week? then the low range becomes -ve right?
    Instead of customer exit, you can try the following
    1. Create a new selection, in which drag the corresponding characterstic
    2. Select restrict from the context menu and
    3. select value ranges from the "show" popup box, choose Between and
    4. for the lower and upper values use the "select from list icon", and select "variables" from the popdown and select your ZWEEK variable
    5. tranfer to the right panel and then select the offset icon...two popup boxes appear once for the lower and once for the upper...select -13 for lower and 0 for upper..
    Assign points if helpful.
    Regards, Uday

  • No of users accessing a bex query

    HI Bw guys,
    we want know no of users accessing our Bex query.Is there any procedure to find out that.Please give the solution for us because we are hurry about this.
    Thanks and regards
    Sreenivas.

    Hi Srinivas,
    If your BI Admin Cockpit is Working Fine and getting loaded to 0TCT_MC01 this cube, then goto  RSRT and Run this Query
    0TCT_MC01/ZQUERY_FRONT_END_OLAP
    The Count shows the number of hit for those queries for that month.
    Similarly there are queries for day wise also.
    Rgds
    SVU

  • Error Message in user-exit  EXIT_SAPLRRS0_001 in Query

    Hi,
    ABAP BW Guru's
    I got an ABAP  type problem with RANGE numeric variables  in EXIT_SAPLRRS0_001.
    With character or dates iuser-exits worke fine.
    My characteristic is CONNID Type  NUMC 4
    My user-exit variable is named CONNID_EXIT_STEP_2.
    My ABAP processing in the exit for the user-exit varibale is quite simple (testcase):
      DATA: l_e_t_range TYPE rsr_s_rangesid.
      l_e_t_range-low  =  '17'.
      l_e_t_range-opt  =  'EQ'.
      l_e_t_range-sign =  'I'.
      APPEND  l_e_t_range      TO   e_t_range.
    My Error message in the BEX Analyser is:
    Value "17" for user-exit variable CONNID_EXIT_STEP_2 is inavlid.
    What's wrong with the ABAP processing in the exit  (testcase) ?
    The debugger clearly shows l_e_t_range-low with value 17.
    l_e_t_range-low  seems is a character.
    Anyone can give a tip ?
    Thank You !
    Martin
    ThanXs

    Dear Karthik,
    You are right. First time my user exit execute, after that report automatically call message located Function Module LCOPDU13 504th row
         IF NOT SY-MSGID IS INITIAL.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    Message number is 806 message id is RU.
    Can you help me for fix this situation? I just want to add a data control in ZXCOFU05 user exit. For user fill data (werks based)
    Thanks your helpful answer

  • User exit  for a query

    Hi Experts,
    I have to design a query wherein the user has to compare the forecast and the actual figures.Forecasting is done on weekly basis for next 12 months.
    Now in my selections i have
    period before forecast is frozen : say if user enters 6
    month interval : say Jan 2006 to march 2006
    now the requirement is
    that i have to display the forecast values of month january done 6 weeks prior to the week in which 1st of jan falls..
    this 6 weeks is because user entered 6 in the 'period before forecast is frozen'this is again variable as user may enter any number ..
    now again for the month of feb we need to consider the forecast value done 6 weeks prior to the week in which 1st of feb falls...
    and so on ....till the last month of the range...
    now if i write a user exit to find the week , 6 weeks prior to first month and restrict my forecast key figure with that variable it will pick the forecast value of all the months in that week and not 6 weeks prior to each month...
    please let me know if i'm right or wrong and also if u have ne solution for the same..
    is it possible thru some coding in user exit...
    i hope i'm able to word my problem ..
    Thanx in advance..

    Hi Bwer,
    True that my data in cube has 0calweek but my query requirement is that i have to calculate the 6 weeks prior not once but for all the month in month range ..that is if the user enters jan to july so for july i need to calculate 6 weeks prior to the week in which 1st of jan falls ,then for feb again 6 weeks prior to the week in which 1st of feb falls and so on..
    so say if for 1st of jan2006 lies in calweek 1 so 47th week of 2005 has to be considered and for feb 51st week of 2005 has to be considered then for march calweek 3 has to be considered...and so on till july...
    so its not that i have to pick up data from 47th week of 2005 for all the months...
    thanx...

  • Customer exit in BEx Query

    Hi,
    I've created a BEx query and added a variable MCE9004 in field Ref.org.unit and this variable is mapped to a customer exit code via CMOD step 2 (post_popup).
    Basically how I want it to work is, I will select an org.unit value e.g. org.unit = A1 in tcode RSRT variable selection screen and this value will be passed in the customer exit code as shown below and retrieve the look up values and pass it to the field ref.org.unit via e_t_range.
    CASE i_vnam.
         WHEN 'MCE9004'.
    ****      IF i_step = 2.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0CALMONTH'.
           l_date = LS_T_VAR_RANGE-low.
           IF l_date IS NOT INITIAL.
             CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
               EXPORTING
                 day_in            = l_date
               IMPORTING
                 last_day_of_month = ld_last_day
               EXCEPTIONS
                 day_in_not_valid  = 1
                 OTHERS            = 2.
           ENDIF.
           READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
           WITH KEY IOBJNM = '0ORGUNIT'.
           SELECT /BIC/ORGUNT_PR FROM /BIC/AMPA5AX0000 INTO lv_org "l_s_range
             WHERE ORGUNIT = LS_T_VAR_RANGE-low
             AND DATETO LE ld_last_day.
             l_s_range-SIGN = 'I'.
             l_s_range-OPT = 'EQ'.
             l_s_range-LOW = lv_org.
    *          l_s_range-HIGH =
             APPEND l_s_range TO e_t_range.
           ENDSELECT.
    ***** To clear value of org.unit field
    ****      READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
    ****      WITH KEY IOBJNM = '0ORGUNIT'.
    ****      IF sy-subrc EQ 0.
    *****        CLEAR LS_T_VAR_RANGE-low.
    ****        DELETE i_t_var_range index sy-tabix.
    ****      ENDIF.
       ENDCASE.
    ENDFUNCTION.
    Once this code has been executed it goes back to the selection screen and there is still an org.unit value on the screen even though I have removed it in my code in red above in i_t_var_range.
    Therefore when I execute the query, the value for org.unit field is not emptied.
    Can you please teach me how to clear that value of org.unit field?
    Let me know if you need further details.
    Thanks,
    Rebekah

    hi thomas,
    yes i get your point but the thing is i need to modify a value in the import table. coz the export table is not for the org.unit field but the ref.org.unit field.
    Basically i pass in org.unit = A1 and e_t_range will have the lookup values to be passed in ref.org.unit field which is B2 and C3.
    Then when i click execute, i want my filter only to have the values B2 and C3 and A1 shud be removed.
    is there any way i could do that?
    please advice.
    Thanks,
    Rebekah

  • User exit for reducing Query lines!

    Hello,
    IS it possible to use a User Exit for queries to reduce my resultpackage before the lines arrive the reporting area?
    For example:
    I have a due date and in case of an entry of a field in the query result package the <exit> must read a reference from a info provider to decide if this line of this resultpackage can be load or not!
    Query resultpackage
    Contract :
    a             look up in, ODS for example, decision! delete line from package or not
    and so on..
    b            Yes
    v            No
    f
    g
    Short form:
    Is it possible to manipulate the result package of a query in a user exit dynamically like described above??
    AND how is it to implent?
    Thank you for you answers!
    By Rene
    Edited by: NW-DEV on Oct 7, 2010 3:52 PM
    Edited by: NW-DEV on Oct 7, 2010 3:55 PM

    Hi,
    Is it necessary that you do this on the fly (during query execution)?
    A simpler way to achieve this is by adding a column to your cubes ... say Flag . Update this flag, during transformations. This Flag field will indicate 'Marked for Deletion' and you can filter out records in the Query, by adding this Flag Field in Query Restrictions.
    If you want to achieve this during Query execution, you may need to use Virtual Characteristics(You can search for the code/implementation steps on SDN). Again Flag field will be the Virtual Characteristic and Query Filters will contain Flag value exclusions.
    Regards,
    Advait

  • Removing or Suppressing 0DAT SAP Exit from BEx Query

    Hi,
    I have a BEx Query on a MultiProvider. The Multiprovider is based on two Cubes. Iam facing a problem with the 0DAT Characteristic Variable on 0CALDAY. Although I dont use the 0CALDAY in my query, this SAP Exit Variable pops-up when I run the query. How do I remove or atleast suppress it from popping-up?
    I tried the 'Save & Reuse Varibale Values' options from the Query Properties Dialog Box. Although this works but I want to use one more Customer Exit Characteristic Variable on 0CALDAY & this variable is also getting resued because of the setting I made for 0DAT. I want this variable to pop-up and the 0DAT variable to be removed completely(or atleast suppressed).
    Would also like to know why 0DAT Variable is popping-up even when I dont use 0CALDAY at all....
    Thanks in advance,
    -Ravi

    Hi,
    Please refer to your following mail..I have the same problem with 0dat. Could you provide me any solution for this..
    Thanks & Regards,
    Karthi
    > Hi,
    >
    > I have a BEx Query on a MultiProvider. The
    > Multiprovider is based on two Cubes. Iam facing a
    > problem with the 0DAT Characteristic Variable on
    > 0CALDAY. Although I dont use the 0CALDAY in my query,
    > this SAP Exit Variable pops-up when I run the query.
    > How do I remove or atleast suppress it from
    > popping-up?
    >
    > I tried the 'Save & Reuse Varibale Values' options
    > from the Query Properties Dialog Box. Although this
    > works but I want to use one more Customer Exit
    > Characteristic Variable on 0CALDAY & this variable is
    > also getting resued because of the setting I made for
    > 0DAT. I want this variable to pop-up and the 0DAT
    > variable to be removed completely(or atleast
    > suppressed).
    >
    > Would also like to know why 0DAT Variable is
    > popping-up even when I dont use 0CALDAY at all....
    >
    > Thanks in advance,
    > -Ravi

  • User Entry for BEx query

    Hi Gurus,
    When I run a standard Business Content query, I could see a dialog box popping up for the user to enter the values. This looks like a mandatory field. How do I modify this? Is there a code which I could do the modification, as to me it seems to be an SAP exit variable?
    Any help would be hugely appreciated.

    Hi,
    When we use variables in a query a pop-up appears at runtime. If we want to modify it, ie., if you want to delete this
    see for which field it's asking to enter the value, in Query -> Global definition -> go to that field, expand it, you can find a variable on that field, you can delete that variable or go to the left side panel and double click on the variable under the same field and modify it, under DETAILS change 'Variable Entery is' to optional from Mandatory.
    To create a variable right click on the field and create a 'New Variable'

  • Super User Profile for Bex Query Designer

    Hi There,
    What is the profile that will allow a user to create local queries, copy an existing (locked transported query), and change local queries - when the system is locked for change.  We are using SAP NetWeaver BI 7.0x
    Regards
    Fiona

    I'm not sure about a security profile, but you will definitely need to make a setting in RSA1 to allow a user to create/change queries when the system is closed for changes.  In RSA1 go to Transport Connection then click on Object Changeability.  Look for the entry for Query Element, and if it says Not Changeable double-click it so it says Changeable Original.  Now you will be able to create queries or change queries that were originally created in that system.  If you want to also be able to change queries that were created in another system (i.e. change queries in production that were created in dev) right-click and choose Everything Changeable.
    You can make similar settings for InfoPackages, process chains, web templates, etc.
    See [here|http://help.sap.com/saphelp_nw70/helpdata/en/0e/a7343e8c7f6329e10000000a114084/frameset.htm].

  • Bex Query is not working in portal

    Dear Experts,
    i have uploaded BI master role into portal, By default Bex Queries are assgined to Master Role. when I clcik on preview for particular Bex Query, it's working fine. but after assigning the master role to end user, that same Bex Query is not working. it's showing Below error..
    Portal runtime error.
    An exception occurred while processing your request. Send the exception ID to your portal administrator.
    Exception ID: 05:22_18/08/10_0002_7116150
    Refer to the log file for details about this exception.
    please give me suggetions...
    Regards,
    VENU

    Hi Venu ,
    Can you please check the logs for details -  http(s):<host>:<port>/nwa . This may be a permissions issue . Check if the iview has read permission for everyone group and then test . Also post the error details here .
    Regards
    Mayank

  • Is User Exit's support ABAP Objects?

    Hi Experts,
    Is User Exits supports ABAP Objects.  I am planning to  implement  the ABAP classes in User exits to fill Query Variables.
    Is it possible?
    Thanks & Regards

    Hi,
         Yes user Exit's support ABAP Object.
    But according to me if you want to use class then use the class into some generic function module, then that function module use in Exit. Its just for Cleanness and Simplicity of user Exit.
    Regards,

  • APD Retraction of BEx query

    Hi all,
    Q1: I know we can fill marketing attributes from BW to CRM using retraction in APD. Is it possible to retract an entire result set of a BEx query using this tool (BW 3.5 / CRM 4.0)?
    Q2, more doubtful on feasibility of ithis one: This query has variables that needs to be filled out by the user if the BEx query is executed normally. If it is possible to retract a query as in Q1 above, is there any way to have these variabled filled by a user/admin once the model is executed?
    Thanks,
    Petter

    Hi ,
    I need to retract data from BW-BPS 7.1 to SRM.I am new to BW
    (3 months experience)
    Can anyone send me documentation , links or steps by steps guide to explain how
    to do the link please?
    Is it more or less the same as with retraction into CO-Pa?
    If there are no standard retractors, what is the solution?
    This a challenging task for me and I really need to do it at work.
    Thanks in advance for your help.
    I'll surely assign points if one can help me.
    My mail is [email protected]
    Nevil

  • How to prevent end user to create a Query View and save back to BW Server?

    Dear All :
    Do Someone know that how to setup authorization for Bex Query View Creation? We want to prevent end user to create a Query View to save back to BW Server his favorite folder. when our user run Bex Query, he can base on this query and use Bex Analyzer's save function to save a Query View and save into his favorite folder.
    My question is :
    1. Can we set up a Authorization to prevent end user to save Bex Query View?
    2. Or can I remove Save function from Bex Analyzer to prevent end user use save function, But Developer should not to be prevent .
    Thanks for all of your kindly response.
    Best Regard
    Lawrence Kuo

    Hi.
    Yes, you can do it like you outline in your point 1):
    You need to use the authorization object S_RS_COMP for this. This object let's you control what parts/components of a query the user can do stuff to. So, in your case, you need to have a role for the users, where you do not grant create-access to the component QVW, and then you need another role for developers, where you grant full access or whatever you need for your developers.
    See [this post|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a6c54319-0e01-0010-20a4-fb81ad32f330?QuickLink=events&overridelayout=true&5003637661135] and the [SAP Help entry|http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6859e07211d2acb80000e829fbfe/content.htm].
    You will also need to use the authorization object S_RS_COMP1. If you already have a productive system with users doing reporting, both objects will be maintained in one of the roles already.
    You also want to consider using the object S_RS_PARAM to allow users to create variants for the variabel screen.
    Good luck.
    Jacob

  • User exit for multiprovider

    hi friends,
    how can I create a user exit for a multiprovider query. and how can I find a multiprovider table for user exit... this is very urgent... help me..

    hi sam ,
    thanks for a quick reply..
    my requirement is I have one multiprovider which combined 3 cubes and 3 ODS.
    now I want to create a user exit of a query for retrieving some Infoobjects from that multiprovider. thats why I asked is any table regard this... by query I got such Infoobjects, due to some enhancement, I need to retrive such infoojects by coding....
    Ex. material,suite,plant and two keyfigures from different infoproviders.... now I want to collect all Infoobjects....
    with hopes,
    JD

Maybe you are looking for

  • Need to restore a session without having to restore the profile folder in explorer

    So, honestly I found this is the only way to register, which I think is stupid, but I'm absolutely infuriated right now because I had 360+ tabs open all in groups and stuff, and I opened some site, it threw a pop-up full screen up in my face, even th

  • Limited Admin Privileges/Specific Elevation of User Accounts

    I'm hoping to create an account on my laptop for my roommate.  I don't want him to have a full admin account, but he knows enough about computers that he could troubleshoot networking, and I want to enable him to install programs on the system.  I'm

  • Sending multitracks back to FCP

    I'm working with HDV. I sent the time line to Color, did my magic and rendered out selected clips on this multi-track timeline. When I sent it back to Final Cut it was okay, then I reopened it later and the clips were not on the time line, but they a

  • Transfering files from Windows Dreamweaver CS5.5 to build apps on MAC

    I am considering upgrading to CS5.5 to take advantage of Dreamweaver's new Phonegap features. I am a Windows user. I know I can't build iOS APPS on Windows but can I move th files I have built to a MAC with a development envvironment and build the AP

  • New Window of ESS with Exit button

    Hi All, For all applications in ESS, I am facing astrange issue. I will explain it taking one scenario. I go to the page where I can change the personal data under service Personal Information. Here there is an 'Exit' button. If i click on that, a ne