ABAP Rouinte Type 6 In Infopackage Selection

Hi Gurus/Collegues
I have requirement such that
The Infopackage should contain an ABAP routine (Type 6) which will be developed to automatically populate the  Performance week - selection field in the Infopackage when the Infopackage is used.  The value of this field will be given as the( previous Performance week) derived from the BW system date.
Data is moved from CUBE to ODS for the above requirement .
tables: rssdlrange.
Global code used by conversion rules
$$ begin of global - insert your declaration only below this line  -
TABLES: ...
DATA:   ...
$$ end of global - insert your declaration only before this line   -
    InfoObject      = Pf_FWK
    Fieldname       = pf_RT_FWK
    data type       = NUMC
    length          = 000008
    convexit        = PERI6
form compute_Pf_RT_FWK
  tables l_t_range structure rssdlrange
  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 = 'Pf_RT_FWK'.
          l_idx = sy-tabix.
          modify l_t_range index l_idx.
Can Any body tell me fill in that piece of code
Thanks & Cheers.

Try:
data: l_idx like sy-tabix.
data: l_d_week type /BI0/OICALWEEK.
Determine week
CALL FUNCTION 'DATE_GET_WEEK'
   EXPORTING
     DATE = sy-datum
   IMPORTING
     WEEK = l_d_week.
read table l_t_range with key
fieldname = 'PF_RT_FWK'.
l_idx = sy-tabix.
l_t_range-SIGN = "I".
l_t_range-OPTION = "EQ".
l_t_range-LOW = l_d_week.
modify l_t_range index l_idx.
Note that the function module delivers a week with 6 digits (YYYYWW) so check if your function module fits. It should refer to 0CALWEEK.
Best regards
   Dirk

