Need to set default value on Account Search

HI All,
In BSP BP_HEADSEARCH view MainSearch I need to default the value of the attribute 'RESP_AREA' to '01'. I can see the attribute on the value node SEARCH but when get the current context of SEARCH the entity is of a type CL_CRM_BOL_DQUERY_SERVICE and I am not sure how to set the default value.
Any help will be appreciated,
Regards,
Tom

Hi Tom,
When it comes to setting values in a search entity you can not use the normal getter/setter methods because the context node class will be inherited from CL_BSP_WD_CONTEXT_NODE_ASP. In the context node class there will be few attributes (FIELD,MAX_HITS,OPERATOR,VALUE1,VALUE2) that corresponds to the fields diosplayed in the search criteria. The fields VALUE1 and VALUE2 represents the LOW and HIGH values.
To set default value for RESP_AREA you must redefine SET_VALUE1 method and read the ATTR_NAME. If ATTR_NAME is RESP_AREA then you can set the value.
Method SET_VALUE1.
* Get current criterion
  data: criterion type ref to if_bol_bo_property_access.
  if iterator is bound.
    criterion = iterator->get_current( ).
  else.
    criterion = me->parameter_collection->get_current( ).
  endif.
* Set its low value from user input
  try.
      data: lv_value type string.
      lv_value =
         me->convert_value_from_string( iv_string = value
                                        iv_criterion = criterion ).
      criterion->set_property( iv_attr_name = 'LOW'
                               iv_value = lv_value ).       "#EC NOTEXT
    cleanup.
*     Keep buggy user input for correction
      criterion->set_property( iv_attr_name = 'LOW'
                               iv_value = value ).          "#EC NOTEXT
  endtry.
* Set the default value for RESP_AREA
lv_attr_name =  criterion->get_property_as_string( 'ATTR_NAME' ).
if lv_attr_name eq 'RESP_AREA'.
    criterion->set_property( iv_attr_name = 'LOW' iv_value = ---- ).
Endif.
Regards,
Arun

