Several single value selection in InfoPackage Data selection using Routine

Hi,
I am trying to extract data from a table(containing Ticket data) in R/3 using Generic extractor with table. As the table is not supporting the delta functionality i have to do daily full load for more than 5 lak records.
I dont want all the tickets from R/3, i just need the tickets which are open. Unfortunately there is no field in R/3 table which indicates Ticket status. But in BW i have a DSO where i can get the tickets along with their status.
Now what i want to do is:
in the Infopackage i want to give the dataselection for ticket, whose status is open which will be calculated in ABAP code by lookup to the DSO. Is this possible?
I know that in ABAP routine for Data selection we can give single values and range values. but here i just want to give several single values. That means if suppose i have 4 tickets T1,T2,T3,T4 in the DSO and if T1 and T4 are open tickets, then i have to get the data from R/3 just for T1 and T4.
in the above case if we use range then the low and high values in the range will be T1 and T4 respectively and the data pulled from R/3 will be from T1 - T4 ie all T1,T2,T3 & T4. but i need just T1 and T4.
Please share your ideas. also please send the code as i am not an ABAPer.
If Several single value selection is not possible at least send the code for the range values.
Thanks,
Cnu.

you can write a code like this in the ABAP routine in data selection in front of ticket characteristic
types: Begin of s_ticket,
     ticket type <type of ticket characterisitcs>,
      End of s_ticket.
data: l_idx like sy-tabix,
      wa_ticket type s_ticket,
      it_ticket type standard table of s_ticket,
      l_s_range type rsrdrange.
You can declare
read table l_t_range with key
     fieldname = '<your field name for ticket>'.
l_s_range-infoobject = '<infoobject name>'.
l_s_range-fieldname = '<field name of ticket cahracteristics>'.
l_s_range-sign = 'I'.
l_s_range-option = 'EQ'.
select * from <ODS active table> into table it_ticket where status = <value for open status>.
if sy-subrc = 0.
     loop at it_ticket into wa-ticket.
          l_s_range-low = wa_ticket-ticket.
          append l_s_range to l_t_range.
     endloop.
end if.
p_subrc = 0.
you need to modify it as per your requirements, i hope this might help you.

