Routine coding in infopackage

Hi ABAP fans
I need to extract the data package from the current day (sy-dat).
The only availabe date field in the source system has a length of 14: YYYYMMDDHHMMSS.
I would like to extract via this field, but need to manipulate it in the way of sy-dat, the current day, YYYYMMDD.
How is the correct coding for the routine of an infopackage?
Thanks

Hi,
here your source field is timestamp
so if you want to restrict data for 20110101 then
you need to use range 20110101000000 to 20110101235959.
Kindly use below code.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'fieldname'.
l_idx = sy-tabix.
Data : L_TS(14),
          H_TS(14).
Concatenate SY-DATUM '000000' into l_ts.
Concatenate SY-DATUM '235959' into h_ts.
l_t_range-SIGN = 'I' .
l_t_range-OPTION = 'EQ' .
l_t_range-LOW = l_ts.
l_t_range-LOW = h_ts.
Modify l_t_range index l_idx.
p_subrc =0.
Kindly note that this is just psudo code, so it might have some error.
pls check it before use.
Regards,
Ashish

Similar Messages

  • 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).

  • 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:

  • 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

  • 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

  • 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

  • How debug a routine created in InfoPackage for Data selection ?

    Hi everybody,
    I decide to debug a routine create in InfoPackage.
    Here, the name of my ABAP routine:
    program conversion_routine
    form compute_TREATMENT_DATE
    When i execute the "/h" command to launch debugger, i don't see this routine in Call Stack...
    How i can debbug ?
    Any suggestions ?
    Thanks in advance,
    Best regards,
    Rodolphe.

    Debug ABAP Routine in InfoPackage:  
    Put a loop on the routine,
    data : debug(1).
    do.
    if debug = 'X'.
    exit.
    endif.
    enddo.
    And when run infopackage, go to sm50.
    On that process, menu program->debug program.
    In debug screen, type in debug, and fill with X and click 'edit'-pencil icon.
    F5 to next step.
    hope this helps...

  • How debug a routine create in InfoPackage for Data selection ?

    Hi everybody,
    I decide to debug a routine create in InfoPackage.
    Here, the name of my ABAP routine:
    program conversion_routine
    form compute_TREATMENT_DATE
    When i execute the "/h" command to launch debugger, i don't see this routine in Call Stack...
    How i can debbug ?
    Any suggestions ?
    Thanks in advance,
    Best regards,
    Rodolphe.

    Debug ABAP Routine in InfoPackage:  
    Put a loop on the routine,
    data : debug(1).
    do.
    if debug = 'X'.
    exit.
    endif.
    enddo.
    And when run infopackage, go to sm50.
    On that process, menu program->debug program.
    In debug screen, type in debug, and fill with X and click 'edit'-pencil icon.
    F5 to next step.
    hope this helps...

  • 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

  • Convert BW3.x Start routine coding into BW 7.0

    The reversal load Update Rules (ICS  IC_TR) Start Routine
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ZCHAR_SUBST.
    DATA: sy_tabix like sy-tabix .
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CS8ICS.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
      loop at DATA_PACKAGE .
        sy_tabix = sy-tabix .
        select single *
          from ZCHAR_SUBST
          where OLD_CHAR = DATA_PACKAGE-/BIC/CURR_CHAR .
        if sy-subrc is initial . " Candidate for a treatment
          DATA_PACKAGE-/BIC/KF1 = DATA_PACKAGE-/BIC/KF1 * ( -1 ) .
          DATA_PACKAGE-/BIC/KF2 = DATA_PACKAGE-/BIC/KF2 * ( -1 ) .
          modify DATA_PACKAGE index sy_tabix.
        else .
          delete DATA_PACKAGE index sy_tabix.
        endif .
      endloop .
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Start Routine for reversal load
    Pls tell me how to write code for this.
    Thanks
    Gaurav Sekhri
    We are not here to do your job. Please search SDN how to convert a 3.X code to BI7
    Edited by: Pravender on Jul 27, 2010 1:29 PM

    Hi
    There are 2 approached for migration
    1) Top down appraoch: here we start from top ( update rules) to bottom ( datasource) . In this approach Infosource is mandatory and all the routines will be taken care by the system no need to do anything manually.
    2) bottom up approach : here we start from bottom ( datasource) to top ( update rules) . here Infosource is optional and once you migrate 3.x datasource all the transfer rules will get deleted so we need to record the transfer some where before mirgration. here we have to write maually the code invlolved in the transformation in BI 7.0 terminology.
    Note: In bottom up approach it is better to use migration with export so that you can restore the datasource back to 3.x whenever any unexpected problem occurs.
    You can do this By using the T code RSDS
    Santosh

  • Infopackage routine for changing  file name

    Hi Everyone,
                               I have to load flat files from application server directories. I get these files from different locations and they are saved in own (location) folders by a script). I would like to run these file from infopackage through process chain. the problem is that these files have changing names. The format is like this
    Canada_co3300.csv
    I can write a routine is my infopackage but  "co3300" keeps changing as it represents different companies code in that particular location (Canada).
      I have a routine
    data: F1 type string value 'D:\usr\sap\FLAT_FILES\Inbound\Cayman\Canada_<b>co3300</b>_',
    F2 type string '.csv'.
    concatenate f1 f2 into p_filename.
      How can I get a variable <b>co</b>---- in my routine so my infopackage can read the file if <b>co</b> has different value like co2000. Thanks In advance.
    Regards,
    Asad

    Hi Saugata,
                           My flat file name has a naming convention based on company code in application server folder, so I get files with name
                                               Canadaco<b>3000</b>.csv  or
                                               Canadaco<b>2000</b>.csv or
                                               Canadaco<b>4000</b>.csv or something else <b>(co</b> number keeps changing)
    So My file name keeps changing all the time. I would like my infopackage to read these files automatically thorugh a routine or logical file name. I have tried both, but donot know how to configure this scenerio thorugh my infopackage. Please give me steps to use that table you mentioned. Thanks .

  • Call function in abap routine of infopackage

    Experts,
    Good day. I have a problem concerning the data to be imported in my ods.I can't find a similar thread corcerning my problem. My ‘File date’ field should contain only 2 years and 3months data of recent data. I'm using a call function fima_date_create to filter values of zfile_date.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        I_DATE                             = sy-datum
        I_FLG_END_OF_MONTH   = ' '
        I_YEARS                          = 2-
        I_MONTHS                        = 3-
        I_DAYS                             = 0
        I_CALENDAR_DAYS          = 0
        I_SET_LAST_DAY_OF_MONTH       = ' '
      IMPORTING
        E_DATE                             =
        E_FLG_END_OF_MONTH   =
        E_DAYS_OF_I_DATE         =   
    The sy-datum becomes the “High” value and the date generated by this FM will be the “low” value. I already tested this function module and it is what i want. How Should I write the ABAP code for this in the abap routine for my infopackage? Or what steps do I need to take.

    Hi,
    When you choose the option to write a routine for one of the characteristics in the infopackage selections, you get a window to write your code with some prewritten code as below. Modify it as shown below, for your requirement.
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'CALDAY'.
    l_idx = sy-tabix.
    START of YOUR CODE
    <----
    Required logic -
    >
    L_T_RANGE-LOW  = <lower limit of range>.
    L_T_RANGE-HIGH = <upper limit of range>.
         L_T_RANGE-SIGN = 'I'.
         L_T_RANGE-OPTION = 'BT'.
    END of YOUR CODE
    modify l_t_range index l_idx.
    p_subrc = 0.
    Hope this helps.

  • ABAP routine in Infopackage

    I am in the process of creating an ABAP routine in the Infopackage to load current month based on system data from one cube in BW to another Cube in BW. I am getting the following error in the load. I am not an ABAPer and would appreciate if you can help or guide me with a sample code.
    Here is the error.
    For sel. field '/BIC/Z_APOSNAP', no selection with SIGN = ''; OPTION '' allowed.
    Thank you
    Neelu

    Hi Neelu,
    U can create a ABAP Routine of the type 6 (ABAP Routine),The field you are trying to populate is a select-option so you have to define both Sign and Option along with Low and High values.
    As u want to load current month, from a system values , u can do it from sy-datum.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = ''/BIC/Z_APOSNAP'.
                l_idx = sy-tabix.
                l_t_range-low = 
                l_t_range-high = 
                l_t_range-sign =
                l_t_range-option =
          modify l_t_range index l_idx.
              p_subrc = 0.
    Just u can fill Sign as 'I' and Option 'EQ'.
    Fill Low and High with values u get from System Data.
    Hope this Helps,
    Thanks,
    Krish
    **awarding points is way of saying thanks in SDN.

  • Use ABAP Routine in Selection Tab of Infopackage

    I am trying to use the ABAP routine in the InfoPackage SELECTION Tab to "EXCLUDE" a value. For example, I want to load all the Material types, except ZUN1. But, when I write in the ABAP, l_t_range-sign = 'E' instead of 'I' or l_t_range-option = 'NE' instead of 'E', I get an error saying these values are not permitted.
    Is there any way to exclude any value from Selection in the InfoPackage?
    Regards,
    Milind Vad

    Hi dear and welcome on board!
    You have two options:
    include everything you want in your IP
    load everything and exclude what you don't want in the start routine in transfer rules
    No other ways...
    Hope it helps!
    Bye,
    Roberto
    ...and please don't forget to reward the answers...it's THE way to say thanks here !

  • ABAP Routine using Table: TVARVC in InfoPackage

    hello...i wanted to create an ABAP Routine in the InfoPackage and I am not good in ABAP Routine. I wanted to pull the data of the "selection value" from the TVARVC table to fill in the "Calendar Day" selection option in the InfoPackage. The selection option for the calendar day should be able to pull out the data from the TVARVC table and save the InfoPackage to load the data based on the selection value. Actually what can I do to archieve this???

    Hello
    You ABAP code is quite right, but there is only one little thing wrong :
    Define i_keyfind LIKE TVARVC   (as a structure)
    Don't DELETE l_t_range, you just have to modify the line.
    SELECT LOW FROM TVARVC into i_keyfind-low WHERE NAME = 'ZTEST'.
    IF sy-subrc eq 0.
    l_t_range-low = i_keyfind-low.
    ENDIF.
      IF l_idx <> 0.
        MODIFY l_t_range INDEX l_idx.
      ELSE.
        APPEND l_t_range.
      ENDIF.
    It should work with this.
    Kind Regards
    Mickael

Maybe you are looking for