Default value for date

Hi experts,
I want to set default value for dates..
My screen has : date_from & date_to.
date_to : will be current date(today's date) if Eg: 27.08.2007 (here i used NOW())
then date_from must be 01.06.2007 (3 months logic)
similarly : if date_to is 01.01.2007
then date_from must be 01.11.2006
kindly help...
Thanks a lot!!!
Regards,
Bijal

Hi Bijal
(DGET(NOW(),'D'))-1) returns number which is 0 incase of 01.08.2007, so DADD(NOW(),-0,'D') is again ideally same day 01.08.2007 .
So, DADD(DADD(NOW(),-0,'D'),-2,'M') should give you 01.06.2007.
<b> IT WORKS!!! -
I have tested it now.</b>
Please check and revert.
The IF formula which sent actually returns String, so use DVAL(IF(DGET(NOW(),'D')!=1,DADD(DADD(NOW(),-((DGET(NOW(),'D'))-1),'D'),-2,'M'),DADD(NOW(),-2,'M')))
Message was edited by:
        Navneet Giria

Similar Messages

  • Set default value for date/time to previous month

    Hi All
    I have two date/time parameters in my report and I want to set the default value for both the parameters
    For start date parameter I want the first date of previous month and for end date parameter I want the last date of previous month.
    Can someone please point me to the right direction
    Thanks
    Rone

    Hi Rone,
    These links can be helpful for you:
    http://www.bidn.com/blogs/hardikabhavsar/bidn-blog/1639/default-date-parameters-in-ssrs
    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/584a98ae-bb75-4740-9198-e6be3c1aec12/
    Regards,
    Manoj
    *Happy to help
    http://experiencingmsbi.blogspot.com/

  • Default values for data types

    what are default values for all the data types that exist  in abap
    Title was edited by:
            Alvaro Tejada Galindo

    Hi
    For CHAR data type default is SPACE
    for INTEGER,PACK and FLOAT types it is ZERO '0'
    for NUMERIC also so many Zeros
    for Time(TIMS) it is 6 zeros and Date(DATS) it is 8 zeros
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • How to make default values for date range?

    Dear Colleagues,
    My customer is asking for a default value for a date range prompt.
    The FromDate should contain the 1st of current month, the ToDate should contain current date.
    Does anyone have any idea how I can meet this demand?
    Regards Silje

    Hi Federico,
    Thank you for the answer, we are back to the challenge after summer vacations!
    I have created a variable in the universe: SELECT current date  as TODAY FROM SYSIBM.SYSDUMMY1. I Called it TODAY.
    Then I created a prompt in the query based on Date. In Prompt Properties I tagged for "Set Default Values" and I typed in TODAY.
    When I try to run the query I get the error message:  The date for the query filter based on 'Date' is invalid (WIS10704).
    What is wrong? What do I have to do differently?
    My goal is to have a default for Date that gives me today..
    Regards Silje

  • Default value for date parameters

    Hi,
    There are several reports that have from_date/to_date parameters where the default value is, e.g. 01/01/2012 and 31/12/2012.
    Every year, after the previous year is closed, I go through the process of having to change the default values to the new year in all the reports. I have checked but not found an option of using a formula for a default value in a parameter. Could there have been something new recently that I missed?
    Or does anyone have a suggestion of a way to get around it? I have tried in the past trying to extract the year from sysdate, but have not succeeded in getting a formula that the Discoverer accepts in the default value.
    Thanks.
    Leah

    Thanks for the information. I doubt that my boss would go for it but I will speak to him when I am at work next week. We have some old reports which have a default value of null and that would most probably be confusing for many of the users. Is there a way to have the default the end of the year also?
    Once again, thank you.
    Leah

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • Default values for creating vendor master data

    Hi.
    Is it possible to set default value for payment term and planning group when creating vendor master data of a specific account group?
    Thanks in advance.

    HI,
    1, Create a vendor in your Account group as the reference vendor account
    2, By t-code:XK01, create new vendor with reference vendor of step 1,
       then the system will transfer the value from your reference vendor.
    Regards
    Ravinagh Boni

  • Set Default Value for a Date Navigator

    Hi all
    Is it possible to set a default value for a date navigator.I mean with out picking the date from the Navigator, on load of the view itself i need a particualr date to be displayed (say 12/31/2000).
    Thanks in advance

    Hi,
      create a value attribute of type date bind to the input field and in wdInit()of view controller write this code..
      wdContext.currentContextElement().setValueAttrName(new Date(Calendar.getInstance().getTimeInMillis()));
    means ...
    u r setting the date entered into some context ....
    type of that attribute must be of date and for initial value write the above code ..if it is under node element create nodeelement bind it to context and write the code accordingly..
    Message was edited by: Yashpal Gupta

  • Default Values For Foreign Trade Header Data

    Hello,
    I have defined a price condition (ZPFR) to gather the price from the company to the custom office (the customs office through which the goods enter or leave the country).
    I want that price condition to be determined in the pricing procedure in foreign trades. The fields in the access sequence are the Plant and the Customs office. In customizing, in the point “Default Values For Foreign Trade Header Data”, I have defined a line for the Departure country, the Destination Country and the proper values for the Office of exit, Export Custom Office and Office of destination (the same that I have selected in the condition record). But when I create a sale document, this condition does not determine because the Customs office seems not to have any value in the document. Does anybody what I am doing wrong?
    Thank you in advance,
    Silvia

    You require to do thenecessay configuration for Foreign Trade Data:
    IMG --> Sales and Distribution --> Foreign Trade/Customs --> Basic Data for Foreign Trade --> (Do the necessary configuration here)
    In most probability, it will not default, but it is required to be maintained in Invoice (based on configuration)
    Regards,
    Rajesh Banka
    Reward points if helpful.

  • Is there any way we can set default value for a Date Attribute to current date in Master Data Services

    Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
    I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
    Thanks.

    Hi Anagha,
    So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
    1. Add buisness rule which can set a default value when Date = NULL/Blank
    2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
    3.Go to that table and add a after update trigger like
    if uda_<entityid>_<attributeid(Date attribute)> = default value
    update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
    I will check on this too from my side.
    By the way AFAIK i dont think so calendar control integration is possible .

  • Default value for variable are not within permitted value range (precalc)

    Hello BW community
    Issue:
    I have created a variable (Characteristic Value/ Manual input-default value) and use the precalculated value set (details-basic settings). In the further variable definition I could select the  precalculated value set in 'Default values', which I have defined beforehand in the broadcaster..
    The precalculated value set in the broadcaster settings is just based on a master data query on 0CUSTOMER.
    Error:
    The variable gets the error E991/R9E Errors: Default values for variable 'XXX' are not within permitted value range.
    The detail description of the error is: You defined default values for variable 'Sold-to party precalc value set for manuel input' that are not appropriate for the variable type; for example, a range is defined as a default value for a variable that only permits a single value.
    So please has someone had the same issue and found out how to solve it? It would be excelent to get good solution for this issue.
    Best regards and thanks
    Christian
    PS-1: System BW 701 / SAPKW70105
    PS-2 : there has been a SDN entry with the same topic but not resolved too.
    link: /thread/980839 [original link is broken]

    Hello,
    Thanks for your response.
    I should have mentioned that in my post. I tried this very first time. I thought that this is the place where you provide default value. But I got following exception at that time, so I thought, may be this is used for something else.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.servlet.ServletException: OracleJSP error:
    oracle.jbo.NameClashException: JBO-25001: Object viewAllInd of type Control Binding Definition already exists.
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)Do I need handle something else when you put the default value?
    Thanks,
    Jai

  • Setting default values for field on screen.

    Hello,
    I am trying to set default value for one of the fields I have on screen when I execute the custom transaction.
    I am doing that in PBO as follows. But the default value is not set for Date field.
    PROCESS BEFORE OUTPUT.
    MODULE PBO_OUT.
    MODULE STATUS_5000.
    *&      Module  STATUS_5000  OUTPUT
          text
    MODULE STATUS_5000 OUTPUT.
      SET PF-STATUS 'NON_SAP_DOCUMENT'.
      SET TITLEBAR '001'.
    ENDMODULE.                 " STATUS_5000  OUTPUT
    *&      Module  PBO_OUT  OUTPUT
          text
    MODULE PBO_OUT OUTPUT.
      ERDAT = SY-DATUM.
    ENDMODULE.                 " PBO_OUT  OUTPUT
    Please help.
    Thanks.
    Regards,
    Rajesh.

    Works Now...

  • Default value for attribute "COUNTRY" in BP_HEAD_SEARCH/MainSearch

    Hi Gurus,
    Requirement is to set default value for attribute "COUNTRY" in BP_HEAD_SEARCH/MainSearch when user clicks on Corporate Account.
    Below is code that i have written in DO_PREPARE_OUTPUT.
    Code is working fine and in the debug also i can see the value of COUNTRY is set to DE, but it is not showing on the screen for first time but when i load component second time(Refresh the screen), it shows me value.
    Any help would be appreciated. If somebody has otheralternative kindly share.
      CALL METHOD super->do_prepare_output( iv_first_time = iv_first_time ).
    Calling Super Method
    CALL METHOD super->do_prepare_output
       EXPORTING
         iv_first_time = abap_true.
    Data Declatation
      DATA :lr_col            TYPE REF TO if_bol_bo_col,
            lr_current        TYPE REF TO if_bol_bo_property_access,
            lr_param          TYPE REF TO if_bol_bo_property_access,
            lr_qs             TYPE REF TO cl_crm_bol_dquery_service,
            lv_attr_name      TYPE name_komp,
            lv_sign           TYPE bapisign,
            lv_option         TYPE bapioption,
            w_country_exist   TYPE c,
            w_param           TYPE string,
            w_value           TYPE string,
            w_flag            TYPE c.
    Getting SEARCH Context Node
      lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).
    Get Selection Parameters
      lr_col ?= lr_qs->get_selection_params( ).
    Start from first parmaters
      lr_current = lr_col->get_first( ).
    Clearing Variables
      CLEAR : w_country_exist, w_flag, w_param, w_value.
    Loop till we have selection paramters
      WHILE lr_current IS BOUND.         " While loop 1
    checking attribute name is COUNTRY then setting some variable
        w_param = lr_current->get_property_as_string( 'ATTR_NAME' ).
        CASE w_param.
          WHEN 'COUNTRY'.
    If country is filled then setting variable
            w_value = lr_current->get_property_as_string( 'LOW' ).
            IF w_value IS NOT INITIAL.
              w_country_exist = abap_true.
            ENDIF.
    When we got COUNTRY attribute then setting flag
            w_flag = abap_true.
        ENDCASE.
    Calling next parameter
        lr_current = lr_col->get_next( ).
      ENDWHILE.                          " While loop 1
    In below block we are checking is COUNTRY attribute is blank and
    we have found COUNTRY attribute in current selection paramters
      IF lr_qs IS BOUND.                 " SEACRCH CONTEXT BOUND
    If vairable is blank means DE or any other value is not filled in COUNTRY Attribute
        IF w_country_exist IS INITIAL.   " w_contry_exist
    We have to add selection attribute if we come accross COUNTRY attribute during our search
          IF w_flag EQ abap_true.        " w_flag
    Adding COUNTRY attribute with default value 'DE'
            lr_qs->add_selection_param( EXPORTING iv_attr_name = 'COUNTRY'
                                                  iv_sign      = 'I'
                                                  iv_option    = 'EQ'
                                                  iv_low       = 'DE' ).
          ENDIF.                         " w_flag
        ENDIF.                           " w_contry_exist
      ENDIF.                             " SEACRCH CONTEXT BOUND
    In below block we will remove COUNTRY attribute when it has blank value
      IF lr_qs IS BOUND AND w_country_exist IS INITIAL.
        lr_current = lr_col->get_first( ).
        WHILE lr_current IS BOUND.
          w_param = lr_current->get_property_as_string( 'ATTR_NAME' ).
          CASE w_param.
            WHEN 'COUNTRY'.
              w_value = lr_current->get_property_as_string( 'LOW' ).
              IF w_value IS INITIAL.
                lr_col->remove( iv_bo = lr_current ).
              ENDIF.
          ENDCASE.
          lr_current = lr_col->get_next( ).
        ENDWHILE.
      ENDIF.
    Edited by: Harsharandeep Singh on Apr 28, 2011 3:44 PM

    Hi,
    Try it like this:
      DATA:
        lr_bo        TYPE REF TO if_bol_bo_property_access ,
        lv_attr_name TYPE name_komp.
      FIELD-SYMBOLS:
        <ls_param>   TYPE crms_thtmlb_search_criterion.
      READ TABLE parameters
           ASSIGNING <ls_param>
           WITH KEY field = 'COUNTRY'.
      IF ( sy-subrc = 0 ).
        <ls_param>-value1 = ip_pfct.
      ENDIF.
      CHECK ( me->parameter_collection IS NOT INITIAL ).
      lr_bo = me->parameter_collection->get_first( ).
      WHILE lr_bo IS BOUND.
        CALL METHOD lr_bo->get_property_as_value
          EXPORTING
            iv_attr_name = 'ATTR_NAME'
          IMPORTING
            ev_result    = lv_attr_name.
        IF lv_attr_name EQ 'COUNTRY' .
          CALL METHOD lr_bo->set_property
            EXPORTING
              iv_attr_name = 'LOW'
              iv_value     = 'DE'.
          EXIT.
        ELSE.
          lr_bo = me->parameter_collection->get_next( ) .
        ENDIF.
      ENDWHILE .
    Kind regards,
    Micha

  • Default Values for Select-options In Webdynpro-ABAP

    Hi Freinds,
    Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP.
    Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View.
    Regards,
    Xavier.P

    Xavier Reddy Penta sent me this question via email and I answered it directly yesterday. Here is the solution that I provided to him, so that it is stored with the original question:
    I believe your problem is that you are not setting the value into the range correctly.  You are setting it directly into the field symbol of the range like such:
    <FS> = L_STRING2.
    But ranges are deep objects. They have four fields: Sign, Option, High, and Low. This is from the online help:
    1.     sign of type c and length 1. The content of sign determines for every row whether the result of the condition formulated in the column is included or excluded in the entire resulting set for all rows. Evaluable values are "I" for include and "E" for exclude.
    2.     option of type c and length 2. option contains the selection option for the condition of the row in form of logical operators. Analyzable operators are "EQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP" if column high is initial, and "BT", "NB" if column high is not initial. With the options "CP" and "NP", the data type of the columns low and high must be of the data type c, and special rules apply for entries on the selection screen.
    3.     low of the data type defined after FOR. This column is designated for the comparison value or the lower interval limitation.
    4.     high of the data type defined after FOR. This column is designated for the upper interval limitation.
    So when you are moving the value into the field symbol you are setting it into the sign column.
    Here is an example of how you can access the components of the range:
    * create a range table that consists of this new data element
        lt_range_table =
          wd_this->lv_sel_handler->create_range_table(
               i_typename = l_typename ).
        IF l_fieldname = 'CARRID'.
          FIELD-SYMBOLS: <tab>         TYPE INDEX TABLE,
                             <struct>      TYPE ANY,
                             <wa>          TYPE ANY,
                             <option>      TYPE char2,
                             <sign>        TYPE char1,
                             <high>        TYPE ANY,
                             <low>         TYPE ANY,
                             <wa_values>   TYPE ANY.
          ASSIGN lt_range_table->* TO <tab>.
          APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
          <sign> = 'I'.
          <option> =  'EQ'.
          <low> = 'AA'.
        ENDIF.

  • Default Value for Order Type based on Company Code  in ME21N

    Hi,
         Using ME21N, I want to make the PO type defaulted to a certain company code, say for instance Company code  XYZ should have a PO type XYZ Purchase Order, ..company ABC should have a PO type ABC Purchase Order, and so on...I'm just puzzled how to implement it. I know that we can set a Default value for PO Headers in Personal Settings but its doesnt give the result I want coz it will only have one Default Value. What I wanted is when a certain company code is chosen, automatically, the corresponding PO type for that Company code will be displayed in the Order Type drop-down menu (so there's no need to choose on the drop down list what Order type) Is this possible in ABAP? Hope i made myself clear.
        Thanks in Advance.

    Use BADI IF IF_EX_ME_PROCESS_PO_CUST - method OPEN
    View the interface documentation in transaction SE19 and you will see the method OPEN can be used :
    2. Opening of a purchase order (OPEN method)
    The system opens a new document to create, change or display a purchase order. With the OPEN method,
    <b>you can import your own data and prepare it for further processing.</b>
    This is available in 4.7 Enterprise but not sure how far back.....
    hope this helps
    Colin.

Maybe you are looking for

  • Apple Loops in Garageband dont work!

    In a standard garageband session i cant seem to make use of any of the apple loops in the loop finder. They are all grayed out but are still listed in full. when I try and play them a message comes up saying: "You have already initiated the installat

  • How to send Excel File using file adapter

    Hello, Please could you tell how i can send an excel file using the file adpater? thank you.

  • LMS 4.2 Device Update without a proxy server

    I'm running LMS 4.2.2, and when I try to initiate a device package update via the webinterface, it fails because I do not have a proxy server configured.  Is there a way to tell LMS that I don't want it to use a proxy?  I have my cisco.com creds in p

  • PI Alert configuration rule definition

    Hello, On my PI production system I want to cretae a rule base on the adapter type (RWB  - Alert configuration), unfortunately i can olly choose between * and MessagingSystem. On my test and dev systems I have all the adapters in the "combo box" : *,

  • Mutiple files to iDVD

    Hello out there, I have a folder with 13 avi files that I need to load in iDVD and burn to a disk.I would like them to play one right after the other. I also want to drag the files into the start automatically window so as to skip the themes. Do I ju