Similar Messages

  • *** Abap Routine in Infopackage selection ***

    Hi !!!
    I have the scenario below:
    I have created an infoobject called CAEMPFF. In the infopackage selection under field 0COMP_CODE I want to create an abap rotine to read all vaules filled in CAEMPFF.
    How can I do that using abap routine ?
    Thanks in advance,
    Leandro.

    Hi Leandro,
    In the infopackage, under 0comp_code (or probably field BUKRS if it's an ERP datasource), you should select ABAP routine (6) under Type field. Then, you'll be prompted to create the routine.
    There you should create a program that reads all the values of your infoobject master data table.
    Hope this helps.
    Regards,
    Diego

  • Infopackage Selections Tab-OLAP Variable/ABAP Routine

    Hi Experts
    In my Infopackage Selections Tab i had Cal Mon/Year field....
    As per my requirment i have to write a selection condion that when we execute info package (it is a monthly data load)  it will extract data only for the months greater than or equal to current month
    Please update me on how can i achieve this either by using OLAP Variable or ABAP Routine in infopackage...will be great if can provide the required ABAP Code
    Thanks in Advance

    here's an example that fills the fiscal year from last month (bold is customer code... the rest is standard):
      data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = 'PARAM_P_GJAHR'.
      l_idx = sy-tabix.
      data:
      v_caldy type /BI0/OICALDAY,
      v_calmn type /BI0/OICALMONTH,
      v_calyr type /BI0/OICALYEAR.
      v_caldy = sy-datum.
    determine first day*
      v_caldy+6(2) = '01'.
    determine last month*
      subtract 1 from v_caldy.
      v_calyr = v_caldy(4).
      l_t_range-sign   = 'I'.
      l_t_range-option = 'EQ'.
      l_t_range-low    = v_calyr.
      modify l_t_range index l_idx.
      p_subrc = 0.

  • ABAP routine at Infopackage selection options

    Dear all,
    I need to write ABAP Routine at InfoPackage Selection Options.
    Requirement is to bring only the versions (contains 2 characters) starting with 'C'.
    Ex. I need versions CR, CP...
    Code template is the following:
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'VERSB'.
    l_idx = sy-tabix.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Can anybody help me to resolve this?
    Regards

    Hi,
    here is an example:
      DATA: string(40) TYPE c.
      CONCATENATE 'C' '%' INTO string.
      SELECT *
      FROM /bi0/hwbs_elemt
      INTO TABLE lt_hwbs_elemt
      WHERE nodename LIKE string.
    Best regards,
    Frank

  • The fields of type Int 1  not appearing in Infopackage selection

    Hello Gurus,
    I have created a generic datasource on two tables .
    The fields that should be set as Selection fields for the DataSource are the following:
    -     field 1------type char
    -     field  2----
    type char
    -               field 3----
    type Int1
    -     field 4----
    type Int1
    Out of the above four table fields only the two fields  with char datatype are appearing in infopackage selection.
    The other two ie(field 3 and field 4) of datatype Int1  does not appear in infopackage selection.
    I have ticked the check boxes in the selection field of datasource.
    I also get all the four fields available for selection in RSA3(extractor checker tcode).
    Kindly help me in resolving this issue.

    Hi Amol,
    Can you please replicate DS once again and then try creating the infopacage
    Mann

  • 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

  • OLAP Variable with user exit for Infopackage Selection 0fiscper

    Hi Frds/ Guru's ,
                    I have a requirement to use a OLAP Variable for Fiscal year period 0fiscper(Characteristic ) in the Infopackage Selection. . I need to extract the data for Previous Year and Current Year , that is to be automatically selected with a OLAP Variable . The standard one's provided by SAP are not satisfying my requirement,as they are getting populated with SAP Exit and I am not getting the ranges .I am planning to create a variable and use the processing type as Customer Exit and Populate it with ABAP code in respective Enhancement RSR00001.
    Even Can I create a ABAP Routine ? Please suggest me which is better to do in respect to performance of dataload  , will be really glad if anyone can provide some code for doing this as u might have faced the situation sometime .
    I have checked with all the threads available , could get some idea but will be really thankful if u gimme some hints in writing the code , at Exit level and routine level .
    Thanks,
    Krish

    thnx

  • InfoPackage selection offset with OLAP variable

    Hi Bw Gurus,
    I have a requirement to load ODS with full upload everytime but in order to reduce repeated loads I am trying to use a DATE field which is not part of communication str. as a selection critera in InfoPacakge.
    I changed DS to include this field avaialable for selection and It's working fine when I input date to and from values hard coded in InfoPackage.
    Further I am trying to automate this InfoPackage scheduled weekly and I need to include date offset value for this DATE field to load for additional last 2 weeks every time to capture changes for already loaded data.
    I have created OLAP customer exit variable having Date interval for Date starting from last 3 weeks to Current DAte and included in InfoPackage selection for DATE field but it's not working. By the way if someone can explain what's meaning for two columns there for TYPE(Variable change to selection.....) and detail for type.
    Any clue for reason or any other way to accomplish this requirement?
    Thanks in advance,

    hi,
    can you explain me ,hw you solved the pbm,
    the same pbm i am facing.
    i am trying to load the data everyweek ( i have date field ),so i have selected OLAP Variable option -7 and there i have selected 0WEEK,but data is not comining from R/3,then i have selected the option -6 abap code,i have written code to get the date range,even though i am not able to retrive the data.
    can you suggest me
    Thanks
    Madhu

  • Routine in Infopackage selection

    Hi,
    We are using DB Connect and hence we need to write a routine in Infopackage selections to restrict the data to be extracted.
    In the source file, there is a field called " Time stamp".
    This is a Char 23 field with mm-dd-yyyy-hh.mm.ss.sssss format.
    My requirement is lookinto first 10 char ( only for date) and filter the records.  If the date = Sy-datum, then only, i want to extract the data in BI staging.
    Is it possible to write a routine in Infopackage ?   Can you pls help me ?
    Or do i need to take the whole data into PSA and then write a routine in transformation while uploading to Data Target ?
    Regds,
    BW Small

    Hi,
    See the below code for Including  0FISCPER dynamically, so in that way you can write code to get your selection or change the data formate etc.., show this code to ABAPer ask according to this code implement your logic.
    In below code I'm calculating  0FISCPER based on Sy-Datum using FM.
    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:   ...
    *$*$ end of global - insert your declaration only before this line   *-*
    *     InfoObject      = 0FISCPER
    *     Fieldname       = FISCPER
    *     data type       = NUMC
    *     length          = 000009
    *     convexit        = PERI7
    form compute_FISCPER
      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        *-*
      DATA: l_idx LIKE sy-tabix,
            zzdate LIKE sy-datum,
            zzbuper LIKE t009b-poper,
            zzbdatj LIKE t009b-bdatj,
            zzperiod(7) TYPE c.
      READ TABLE l_t_range WITH KEY
           fieldname = 'FISCPER'.
      l_idx = sy-tabix.
      zzdate = sy-datum - 1.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date               = zzdate
    *             I_MONMIT             = 00
          i_periv              = 'V3'
               IMPORTING
         e_buper              = zzbuper
         e_gjahr              = zzbdatj.
    *           EXCEPTIONS
    *             INPUT_FALSE          = 1
    *             T009_NOTFOUND        = 2
    *             T009B_NOTFOUND       = 3
    *             OTHERS               = 4
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CONCATENATE zzbdatj zzbuper INTO zzperiod.
      l_t_range-low = zzperiod.
      l_t_range-option = 'EQ'.
      l_t_range-sign = 'I'.
      MODIFY l_t_range INDEX l_idx.
      p_subrc = 0.
    *$*$ end of routine - insert your code only before this line         *-*
    endform.
    Thanks
    Reddy

  • Email Alert for Process Chain for ABAP Process Type

    Hi BW Experts,
                             I created a process chain based on ABAP Process Type ( for Broadcasting rsrd_broadcast_starter). I want to add alert message for each ABAP process if it is failed. But I cant see any option showing Successfull or Error or Always when I select create message option on the process type. How ever I can see for other process chain which is loading data (Process Type is Info Package ) from SAP into BW.
                             Please some one tell me why it is not showing alert message for ABAP Process Type.
    Thanks
    Ganesh Reddy.
    Edited by: Ganesh Reddy on Jul 13, 2009 10:16 PM

    I dont have the exact answer for your question, But as a work around i can suggest you that.
    If these ABAP programs are included in a chain and this local chain is a part of meta chain then you can create a message on the local chain.By right clicking on the local chain >Create Message>Success
                                                                                    --->Failure
    >Always
    Hope this resolves the problem tempervorly.I will get back to you once i have
    Or the permanent solution is
    Its big and also easy method to perform, by this you will be able to get all the options for a ABAP Program also.If you have any questions please let me know.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/a-c/creating%20an%20abap%20process%20type%20for%20process%20chains%20in%20bi.pdf

  • InfoPackage Selection - Logical OR

    Is there any way to enable a Logical 'OR' in an InfoPackage on 2 fields? When both fields are populated by respective ABAP routines, the result condition turns out a Logical 'AND'.
    I have two timestamp fields, in InfoPackage Selection TS1 and TS2 intervals. I have routines on both of them. How can I enable the system to generate my selection to be an OR meaning either TS1 interval OR TS2 interval. The way it is behaving now is TS1 interval and TS2 interval.
    I am using BW 7.1 and DB Connect interface in this case.
    Thanks.

    I don't need this anymore but if anyone has ideas, please feel free to chime in as it can benefit the community.

  • ABAP Data type to XI data type mapping

    Hi,
    I am creating a message type in XI corresponding to a ABAP structure. There are couple of data types on the ABAP side (for example: RAW, QUAN, CURR CUKY, UNIT, NUMC etc) which i have no idea on what it should be mapped to on the XI side(xsd:string, xsd:token, xsd:int etc).
    Is there is any document on mapping from ABAP data type to XML data type ? if yes please send it across.([email protected])
    if no doc available, if some body could let me know what these ABAP data type would map on the XI side it would great.
    Best Regards,
    Kiran

    Hi Kiran,
    just some more background information to the data types CURR, CUKY, QUAN, UNIT:
    1) Each field of data type CURR must be assigned to a field of data type CUKY (the financial amount must be assigned to a currency) and each field of data type QUAN must be assigned to a field of data type UNIT (each quantity must have a dimension). If you want to know this assignment for your specific ABAP structure, you can find it using transaction SE11 with your ABAP structure and go to the tab <i>Currency/Quantity fields</i>. Here you find the information under <i>Reference table</i> and <i>Ref. field</i>.
    2) The default number of decimals for a field of data type CURR is 2, but this can be overwritten by the assigned CUKY field. You can check the actual number of decimals for a specific currency with transaction OY04. Here are all currency list that do <b>not</b> have 2 decimals.
    3) The default number of decimals for a field of data type QUAN is 3, but this can be overwritten by the assigned UNIT field. You can check the actual number of decimals for a specific unit with transaction CUNI. Click on <i>Units of measurement</i> (pick the correct dimension first), double click on your unit and you find the info in the field <i>Decimal places</i>.
    4) Depending on the data you receive your conversions can get quite tricky. Lets take as an example a field of type CURR. If you find the value 1000 in there, this would convert to 10.00 USD if the assigned CUKY field contains the value USD (US dollar). But the same value ca represent 1000 JPY (Japanese Yen) if the assigned CUKY field contains the value JPY. What i try to say is that the value in the field of type CURR alone does not give you the actual amount, you have to know the value of the CUKY field as well. Similar for QUAN and UNIT.
    Regards,
    Claus

  • ABAP Dictionary type FLTP is not allowed for screen element

    Hi Experts
    I tried to open VBFA in se16 and i got the message in the status bar like this , what does it mean. please explain.
    "ABAP Dictionary type FLTP is not allowed for screen element"

    Hi,
        This is from help
    ABAP Dictionary type FLTP is not allowed for screen element
    Message no. 37048
    <b>Diagnosis</b>
    The format of the ABAP Dictionary field is only for use within the ABAP
    program and cannot be used in the Screen Painter.
    <b>Procedure</b>
    The field cannot be used in screens. If you want to output the
    information in the field or assign a value to the field from the screen,
    you must use an intermediate field with an appropriate format.
    <b>Reward points</b>
    Regards

  • ABAP Dictionory type FLTP is nt allowed for  screen Painter!!

    Hello All,
    ABAP Dictionary type FLTP is nt allowed for  screen Painter!!  am getting this error message if am giving some input.
    Thanks
    santu
    Edited by: santu4u on Oct 23, 2009 1:48 PM

    Hi
    Instead of FLTP use Quantity or Currency or Packed Decimals type fields for the Screen Elements.
    While you save the data into the database if the database field is of type FLTP the values entered would be automatically converted into FLTP type. We need not take care of this.
    ---?? What do you mean by IDES version --->
    You mean in SE11 or SE16, Wherever it may be you can not use FLTP type on Screen Fields.
    This is Standard SAP Procedure, As mentioned Above you can use Packed Decimals or Currency or Quantity Fields
    Cheers
    Ram
    Edited by: Ramchander Krishnamraju on Oct 23, 2009 2:10 PM
    Edited by: Ramchander Krishnamraju on Oct 23, 2009 2:13 PM

  • ABAP Table Type in RFC Callable Object in GP

    Hi Experts,
    I have created a RFC in ABAP that has as one of its export parameters a table type. I am trying to call this RFC in my GP process. So I created the external service callable object as required. However, when I look at the output parameters for the callable object, the table type is not shown as a list (the is list column is not checked for this parameter).
    Do you know if ABAP table types is supported/recognized by GP as a list? or is this a limitation?
    Any help is welcomed!
    Thanks in advance.
    Robert

    Hi Aneel,
    You can try the following:
    e.g.
    for j = 1 to ActiveCell.SpecialCells(11).Column
      oParam4.Rows.Add
      if j=1 then oParam4.Value(j, "NAME") = ActiveSheet.Cells(1,j).Value
      if j=2 then oParam4.Value(j, "TYPE")  = ActiveSheet.Cells(1,j).Value
      if j=3 then oParam4.Value(j, "NUMB") = ActiveSheet.Cells(1,j).Value
    next j
    Regards,
    ScriptMan

