Transform Date Field to Flag

I'm having trouble transforming the data associated with Start_Date to the associated meta-data (Year/Period dimensions).
I'm not sure if this is possible, and have spent some time researching with no apparent solutions. I am trying to allow users to enter a date in the Account dimension and then transform that date in a business rule to a flag associated with the correct Year and Period dimension.
For example, my application has a date member which users can enter via Planning: Start_Date = 20110301. I'd like to transform that date to a flag to be used for other purposes: Start_Date_Flag->FY11->Mar=1.
I can accurately calculate just the month and just the year portion of the data.
Since months are fixed (always only 12 months), I can use IF statements to place the flag in the correct months.
Since years are not fixed, I'd like to find a dynamic solution without creating a multitude of IF statements.
I thought something like the following would be my solution:
Year Dim Members=FY10,FY11,FY12,...
Year Dim Aliases:2010,2011,2012,...
FIX(@NAME(@MEMBER(@ROUND("Start_Date"/10000,0))))
CLEARDATA "Start_Date_Flag";
"Start_Date_Flag"(
IF(@ROUND(("Start_Date"-(@ROUND("Start_Date"/10000,0))*10000)/100,0)==1)
     "Start_Date_Flag"->Jan=1;
ELSEIF(@ROUND(("Start_Date"-(@ROUND("Start_Date"/10000,0))*10000)/100,0)==2)
     "Start_Date_Flag"->Feb=1;
ENDFIX
I can't seem to use the @ROUND function on the Start_Date (expecting number) and fix on the value (expecting member|string).
Has anyone successfully implemented a similar solution? Do you have any examples I could use?
Thanks for your help!

I am assuming you have expertise in writing formula. Here is link to another post: Use difference between 2 dates in calculation
I have posted certain member formulae in the post that can you help you create similar flag as you need based on hire month and hire year. Hint: You might need to create additional members to create flags/values for hire month and hire year.
Let me know if you need additional help.

Similar Messages

  • Transformation & Conversion for empty data fields

    Hi,
    I need help in replacing empty transaction data fields with dimension members based on other fields in the record. For example, the "cost center" field mayl be empty in the transaction data. I want to replace the empty field with a cost center dimension member based on the "Company" fileld in "Column A'.
    Thank you,
    Tim

    Hi,
    I have done somthing like this many times, if you need to do this when you feed data into BPC, you can do that using SQL.
    I have created lookup subqueries to achive this. if you are feeding info some other way then please explain.
    1 - How are you feeding in the data
    2 - Whare is the lookup value resids.
    Thanks

  • Filling Data fields of a DSO in End Routine

    Hi Everyone,
    The data fields of a DSO contains 2 key figures and a characteristic.
    In the End routine of the transformation, i have assigned constant values for the infoobjects in the data field.
    After executing the DTP, if I check in the New Table of the DSO, these constant values are present.  But when I activate the DSO, the values for key figures gets initialised and the values for the characterisitic becomes empty (NULL).
    Is it not possible to assign values for the infoobjects in the data field? If so, why is this limitation?
    Thanks in advance,
    Uma

    Uma,
    To populate any field in the end routine, you have to assign some constant in the transformation first and then re-populate them using the end routine.
    Sometimes if you dont assign any constant in transformation, the values remain initial and even after you write a code fo that field, it is not populated in the end routine.
    All you have to do is assign constant 0 to the key figures you are populating in the end routine and run the DTP again.
    Thanks
    Sachin

  • Date fields are showing as  /  /   in DSO for blank dates or no dates

    We are loading flat file data to DSO and the date fields are showing as  /  /   in DSO for blank dates or no dates in the flat file source system.  We don't want to see this / /  and instead of this, we would want to this field in DSO to be in blank. Please help how to achieve this. Is there any way to do this transformation. If yes, then can you please provide  the sample coding.
    Advance Thanks,
    Christy

    I have added the code and data loading is successful. while DSO activation, it is failing. The error message is,
    Value '#' of characteristic 0DATE is not a number with 000008 spaces.
    It seems that we need to change the code. Can you provide me the corrected code please. Thanks.
    Christy

  • Data fields not filled in DSO Activation

    Dear All,
    I have written an End routine to extract data into a DSO to fill some data fields. The End routine will perform a lookup on another DSO and modifies the records of the result_package. The data fields are characteristics and hence in the transformation, they are set to No Transformation.
    When I extracted the data into DSO, the new table has all the data fields correctly filled. But, after activating the request, all the data fileds data are erased. However, the keyfields data is still available in the Active table.
    Can you please help me on this.
    Thanks,
    Srinivas

    Hi Srinivas
    I have faced the same issue.Data was coming till new table,but after activation fields were getting
    blank.
    There is no necessity for doing a dummy mapping. In the transformation screen you will be having an ikon near to the delete
    routine symbol with an arrow symbol
    similar to select all and unselect all, just clikc on it and then mention the setting as Update all the target fields need to be populated.
    This will solve the issue, if it is not solved, then you can make a direct mapping to any of the field in the source, it need not be the
    exact field in the target.
    Thanks,
    Saveen Kumar

  • Data arrived in ODS new data - all  data fields are cleared

    Hello Experts
    We are loading every day since 3 years data into a DSO   There is a simple start routine.
    Issue:
    Suddenly 1x  record out of 12'000 records loses the data fields or in other words the data fields are cleared. The key part of the record still extists. The table of new data shows the record with all cleared data fields. Thus before activation the data are lost already somwhere in updating.
    We dont use expert routines, no end routines ect. It is a simple 1:1 transformation with a simple start routine.
    We debugged the start routine and the record still exists correctly at the end of the start routine with all entries in the data fields.
    So quite tricky and we hope of some good ideas , you may help us.
    Thanks a lot for your input and help
    Christian
    Our system is SAP BW 7.01 on DB6

    Hello Raf
    The data request has been split in 2 x data packages.
    And the erroneous record was exactly the last data record in data package 1.
    I have than increased the data request size from 10’000 Records to 50’000
    records (default) and it worked than perfectly without clearing any data
    columns
    For me absolutely not understandable, why this can happen.
    Do you have an idea.
      Best regards
    Christian

  • IDoc posted in R/3 but data for Date field has not generated.

    Hi Experts
    This is JDBC to IDoc scenarion.
    Source: MS SQL Server
    Date Data Type: smalldatetime
    Date field Format: yyyy-MM-dd hh:mm:ss --> example: 2009-11-13 00:00:00
    XI Mapping: Source Date --> Transformation --> Target Date
    Transformation: yyyy-MM-dd hh:mm:ss to yyyyMMdd
    Target: R/3 System
    Date Data Type:  ERDAT from VBAK table - Date on Which Record Was Created
    Date field Format: Date field (YYYYMMDD) stored as char(8)
    Check points:
    1. Mapping is working fine in XI and transformation is done with the test data: 2009-11-13 00:00:00  --> to ---> 20091113
    2. In SXMB_MONI the data is processed from the source and the IDoc XML data is generated. In the IDoc XML data the date field is containing the value <DATE>20091113</DATE>
    3. But when I tried to open the IDoc(SE05) in R/3 the date field is empty and no data is generated.
    Request you to let me know why the error is happening.
    Regards
    Ram

    Hi Ram,
    First try to test the same IDOC generated in ECC Box by populating date field value using WE19 and test .
    Or
    Instead of passing date value from SQL Server, Just give a try with  Current Date function in Mapping and test in ECC system.
    then we can think on further analysis.
    Regards,
    Vijay

  • :Due On" date field missing while posting with Spl GL indicator for vendor

    Hello,
    I am facing a problen while posting a n entry with spl GL indicator in fb01, the issue is Due On date field is missing in the screen.
    I am posting an spl GL transaction for a vendor thro FB01 and after entering the posting key 39, vendor code and spl Gl indicator in line item and in next screen, the "Due ON" date field is not appearing.
    Both vendor recon account and spl GL alternative account use same field status group and  checked the field status group , the due date, payments terms are made optional.
    The strange thing is, when I use the same vendor with Spl GL indicator "A" , the Due ON field is missing in next screen, and when I use spl indicator " B" , for same vendor, Due On date field is appearing.
    Is there any specfic field status setting for DUE ON date field for Spl GL indicator wise? or please help me how to bring due on date field in the screen when posting spl GL transaction?
    Please help me on this.
    Regards
    Surya

    Hello Surya,
    To make field baseline date for payment (BSEG-ZFBDT) ready for input for
    posting the down payment, the following Customizing setting is
    necessary:
    Financial Accounting -> Accounts Receivable and Accounts Payable ->
    Business Transactions -> Outgoing Payments -> Automatic Outgoing Payment
    -> Payment Method/Bank Selection -> Configure payment program -> All
    company codes -> double-click on corresponding company code -> under
    Customer -> 'Sp. G/L transactions to be paid' the letter A should be
    entered.
    The field "Due On (BSEG-ZFBDT)" cannot be controlled with field status.
    It is contolled by field attribute of screen painter (Tcd: SE51).  If
    you look at element attribute for "Due On" field, a flag for required
    entry is activated.  In this case, field status has no control over
    the field.
    As of release 3.1G, field BSEG-ZFBDT is hardcoded in most FI screens
    to be mandatory and cannot be influenced by any field status
    changes. This situation is only valid when posting with special G/L
    indicator (ie PK 29/39).
    SAP development team has determined that this is a critical field.  The
    reason behind this is that this special GL screen and the data entered
    here are very important to many other programs. This data affects
    liabilities and receivables where due date is necessary almost
    everytime. Thus, we changed this field in this screen in order to
    prevent problems in many other areas. The reason is explained further in
    note 95079.
    545944    FAQ, down payment, tax code, baseline date
    above Field is controlled through SE51 only.
    Tcode : SE51
    Program (screen)     SAPMF05A
    Screen number        304
    Eliment list  press display.
    special attributes.
    BSEG-ZFBDT - Required.
    Other options are below.
         The attribute "Input" can have the following values:
         o    Not possible
             The input/output field cannot be supplied with an input - that
             the screen element can only be used for outputs.
         o   Possible
             The input/output field can be supplied with an input at runtime
             the remainder of the transaction, an input is not required.
         o   Recommended (Optional Field)
             The input/output field should be supplied with an input at runt
             The system, of course, does not check immediately whether there
             been an input. During the remainder of the transaction, however
             input is necessary.
             To mark this kind of target field, the input template starts wi
             special character that is represented in the Screen Painter by
             question mark ('?'). The question mark will be suppressed only
             the field is in a table control or a step loop.
             You use the "target field", for example, if inputs cover severa
             screens and only at a later stage are subject to a common check
    o   Required Field
        The input/output field must be supplied with an input at runtime.
        The system checks this property immediately, and very definitely
        when the event is processed  (PROCESS AFTER INPUT).
        So that such a required field is marked accordingly, its input
        template must begin with a special character that is represented in
        the Screen Painter by a question mark ('?'). The question mark is
        suppressed only if the field is in a table control or a step loop.
    I hope above information will resolve your issue.
    Kind Regards,
    Fernando Evangelista

  • Current Date to Date field

    I have a DSO that has a date field like:
    ZDATE DATS 8 references 0date
    and I have a transformation that needs to load the run_date.
    So my abap looks like:
    DATA: my_date(10) type C.
      DATA: my_mm(2) type C,
                my_dd(2) type C,
                my_yy(4) type C.
    WRITE sy-datum to my_date MM/DD/YYYY.
    my_mm = my_date+0(2).
    my_dd = my_date+3(2).
    my_yy = my_date+6(4).
    concatenate my_mm my_dd my_yy to zdate
    but this fails to activate in my DSO because its the wrong format.
    I'm not getting that. Do I somehow have to specify that my variable is like 0DATE?

    Hi,
    Use FM  'CONVERT_DATE_TO_INTERN_FORMAT'
    give exporting parameters as      
                datum         = (Date you wat to convert)
                dtype         = 'DATS'
             importing
              ERROR         =
               idate         = l_budat
              MESSG         =
              MSGLN         =
    This should correct your error.
    Regards,
    Nikhil
    Edited by: Nikhil A Chitre on Jul 11, 2008 11:12 AM
    Edited by: Nikhil A Chitre on Jul 11, 2008 11:14 AM

  • Issue in Updating Date Fields in JDBC

    Hi Experts ..
      I am having issues in updating date fields in Oracle Database.
    My Sender Sends date in format 2007-05-19T14:34:55.0000000+02:00
    Can any one please suggest me how does the above format can be updated in JDBC with format 2007/05/19
    Thanks !

    Hi,
    See this Scree shot
    http://img517.imageshack.us/my.php?image=16324662pf7.jpg
    Take the Substring Function From Text Functionsand mention the position from 0 to 10 to take the Date alone from the Whole String which is getting in Source Field.
    And after that apply the Transform date Function fron Date Functions and mention the source date format and the target date foramt that needs to convert into.
    REgards
    Seshagiri

  • Can we cleanse and transform data at flat file or external table level?

    Hi,
    I have some data that I want to cleanse and transform. I don't want to cleanse it after i populate the external table, I want to get done with it at flat file level or while populating the external table. Can we cleanse and transform data at flat file or external table level through Oracle or OWB 11.2? Is it possible to run a conditional load (i.e. having a where clause or if-else-then) for an external table? Can we call oracle functions for an external table at the time of creation?
    Thanks in advance.
    Regards,
    Ann.

    Hi Oleg,
    Thanks a lot for the clarification. :)
    So is there a way that I can clease the data within the text file through Oracle or OWB? I have datatype mismatches in the data and most of my data is getting rejected because of that. The way I can think of, for solving this problem, is to create the external table with all fields with datatype varchar and then cleansing the data. But it doesn't seem very effecient plus it will get very complicated because I have almost 80-90 fields.
    Any help?
    Thanks and regards,
    Ann.

  • Importing Date fields from Oracle always defaults to DT_DBDATETIME, and won't accept chages

    Hi
    I am trying to import date fields in an Oracle database in to SQL Server 2012, using SSIS. The package is using DT_DBTIMESTAMP type in the Data Flow, but this has the same range as SQL Server datetime, and it bombs out all the time.
    I have tried to change the type used to DT_DBDATE, but no matter what I do the data type on the input columns is readonly and will not change.
    Any help would be much appreciated
    Andy
    CRM 4, SQL Server and .Net developer using C#

    Hi Andy,
    From the Mapping of Integration Services Data Types to Database Data Types section of the document, we can get the detailed information about mapping the Oracle data types to Integration Services data types. To change the data type from DT_DBTIMESTAMP to
    DT_DBDATE, we can use the following two methods:
    Method 1:
    Right click on the Source component and click “Show Advanced Editor”.
    Switch to the “Input and Output Properties” tab, expand the XX Source Output node, and expand the Output Columns node.
    Click the target column, and change the DataType property to DT_DBDATE.
    Method 2:
    Add a Data Conversion component to the Data Flow Task
    Double click the Data Conversion component to open the Data Conversion Transformation Editor
    Select the target input column, and change the Data Type to database date [DT_DBDATE].
    If I have anything misunderstood, please feel free to let me know.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Database DATE field

    I have a process on a page that loads a form's field data into a %rowtype variable and passes it to a package in the database.
    The package then performs an update to the table holding the data.
    There is a DATE field that I can not validate on the APEX front-end.
    So, if the user enters something in the date field that is invalid,
    it gets passed to the package on the back-end that's doing the update and it throws a database error back to APEX.
    Question: How can I intercept this during the update.
    Sure, I can update the other fields and send a flag back to APEX indicating that something is wrong with the date field and APEX can then redirect the user to a "You entered an invalid date field". But then I'm just re-creating the APEX validation that I can't use.
    This is where the customer has put me. 8-)
    Just wondered if I'm missing something. I guess I could do some formatting validation in the APEX process, but then I'm still just mimicking the APEX-provided validations.
    Thanks.
    Edited by: semaphore on Sep 15, 2008 8:33 AM

    Why can't you validate the date field in apex front end?
    You can certainly determine if the field is a valid date or if it falls within a range.
    It's just custom item validation that needs to be done.
    I have apex pages with start and end dates and I check that end date is greater or equal to start date, etc.
    If its got to be a range of dates you can pick a date from a lookup.
    You could also populate it from a calendar.

  • How to convert SAP dateTime field to Oracle date field

    Hi All,
                We have a scenario where the incoming data is in the following format:
    < ReconciliationData >
        < RowID > 9 </ RowID > 
        < Run_ID > 7 </ Run_ID > 
        < Control_ID > 5.40 </ Control_ID > 
        < Control_Name > MTD CHARGES TO CARP ORDERS INVENTORY </ Control_Name > 
        < Start_Month > 008 </ Start_Month > 
        < End_Month > 008 </ End_Month > 
    <b>   < SAP_Time > 20070828190545 </ SAP_Time > </b>
        < SAP_Count > 4 </ SAP_Count > 
        < SAP_Amount > 5000.00 </ SAP_Amount > 
        </ ReconciliationData >
    On the receiver side is oracle database. SAP TIME field has to go into Oracle Date field. it should be transformed to structure yyyy/mm/dd hh:mm:ss format.
    How do i go about doing it?
    Regards,
    XIer

    hey
    did u try the DateTrans function?if that does not work then u can write a simple UDF for it
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm
    Thanx
    Aamir

  • Populating Date field when Date = 00000000

    Hi Friends, Please help me with this , I have a requirement where user is not populating the date field "0objvalto" I want to populate that to 12/12/2020
    Abap code i put in transformation in BI but it is throwing error that 20.12.2008 format not correct
    Please help me correct the code or let me know what should i code to populate
    IF    SOURCE_FIELDS-REOBJVALTO = '00000000 '.
          RESULT = '20.12.2020'.
    ENDIF.
    Thanks
    Soniya

    Hi Soniya,
    Dates are internally stored as YYYYMMDD - so you must input them this way when you are doing in directly using ABAP.
    IF SOURCE_FIELDS-REOBJVALTO is INITIAL.
    RESULT = '20201220'.
    ENDIF

Maybe you are looking for