How to set variable default value by program?
Dear all,
We would like to set a BW variable default value by program (not using query designer).
Do you have any ABAP sample code for this? I'm really new in ABAP programming.
we are using BI 7.0
Thank you for your help!
Olivier DESFOUR
Hi Olivier,
FOllowing is the code which defaults calmonth to first month of the year to current month - 1.
Data : input1(4) TYPE n,
input3(2) TYPE n.
WHEN 'YQV_FD'.
if i_step = 1.
input1 = sy-datum+0(4).
concatenate input1 '01' into l_s_range-low.
input3 = sy-datum+4(2) - 1.
concatenate input1 input3 into l_s_range-high.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
endif.
Similar Messages
-
How to set the default value in dashboard prompt?
Hi there,
In my Dashboard prompt I'm getting values like:
Mar 2010
Apr 2010
May 2010
Jun 2010
How to set the default value to the current month (Jun 2010). I don't want to use "specific value". I want to use the "SQL Result" for populating the default value.
Appreciate your helphi,
you can create a Repository variable current_month with the expression as
select to_char(trunc(sysdate),'Mon')from dual
and use this in the prompt "Default to" Server variable and use this repository variable.
hope this helps.
cheers,
vineeth -
SRM 4.0- How to set the default values for product type (01) only for SC
The radio button Service should not be visible.
Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
How to set the default values for product type (01) only for SC
We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
Here we can set defalut value 01 but it is not correct one since same search help is using several places.
We need to limit the search help results only for SC.
Kindly help out me ASAP.The easiest way to set defautl values is to edit the batch class.
Goto the characteiristic and go to update values.
In here you probably have something like 0 - 100 as a spec range.
On the next line enter the default value within this range. At the end of the line, click in the box in the column labelled "D". This indicates the defautl value for the characteristic.
If you need to you can do this in the material classification view as well.
Just to be clear, these values will only show up in the batch record. You can not have defautl values in resutls recording screens.
FF -
How to set a default value in dropdown list in Wendynpro ABAP? Help!
Hi Experts,
I have Webdynpro for ABAP application that shows a DropdownwithKey UI element.
1. I am able to populate the dropdown list. But by default the list is not showing any value. Only when I select a value from the list then it shows it.
So how to set the default value to the first value in the list? Any code sample will be really helpfull.
I have written the following code:
method WDDOINIT .
DATA:
node_category TYPE REF TO if_wd_context_node_info.
node_category = WD_CONTEXT->GET_NODE_INFO( ).
node_category = node_category->GET_CHILD_NODE( 'CATEGORY' ).
data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST,
L_VALUE type WDR_CONTEXT_ATTR_VALUE.
L_VALUE-VALUE = 'V1'.
L_VALUE-TEXT = 'yesterday'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'V2'.
L_VALUE-TEXT = 'today'.
INSERT L_VALUE into table LT_VALUESET.
L_VALUE-VALUE = 'V3'.
L_VALUE-TEXT = 'tomorrow'.
INSERT L_VALUE into table LT_VALUESET.
node_category->SET_ATTRIBUTE_VALUE_SET(
NAME = 'CAT_VALUE'
VALUE_SET = LT_VALUESET ).
endmethod.
Note that: I am using webdynpro for ABAP.
Thanks
GopalI am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element) in the context
like
wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
This generally done in Initialization method of the controller. -
How to set a Default Value in the drop down on Account Creation ?
Hi,
i have to set a default value in the drop down as soon as a User in a particular business role clicks on New Account. I have written the following code in do_prepare_output method. But this code is executed in the 2nd server round trip after entering some value or pressing enter. so i am not getting as soon as user clicks on the New Account.
How to set that default value when user clicks on New Account ? and where should i code ?
IF lv_icwc_profile = 'ZCSALESPRO' or lv_icwc_profile = 'Z_SALESPRO' .
try.
lr_entity ?= me->typed_context->header->collection_wrapper->get_current( ).
lv_current = lr_entity->create_related_entity(
iv_relation_name = 'BuilRolesRel' ).
lv_current->set_property(
iv_attr_name = 'PARTNERROLE'
iv_value = 'BUP002' ).
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
return.
ENDTRY.
Thanks and Regards
Raman KhuranaHi,
I have some idea abt it, it is also used in account life cycle.
Please refer SAP note 1097651, Defaulting a life cycle stage.
Let me know if useful.
rgds,
Vinay -
How to set a default value in Select one choice.
Hi
I'm using ADF BC, in that how to set a default value in select one choice.
pls. help on this.
regardsset the default value on the underlying EO or VO attribute
john -
How to set a default value to t-list when creating t-list programmatically
hi,
I'm creating a t-list programmatically
by calling
n = populate_group('groupname');
populate_list('form.list','groupname');
In this case how to set a default value for the t-list
thanks
raniI am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element) in the context
like
wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
This generally done in Initialization method of the controller. -
How to set a default value for particular field in SRM PO Portal
Dear Gurus,
Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
Thanks in advance...
Regards,
SathishDear Laurent,
Thanks for your response,
But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
Kinly guide me how to get the particular node of field in the Purchase order screen.
Thanks you in advance,
Sorry for the inconvenience if any
Regards,
sathish -
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,
CVHi,
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 -
How to set the default value of an item type DATE PICKER to the day of yest
Hi
How to set the default value of an item type DATE PICKER to the day of yesterday ?
Thank you very much !
Christian.Hi Christian,
Have a look at this thread Re: Default the Date Picker to Today
It covers this issue in detail.
Regards
Paul -
How to set a default values on fields
Hi !
using Jdeveloper:11.1.1.4.0
ADF Business Components 11.1.1.59.23
Jsp page
I want to set a default Date value in the field (in search form) How to do this ? Img priview [http://tinypic.com/r/zjhuf9/6]
The default value need to be one week older that today priview Default value: 07.08.2012 (14.08.2012:Today)
and a user cannot change that value
I am newbie in ADF and Java so some usefull links can be posted to
IDHi,
Adding default value for the attribute would work for the new rows that are created. If you want to have that in the search field, you need to set the default value for the bind variable which you are using in your View Criteria. The blog i've posted serves exact same usecase as yours.
-Arun -
How to set the default value of a LOV that is found in a view criteria
HI,
I need to set the default value of an LOV that is found in a view criteria. I tried to set a groovy expression but unfortunately it wasn't read. i also tried to bind the LOV to a bind variable and set the value of the bind variable in the constructor of my backing bean but unfortunately the default value appeared the second time i entered the screen and not on page load.
Can anyone advise where can i set the default value,
Thanksif you want some default value in LOV. you go to edit list of value wizard-> UI hint->include no selection Item checkbox -checked.use labeled item first of list- and beside that put the label. but when you try to get value, it will show null.but you can manipulate in ur java , if it default value
-
How to set a default value in my DropDown using the key ?
Hello All,
Can someone advose how I can achieve the above ? I will like to know how to select a default value for the dropdown by key using the key value instead of description.
The reason why I need to do so instead o fusing description is because my application will populate the dropdown using web services based on the language selection. Hence, if I were to set the default value using description, den other languages will not work anymore.
Any help will be greatly appreciated. Thank you !!
from
KWok WeiKwok,
Assuming that:
1. You have a node NodeX, where attribute TargetAttr defined
2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute
Then:
Place in your code:
wdContext.currentNodeXElement().setTargetAttr("yourKey");
VS
P.S. This topic was raised several times, and forum search works good enough to find an answer -
How to set a default value in a dropdownlistbox
Hi,
In CRM 2007 WEBUII have created a dropdownlistbox (ddlb) filled with currency codes.
Now I want the default value of the ddlb to be the currency of the country of the loggedin user, ie : 'EUR'
Anyone an creative idea how I can achieve this ?
In first place I need to know how I can set a default value of a ddlb.
--> ddlb type ref to CL_CRM_UIU_DDLB.
regards,
AbjuhHello Wolfgang,
If the method does not exist yet, you can create it in your enhanced (Z) context node.
Definition:
ATTRIBUTE_PATH Importing Type STRING
ITERATOR Importing Type Ref To IF_BOL_BO_COL_ITERATOR
VALUE Returning Type STRING
Implementation:
method GET_BP_GROUP.
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
TRY.
TRY.
dref = current->get_property( 'BP_GROUP' ). "#EC NOTEXT
CATCH cx_crm_cic_parameter_error.
ENDTRY.
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.
IF dref IS NOT BOUND.
value =''
RETURN.
ENDIF.
TRY.
value = if_bsp_model_util~convert_to_string( data_ref = dref
attribute_path = attribute_path ).
CATCH cx_bsp_conv_illegal_ref.
FIELD-SYMBOLS: <l_data> type DATA.
assign dref->* to <l_data>.
* please implement here some BO specific handler coding
* conversion of currency/quantity field failed caused by missing
* unit relation
* Coding sample:
* provide currency, decimals, and reference type
* value = cl_bsp_utility=>make_string(
* value = <l_data>
* reference_value = c_currency
* num_decimals = decimals
* reference_type = reference_type
CONCATENATE <l_data> '-CURR/QUANT CONV FAILED-' INTO value
SEPARATED BY space. "#EC NOTEXT
CATCH cx_root.
value = '-CONVERSION FAILED-'. "#EC NOTEXT
ENDTRY.
if value is initial.
value = 'Your default value'.
endif.
endmethod.
Regards,
Fabian -
How to set a default value in a DateTime field?
Hi!, how do you set a default value in a DateTime field in a user table to the value of "today"?
Thank you!It's in SAP Business One 2007, in User-Defined-Fields, under User Tables, Iam trying to add a field to a Table I created in the User-Defined-Tables-Setup menu.
I click Add then type the field name, description and then I select the Type, which is DateTime, then the SelectDefault Value For Field get's grayed out.
Thank you!
Maybe you are looking for
-
Optical drive no longer recognized by Leopard
Hello everyone, Over the last few months, I started getting MEDIUM errors while burning cdrs with Toast Titanium. Burning DVD's was never a problem. I even tried using several different brands of cdrs to no avail. My Macbook Pro is out of warranty, s
-
How can I create a mobile account in Mountain Lion?
Dear All, I have a problem creating a mobile account while joining an Active Directory domain controller (DC). ** Case one: While joining the DC, if these options are selected (Create mobile account at login) & (Force local home directory on startup
-
IPad English handwriting to text in form fields
Anyone out there know of any way that I can handwrite a sentence on an iPad and have the sentence converted to text and put into the field? I know there is currently only a built-in Chinese version of this, but hoping that someone knows of a third
-
Where tag libs related to JavaHelp can be downloaded?
Where the JSP tag libs related to JavaHelp can be downloaded? .It was not available as part of JH2.0 downloadable.
-
Mac OS X v10.6 Snow Leopard and CS 2
I have a question regarding CS2 on Snow Leopard... will CS2 work without any problems on this new OS? I have OSX 10.5.8 and never had any problems. have some of you already tested them together? thank you