Get input field data
Hi Experts,
Can anyone suggest me the steps to get the data entered by the user in input field?
Regards,
Murali Krishnan N
You need to create a context value Attribute.
If you want the input value to be accessible in many views, then follow the steps to create a value attribute in Component Controller.
1. Go to your Component Controller and Properties-->Context.
2. Right click on root(Context) ->New->Attribute (say EmployeeID).
3. Now in the graphical section, which shows your controller and view, search for Data Link (on right hand side I believe) and drag from your View to component controller.
4. In the next popUp, select the EmployeeID attribute from Component side (right hand side) and drop
it on the context node of view(lhs).
5. Click Finish. And you are done.
This is called Context mapping. You can access the value of EmployeeID in any view controller using the following Code--
String sEmployeeID = wdContext.currentContextElement().getEmployeeID();
Similar Messages
-
How to get Input field value?
Hi All,
I have some problem in getting of input value from View to customcontroller.
My problem is I have created a Input field in the view and if Iam giving the value to that field I can capture the value from View to customcontroller and send it as BAPI input.But My input filed is in the view Context.
How can i capture InputFiled value from View to CustomController.
Advance thanks
Nageswara.
Message was edited by: nageswar mandapatiThanks for your response Patrick,
In my customcontrollerView all my BAPI mathods instances and execute methods are declared.All the attributes directly getting from model class.
But I have two views , in first view I created a input field(for that i created valueAttribute in that context).
Here I want give the conditions If the input field is empty then directly call the execute method of BAPI.
Otherwise give any input to the inputfiled then capture that value and send it input to BAPI from view to BAPI.
In my customcontroller
BAPI b = new BAPI();
b.Param1();
b.param2();
and
execute BAPI()
I done like this.
How can i capture the view input value how to send as a b.parama();
Please guide me .
Any snippests appriciate.
Thanks
nageswara. -
How to get input fields based on selection
Hi
i have dropdown which cointains 1 to 10 numbers,as soon as we select 2 in dropdown 2 input fields should be displayed.can u please help me in solving this problem
thanks
kishoreHI,
1:Add one child TransparentContainer to RootContainer with id TransparentContainer1
2:Take one attribute of type integer in context
3:When dropdown selected set the selected value to this attribute like
wdContext.currentcontextElement().set<value>(wdContext.current<DDNode>Element().get<DDValue>);
4:And in do modify view Method, put following code
IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("TransparentContainer1");
if(tc!=null)
tc.destroyAllChildren();
int number=wdContext.currentContextElement().getNumber();
IWDNodeInfo info=wdContext.getNodeInfo();
if(!(wdContext.isEmpty()))
wdContext.getContext().reset(false);
for(int i=0;i<number;i++)
IWDInputField inp=(IWDInputField)view.createElement(IWDInputField.class,"inp"+i);
info.addAttribute("val"+i,"com.sap.dictionary.double");
inp.bindValue("val"+i);
tc.addChild(inp);
Regards
LakshmiNarayana -
How to validate the input field data in VC using RFC FM
HI,
Could any body please give me the solution for the following issue?
When ever I enter a value in the input field of an iView, this value has to be validated from the backend BW system. Is this validation is possible using RFC function module?
If yes, please explain me.Hi Deepak,
U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
There are two ways to achieve ur task.
1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
http://aspzone.com/blogs/john/articles/173.aspx
Regards,
Naren -
Input Field Date Problem in EP7.0
Hi,
We have migrated the Enterprise Portal Application EP5SP6 to NW2004s SP6.Everything works fine except one issue in a Manager Reports, Where we are using Date type InputField.
Code used:
<hbj:inputField
id="otherdate1"
type="DATE"
showHelp="TRUE"
size="10"
maxlength="10"
jsObjectNeeded="true"
disabled="TRUE"
>
<%
JSP-scriptlet-START----
otherPeriodFrom=myContext.getParamIdForComponent(otherdate1);
JSP-scriptlet-END----
%>
</hbj:inputField>
<b>Javascript Error : Line : 3958 code: 2 Error: 'Undefined' is null or not an object</b>
Above Error appears when the below option in IE is selected.And also, Error appears only when the user enters the date.
Error doesn't seem to appear when user selects the date from DataPicker component irrespective whether the below option in IE is selected or not.
<b>IE Setting option :
Display a Notification about Every Script Error</b>
I'm not able to find what could be the problem in EP 7.0 as it works perfectly in EP5.0.
Any ideas would be appreciated !!
Thanks,
JojoHello,
Interesting to see the migration from EP5 to EP7 went well (except one issue).
Would it be possible to share thoughts on how you did the migration? Migration tools used? Lessons learned? ...
Thanks in advance
Best regards
Stephie
Message was edited by: deman Stephie -
Compound date (dd.MM.yyyy HH:mm) from two input fields
Hi,
I need to compound a date field in format dd.MM.yyyy HH:mm from two input fields(date and time field). I was trying a lot but could not get it to work. So right now I'm trying to start it simple but still have a couple of problems.
1.) To start easy I wanted to fill a hardcoded date into my field.
setAttribute(MYDATE, "01.01.2005 12:10");
brings (java.lang.IllegalArgumentException) Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
2.) setAttributeInternal(MYDATE, "01.01.2005 12:10");
brings JBO-27018: AttrSetValException Cause: The type of attribute value provided as an argument to the set() method for this attribute is not an instance of the Java type that this attribute expects.
3.) The thing that I reall need is something like:
DateFormat sim = new SimpleDateFormat("dd.MM.yyyy HH:mm");
java.util.Date datum = new java.util.Date();
try
datum = sim.parse("01.01.2005 12:30");
} catch (ParseException e)
setAttributeInternal(MYDATE, datum);
but right now this also ends with the JBO-27018
I also did try different types (timestamp and date) in my entity object and different format masks. Not working at all. All the threads I found are pointing to articles from Steve, which are not available anymore (the links don't work). So any help is appreciated.
Regards, PeterThankyou for the hint. I get it to work with
public void whatever
DateFormat simple = new SimpleDateFormat("dd.MM.yyyy HH:mm");
java.util.Date javaDate = new java.util.Date();
try
javaDate = simple.parse("01.01.2005 12:30");
} catch (ParseException e)
java.sql.Timestamp sqlDate = new java.sql.Timestamp(javaDate.getTime());
oracle.jbo.domain.Date nowDate = new oracle.jbo.domain.Date(sqlDate);
setAttributeInternal(MYDATE, nowDate);
but is there an easier and more 'beautiful' way to do this? Like using a date formatter on oracle.jbo.domain.Date instead using the SimpleDateFormat? btw. did I mention that I'm a Forms and PL/SQL programmer ;-)
Regards, Peter -
Hi...Experts am new in ABAP Webdynpro. Actually my application is Add Dynamic Input Field in webdynpro. Already One lable, one Input field is there and I add one more button. When I click that button Dynamically Adding same like existing lable and inputfield.Can anyone tel me how to resolve my problem.
Hi..Yugesh
U will try this,Definitly Ul get Answer.
For Dynamically creating Attribute
DATA : rootnode_info TYPE REF TO if_wd_context_node_info,
dyn_node_info TYPE REF TO if_wd_context_node_info,
dyn_node TYPE REF TO if_wd_context_node.
DATA : dyn_attr_info TYPE wdr_context_attribute_info.
dyn_attr_info-name = 'NAME'. Attribute Name
dyn_attr_info-DEFAULT_VALUE = 'Prakash'. +Iam Setting Default value of attribute,u can change as per ur requirement +
dyn_attr_info-type_name = 'ZDE_NAME' . Data Element(CHAR20) ( Type Of Attribute )
rootnode_info = wd_context->get_node_info( ).
CALL METHOD rootnode_info->add_attribute
EXPORTING
attribute_info = dyn_attr_info.
This will create a attribute at run time...
For Dynamically creating Input Field
DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lr_input TYPE REF TO cl_wd_input_field.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
DATA lr_button TYPE REF TO cl_wd_button.
DATA lr_grid_data TYPE REF TO cl_wd_grid_data.
DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
DATA lr_matrix TYPE REF TO cl_wd_matrix_head_data.
+Note : Before that change the Layout of ROOTUIELEMENTCONTAINER to MATRIX LAYOUT +
navigate from <CONTEXT> to <SFLIGHT> via lead selection
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
CALL METHOD cl_wd_input_field=>new_input_field
EXPORTING
bind_value = 'NAME' + attribute which i created above+
id = 'INPUT1'
RECEIVING
control = lr_input.
lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_input ).
lr_input->set_layout_data( lr_matrix ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_input.
ENDIF.
Code it in WDDOMODIFYVIEW... -
Input Fields of Selection Screen
HI
GIven the program name and the Screen #, i need to figure out all the Input fields , Data type and Length for that program( SAP STD REPORT).
I checked out the Element List in Se51 for the program name and screen number, I need something similar to it ..I need to pull out that data. How should i approach.
-Ravi.Output checkbox, means that it is a "disabled" input field. Output Only checkbox, means that it is more like a static text box.
F1 Help on Output Only.
<i>Pure output field
This specification makes sense only for template fields.
At runtime, the format of a template field can be distinguished from that of a field/text field, if it is defined as an output field, but not if it is defined as an input field.
If the flag is set for an output template, you cannot distinguish the format of a template field from that of a text field. This allows you to insert variable components in apparently fixed texts.
At runtime, you cannot dynamically modify the input/output attributes of output templates which have this flag set within the LOOP AT SCREEN ... ENDLOOP block in PBO modules.</i>
Regards,
Rich Heilman
Message was edited by: Rich Heilman -
Want the data store values to be displayed in input field of form
Hi,
I wanted to know wether is there possibility of displaying the data in a input field instead of expression field.
In our model i have used a form which has material type,plant and Vendor connected to data service1 in turn gives the out put in chart and i also have the second input form which has To(0CALMONTH) combo box which is connected to Data service2 and gives the data in table.
But what i wanted is to i also want to use the input fields of first form to second Data service2 and get the data based on on inputs of form1 and form2i.e also To field.
We can connect the port from form1 to DS2 but problem is we need to click the submit of form1 and form2 and it doesnt gives the output according the input of form1 and form2 as it gives the output of that form when we click that submit button.
I have followed help.sap for data tore procdure.
So i have used a datstore where i will store the values of form1 and call it in expression field which i will add and hide it in form2(hide because user should not see that input fields).
Formula used in data store for expression field.
IF(CONTAINS(STORE@matltype,@Material_Type),STORE@matltype,STORE@matltype &(IF(LEN(STORE@matltype)>0,'; ',''))&@Material_Type)
But whats happening is the value is getting concatenated when i goon change the values in input field, so i wanted to get the values to be replaced as soon as i change input field of form1(if use replace function its not working) and also it would be more preferrable if we use input field instead of expression field.
I would also like to know is there any alternate solution for the above requirement instead of datastore.
Thank You
K.SrinivasHi,
I have Form1 connected to Data service1 displays the data in a Chart and i have another Form2 connected to Dataservice2 displays the data in table.
In form1 there are Material Type,plant, and Vendor and form2 i have To (0CALMONTH)SO now i want also Form1 inputs for Table which gets teh data from Dataservice2.
What i have said earlier is connecting Form1 to Dataservice doesnt fetch the data correectly,its because if i click submit in form1 i get the data of those 3 inputs and i need to click the submit button in form2 after giving input which shows the data accordingly where it doesnt fulfill the requirement.
So i wanted some solution for that.For that reason i have used the data store and the procedure i have followed the help.sap as i said in my above mesage.
If Data store is also suggestable than i want to display the data in Text input Field instead of Expression field which should replace the previous values as soon as values change in data store.
Hope i have tried to be clear if still it is not i am ready to explain again.
Thank You
K.Srinivas -
Add data to table view from input fields in a page
Hi
I am developing a BSP page which will be called from SRM shop transaction. After user enters the line item data, data will be passed back to shop transaction using OCI interface and the page attributes (URL).
(1) How can I add data from input fields to table view on a page on a button click? I am able to add first line but I could not retain first line data when I try to add the second line.
I am able to add multiple lines to table view if I use view and controller by adding to the line data to static attribute of the controller. I cant use the controller and view because I can not set the attribute to Controller automatically.
(2) Is there a way to pass an attribute (URL) to controller from SPRO? Like we pass an attribute to page automatically (Automatic page attribute).
(3) How can I call a controller and view and pass the page attribute to the controller on a button click from a page with out controller?
Thanks
SreenivasI'm trying to test the merge with the following data in a test.txt file:
ZZZZZ114923000004
1234Z400660000001
ZZZZZ114923000010
Getting an error:
SQL> @C:\dataformats\sql\pc12seriesMerge.sql
Directory created.
SP2-0552: Bind variable "17" not declared.
SQL>
here it the pc12seriesMerge.sql file
set serveroutput on
create or replace directory user_dir as 'c:\dataformats\incoming\';
DECLARE
v_filename VARCHAR2(100); -- Data filename
v_file_exists boolean;
v_file_length number;
v_block_size number;
f utl_file.file_type;
s varchar2(200);
lineString varchar(200);
v_account varchar(5);
v_IDN varchar(6);
v_quantity varchar(6);
BEGIN
v_filename := 'TEST.TXT';
DBMS_OUTPUT.PUT_LINE(v_filename); --shows filename
utl_file.fgetattr('USER_DIR', v_filename, v_file_exists, v_file_length ,v_block_size );
IF v_file_exists THEN
dbms_output.put_line('File Exists');
create table ext_table (
account varchar2(5),
idn number(6),
quantity varchar2(6)
organization external (
type oracle_loader
default directory user_dir
access parameters (
records delimited by newline
fields (
account position(1:5) char(5),
idn position(6:11) char(6),
quantity position(12:17) char(6)
location ('test.txt')
reject limit unlimited;
MERGE INTO id_req_stg t
USING (
SELECT account,
idn,
decode(quantity, '-', 0, to_number(quantity)) as quantity
FROM ext_table
) v
ON ( t.account = v.account AND t.idn = v.idn )
WHEN MATCHED THEN
UPDATE SET t.quantity = v.quantity
DELETE WHERE t.quantity = 0
WHEN NOT MATCHED THEN
INSERT (account, idn, quantity)
VALUES (v.account, v.idn, v.quantity);
ELSE
dbms_output.put_line('File Does Not Exist');
END IF; -- file exists
EXCEPTION
WHEN UTL_FILE.ACCESS_DENIED THEN
DBMS_OUTPUT.PUT_LINE('No Access!!!');
WHEN UTL_FILE.INVALID_PATH THEN
DBMS_OUTPUT.PUT_LINE('PATH DOES NOT EXIST');
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);
END;
/ -
To add a method on select of a date from a date input field
Hi,
I have a input field which is binded to context element, type date. Hence the output screen has a date popup, from which user can select any dates.
Is it any way i can have a action executed on select of a date value?
I mean when the user selects a date from the date field an wction should be called.
As I have chosen it to be input field so at present I have only the option of OnEnter, which is not fulfilling the requirement.
Regards,
PranayHi Pranay,
Use the Date Navigator instead. It has got the same functionality as Date Picker (this is what you are using) & moreover, you can achieve what you desired. It has got the functions like onDaySelect, onWeekSelect & onMonthSelect & onSelect.
That will trigger the action what you want.
Regards
Chander Kararia
# Please close the thread once get the correct answer. Give rewards for answers. -
Not getting field value in Input field of field exit
Hi all
I am using field exit for data element GWLDT in transaction code IE02. But in this field exit I am not getting the value entered in the field "Begin guarantee date(GWLDT)" in the INPUT field of field exit.How I can get the value in the INPUT field of field exit?
Regards
DeepakUse this statement in source code.
output = input. -
How to enable/disable the input fields based on the data entered in the web dynpro application abap? If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.
Hi,
Try this code.
First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
Next go to Init method.
Set the readonly value as 'X'.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visible TYPE wd_this->element_context-visible.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
* @TODO fill attribute
* lv_visible = 1.
* set single attribute
lo_el_context->set_attribute(
name = `READONLY`
value = 'X').
After that Go to the Action ENTER.
First read the input field ( first input field, which is value entered field) , next give a condition
if input value is not initial then set the readonly value is ' '.
DATA lo_nd_input TYPE REF TO if_wd_context_node.
DATA lo_el_input TYPE REF TO if_wd_context_element.
DATA ls_input TYPE wd_this->element_input.
DATA lv_vbeln TYPE wd_this->element_input-vbeln.
* navigate from <CONTEXT> to <INPUT> via lead selection
lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
* @TODO handle non existant child
* IF lo_nd_input IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_input = lo_nd_input->get_element( ).
* @TODO handle not set lead selection
IF lo_el_input IS INITIAL.
ENDIF.
* get single attribute
lo_el_input->get_attribute(
EXPORTING
name = `VBELN`
IMPORTING
value = lv_vbeln ).
if lv_vbeln IS not INITIAL.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visible TYPE wd_this->element_context-visible.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
* @TODO fill attribute
* lv_visible = 1.
* set single attribute
lo_el_context->set_attribute(
name = `READONLY`
value = ' ' ). -
How to set Date in input field by hard coding in application
Hi all,
1.I have to make a date(its my choice to set the date) to appear in input field which is date type.
2.How to compare two numbers of type decimal. for example greatest of two numbers
urgent requirementHi
Check the http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
Sample Code
Date now = new Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
System.out.println("Today is " + s);
java.sql.Date descends from java.util.Date, but uses only the year, month and day values. There are two methods to create a Date object. The first uses a Calendar object, setting the year, month and day portions to the desired values. The hour, minute, second and millisecond values must be set to zero. At that point, Calendar.getTime().getTime() is invoked to get the java.util.Date milliseconds. That value is then passed to a java.sql.Date constructor:
Calendar cal = Calendar.getInstance();
// set Date portion to January 1, 1970
cal.set( cal.YEAR, 1970 );
cal.set( cal.MONTH, cal.JANUARY );
cal.set( cal.DATE, 1 );
cal.set( cal.HOUR_OF_DAY, 0 );
cal.set( cal.MINUTE, 0 );
cal.set( cal.SECOND, 0 );
cal.set( cal.MILLISECOND, 0 );
java.sql.Date jsqlD =
new java.sql.Date( cal.getTime().getTime() );
The second method is java.sql.Date's valueOf method. valueOf() accepts a String, which must be the date in JDBC time escape format - "yyyy-mm-dd". For example,
java.sql.Date jsqlD = java.sql.Date.valueOf( "2010-01-31" );
creates a Date object representing January 31, 2010. To use this method with a Calendar object, use:
java.sql.Date jsqlD = java.sql.Date.valueOf(
cal.get(cal.YEAR) + ":" +
cal.get(cal.MONTH) + ":" +
cal.get(cal.DATE) );
which produces a Date object with the same value as the first example.
Regards
Ayyapparaj -
Hi All,
I am a newbie to ABAP Webdynpro.I would liketo know how should I get the value from an input field at runtime?
Thanks,MuktaBy reading the context attribute which bound to inputfield, you can get the value.
Say you have a node called 'MAIN_NODE' and has the attribute 'INPUT_VALUE', which is bound to the Inputfield.
DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.
DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.
* navigate from <CONTEXT> to <MAIN_NODE> via lead selection
LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).
* get element via lead selection
LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT( ).
* get single attribute
LO_EL_MAIN_NODE->GET_ATTRIBUTE(
EXPORTING
NAME = `INPUT_VALUE`
IMPORTING
VALUE = LV_INP_VALUE ). "LV_INP_VALUE will have the value of inputfield
Raja T
Message was edited by:
Raja Thangamani
Maybe you are looking for
-
Adobe Creative Cloud not working
the adobe creative cloud home screen is all black and i cannot visualise anything. How can i resolve this?
-
Dreamweaver copy and paste not working
Hi The copy and paste functions on my Dreamweaver have stopped working. The copy and paste functions are greyed out in the edit drop down in both code and design views. Ctr C and V are also not working. Tried various fixes including moving the config
-
Hello folks, I'm having a strange issue with a computer I use as a media center. XFCE4 running on Arch. Everything works great except for the fact that the monitor turns off at random. It's not frequent, but once every 10-20 minutes it will happen. N
-
Connecting SAP CRM with Xcelsius to generate dashboards
Post Author: ppchandrasekar CA Forum: Xcelsius and Live Office Hi Team, I am new to BOBJ and its components. I want to integerate SAP CRM system with Xcelsius to generate dashboards. As per my understanding only through three sources we can generate
-
R400: Which LCDs/displays are compatible?
After years of good service, my think pad has a cracked LCD panel. Since the laptop is fine otherwise and I am quite content with it, I would like to replace the panel. The computer is a R400 7439 CT0, the display in question is a 14.1'' WXGA+ LED b