Maybe you are looking for

  • Is there any valid reason why Wifi calling is not enabled and we have to wait until mid 2015?

    It seems like it shouldn't have anything to do with the carrier since its completely off their network. It is a feature and function of the device. I've been living in a dead zone for over a year and was excited to hear Wifi calling was coming with t

  • Input Not Supported

    I was in my mac mini playing with the display settings and I clicked on one that was way to big for my monitor. Now its not coming up at all. I can see the screen when it boots up, however when it gets to the OS, the screen goes to a blank black scre

  • How to attach a MP4 file to email in Mail?

    How do I add a MP4 video file to an email? When I drag or use the "attach file" process in Mail I keep getting a "Missing Plug-in" message. The file opens in Quick Time Player on my iMac and runs just fine. The MP4 is a Holiday Greeting from my grand

  • Jms c api for weblogic

    How to access jms queue of weblogic server from c/c++ application.Can any one provide example for this.I have tried to download jmscapi from http://dev2dev.bea.com/resourcelibrary/utilitiestools/environment.jsp#jmscapi but the page is not available.

  • JS CS4: strokeDashAndGap question

    var myOutsideGuide_Left = app.activeDocument.pages[0].graphicLines.add (app.activeDocument.layers.item ("Die")); myOutsideGuide_Left.geometricBounds = ["0 in", "3 in", "10 in", "3 in"]; myOutsideGuide_Left.strokeDashAndGap = ["3 p", "3 p","3 p","3 p"