Similar Messages

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • Need to set default value in table EABL.

    Hi Experts,
    How to set default value of field ATIM form 00:00 to 23:59 ion field selection screen for table EABL in transaction SE16?

    hi jazz try this way.
    forget about every thing and come from beginning.
    by now i think your are familiar with shd0.
    firstly create a variant using shd0 for your table eabl with default value and save it and activate it.
    next check whether it is working or not by opening se11 or 14 and enter table name and click display, the you can you see your default vale in your required field.
    after it is done the come to second part i.e your se16.
    now create another variant for this and save it and activate it.
    (by this i mean to say you are creating two variants )
    hope this will solve your problem.
    if your purpose is not solved yet then please write to my mbox.
    regards,
    kool.

  • Help needed in setting Default Value of Concurrent program parameter

    Hi All,
    I have 3 parameters in a concurrent program
    Org ID From
    Org ID To
    Currency Code
    In the Currency Code parameter I want to use the following query in the Default Value
    SELECT currency_code
    FROM gl_sets_of_books sob, org_organization_definitions ood
    WHERE ood.organization_id = :p_org_id_from
    AND sob.set_of_books_id = ood.set_of_books_id
    Now, at runtime this gives me an error of p_org_id.
    Can anyone please advice me how can I use this parameter(p_org_id_from) in the above query.
    Any help will be really appreciated.
    Regards,
    Shruti

    Hi Helios,
    Thaks a lot for the help.
    I modified the query as follows:
    SELECT currency_code
    FROM gl_sets_of_books sob, org_organization_definitions ood
    WHERE ood.organization_id = :$FLEX$.ORG_INTRANSIT
    AND sob.set_of_books_id = ood.set_of_books_id
    Here ORG_INTRANSIT is the valueset I am using in From Org ID and To Org ID.
    Now the problem which I face is that when I use ORG_INTRANSIT valueset in both From Org as well as TO Org then the Currency is not defaulted, but if I use it in either From Org or To Org then the Currency is defaulted.
    How can I resolve this. Please help.
    Regards,
    Shruti

  • Default values in Account creation page

    Hello.
    I'm new to CRM and this forum too.
    I need some guidance. I have to set default values in account creation page. For this, I thought to use DO_INIT_CONTEXT method. And, when I searched this forum, I see a lot of threads about BADI CRM_BP_UIU_DEFAULTS.
    Can someone explain if there is any difference if we implement that using DO_INIT_CONTEXT method?
    Thanks to all!

    Hello,
    Actually, some BADI are WebUI specific.
    BADI CRM_BP_UIU_DEFAULTS only gets trigerred in WebUI BP screens.
    DO_INIT_CONTEXT method will be triggered every time you open a window wich contains the view considered. So not only during BP creation.
    Chris Evans, This is the way to go to initialize some fields during BP creation : use of BADI CRM_BP_UIU_DEFAULTS.
    Hope this helps.
    Best regards,
    Sylvain AGUETTAZ

  • How to set default value to input field

    Hi Experts,
    I need to set default value to one input field for the transaction crmd_order as a screen variant. Guide me in doing that.
    Regards,
    Harish

    Using the transaction SHD0, you can define the screen variant. While defining the sceen variant, you are allowed to define the default values.
    Using screen variant, for the main transactoin, you can also define the transaction variant and you can use this as an independent transaction.

  • How to Set default value to dropdown list in oracle ADF

    hi,
    I need to set default value in the drop down list in oracle ADF.
    If you take in HTML :
    <select>
    <option value="">Select Value </option>
    <option value="saab">Saab</option>
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
    </select>
    Like this i need to set default value in drop down llist in oracle ADF.
    Thanks and Regards,
    M. Ramu.

    Hi Ramu,
    Please be more clear on ur post whts ur Jdev version and wht type of dropdown u r using model driven or static list..?????
    Its hard to help u without proper info..
    Just have a look into this before u post a thread...
    https://forums.oracle.com/forums/ann.jspa?annID=56
    Regards,
    Suganth.G

  • Set Default value for transaction code F-36

    Hi
    I need to set default value to feild special G/L indicator in transaction code F-36 How can I do that. Please advice.
    Regards
    Kesharika

    Just in case anyone would need to know. You can change the default values for transactions by using SE93.
    Regards,

  • Setting default values for item in opportunity mgmt(crmd_bus2000111)

    Hi All,
    I need to set default values for the field Fiscal Quarter in item level using BADI CRM_CUSTOMER_I_BADI .This Field is created using EEW. The default value is like if the date is nov-2007 the value for this fiscal period is FQ4-2007 .
    Any clue would be great help..

    Why don't you try setting the default value in the List next to the Matrix - item 107
    Item 107 is a matrix (a transposed one), I have no idea what list you mean...  I am using item 107, not 112. Item 112 is used only to detect a click on the "Add Record" button, which is the last row of the matrix 112.
    I don't see the gender column in the grid and I'm also unsure of the id you have for it "12" - are you sure it's correct ( i usually use Item("columnName") )?
    Sorry for the confusion. "12" is the name of the standard column "Password" which we have renamed to store the gender.
    Anton

  • Setting Default Values in Search Criteria for COSTCENTER

    Hi ALL,
    I need Help for setting default values in search criteria for COST CENTER.
    Basically the issue is when creating a Shopping Cart, i need to assign a COST CENTER at Item level under COST ASSIGNMENT Tab.
    While searching the cost center i need to default the following fields in my search criteria based on the Login User :
    1. Controlling Area,
    2. Language Key.
    Please suggest some solution.
    Thanks & Best Regards,
    Surya

    Hi Vani,
    Sorry for the delay reply and Thanks a Lot for your timely support......I would like confirm once again is the name of the BADI is <b>bbp_f4_read_on_exit</b> or <b>bbp_f4_read_on_entry</b>. In this BADI i've not found a method to default Controlling Area. Can you please suggest me which method i can use.
    Thanks & Regards,
    Surya

  • Any opinions on setting default values on Business Partner level?

    Hi All,
    I do not have a question, but would like to have a good discussion on how you should preferably be setting default values on a business partner and it's assignment blocks.
    In my opinion you have two main alternatives:
    1. The "old fashioned" way by using the get_<attribute_name> method and doing some checks for the perticular attribute in the context node.
    2. Using the Badi BADI_CRM_BP_UIU_DEFAULTS to fill fields with a default value. With some enhancements on the assignment blocks (making typed_context attribute public and, when not called yet, calling the badi) you can use the badi for all assignment blocks.
    Because I discovered via debugging that in the, by many forums suggested, badi code a programm error/exception is used so that the default values are only set during creation mode, I started doubting to use the badi. Because once I had set my data declarations to the right references and the exception did not occur anymore, suddenly it always fills the values even when there are already values filled. So additional checks are needed to assure that I am in creation mode.
    Although I like the use of the badi, because all my default values on the whole business partner object can be found in the same place, it is getting a bit strange to: first still enhance the view and context node class, adjust the visibility of the typed_context, call the badi and do all kind of checks to assure that you are in the right view/context node, where this all is faster and more lean and mean when done directly in the get_<attribute_name> method on a context node.
    Anyone who wants to give there opinion on this?
    Regards,
    Martijn.

    Cameron,
    Unfortunately you cannot pass the Account and Contact name before saving the record. Post default tries to capture the name just before the record gets saved, but as the record is yet to be created, the relationship wont exist and only the respective id fields will have values. If you try using account id/ contact id it will work else just pass the time stamp in the name field which will make sure there is some value when the record is saved. later in the back end you might need WS to update the field values.

  • How to set default values in initialization event for select option

    Abapers,
    I have 3 GL account like 0024831231,0024831238,0024831245.
    Please help me how to set default values in select-options ( s_hkont ) in INTIALIZATION event
    Thanks

    Select option is table <Structure> with fields, low, high, sign & option
    you need to append the value into the select option, with appropriate value in low or
    example:
    S_HKONT-low  = <value>
    S_HKONT-SIGN = 'I'
    S_hkont-OPTION = 'EQ'
    append s_hkont.
    Default value for select-option also can be added directly in select-option statement.
    Regards,
    Mahesh

  • Insert default value into account in AP/Invoice service

    How I can insert a default value in account in AP/Invoice ?
    I try use a Formated Search this is an better way?
    declare @conta varchar(20)
    set @conta= '62298000'
    If  $[OPCH.DocType]='S'
    SELECT @conta  FROM [dbo].[PCH1] T0
       WHERE T0.DocNum = $[$20.1.0]

    IF $\[OPCH.DocType] = 'S'
    SELECT '62298000'

  • Set Default Values in Listbox with Dialog Programming

    Hi all,
    I am stuck with a problem i.e  I am working with Dialog Programming Screen
    where i have to set default values in some n numbers of Listbox which i have created on Screen.
    This default value is needed to be fetched from database table.
    I am using single table. Hence no confusion that i have to first fetch data from 1st listbox then corresponding data is fetched into second & so on ..NO NO This is not required.
    Simple one screen which will update a table in database, where  some fields on the screen needs to be default set as per tables domain default values set while table creation.
    Please help me out in this.
    Thanks & Regards,
    Sandhya.

    Please search SDN, before you post a new forum from next time... any ways just follow the below code..
    u need to use the FM 'VRM_SET_VALUES' to implement list box in module pool. Check the below code. u have to write this code in PBO..
    if c = 0.
    select land1 landx from t005t into table wi_country.
    sort wi_country by land1.
    delete adjacent duplicates from wi_country comparing all fields.
    loop at wi_country.
    wa_ctry-key = wi_country-land1.
    wa_ctry-text = wi_country-landx .
    append wa_ctry to wi_ctry.
    endloop.
    call function 'VRM_SET_VALUES'
    exporting
    id = 'ZCUST_MASTER1-COUNTRY'
    values = wi_ctry
    exceptions
    id_illegal_name = 1
    others = 2
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    c = 1.
    endif.
    Hope this helps u,
    Regards,
    Rajesh

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

