Virtual InfoCube - Data Selection Logic

Hi, I have a query that accesses a Virtual InfoProvider.  Anyone have an example of the code required to access or use the query selections in the InfoProvider Function Module?  The Virtual InfoProvider "How To" doesn't show this...
Thanks,

  LOOP AT I_T_RANGE ASSIGNING <F_RANGE1>.
    SELECT SINGLE FIELD_NAME INTO SHLPFIELD FROM ZDWPSCHAR
       WHERE CHARACTERISTIC = <F_RANGE1>-CHANM.
    IF SY-SUBRC = 0.
      LS_RANGE-SHLPFIELD   = SHLPFIELD.
    ELSE.
      LS_RANGE-SHLPFIELD   = <F_RANGE1>-CHANM.
    ENDIF.
    LS_RANGE-SIGN        = <F_RANGE1>-SIGN.
    LS_RANGE-OPTION      = <F_RANGE1>-COMPOP.
    LS_RANGE-LOW         = <F_RANGE1>-LOW.
    LS_RANGE-HIGH        = <F_RANGE1>-HIGH.
    SELECT * FROM DD03L INTO LS_DD03L UP TO 1 ROWS
       WHERE TABNAME = 'ZDWPSTRANS'
         AND FIELDNAME = LS_RANGE-SHLPFIELD
         AND AS4LOCAL  = 'A'.
    ENDSELECT.
    IF SY-SUBRC = 0.
      APPEND LS_RANGE TO LT_RANGE.
    ENDIF.
  ENDLOOP.
* CONVERT RANGE TABLE TO WHERE CLAUSE
  CALL FUNCTION 'F4_CONV_SELOPT_TO_WHERECLAUSE'
    IMPORTING
      WHERE_CLAUSE = WHERE_CLAUSE
    TABLES
      SELOPT_TAB   = LT_RANGE.
* SELECT DATA BASED ON QUERY SELECTIONS
  SELECT * FROM ZDWPSTRANS INTO TABLE LT_ZDWPSTRANS WHERE (WHERE_CLAUSE).

