Routine in InfoPackage for flatfile loading

Hi Friends,
Can you give be possiblesolution for my scenario.
I am getting a flatfile from a Third Party source and I am loading the data into a Cube.
Recently, we have identified that we are getting duplicate data in the file for the same week.And I am calculating the Calweek based on that date.
For ex:For week 35, I have same data for date 07/23, 07/24,07/25.When I pull my report for that week, I am getting trippled data in my report.
So my requirement is to ignore two dates in that file and load only one date's data.
Can you tell me how to do that?
Thanks in advance
Priya

Adding additional key field will be the option in addition to writing some abap code. In your abap code, you could get the 0CALWEEK of the date field and store it in internal table when loading data, then every time you update, you need to read the internal table to make sure that the data is not updated, if it is, then you need to skip.
And also if you want to add key in your ods and but don't want to change the existing ods, then you can create another ods with overwrite option which will update to the ods you have now.
I would recommend changing key of the ods instead of using abap code which will make the loading process slower.
thanks.
Wond

Similar Messages

  • ABAP Routine in InfoPackage for selection

    Hello,
    I have 2 InfoPackages for loading from ODS1 to ODS2. InfoPackage 1 is restricted via ABAP Routine to load only certain customer numbers.
    InfoPackage 2 is supposed to load all other customer numbers - therefore the ABAP Routine makes ranges that exclude the customer numbers selected in InfoPackage 1.
    Now I face the fact that the selection of InfoPackage 2 is much to small in numbers. Problem is, the ranges only work when entered manually - but via ABAP entry these ranges don`t work. I can`t understand why this problem happens. Do you have an idea?
    Example (first number is from, 2nd number is to)
    InfoPackage 1:       customer numbers     
    5| 5
    100|100
    999|999
    InfoPackage 2: customer numbers
    0|4
    4|99
    101|998
    1000|99999
    But selection of InfoPackage 2 does not work propberly...
                                                                                    Thanks for your help,
    Angelika

    Hi,
    no, that was just a typing mistake. Sorry.
    The problem is, that in Monitoring I can see the selection and it looks good.
    But when I check the number of datasets selected it is far to small. Therefore I don`t believe the selection works.
    I tried manually to put all the ranges selected by ABAP Routine in InfoPackage 2 in another InfoPackage 3 - the selection is identically to InfoPackage 2 (but not made via ABAP, but manually) and in Monitoring the selection looks absolutly alike.
    But the manuall InfoPackage 3 selects far more records than InfoPackage 2.
    I can`t understand the problem. Can you? Can you give me advice?
    Thanks,
    Angelika

  • Routine in infopackage for selection

    I am writing an ABAP routine in an infopackage to select data upto a certain year. I want to load data for all the years upto 7 years ago. However, if I leave the l_t_range-low blank, the infopackage throws an error when I run it saying invalid date range. What's the right way to assign the low value?
    l_year = sy-datum(4) - 4.
    l_t_range-sign    = 'I'.
    l_t_range-option  = 'BT'.
    l_t_range-low     = ''.
    l_t_range-high = l_year.
    modify l_t_range index l_idx.

    Hi Uday
    Add l_t_range-low = sy-datum(4). Also i see that in l_year you have defined it as sy-datum(4) - 4. So you are only picking latest 4 years. Please change it to 7 if you want the latest 7 yrs.
    Regards,

  • ABAP ROUTINE AT INFOPACKAGE FOR DATE RANGE

    hi all,
    I want to Schedule my infopackge with selection options 
    0DATE  infoobject with First date of current month( 01.02.2008)  to last date of current month ( 29.02.2008).
    this i have to get automatically bcoz i have to use this in process chain.
    so I want to write a routine for this at the infopackage level with ABAP Routine -6 option.
    So please suggest me how to write the code for this case.
    thanks,
    kiran manyam.

    Hi Kiran,
    Please paste the following code there and also check for syntax error.
    data first_date type d.
    data last_date type d.
    first_date = sy_datum.
    first_dat+6(2) = '01'.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
    Exporting
    DAY_IN = first_date
    Importing
    LAST_DAY_OF_MONTH = last_date.
              read table l_t_range with key
                   fieldname = 'DATE'.
               if sy-subrc = 0.
                   l_idx = sy-tabix.
                   l_t_range-sign = 'I'.
                   l_t_range-option = 'BT'.
                   l_t_range-low = first_date.
                   l_t_range-high = last_date.
                   modify l_t_range index l_idx.
                else.
                   move 'DATE' to l_t_range-fieldname.
                   l_t_range-sign = 'I'.
                   l_t_range-option = 'BT'.
                   l_t_range-low = first_date.
                   l_t_range-high = last_date.
                   append l_t_range.
                   endloop.
                endif.
              p_subrc = 0.

  • What are the settings for datasource and infopackage for flat file loading

    hI
    Im trying to load the data from flat file to DSO . can anyone tel me what are the settings for datasource and infopackage for flat file loading .
    pls let me know
    regards
    kumar

    Loading of transaction data in BI 7.0:step by step guide on how to load data from a flatfile into the BI 7 system
    Uploading of Transaction data
    Log on to your SAP
    Transaction code RSA1—LEAD YOU TO MODELLING
    1. Creation of Info Objects
    • In left panel select info object
    • Create info area
    • Create info object catalog ( characteristics & Key figures ) by right clicking the created info area
    • Create new characteristics and key figures under respective catalogs according to the project requirement
    • Create required info objects and Activate.
    2. Creation of Data Source
    • In the left panel select data sources
    • Create application component(AC)
    • Right click AC and create datasource
    • Specify data source name, source system, and data type ( Transaction data )
    • In general tab give short, medium, and long description.
    • In extraction tab specify file path, header rows to be ignored, data format(csv) and data separator( , )
    • In proposal tab load example data and verify it.
    • In field tab you can you can give the technical name of info objects in the template and you not have to map during the transformation the server will automatically map accordingly. If you are not mapping in this field tab you have to manually map during the transformation in Info providers.
    • Activate data source and read preview data under preview tab.
    • Create info package by right clicking data source and in schedule tab click star to load data to PSA.( make sure to close the flat file during loading )
    3. Creation of data targets
    • In left panel select info provider
    • Select created info area and right click to create ODS( Data store object ) or Cube.
    • Specify name fro the ODS or cube and click create
    • From the template window select the required characteristics and key figures and drag and drop it into the DATA FIELD and KEY FIELDS
    • Click Activate.
    • Right click on ODS or Cube and select create transformation.
    • In source of transformation , select object type( data source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
    • Activate created transformation
    • Create Data transfer process (DTP) by right clicking the master data attributes
    • In extraction tab specify extraction mode ( full)
    • In update tab specify error handling ( request green)
    • Activate DTP and in execute tab click execute button to load data in data targets.
    4. Monitor
    Right Click data targets and select manage and in contents tab select contents to view the loaded data. There are two tables in ODS new table and active table to load data from new table to active table you have to activate after selecting the loaded data . Alternatively monitor icon can be used.
    Loading of master data in BI 7.0:
    For Uploading of master data in BI 7.0
    Log on to your SAP
    Transaction code RSA1—LEAD YOU TO MODELLING
    1. Creation of Info Objects
    • In left panel select info object
    • Create info area
    • Create info object catalog ( characteristics & Key figures ) by right clicking the created info area
    • Create new characteristics and key figures under respective catalogs according to the project requirement
    • Create required info objects and Activate.
    2. Creation of Data Source
    • In the left panel select data sources
    • Create application component(AC)
    • Right click AC and create datasource
    • Specify data source name, source system, and data type ( master data attributes, text, hierarchies)
    • In general tab give short, medium, and long description.
    • In extraction tab specify file path, header rows to be ignored, data format(csv) and data separator( , )
    • In proposal tab load example data and verify it.
    • In field tab you can you can give the technical name of info objects in the template and you not have to map during the transformation the server will automatically map accordingly. If you are not mapping in this field tab you have to manually map during the transformation in Info providers.
    • Activate data source and read preview data under preview tab.
    • Create info package by right clicking data source and in schedule tab click star to load data to PSA.( make sure to close the flat file during loading )
    3. Creation of data targets
    • In left panel select info provider
    • Select created info area and right click to select Insert Characteristics as info provider
    • Select required info object ( Ex : Employee ID)
    • Under that info object select attributes
    • Right click on attributes and select create transformation.
    • In source of transformation , select object type( data source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
    • Activate created transformation
    • Create Data transfer process (DTP) by right clicking the master data attributes
    • In extraction tab specify extraction mode ( full)
    • In update tab specify error handling ( request green)
    • Activate DTP and in execute tab click execute button to load data in data targets.

  • 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

  • Include for Routine in Infopackages

    Hi All,
    i created a routine in infopackage. The extraction is working as expected.
    We have several Infopackages which should work with the same logic.  That means i have to copy the routine in all IP.
    I would like to avoid that by inserting  the routine in an include so that by changing something, the chnage should be central.
    I could i do it?
    Thanks

    Hello,
    you can write a universal routine in se38 and call it in all your IP. You can also implement OOPs concept and use a global class for your requirement. Goto tcode SE24 and declare the class with methods. Call this class in all your IP.\
    Else you can write a global routine in SE38 (INCLUDE) and call this include in all your IP. This what we are doing in our project where we need to implement the same logic in all 10 IPs. We declared a subroutine and call this subroutine every where.
    Regards,
    satyam

  • Wht is the relevant for BW Flag option in the infopackage for loading Hier

    Hello Gurus,
    Whta is the relevant for BW Flag option in the infopackage for loading Hierarchies? What happens when you turn this on?
    Thanks
    Simmi

    As the hierarchies are stored in combination with the OLTP system, when you tend to load from a flat file, the system doesnt allow you to maintain this feature, as this hierarchy would be relevant to BI.
    Diagnosis
    The relevant hierarchies in BI are stored according to the combination DataSource/source system.
    If you want to change the selection of BI-relevant hierarchies, this change is effective for all InfoPackages that have been created for the same DataSource/source system combination.
    Procedure
    Check all other InfoPackages for DataSource 0COSTCENTER_0101_HIER and source system PRDCLT100 to see whether the change executed is also appropriate for these InfoPackages.
    Procedure for System Administration
    If you want to load a hierarchy in a different InfoPackage (which will be marked as non BI-relevant as a result of your changes) the selections made for this InfoPackage will be lost and The InfoPackage can no longer load.
    Errors will occur when you start the InfoPackages. The monitor produces an error message to say that a valid hierarchy selection has to be made.

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

  • Regarding the routine in infopackage

    Hi Experts,
    I have an infopackage with only full load update,i am loading a daily load into the target with that ..now what i want to know is that i want to create a routine in infopackage so that it deletes the previous day data automatically ..so that if i am loading todays data it wont be duplicated..so can any one give me the code and step by step ways to  do that ..i would appreciate the answers and assign maximum points for the valuable one...
    regards,
    Rk

    If it is going to be full load, you have some options like:-
    a. At Infopackage Level:- Under the data-targets tab, you have a check box for deleting the targets contents before loading, if you check that tab, the data will be deleted automatically before loading.
    But beware that ALL data will be deleted and only today's data will remain there.
    b. Process Chains:- If your selections are same, you can use a process type "Delete Overlapping Request" in the process chain, and it will delete the contents before reloading them.
    Hope this helps.
    Cheers,
    Sumit

  • Transformation for flatfile???

    Hi,
    How can i create Transformations for DSO as i intent to upload the data from faltfile to DSO?
    Should i create infosource before creating transformation??
    as i see when i am trying to create transformations there is no option for flatfile as such--
    Raj

    Hi,
    Follow these steps.
    1. Create Source system for Flat File (PC File).
    2. Create Datasource with the same sequence of the CSV file you have.
    3. Create Infopackage to load data into datasource.
    4. Create transormation between your DSO and datasource.
    5. Check the mapping and activate the transformation.
    6. Create DTP and activate it.
    7. execute the DTP.
    Thanks
    Mayank

  • Short dump error for delta load to 0CFM_C10 via 0CFM_DELTA_POSITIONS flow

    hi all,
    i am getting short dump error for delta load to 0CFM_C10 via 0CFM_DELTA_POSITIONS flow.
    not able to figure out the actual issue and how to solve it.
    can anyone suggest?
    below is the details of the short dump
    Short text
        Exception condition "UNKNOWN_TRANSCAT" raised.
    What happened?
        The current ABAP/4 program encountered an unexpected
        situation.
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    Error analysis
        A RAISE statement in the program "CL_SERVICE_TRG================CP" raised the
         exception
        condition "UNKNOWN_TRANSCAT".
        Since the exception was not intercepted by a superior
        program, processing was terminated.
        Short description of exception condition:
        For detailed documentation of the exception condition, use
        Transaction SE37 (Function Library). You can take the called
        function module from the display of active calls.
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "RAISE_EXCEPTION" " "
        "CL_SERVICE_TRG================CP" or "CL_SERVICE_TRG================CM003"
        "SORT_TRANSACTIONS"
        or
        "CL_SERVICE_TRG================CP" "UNKNOWN_TRANSCAT"
        or
        "SBIE0001 " "UNKNOWN_TRANSCAT"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
        4. Details about the conditions under which the error occurred or which
        actions and input led to the error.

    Hi,
    It seems like some routine are there and check your rotines , transformation etc.
    Regards
    sivaraju

  • Routine in Infopackage - Extraction

    Hi All,
    I want to know ; How to write Routine in the Infopackage Extraction?
    I know that we can write Routine in Infopackage extraction.
    PLease let me know the steps.
    Regards,
    Macwan James.

    Hi
    In ifopackage we use routine for selection, please find below threads related to this which will be helpfull to you:
    Infopackage Selections Tab-OLAP Variable/ABAP Routine
    ABAP Routine correction in the selections fields of a Infopackage
    Re: how to write routine for infopackage
    Regards
    Ravi

  • Routine in Infopackage not working

    Hi all..
    I wrote a routine in Infopackage with the selection Abap routine 6. for some reason the code is not selecting..i mean if the code has to get fisc year 2007, instead its getting all the records from all the years. i tested out the code in abap se38, it works fine, the function module is working fine, i am missing something here in infopackage, can anyone please let me know.
    Here is the code.
    data: l_idx like sy-tabix,
            Year  type /BIC/CS8ZCBFCOPA-FISCYEAR.
    data : begin of itab occurs 0.
    include structure /BIC/PZOCDPYCTA.
    data : end of itab.
      CALL FUNCTION 'ZBW_GET_FY_PKG_SELECTIONS'
        EXPORTING
          VTYPE     = '010'
        IMPORTING
          ZOCDPYCTA = itab.
      loop at itab.
      read table l_t_range with key
           fieldname = 'FISCYEAR'.
      l_idx = sy-tabix.
      l_t_range-SIGN = ' I '.
      l_t_range-OPTION = ' EQ '.
      l_t_range-LOW = itab-FISCYEAR.
      modify l_t_range index l_idx.
      endloop.
      p_subrc = 0.
    The FM takes the input as 010 and gets all the records related to that..which is 2007 year records instead its getting all the records from all years..please help me.
    Thanks
    Vj

    Check the monitor to see what values are entered as the restrictions in the infopackages for fiscal year. if the correct values don't show up in the monitor you know the routine is the problem and not a system bug.
    Also, you may want to consider doing a range if the multiple single values isnt working.

Maybe you are looking for