Maybe you are looking for

  • IPhone 5s poor call quality - static

    I received my 5s a couple weeks ago and the phone had A LOT of static on the line during phone calls. I went to the local AT&T store and was told that it might be the sim card that was shipped in the phone, so they replaced it. That did not fix the p

  • Xerces cannot find symbol problem

    In my program I get an Xml from an exist database and want to place it in the hard drive. I have made the xerces imports I need: import org.apache.xerces.domx.XGrammarWriter.OutputFormat; import org.apache.xml.serialize.XMLSerializer;I have the jar o

  • ScreenSharing and Firewall (OS 10.5.4)

    Hi, Back in November, when I installed Leopard, I enabled the Mac OS X firewall (in sharing preference pane) and had no connection problem whatsoever (sharing the screen or the drives). Recently, I discovered that I could no longer connect to my othe

  • How to get the ownership application

    Hi, I am trying to create the ownership applicatoion, I have gone to add a new application named it as "ownership" and mentioned the dimension type as Ownership . But in the lat step the system throws an error "Required dimension type is missing  I "

  • Can we ad a functionality of skipping the Pre Roll ad after 30 seconds of the Ad has been played?

    I am using the OSMF framework for developing my own video player... I need to know that can I ad a functionality by which I can skip the Pre Roll Advertisement Video only after a certain duration... say 30 seconds? eagerly waiting for your suggestion