Routine at the Infopackage level-Urgent

Hi,
My requirement is I need to write an routine at the infopackage level for the fiscal period which should have the low value as the current period and the high value as current period +12 months.
For example.
As per the system date the
low value should be 2007.09
and the high value shoudl be 2008.09.
Could anyone help me with the ABAP code.Points would be assigned.
Regards,
vamsi

data: l_idx like sy-tabix.
          read table l_t_range with key
               fieldname = 'FISCPER'.
          l_idx = sy-tabix.
data: l_year                like T009B-BDATJ,
      l_period              like T009B-POPER,
      today                 like SY-DATUM.
data: l_fiscperlow like l_t_range-low.
data: l_fiscperhigh like l_t_range-high.
      today = SY-DATUM.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            I_DATE               = today
          I_MONMIT             = 00
            I_PERIV              = 'Z1'
          IMPORTING
            E_BUPER              = l_period
            E_GJAHR              = l_year
        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 l_year l_period+1(2) into l_fiscperlow.
      l_t_range-low = l_fiscperlow.
      l_t_range-high = l_fiscperlow+12.
      l_t_range-option = 'BT'.
      l_t_range-sign = 'I'.
      modify l_t_range index l_idx.
      p_subrc = 0.
          modify l_t_range index l_idx.
          p_subrc = 0.
This is the code which i had written but when i execute the infopackage i am aboe to see only the low value 200709 in the infopackage selections and unable to see the high value,Could any one suggest me if i missed something in the code.
regards,
Vamsi