Similar Messages

  • Virtual Infocube Data

    Hi Guys,
    How can I see the data and function module/program for a virtual infocube?
    How can I see the composition? And the manage?
    Thank you very much.
    Regards,
    Jeysi

    To see that function module, ...double click on 0FIGL_VC1 --> goto change mode --> click on Information (blue ' i ' ) icon --> click on "Type/Namespace" tab --> click "details" tab

  • Trouble in data selection logic

    Hi All,
    I am hitting 4 tables for selecting some data using inner join. There are three user
    input fields which if filled, has to take part in data selection. These three input fields are independent of each other.
    so while writing select query, how can i take care of all the possiblilities(none of them filled -- every one of them filled ) in the
    most efficient way..?
    Thanks
    -pranati

    Hi,
    IN the select-options you can add NO-EXTENSION NO INTERVALS..Which can be used a parameter..And you have to use IN in the select statement to filter the data..
    Check this example
    TABLES: marc.
    <b>SELECT-OPTIONS: so_matnr FOR marc-matnr NO-EXTENSION NO INTERVALS.
    SELECT-OPTIONS: so_werks FOR marc-werks NO-EXTENSION NO INTERVALS.</b>
    DATA: t_marc TYPE STANDARD TABLE OF marc.
    START-OF-SELECTION.
    Get the first 100 rows.
      SELECT mandt matnr werks UP TO 100 ROWS
             INTO TABLE t_marc
             FROM marc
    <b>         WHERE matnr IN so_matnr
             AND   werks IN so_werks</b>.
      IF sy-subrc = 0.
        WRITE: / 'RECORD COUNT - ', sy-dbcnt.
      ELSE.
        WRITE: / 'NO RECORD FOUND'.
      ENDIF.
    Thanks,
    Naren

  • Display data from a virtual InfoCube

    Hi experts,
    When I tryed to display data from the virtual InfoCube 0FIGL_V40, I've got a dump.
    Please help me to solve this problem.

    Dear Akshay,
    Is it possible that the problem comes from R/3 since when I check the extractor 0FI_GL_40 with the RSA3 Tcode I've got the message:
    Errors occurred during the extraction --- Message no. RJ012
    I think that the pb has been solved by switching on the business function "Reporting Financials" . Inthe SAP source System -> TA: SFW5. Turn on Reporting Financials. Then I've no pb while testing the extractor.
    Pb solved.
    Many thanks
    Youness
    Edited by: Youness NAJI on Jan 13, 2010 4:39 PM

  • How to retrieve data using logical database and custom select options

    Hi all,
    I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
    Thanks in advance.

    Hai Gupta
    Check the following Document & Links
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Sreeni

  • Date selection in query : logic needed!

    Hi,
    we have one calendar day depending on which the query result is displayed!
    Now the requirement is such that when user enters one date the query has to generate the result for the multiple date ranges including the one which he has entered.
    example: if user has entered 15/9/2007 then query should not only display the result of the date 15/9/2007 but also the results of  -5 to +2 ( means 10/9,11/9,12/9,13/9 and 14/9 plus 16/9 and 17/9 )
    simlarly other ranges like -8 to + 7 and so on
    How to define this in query?
    Thanks,
    Ravi

    Hello ,
    I need to make a graph conveying the information of the deliveries by comparing the goods issue date and promised date !
    report also requires how many deliveries were on time, how many were late and how many were early!
    for this requirement, i had thought of making a date selection field which is promised date and make furthur more date ranges selections by query it self so that late deliveries and early deliveries also covered in these date ranges.
    -5 to + 2 is that one range which is on time delivery range
    if the delivery is more eally than the -5 days then it is early delivery. even in ealry delivery i want to make how early it is.
    and suppose the delivery has crossed the promised date 2 days more then it is late delivery.
    all has to be acheived by single date selection and there after the logic which takes care of all the date ranges i had explained.
    i am looking for that logic which i am not finding
    Hope this is clear now
    Thanks,
    Ravi

  • Infocube Requests - Data Selection

    Hi Gurus,
    In the Infocube there were 4 requests, i want to know the selection conditions used in those requests apart from the place Infocube -> Manage -> Request tab.
    I need to use that information in ABAP codings, so please give the information like Table names where such information regarding selection conditions stored.
    Thanks & Regards,
    Balaji.S

    Hi There,
    The selection conditions are defined inside the infopackage, under tab Data Selection (*) ,  that generates the request.  Normally, these criteria are used to screen out unnecessary records before the load actually begins (for the purpose of performance).
    Also in order for any fields to appear in (*), it first must be indicated  in the associated data source under the tab Fields (Sel  Opts = 1,2,3,7).
    Hope this helps. Jen
    PS: I should have replied to the author of the thread. I'm sorry Murali M.
    Edited by: Jen Yakimoto on Aug 25, 2010 5:02 AM
    Edited by: Jen Yakimoto on Aug 25, 2010 5:34 AM

  • "Error occurred in the data selection" on init delta load ODS- InfoCube

    Hi, gurus and experts!
    I'm trying to do Init delta load from 0FIAR_O03 ODS into 0FIAR_C03 InfoCube in PRD env. by InfoPackage "Initialize with delta transfer (with data transfer)". Immediately after the load was started I got error
    "Error occurred in the data selection"
    with details
    "Job terminated in source system --> Request set to red".
    Where are no any short dumps. There are 1 activated init load in ODS - nearly 6 500 000 records.
    Any ideas about error? And the way I can load data?

    Hi Gediminas Berzanskis,
    I faced the similar error when I tried to load data from an ODS which contained huge amount of data to a Cube. Even in your case the volume of data is more (around 6.5 million records). The error could be due to the table space issue, please contact your Basis team to check if enough table space exist for both the data targets. 
    Meanwhile you may also check the RFC connection of the Myself source system.
    You can replicate the DSO datasource once and then reactivate the transfer rules using the program RS_TRANSTRU_ACTIVATE_ALL.
    Try load with a small amount of data with a Full load option and then with a delta option..
    Hope this Helps,
    Prajeevan (XLNC)

  • Gurus..need help in reading data from virtual infocube

    Gurus,
    I have to read data from an virtual infocube...I am trying to use FM RSDRI_INFOPROV_READ to read data but it doesn't work..
    I am doing exactly what has been done in the demo program RSDRi_INFOPROV_READ_DEMO...
    Please help me...its really URGENT...
    Thanks
    sam

    Check out this thread....
    must be helpful
    Re: Read data from 0BWTC_C02 via ABAP

  • Help please: Selective Deletion of Infocube data (Sales)

    Dear Experts
    Am working on a BW 3.5 server
    I have been referring to the below SDN posting
    <u>Selective Deletion of Infocube data</u>
    My scenario is like this..
    My Sales data infocube has multiple records with the
    same Delivery number and Bill of Lading number
    (same material number also).
    Some of these records are having "Created" status
    others are with "Cancelled" status.
    Requirement is to retain latest record based on Billing date
    after deleting previous records
    having same Delivery number and Bill of Lading number.
    Kindly advice a best practice solution.
    warm Regards,
    AbyJ
    ============

    Hi,
    I think selective deletion won't be the right solution to your problem.
    I would suggest to build up a second cube as a 1:1 copy of your sales cube.
    Build a transformation or update rule from your old to your new cube. In the startroutine you can now easily retain latest record based on Billing date
    after deleting previous records having same Delivery number and Bill of Lading number by sorting your data package according to this fields. After you have checked it in the new cube, you can either leave that and build the reporting on this cube if possible or in a second step you have to delete data in your old cube and then reload your new cube completely in your old cube. Build a transformation or update rule, easy 1:1 relations and reload data.
    An issue for this approach can be the number of records in your sales cube.
    Regards,
    Juergen

  • Error:Unable to determine data basis for virtual InfoCube.

    Hi all,
           I am working on Virtual cubes. I have created a query on virtual cube which is getting loaded from a transaction cube. I am using  a transaction cube which is a  copy of standard cube <b>0BCS_C10 - Consolidation (Company/Profit Center).</b> (Transaction cube).
    When I execute the query in BEX it is disconnecting from the server and if I execute the same in transaction <b>RSRT</b> it is showing following errors.
    1.Unable to determine data basis for virtual InfoCube.
    2.Error reading the data of InfoProvider.
    3.System error in program SAPLRRK0 and form RSRDR;SRRK0F30-01-
    Will be thankful for suggestions.

    Hi Pankesh,
    Thanks for the response..
            Transaction cube contains data and characteristics of virtual cube are  consistent.
              I am trying to see the contents of the virtual cube in transaction <b>LISTCUBE</b>, there also its showing same errors.
    How can I proceed now?

  • Data selection period seems no use in logical DB PCH??

    Hi experts,I have a problem when using LDB PCH.
    There are object selection period fields PCHOBEG and PCHOEND.
    there are also data selection period fields PCHBEGDA and PCHENDDA .
    I set the data selection fields PCHBEGDA & PCHENDDA values at Start-of-selection event.
    But this seems to have no effect on the data selection.
    on GET OBJEC event,all of the infotype data will be got,but not corrosponding to the data selection period.
    Is this normal?or something wrong?Thanks.

    In PCH you have two periods. One for selecting objects and one for selecting data (infotypes).
    LDB PCH works like PNP or PNPCE

  • Virtual infocube with services - division of suppliers in categories

    Hello,
    I’ve a problem and the idea to solve it with a virtual infocube with services. But unfortunately I don’t know if it’s really possible to solve it like this.
    The scenario is:
    I’ve suppliers, turnovers, goods (which have been delivered) and different quality deficiencies.  In dependence of the turnover with each supplier, they will be ranked. For the position in the ranking they get points. From this start points one have to subtract points for the different quality deficiencies. In dependence of this end-sum, the suppliers will be divided into categories. And this division should be shown in the query.
    But the suppliers can vary in each run of the query in dependence of the selection in the query. And the turnover of each supplier which depends on the selected goods can vary, too. So the division into the different categories depends on the selection and is dynamic. One doesn’t know this before. And so it isn’t possible to save the category of each supplier in an infoprovider.
    Now I want to know, if it’s possible to solve this with a virtual infocube with services.
    I hope there’s somebody who can help me. Thank you.
    Susanne

    Hello Susanne,
    first of all, yes, it can be solved with VirtualProviders. But I wouldn't expect it to have a good performance. It depends on the number of data records we are talking about.
    When you create a VirtualProvider you should make sure that the RFC Packing switch is flagged on. You can then get the selections in the tables-parameter selection with the structure bapi6200sl. Now you need to read the raw data for your selection. Either use the function module RSDRI_INFOPROV_READ or write the data into an ODS to simplify the selection.
    Based on the raw data you need to do you calculation and write the data back to the table data.
    For details of the implementation of the VirtualProvider and the function module you can check the SDN. These topics are also covered in my book ABAP Development in SAP BW - User Exits and BAdIs that was lately translated into English. You can find both the German and English version under <a href="http://www.sap-hefte.de/katalog/hefte/titel/gp/titelID-1256">www.sap-hefte.de</a> or <a href="http://www.sappress.com/product.cfm?account=&product=H1948">www.sappress.com</a>
    Best regards

  • Question for inverse routine in the transformation for a virtual infocube

    Hello,
    I have a virtual infocube with it transformation and i want to know if there is a way to know in the inverse routine or in the start routine if in the query the user is selecting a filter value.
    When the user want to select one value for a characteristic the transformation is executed in order to obtain the infoprovider values. In this moment the inverse routine is executed and i want to know if there is a way to identify when the user is making a drilldown or a filter.
    In the start routine of the transformation i have an abap code with a very expensive time of execution to obtain some key figures values but i dont want that this abap code will be executed when the system executed the transformation to obtain the values for one characteristic in order to make a filter.
    Thanks in advance for your help. 
    Best regards.
    Ignacio

    Hi Ashish,
    Your document is very useful, in fact I used it to write my abap code, now Iu2019m getting the values of the query selection conditions, but what I need is after the report is showed in the first time.
    When data in report is showed, user has the possibility to filter values for one characteristic. If the characteristic has the option for filter value selection during query execution equal to u201COnly Values in infoprovideru201D , the inverse routine is executed to obtain the values that are contained in the infoprovider and then the system show all the possible values. What I need is to identify this event, because in this case I donu2019t want to make some calculations in the transformation that are very expensive in time.
    Thanks a lot for your information.
    Best regards
    Ignacio

  • Is it possible to delete data selectively from Business content cubes

    Dear Experts,
             Requesting you to help me out to know, is it possible to delete data selectively from Business content cubes.
    When I'm trying to delete selectively from Business content cubes, the background job gets cancelled with ST22 logs stating
    A RAISE statement in the program "SAPLRSDRD" raised the exception  condition "X_MESSAGE".                                                                               
    Since the exception was not intercepted by a superior program, processing was terminated.  
    and i tried  with few more Technical content cubes but the same thing happens.
    Pls let me know how to selectively delete data from Business content cubes if it's possible?.
    Thanks in advance for your favorable assistance.
    Regards,
    Ramesh-Kumar.

    Hi Ramesh,
    Follow below steps for selective deletion:
    1.     Transaction code: Use the Transaction code DELETE_FACTS.
    2.     Generate selective deletion program:
    A report program will be generated of the given name, here .
    3.     Selection screen:
    Take the deletion program u201CZDEL_EPBGu201D to the transaction code SE38 to see/execute the program.
    After executing it will take you to a selection screen:
    As we need to carry out deletion selective on Calendar week, we need to get the screen field for the field Calendar week. For this, click on the Calendar week field and press F1.
    Click on the technical information button (marked in red box above) you will get below screen:
         ABAP program to carry out the Calendar week calculation
    Problem scenario: As stated earlier the requirement is to delete the data from the cube based on the calendar week. Thus a code must be developed such that the number of weeks should be taken as input and corresponding calendar week should be determined. This calendar week should be then passed to the deletion program in order to carry out the data deletion from the InfoCube.
         Transaction code: Use T-code SE38 in order to create a program.
    Logic: Suppose we need to delete the data older than 100 weeks.
    a.     Get the number of weeks and system date in variables and calculate the total number of days :
    lv_week = 100.      *number of weeks      
    lv_dte = sy-datum.     *system date
    v_totaldays = lv_week * 7.      *total days
    b.     Get the corresponding calendar day from the total days. This is obtained by simply subtracting the total no. of days from the system date.
    lv_calday = lv_dte - v_totaldays. *corresponding calday.     
    c.     Now in order to get the calendar week corresponding to the calculated calendar day we must call a function module 'DATE_TO_PERIOD_CONVERT'. This function module takes input as Calendar day and Fiscal year variant and returns the appropriate fiscal period.
    Get the sales week time elements
      call function 'DATE_TO_PERIOD_CONVERT'
        exporting
          i_date                      = lv_calday
          i_periv                     = lc_sales
        importing
          e_buper                     = lv_period
          e_gjahr                     = lv_year
        exceptions
          input_false                 = 1
          t009_notfound               = 2
          t009b_notfound              = 3.
      if sy-subrc = 0.
        ls_time-calweek(4)      = lv_year.
        ls_time-calweek+4(2)    = lv_period.
      endif.
    v_week = ls_boots_time-calweek.
    Note: We can pass the fiscal year variant which can be obtained from the table T009B.For e.g. here fiscal year variant lc_sales = Z2. LS_TIME will be any table with suitable time units.
    d.     Now we have obtained the required calendar week in the v_week variable. This calendar week is the week till which we need to keep the data. And older data than this week will be deleted. This deletion will be done by the deletion program
    Submitting the Data deletion program for ZEPBGC01 and key field
    SUBMIT ZDEL_EPBG WITH C039 LT v_week.
              Here the calendar week value is submitted to the deletion program ZDEL_EPBG with the screen field of calendar week.
    Hope ... this will  help you..
    Thanks,
    Jitendra