Similar Messages

  • How to change date selections at Infopackage data selections in production sys

    Hi All ,
    we are loading data into Infocube from datasource ,one process chain for delta init with data transfor  ,which has data selections at infopackage say 06.2014 and other process chain for delta which has same selections at infopackage . Now I want change this data selections  at Infopackage level .
    I Have tried to change these dates in data selections at infopackage level , tho I have changed and saved to future date at delta initial with data transfor ,it's keep coming back to 06.2014. Of course data selection at delta Infopackage level is faded .
    I Want to set future date with delta int with disturbing delta loads . How to do it please .
    regards
    hari

    Hi Ram,
    We will  load delta Intial with data transfer every weekend , and we run delta everyday , because we do delta init with data transfer with selections say ( 01.20011 to 12.2003 ) every weekend , hope I need to create new delta infopack  with new data selections say ( 01.2004 to 12.9999) only  to get update data in Infocube.
    Please correct me if I am wrong .
    Regards
    hari

  • How to debug a ABAP Routine which is in Infopackage Data selection Tab

    Hi ,
       Please let me know How to debug a ABAP Routine which is in Infopackage Data selection Tab.

    Hi,
    You can try to create infinite loop:
    DATA: STOP.
    WHILE STOP IS INITIAL. ENDWHILE.
    Start InfoPackage and then go to SM50 and swich on debugging for your process. Then in debugger you can change value of STOP variable to skip the loop.
    Krzys

  • Routine in Infopackage Data selection Tab

    HI,
    I am having one InfoObject (marital staus) in InfoPackage Data selection Tab.
    Now I want to write a ABAP routine for that infoObject in Infopackage to select only those records of  marital status = ‘SINGLE’.
        I am new to ABAP . please let me know what code should I write in this routine.

    Hi Kris,
    You would do it like this:
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'MARITAL_STATUS'.
              l_idx = sy-tabix.
              move: 'I'      to l_t_range-sign,
                    'EQ'     to l_t_range-option,
                    'SINGLE' to l_t_range-low.
              modify l_t_range index l_idx.
    Thanks,
    Joseph

  • Filed not reflecting in infopackage data selection screen

    Hello Gurus,
    I have added a time stamp fiield in generic datasource in R3 and selected that field,but when i replicate the data source in BI and go to infopackage data selection screen,i dont see that field.I tried all the possible things but its not working.
    Please help me.
    Thanks in advance.
    Regards,

    Hi,
    Did you select that  Time stamp field as Selection field in RSA6? If not then select it as selection field and activate and then replicate the DS in BW and then check if that comes in Infopackage level.
    Hope this helps..
    Murali

  • Infopackage Data Selection Problem

    Hi All,
    When i load master data from source system, in Infopackage data selection tab i give some criteria (e.g Customer number = 1000) But in infopackage the data load with all customer.(Not only 1000)
    How can i solve this problem??

    Hello Ozan,  
    Please check the datasource in RSA3 and make sure that its working for the same selection.
    Is there any routine in your infopackage and what is your source system?
    [Thanks|http://chandranonline.blogspot.com/]
    [Chandran|http://chandranonline.blogspot.com/]

  • Not able to put data selection condition in data selection tab of infopakag

    I was loading data from data source as data mart ( export data sauce from ODS) to other ODS.
    when I tried to do delta Initialization with data transfer , I am not able to put data selection condition in data selection tab of infopakage.
    when I choose Full Update in Update tab . It enables data selection fields in data selection tab. and I could put the condition.
    I have checked in transfer structure as well , the fields are marked for selection.
    Please advice .
    Please tell me what could be the reason for this problem

    Ashutosh,
    As you are doing delta upload the data selection tab will be disabled, if you want to do the selective load then you need to do init update with your selection.
    When you do the full updtae then definitely the data selection tab will be enabled for all the objects.
    Hope this helps...
    *******Assign Points if it helps********
    Thanks,
    Gattu

  • Want create filter data  in using routine by DTP

    hi
    I  want create filter data  in using routine by DTP
    I want dowload data in my DSO, if the material exist in my infoobject 0material.
    But my code donu2019t worked:
    ===============================================================
    *&  Include           RSBC_SEL_ROUTINE_TPL
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rssdlrange.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    tables :   /BIC/MATERIAL.
    DATA:
      l_s_ztable   TYPE /BIC/MATERIAL,
      l_s_range  type rssdlrange.
    $$ end of global - insert your declaration only before this line   -
        Fieldname       = ZCOSTCTR
        data type       = CHAR
        length          = 000010
    form compute_ZCOSTCTR
      tables l_t_range structure rssdlrange
      using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW
            i_fieldnm type RSFIELDNM
      changing p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
      data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = '/BIC/MATERIAL'.
      l_idx = sy-tabix.
      clear l_s_range.
      SELECT DISTINCT /BIC/ZCOSTCTR FROM /BIC/MATERIAL INTO l_s_ztable.
        l_s_range-iobjnm = '/BIC/MATERIAL'.
        l_s_range-fieldname = '/BIC/MATERIAL'.
        l_s_range-sign = 'I'.
        l_s_range-option = 'EQ'.
        l_s_range-low = l_s_ztable-/BIC/ZCOSTCTR.
       l_t_range-HIGH = l_s_ztable-/BIC/ZCOSTCTR.
        if l_idx <> 0.
          modify l_t_range index l_idx.
        else.
          append l_t_range.
        endif.
        p_subrc = 0.
      ENDSELECT.
    ==================================
    best regard
    francoise

    my code
    ===============================================================
    *& Include RSBC_SEL_ROUTINE_TPL
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rssdlrange.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA: ...
    tables : /BIC/SMATERIAL.
    DATA:
    l_s_ztable TYPE /BIC/SMATERIAL,
    l_s_range type rssdlrange.
    $$ end of global - insert your declaration only before this line -
    Fieldname = MATERIAL
    data type = CHAR
    length = 000010
    form compute_MATERIAL
    tables l_t_range structure rssdlrange
    using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW
    i_fieldnm type RSFIELDNM
    changing p_subrc like sy-subrc.
    Insert source code to current selection field
    $$ begin of routine - insert your code only below this line -
    data: l_idx like sy-tabix.
    read table l_t_range with key
    fieldname = '/BIC/MATERIAL'.
    l_idx = sy-tabix.
    clear l_s_range.
    SELECT DISTINCT MATERIAL FROM /BIC/SMATERIAL INTO l_s_ztable.
    l_s_range-iobjnm = '/BIC/SMATERIAL'.
    l_s_range-fieldname = '/BIC/SMATERIAL'.
    l_s_range-sign = 'I'.
    l_s_range-option = 'EQ'.
    l_s_range-low = l_s_ztable-/BIC/SMATERIAL.
    l_t_range-HIGH = l_s_ztable-/BIC/SMATERIAL.
    if l_idx 0.
    modify l_t_range index l_idx.
    else.
    append l_t_range.
    endif.
    p_subrc = 0.
    ENDSELECT.

  • Infopackage-Data Selection Tab Values Get Populated Automatically.

    Hi All,
    In infopackage dataselection tab currently we are entering manually values for 0version info object and process has to be done for 4 differenct infopackagewe are getting a ticket for doing this process for every month.So 0version values would not be unique values ,all the values are different,for instancec10,c99,c11.
    user community felt that this one is a time consuming take they want to customize it and they want to enter the value on their own thorug some custom sap screen.
    we cannot give access to the user for the infopackage selection and all .we have figured out like we have to create a custom t code and give acces to the user for that t code alone.
    If the user enter the 0version value in the front end of it should get reflected in  infopackage dataselection tab.
    It would be really grateful if u have shared ur thought on the same.
    Regards,
    Sakthivel S

    Hi,
    You could use the TVARVC table instead of creating a Z-control table, and allow the users to enter the data into TVARVC via the tcode you are creating.
    So for instance the table entries could be as follows.
    NAME
    SIGN
    OPT
    LOW
    HIGH
    IP_1
    I
    EQ
    V1
    IP_2
    I
    BT
    V3
    V4
    IP_3
    I
    EQ
    V9
    Now, in the first InfoPackage, write the ABAP routine to read the data from TVARVC where the NAME = IP_1. Based on the results the InfoPackage restrictions will be populated by the routine. 
    In the second InfoPackage you read based on NAME = IP_2. And so on. Rest of the routine code is same as in the first InfoPackage.
    This way you can be assured that the different IPAKs will not have overlapping criteria as long as the table entries are correctly maintained.
    Regards,
    Suhas

  • ABAP Routine in the Infopackage data selection

    All,
    I have requirement where i need to write a routine on a Date field(Activity Year Month) which has to return values from the first to the last day of the Previous month in the data selection of the infopackage.
    I know that on Date there is a STD that can be used but my requirement is on Year Month.
    there are 3 vartypes available
    5. free temporal selection
    6. ABAP routine
    7. OLAP variable
    when i pick ABAP routine it asks me to create a routine i need some help with the code here
    Can someone help.
    Thanks

    Hi there
    If the Data field is 0FISCPER you can use the OLAP variable 0P_PRFP1. If you have developed the field yourself i think you need to write code. The code could look something like this.
    DATA:  sysdat TYPE d.
      sysdat = sy-datum.
      sysdat4(2) = sysdat4(2) - 1.
      IF sysdat+4(2) = '0'.
        sysdat+4(2) = '12'.
        sysdat(4) = sysdat(4) - 1.
      ENDIF.
      CONCATENATE sysdat(4) '0' sysdat+4(2) INTO l_t_range-low.
      MODIFY l_t_range INDEX l_idx.
      p_subrc = 0.
    This code returns the previous months as a single value.
    Chris

  • Infopackage "Data Selection" Criteria

    Hello,
    This is a really simple question.
    I want to break out an INIT infopackage from 1 big load to several smaller loads.
    To do this I am going to create multiple INIT infopackages that have selections based upon Fiscal Year, and each infopackage will also include a selection for 0VTYPE of 010.
    The result will be 4 infopackages that have the following selections for Fiscal year/0VTYPE
    1. The beginning of time to 2001      010
    2. 2002    010
    3. 2003    010
    4. 2004 to the end of time    010
    When I create the infopackages under the 'data selection' tab I see "From Value" and "To Value"
    For each infopackage what values should I enter, so that I get the 4 correct infopackages as described above ( I am most concerned about structuring #1 and #4 correctly)?
    Thanks,
    Nick

    Hello Andres,
    I am still testing but things seem to be working well.
    What i did was setup an Delta INIT infopackage for Periods 007/2008 - 012/9999
    Then I built Full (repair) loads for 6 period intervals beneath the INIT.  For example:
    001/2008 - 006/2008
    007/2007 - 012/2007
    001/2007 - 006/2007
    It works nicely to break the load up from 1 gigantic to many smaller loads.  I put all these packages together in a process chain.
    I also found that the load was not slowing down becuase of it being a huge load, it was actually because of the Update rule processing.
    I like the smaller loads in the process chain better then 1 huge load, it is easier to manage.
    I have also addressed the update rule processing issue, so things (will be) operating much better going forward.
    Thanks for the help!
    Nick

  • Routine in Infopackage data selection doesnt give appropriate results...

    Hi Gurus,
    I need to pull data into PSA (BW 3.5) based on a certain selections in the Infopackage. Selection is based on specific values of Infoobject 0PLANT , however, as these values are multiple and do not fall in a specific range I have written a routine to derive these values.
    The routine  does the following steps :
    - creates an internal table from /bio/mplant and deletes the plant values that I do not wish to consider in the extraction.
    - delete data from l_t_range for fieldname = 'PLANT'
    - Appends data from the internal table to l_t_range.
    However, when I execute the infopackage, the extraction is done for ALL the 0PLANT values i.e it includes the data for 0PLANT value which have been delete from the internal table.
    My routine is :
    $$ end of global - insert your declaration only before this line   -
        InfoObject      = 0PLANT
        Fieldname       = PLANT
        data type       = CHAR
        length          = 000004
        convexit        =
    form compute_PLANT
      tables   l_t_range      structure rssdlrange
      using    p_infopackage  type rslogdpid
               p_fieldname    type rsfnm
      changing p_subrc        like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
    TYPES ls_range like l_t_range.
    data: l_idx like sy-tabix.
    DATA: lt_plant like /bi0/mplant OCCURS 0 with header line.
              SELECT PLANT from /bi0/mplant into lt_Plant WHERE objvers = 'A
              ENDSELECT.
              delete lt_plant WHERE plant = 'W206'.
              delete lt_plant WHERE plant = 'WF11'.
              delete lt_plant WHERE plant = 'W945'.
              DELETE lt_plant WHERE plant = 'W530'.
              read table l_t_range with key
                   fieldname = 'PLANT'.
              l_idx = sy-tabix.
              DELETE l_t_range where fieldname = 'PLANT'.
              Loop at lt_plant.
                    l_t_range-sign = 'I' .
                    l_t_range-low = lt_plant-plant.
                    l_t_range-OPTION = 'EQ'.
                    append l_t_range.
              endloop.
              modify l_t_range index l_idx.
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.
    Any bugs in the routines ?

    try this one:
    Loop at lt_plant.
    if lt_plant-plant ne 'WF11' or lt_plant-plant ne 'W945' or lt_plant-plant ne 'W530'.
    l_t_range-sign = 'I' .
    l_t_range-low = lt_plant-plant.
    l_t_range-OPTION = 'EQ'.
    append l_t_range.
    endif.
    endloop.
    or
    don't use a table with header ( use a standard table and use a work area to access the table ) and do an other select like this:
    SELECT PLANT from /bi0/mplant
    into corresponding fields of table lt_Plant
    WHERE objvers = 'A
    and plant ne 'WF11'
    and plant ne 'W945'
    and plant ne 'W530'.
    I hope it helps...
    Kind regard.
    Tobias
    Edited by: Tobias Kreuser on Aug 23, 2010 11:34 AM

  • Can't find 0FYTLFP OLAP Variable in InfoPackage Data Selection tab on 3.5

    On BW 3.5, when generating an InfoPackage with the datasource as Purchasing Data(80PUR_C01), under Data Selection tab, for the InfoObject 0FISCPER, I selected 7 (OLAP variables)for the Type column, then click the button next to it and under the column of Details for Type to bring up a window, but when expending the OLAP Variable field list, can't find the following value in the list which shows up on BW 3.1:
    0FYTLFP     0FISCPER Cumulated to Last Fiscal Year/Period (SAP Exit)
    How to make the above value show up in the OLAP Variable list?   I thought maybe the variable 0FYTLFP needs to be installed in Business Contents, but there is no variable object type in Business Content.  It sounds like a SAP Exit, but how to make the SAP Exit value show up on BW 3.5?
    Thanks for everyone's input!

    hey Rohit,
    Besides the three variable values in the list on BW 3.5, now I find a new one in the list, called "0E_ROLE     0SR_ROLE     Role (SAP Exit)", I have no idea why this one shows up now.  Now all the four variables in the list are:
    1. 0CML12LM     0CALMONTH     Last 12 Months Excluding the Current Month
    2. 0CMONTH     0CALMONTH     Current Calendar Month
    3. 0E_ROLE     0SR_ROLE     Role (SAP Exit)
    4. 0S_RQMRC     0REQUID     Most Current Data
    0FYTLFP is still not in the list!   We can't try to create BEx query since our BW 3.5 system is just installed and we have not got to the step to ceate a query.  I try the 2nd way you suggested by pressing F6 on this variable with the typed in value 0FYTLFP, get the following msg "BEx variable 0FYTLFP could not be evaluated - No error message", that means it would not work on BEx query as well, right? 
    What could be the reason that we can't see 0FYTLFP variable in our new installed BW 3.5?  Do you think our BASIS missed installing sth?
    Thanks
    Message was edited by: Kevin Smith

  • Special Characters in InfoPackage Data Selection

    Hi Experts,
    Is it possible to include special key such as * in the data selection tab in the infoPackage? e.g. *AB
    I have created a custom DataSource to extract all work order with costs data.
    However we only need work order data with revision number that finishes with 'AB' for reporting. (if I do not apply this selection, extracted data will be too big).
    i.e.
        REVNR
        00000012AB --> to be included in extraction
        00000231AB --> to be included in extraction
        00012322AB --> to be included in extraction
        Y07WK06    --> excludes this record
        00000007AB --> to be included in extraction
    Can this be achieve by using '*AB' in the data selection screen?
    Currently, SELOPTS of custom DataSource is been set to '0'. (where can I change this SELOPTS value to something else?)
    If special key is not allowed in the data selection screen, can you suggest any alternative solution?
    Kind regards,
    Steve

    Hi steven,
       Yes you can do this one at info package level by selecting the ABAP Coding at Type (variable change for selective values) at selection tab of info package.
      Here you need write ABAP coding according to your business requirements….
      or
      You can drop unnecessary data at update routine.
    Regards,
    PRK
    Message was edited by: PRK

  • Abap routing in infopackage data selection

    Hi guys
    I'm using an ABAP routin for the Data selection in my infopackage. I want to fetch all the records which is having value Less than 'IN14' for company code.I have modifuied the l_t_range as shown
              l_t_range-sign = 'I'.
              l_t_range-option = 'LT'.
              l_t_range-low = 'IN14'.
              modify l_t_range index l_idx.
    But while executing, its giving the followinf error message.
    "For sel. field 'COMP_CODE', no selection with SIGN = 'I'; OPTION 'LT' allowed"
    Does anybody knows what should be done for this?
    Regards
    Sriram

    Hi Sriram,
    Instead use an OLAP variable to achieve the results you want.
    But first check what are the selection oprions supported by your data source in the table <b>ROOSFIELD</b> in your source system.
    Bye
    Dinesh
    Message was edited by: Dinesh Lalchand
    Message was edited by: Dinesh Lalchand

Maybe you are looking for

  • Need a sollution for a logic

    Hi all, Presently iam developing an ALV report related to MM. I want a logic for calculating previous six months consumed quantity(material).The date for calculating g the quantity is sy-datum.the fields to calculate the qty. are given below. Table- 

  • I want the code to send a mail with attachment

    can u please help me?

  • Exchange Server 2013 Database not showing in ECP after removal of Exchange Server 2010

    I recently complete the migration of my Exchange 2010 server to Exchange 2013. I then proceeded to uninstall the 2010 server using setup.com /m:uninstall. At the end of the process I received an error that it did not complete the uninstall. I checked

  • KMail search not working

    Whenever I do a search in KMail, I always get an empty result set. Nepomuk and email indexing are on. Am I missing something or is the search command broken?

  • System Crash - Manage Site?

    My processor fried but fortunately no files were lost. I have mounted the drive that held all the necessary data for the site I'm working on in a temporary machine. I still have the folder local_sites, that has all the various folders and html pages