Similar Messages

  • Routine at the infopackage

    Hi,
    If i write a routine at the infopackage level and if i specify the selection criteria for other infoobjects,they are not taken into consideration while the data is getting loaded.
    Could anyone of you help me as how to handle this.
    Regards,
    Subha

    Hi,
    The selections in the infopackage are the selctions in my routine.
    the code is
      tables /BIC/TZCS_GROUP.
    *data: v_year(4) type c.
      clear l_t_range.
      clear l_t_range[].
      v_year = sy-datum+0(4).
      l_t_range-iobjnm = '0CS_VERSION'.
      l_t_range-fieldname = 'CS_VERSION'.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      l_t_range-low = '100'.
      l_t_range-high = SPACE.
      append l_t_range.
      l_t_range-iobjnm = '0FISCYEAR'.
      l_t_range-fieldname = 'FISCYEAR'.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      l_t_range-low = 2007.
    *l_t_range-low = v_year.
      l_t_range-high = SPACE.
      append l_t_range.
       l_t_range-iobjnm = '0FISCPER3'.
      l_t_range-fieldname = 'FISCPER3'.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      l_t_range-low = 001.
      l_t_range-high = SPACE.
      append l_t_range.
      select * from /BIC/TZCS_GROUP.
        if /BIC/TZCS_GROUP-/BIC/ZCS_GROUP cs 'GROUP'
      or /BIC/TZCS_GROUP-/BIC/ZCS_GROUP cs 'SUBS'
       or /BIC/TZCS_GROUP-/BIC/ZCS_GROUP cs 'WORLD'.
          l_t_range-iobjnm = 'ZCS_GROUP'.
          l_t_range-fieldname = '/BIC/ZCS_GROUP'.
          l_t_range-sign = 'I'.
          l_t_range-option = 'EQ'.
          l_t_range-low = /BIC/TZCS_GROUP-/BIC/ZCS_GROUP.
          l_t_range-high = space.
          append l_t_range.
        endif.
      endselect.
      l_t_range-iobjnm = 'ZCS_GROUP'.
      l_t_range-fieldname = '/BIC/ZCS_GROUP'.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      l_t_range-low = space.
      l_t_range-high = 'XXXXXX'.
      append l_t_range.
      p_subrc = 0.
    or please help me handle this funtionality at the update rule level.
    Points will be assigned
    Regards,
    Subha

  • ABAP routine in the infopackage for Multiple Selection

    Hi experts,
    I want to include a abap routine in the infopackage for Multiple Selection so that I can fetch only the required Material Numbers when the InfoPackage is schedule. As I have the constraints that I have to select certain Material Numbers only, that are not in series - so I cannot select"BT' fuction. Tell me what ABAP Code will work in this scenario.
    Kind regards,
    Rajesh Giribuwa

    Hi,
    The Routine will have to use 'EQ' operator and Append each selections to the Structure.
    ABAP Routine
    InfoPackage definition for Bespoke SIS Structure
    Infopackage routine !
    Regards
    Happy Tony

  • ABAP Routine in the InfoPackage

    Hello,
    I need to write an ABAP Routine in the infopackage to populate the selection conditions automatically. Coding is for Fiscal year/Period and it should be populated as LOW - Pervious period and HIGH - Current period.
    I tried to do the coding myself but couldn't able to fetch the current and previous periods. I would be grateful if some one can share the code with me.
    Best Regards,
    Nene.

    Hello,
    Try this.
    1) Identify the current period by inputting sy-datum to function module  'DATE_TO_PERIOD_CONVERT'.
    2) Find the first day of current period using function module
        'FIRST_DAY_IN_PERIOD_GET'
    3) Minus one day from the first day of current period to get previous period last date.
    4) Call the same function module 'DATE_TO_PERIOD_CONVERT' by inputting the previous period last date (derived in step 3).
    5) Pass the values to the infopackage code.
    $$ begin of routine - insert your code only below this line        -
    data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = '<field name>.
      l_idx = sy-tabix.
      l_t_range-SIGN   = 'I'.
      l_t_range-OPTION = 'BT'.
      l_t_range-LOW    = <previous period> (refer step 4)
      l_t_range-HIGH   =  <current period>  (refer step 1)
      modify l_t_range index l_idx.
    Thanks
    Viswa
    (Assign points if helpful).

  • 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

  • Error While Monitoring the Infopackage Load(URGENT)

    Hi All,
    I am monitoring one Process Chain in that one Infopackage load is going on since 1h 45m , i have checked for the short dumps but there is no time out issue and i am checking the job status R/3 side in SM37 but it saying no job matches with this selection criteria.
    Can anyone please help me out in this isuue.
    Thanks
    karuna

    Hello,  
    Check the background job (SM37) by giving one day before in the BW Side. Also goto RSMO -> Detailed tab and check still IDoc is being received and in the Status tab check the waiting time of the job for cancellation.
    [Thanks|http://chandranonline.blogspot.com/]
    [Chandran|http://chandranonline.blogspot.com/]

  • Selections conditions at the Infopackage

    Hi,
    My Requirement is to load data for the selection conditions of Current month+12 periods and Current Month-24 periods for the Calmonth characteristic by writing a routine at the infopackage level.
    Is there any standared function module for caluclating the year and period using the system date.
    If I use 'DATE_TO_PERIOD_CONVERT' then this would give me the year and period but that needs my fiscal variant.
    Could some pne help me with this.
    Regards,
    Vamsi

    Hi Ajay,
    Could you please tell me whether this code works out for +12 months..
    Data : today like sy-datum,
          current_month(6)  type C,
           I_MONTH    TYPE I,
          I_YEAR     TYPE I.
         data: l_year like T009B-BDATJ,
          l_period like T009B-POPER.
    data: l_fiscperlow like l_t_range-low.
    data: l_fiscperhigh like l_t_range-high.
      today         = sy-datum.
      current_month = today+0(6).
      l_year        = today+0(4).
      l_period      = today+4(2).
    l_fiscperlow = current_month.
        Add 1 to l_year.
            concatenate l_year l_period+1(2) into l_fiscperhigh.
          l_t_range-low = l_fiscperlow.
          l_t_range-high = l_fiscperhigh.
          l_t_range-option = 'BT'.
          l_t_range-sign = 'I'.
    Regards,
    Vamsi

  • Restrcitions at Infopackage level

    Dear All,
    There is an Info package where we have an Infoobject Posting level. We need to restrict some of the postings levels data when coming from the Source cube to the target cube.
    For eg: we have posting level 00,01,02,10,12,20,22. We need to restrict 02,12 and 22 from coming to the Target cube. Can I restrict these at the infopackage level?
    Please suggest.
    Thanks Rama.

    If u use infoapck selections, then enter values other that restriction 02, 12, 22...
    U have to write a routine to restrict at infopackage level....  Check following sample code
    data L_S_MC11VA0ITM like MC11VA0ITM,
    L_tabix like sy-tabix.
    case i_datasource.
    when '2LIS_11_VAITM'.
    loop at c_t_data into L_S_MC11VA0ITM.
    l_tabix = sy-tabix.
    if L_S_MC11VA0ITM-SPART ne '10'.
    Else.
    delete c_t_data index l_tabix.
    continue.
    endif.
    modify c_t_data from L_S_MC11VA0ITM index l_tabix.
    endloop.
    Endcase.

  • The data target is not appeared in the Infopackage under datatagets tab.

    Hi thanks for your response, i  eloboreted my problem below pl see,
    In the Info Cube structure i check the Trassactinal check box, In the Infopackage level under the data targets tab i selected the 'Select data targets' radio button icon but the data target is not appeared in the  table.pl give me a suggetion in which location  can i make a change.
    Thanks & Regards
    Bhaskar

    The same question in data source is not appeared in the Infopackage.

  • Error in infopackage level routine

    hi guys
    I am trying to write a infopackage level routine for dynamic flatfile selection.Im getiing error:Error 1 while loading external data.
    I did like this:
    I am accessing one external harddisk having BW-R3 software installed in it through VM Ware from my laptop.here I saved one flatfile with name DFF_10.10.2009.csv  in D drive.so path becomes  -- D:\DFF_10.10.2009.csv
    then in my infopackage...i wrote code ..here it is
    DATA: XFILE LIKE P_FILENAME .
      CONCATENATE 'D:\DFF_' SY-DATUM '.csv' INTO XFILE .
    P_FILENAME = XFILE .
    now tried to schedule infopackage....to see if it worksand loads data from flatfile.....but it throws error....Error1 while loading external data....
    how can I fix this?
    Thanks in adv,
    Rgds,
    S

    DATA:
      ch1(32) TYPE x VALUE
      '00200120022003200420052006200720082009200A200B200C200D200E200F20',
      ch2(32) TYPE x VALUE
      '10201120122013201420152016201720182019201A201B201C201D201E201F20',
      ch3(60) TYPE c VALUE
      '¿ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¡ ¯ ® ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ '.
    DATA:
      ch4(90) TYPE c VALUE
      'ø ÷ æ ß  ? ? ? ? ? ? ? ? ? ? ? ! ~ `  #'.
    FIELD-SYMBOLS:  TYPE c.
    DATA: l_ZPWRKCTY TYPE /BIC/OIZPWRKCTY,
          l_ZPSTNAMe TYPE /BIC/OIZPSTNAME.
    l_ZPWRKCTY = SOURCE_FIELDS-FIPS_NAME.
      translate l_ZPWRKCTY to upper case.
         RESULT = l_ZPWRKCTY.
      CONDENSE RESULT.
    Exclamation mark is not permitted as a first symbol of the field
    content
      IF RESULT(1) = '!'.
        RESULT(1) = ' '.
      ENDIF.
      CONDENSE RESULT.
    The only # sign is not permitted
      IF STRLEN( RESULT ) = 1.
        IF RESULT(1) = '#'.
          RESULT(1) = ' '.
        ENDIF.
      ENDIF.
    Replace Invalid Characters by SPACE
      ASSIGN ch1 TO .
      TRANSLATE RESULT using ch3.
      TRANSLATE RESULT using ch4.
      CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'
        EXPORTING
          INTEXT                  = RESULT
       IMPORTING
         OUTTEXT                = RESULT.
    Remove leading and trailing blanks if any
      CONDENSE RESULT.

  • What is the significance of create routines found in infopackage?

    hi all,
    Can anyone explain me with an example the significance of create routines found in infopackage - external data tab.
    And as well as writing an abap routine in the data selection tab of the info package.
    regds
    hari

    hi,
    if u want to load only particular values to the particular field... let s say example
    material colour = 'Red'
    by writing routine at infopackge in data selection tab u can achive this
    its just one example
    Check this thread...
    Flatfile renaming logic and upload date logic!
    thanks
    Message was edited by:

  • Change the packet size at infopackage level

    Hi, Experts:
    All loads (full or delta) in the system can split data into small packets expect for one full load, which has almost 2 million records into 1 packet. It overflows the memory and fails.
    I found the following settings for this datasource when click from menu "Scheduler"->"DataS. Default Data Target":
    "Maximum size of a data packet in kByte" = 20000
    "Number of Data Packets per info-IDoc" = 10
    "Number of Data Packages per Delta Request" = 0
    "Update Method" - full Upload
    It seems to me that the load should split data into small packets.
    Can someone please tell me why only this load still puts all 2 million records in one big packet?
    Thanks,
    Jenny

    Some update on more information:
    The datasource is 0FI_GL_8, a standard SAP datasource for transaction data. I think it is an old datasource because I can not find any on-line document for its details from SAP help website. I was told that this datasource is not Delta capable. That is why full load is used.
    I also tried to reduce the package size settings for this datasource from "Scheduler"->"DataS. Default Data Target". But whatever I changed did not affect the way that this load is putting all records in one big data package.
    I assume the set up in Transaction RSCUSTV6 is for every infopackage across the whole system unless setup differently at infopackage level? I checked in RSCUSTV6, it is set up as the following:
    FrequencyStatus-IDOC = 10
    Package size = 30000
    Partition size = 1.000.000
    I also checked in ECC system with transaction SBIW for the control parameters for data transfer from the source system. It has the following set up for the source system:
    Max. (kB) = 20000
    Max. lines = 0
    Frequency = 10
    Max. Proc. = 3
    Max. DPs = 0
    From all the checked results, I still don't get why every other datasource loading can split data into small data packages, but only this one datasource can not. And why whatever I changed from the infopackage to reduce the size did not affect how it is splitting the data package.
    Any more inputs?
    Thanks,
    Jenny

  • Display the Line level details in the Notification - Urgent

    Hi,
    I have developed a Approval Workflow for customized form.
    I want to display the Line level details in the Notification/Message.Please guide me to do this?
    Thanks

    You can make use of the attribute type DOC. See 'To Define a Document Attribute' in the Workflow Development Guide. Then you just include it in the body of the message the same way you do with other attributes.
    Regards,
    Alejandro.

  • Notes at the Item level is not getting Copied

    Hi All,
    When a quotation is copied by clicking on the "Copy" button, the new quotation has all the Notes copied at the header level. But all the Notes maintained at the Item level dosent get copied.
    The Copy control has been maintained between the Item Category (ZAGN to ZAGN) and a Copy Routine 9REVQT is maintained.
    Help in this regard would be appreciated.
    Thanks
    Srinivas

    Hi Thomas,
    Thanks for the reply.
    I tried that but looks like it doesnt work as we are not creating the follow up but copying a quote. Once copied the new quote doesnt have the notes maintained at the item level.
    Could you please tell me what would be the "Reference Text Type" for the notes maintained at the item level (As shown in the attachment)?
    Regards
    Srinivas

  • Cost center field not getting updated to the second level dso

    Hi Experts,
    Data is going from one DSO to other high level DSO where in the source DSO there is cost center filled for a Purchase order but it is not in the target DSO. Target DSO fetches data from 5 DSO's and this is one of them.
    Please suggest.
    Thanks
    Sudha

    Hi Sudha,
    As you say that the load from source DSO to Target DSO is the final load, so question of overwrite does not come into picture.The only point which I feel is that the data might be getting resticted somewhere...
    Is there any routine in the transformation for that field available which will be restricting the load from the source DSO to the target DSO. Is there any start routine available..Please check all these things...
    Hope it Helps,
    Thanks,
    Amit Kr.

Maybe you are looking for