Maybe you are looking for

  • CUCM 8.6.2 maximum rings

    Hi all. We currently have an alarm system at one of our sites that is triggered by calling an analog port that the alarm is plugged into, and then the alarm rings only as long as the call is ringing. Since there is a maximum ringing time on the syste

  • Invalid subreport name Error code:-2147483086

    The setup used in this particular environment is to run reports via Crystal reports server 2008. We call the servers via the rassdk_java_dg_12_en and the setup works just fine BUT in one particular case. The report that fails have a main report with

  • Invalid column name error in JDBC adapter

    Hi all, My scenario is Proxy->XI->JDBC. I get the following error in receiver JDBC  adapter. Unable to execute statement for table or stored procedure. 'Account_Master' (Structure 'STATEMENT') due to com.microsoft.sqlserver.jdbc.SQLServerException: I

  • MacBook Pro - XP - Labview

    Does anyone have experience with operating Labview 8.2 on a MacBook Pro when booted in XP?  I would like to get a MacBook Pro as my home computer, as understood in the NI license agreement, to run my Developer Suite.  It would be nice to know before

  • DO porcess for logistics

    Dear all, I am mm consultant .... We need to develop DO (Delivery Order for logistice dept. ) facality from supply location. client requirement is follwing Delivery Challan: This will be generated from depot and will be linked to SO. Every vehicle sh