Set cursor in HTMLB/JSP??
Hi SDN
Can anyone tell me how I can set the cursor in a specific field, when I'm using JSP taglib?
Thanks in advance
Peter
Here is my jsp
It's fx "customerNumber" I would like to place the cursor in
<%@ taglib uri="tagLib" prefix="hbj" %>
<jsp:useBean id="rushOrderDataBean" scope="session" class="com.rushorder.DataBean" />
<jsp:useBean id="rushOrderLanguageBean" scope="session" class="com.rushorder.LanguageBean" />
<jsp:useBean id="rushOrderPropertiesBean" scope="session" class="com.support.PropertiesBean" />
<jsp:useBean id="rushOrderUserBean" scope="session" class="com.support.UserBean" />
<%@ page import="com.support.OrderItemCellRenderer" %>
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<!-- Navigation Top -->
<%
String getCustomer = null;
String getShipToCustomer = null;
String getMaterial = null;
String getMaterialInList = null;
String shipChanged = null;
String returnsChanged = null;
String deleteYesNo = rushOrderLanguageBean.getMsgDeleteYesNo();
String selectARow = rushOrderLanguageBean.getMsgSelectARow();
String internalNote = rushOrderDataBean.getInternalNote();
String orderTypeMissing = rushOrderLanguageBean.getMsgOrderTypeMustBeChecked();
String orderHandlerMissing = rushOrderLanguageBean.getMsgOrderHandlerMissing();
%>
<Table width="100%">
<TR>
<TD>
<TABLE width="100%">
<TR><TD width="40%"></TD>
<TD width="100%" align="left" valign="bottom">
<hbj:isolatedHtmlContainer id="isohtmlCont"
width="100%"
height="75"
srcUrl="<%= rushOrderPropertiesBean.returnRoadmapUrl() %>"
scrolling="AUTO"
bordered="FALSE"
tooltip="Roadmap"
/>
</TD>
<TD align="right" valign="bottom">
<hbj:button
id="btnBack"
text="<%= rushOrderLanguageBean.getButtonPreviousText() %>"
onClick="MoveBackClicked"
disabled="FALSE"
design="EMPHASIZED" />
</TD>
<TD align="right" valign="bottom">
<hbj:button
id="btnCreate"
text="<%= rushOrderLanguageBean.getButtonCreateAndPrintText() %>"
onClick="CreateClicked"
onClientClick="validate()"
disabled="<%=rushOrderDataBean.getCreateDisabled() %>"
design="EMPHASIZED"
jsObjectNeeded="true" />
</TD>
</TR>
</TABLE>
<HR align="left" size="4" color="#800000">
</TD>
</TR>
<TR>
<TD>
<TABLE>
<TR>
<TD>
<hbj:button
id="btnCancel"
text="<%= rushOrderLanguageBean.getButtonCancelOrderText() %>"
onClick="CancelClicked"
disabled="FALSE"
design="EMPHASIZED" />
</TD>
</TR>
</TABLE>
<TABLE style="BORDER-COLLAPSE: collapse" BGCOLOR="silver" borderColor="gray" border="1" cellPadding="3" width="100%">
<TD>
<TR>
<TD width="25%">
<hbj:label
id="label_pgiDate"
labelFor="pgiDate"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelPgiDate() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="pgiDate"
text="<%=rushOrderDataBean.getPgiDate() %>" />
</TD>
<TD width="25%" BGCOLOR="snow" BORDERCOLOR="SNOW">
</TD>
<TD width="25%" BGCOLOR="snow" BORDERCOLOR="SNOW">
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_order_type"
labelFor="rbOrderType"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelOrderType() %>" />
</TD>
<TD width="25%" BGCOLOR="snow">
<hbj:radioButtonGroup
id="rbOrderType"
columnCount="2"
selection="<%= rushOrderDataBean.getRbUpdateOrderTypeSelection() %>" >
<hbj:radioButton
id="First"
text="<%= rushOrderLanguageBean.getLabelCredit() %>"
key="Credit"
disabled="false"
jsObjectNeeded="true" />
<hbj:radioButton
id="Second"
text="<%= rushOrderLanguageBean.getLabelCashsale() %>"
key="Cashsale"
disabled="false"
jsObjectNeeded="true" />
</hbj:radioButtonGroup>
</TD>
<TD width="25%">
<hbj:label
id="label_hhcReference"
labelFor="hhcReference"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelReferenceFromHcc() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="hhcReference"
text="<%=rushOrderDataBean.getHhcReference() %>" />
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_customerName"
labelFor="customerName"
width="100%"
wrapping="TRUE"
design="EMPHASIZED"
text="<%= rushOrderLanguageBean.getLabelCustomerName() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="customerName"
text="<%=rushOrderDataBean.getCustomerName() %>" />
</TD>
<TD width="25%">
<hbj:label
id="label_customerNumber"
labelFor="customerNumber"
design="STANDARD"
wrapping="TRUE"
width="100%"
text="<%= rushOrderLanguageBean.getLabelCustomerNo() %>" />
</TD>
<TD width="25%" BGCOLOR="snow">
<hbj:inputField
id="customerNumber"
type="string"
invalid="<%=rushOrderDataBean.getIsCustomerInvalidAsString() %>"
width="100%"
value="<%=rushOrderDataBean.getCustomerNumber() %>"
tooltip="<%=rushOrderDataBean.getToolTipForCustomerNumber() %>"
jsObjectNeeded="true" >
<% customerNumber.setClientEvent(
com.sapportals.htmlb.enum.EventTrigger.ON_CHANGE,
"getCustomer()");
%>
</hbj:inputField>
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_customerName2"
labelFor="customerName2"
design="EMPHASIZED"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelCustomerName2() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="customerName2"
text="<%=rushOrderDataBean.getCustomerName2() %>" />
</TD>
<TD width="25%">
<hbj:label
id="label_tel"
labelFor="telNumber"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelPhone() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="telNumber"
width="100%"
text="<%=rushOrderDataBean.getPhone() %>" />
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_address"
labelFor="address"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelAddress() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="address"
width="100%"
text="<%=rushOrderDataBean.getAddress() %>" />
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_postalcode"
labelFor="postalcode"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelPostal() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="postalcode"
width="100%"
text="<%=rushOrderDataBean.getPostalCode() %>" />
</TD>
<TD width="25%">
<hbj:label
id="label_city"
labelFor="city"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelCity() %>" />
</TD>
<TD width="25%">
<hbj:textView
id="city"
width="100%"
text="<%=rushOrderDataBean.getCity() %>" />
</TD>
</TR>
</TD>
</TABLE>
<TABLE style="BORDER-COLLAPSE: collapse" BGCOLOR="silver" borderColor="gray" border="1" cellPadding="3" width="100%">
<TR>
<TD width="25%">
<hbj:label
id="label_shipToCustomerNumber"
labelFor="shipToCustomerNumber"
design="STANDARD"
wrapping="TRUE"
width="100%"
text="<%= rushOrderLanguageBean.getLabelCustomerShipTo() %>" />
</TD>
<TD width="25%" BGCOLOR="snow">
<hbj:inputField
id="shipToCustomerNumber"
type="string"
invalid="<%=rushOrderDataBean.getIsShipToCustomerInvalidAsString() %>"
disabled="<%=rushOrderDataBean.getShipToCustomerDisabled() %>"
width="100%"
value="<%=rushOrderDataBean.getShipToCustomerNumber() %>"
tooltip="<%=rushOrderDataBean.getToolTipForShipToCustomer() %>"
jsObjectNeeded="true" >
<% shipToCustomerNumber.setClientEvent(
com.sapportals.htmlb.enum.EventTrigger.ON_CHANGE,
"getShipToCustomer()");
%>
</hbj:inputField>
</TD>
<TD width="50%">
<hbj:textView
id="shipToCustomerAddress"
width="100%"
text="<%=rushOrderDataBean.getShipToCustomerAddress()%>" />
</TD>
</TR>
</TABLE>
<TABLE width="100%">
<TR>
<TD width="1%">
<hbj:button
id="btnSearchCust"
text="<%= rushOrderLanguageBean.getButtonSearchCustText() %>"
onClick="MoveSearchCustomerClicked"
disabled="FALSE"
design="STANDARD" />
</TD>
<TD width="1%" align="left">
<hbj:button
id="btnSearchShipCust"
text="<%= rushOrderLanguageBean.getButtonSearchShipCustText() %>"
onClick="MoveSearchShipToCustomerClicked"
disabled="<%=rushOrderDataBean.getShipToCustomerDisabled() %>"
design="STANDARD" />
</TD>
<TD align="left">
<hbj:button
id="btnAccept"
text="<%= rushOrderLanguageBean.getButtonAcceptCustomerChoiceText() %>"
onClick="AcceptClicked"
disabled="<%= rushOrderDataBean.getAcceptCustomerChoiceDisabled()%>"
design="STANDARD" />
</TD>
<TD align="right">
<hbj:button
id="btnPrice"
text="<%= rushOrderLanguageBean.getButtonPriceQuotationText() %>"
onClick="MovePriceQuotationClicked"
disabled="false"
design="STANDARD" />
</TD>
</TR>
</TABLE>
<TABLE width="100%">
<TR>
<TD width="25%">
<hbj:label
id="label_purchase"
labelFor="purchaseorder"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelPurchaseNo() %>" />
</TD>
<TD width="25%">
<hbj:inputField
id="purchase"
type="string"
width="100%"
value="<%=rushOrderDataBean.getPurchaseOrder() %>" >
</hbj:inputField>
</TD>
<TD width="25%">
<hbj:label
id="label_order"
labelFor="orderno"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelManualRoutineOrderNo() %>" />
</TD>
<TD width="25%">
<hbj:inputField
id="orderno"
type="string"
width="100%"
value="<%=rushOrderDataBean.getOrderNo() %>" >
</hbj:inputField>
</TD>
</TR>
<TR>
<TD width="25%">
<hbj:label
id="label_orderHandler"
labelFor="orderHandler"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelOrderHandler() %>" />
</TD>
<TD width="25%">
<hbj:inputField
id="orderHandler"
type="string"
width="100%"
value="<%=rushOrderDataBean.getOrderHandler() %>"
jsObjectNeeded="true" >
</hbj:inputField>
</TD>
<TD width="25%">
<hbj:label
id="label_personalId"
labelFor="personalId"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelPersonalId() %>" />
</TD>
<TD width="25%">
<hbj:inputField
id="personalId"
type="string"
width="100%"
value="<%=rushOrderDataBean.getPersonalId() %>" >
</hbj:inputField>
</TD>
</TR>
</TABLE>
<TABLE width="100%">
<TR>
<TD width="25%">
<hbj:label
id="label_text"
labelFor="text"
design="STANDARD"
width="100%"
wrapping="TRUE"
text="<%= rushOrderLanguageBean.getLabelOrderText() %>" />
</TD>
<TD width="75%" align="left">
<hbj:inputField
id="text"
type="string"
maxlength="50"
width="100%"
value="<%=rushOrderDataBean.getOrderText() %>" >
</hbj:inputField>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<TABLE style="BORDER-COLLAPSE: collapse" BGCOLOR="silver" borderColor="gray" border="1" cellPadding="3" width="100%">
<TD width="100%">
<hbj:textView
id="oi"
text="<%= rushOrderLanguageBean.getLabelOrderItems() %>"
design="HEADER2" />
</TD>
</TABLE>
<TABLE>
<TR>
<TD>
<hbj:button
id="buttonDeleteOI"
text="<%= rushOrderLanguageBean.getButtonDeleteOrderItemText() %>"
onClick="DeleteOIClicked"
onClientClick="confirmDelete();"
disabled="<%= rushOrderDataBean.getDeleteOrderItemDisabled()%>"
design="STANDARD"
jsObjectNeeded="true" />
</TD>
<TD>
<hbj:button
id="buttonAddOIText"
text="<%= rushOrderLanguageBean.getButtonAddOrderItemText() %>"
onClick="MoveAddOrderItemTextClicked"
onClientClick="checkFlag()"
disabled="<%= rushOrderDataBean.getAddOrderItemTextDisabled() %>"
design="STANDARD"
jsObjectNeeded="true" />
</TD>
<TD>
<hbj:button
id="buttonEditIccInfo"
text="<%= rushOrderLanguageBean.getButtonViewEditIccInfoText() %>"
onClick="MoveViewEditIccClicked"
onClientClick="checkFlag()"
disabled="<%= rushOrderDataBean.getViewEditIccDisabled()%>"
design="STANDARD"
jsObjectNeeded="true" />
</TD>
<% if (rushOrderUserBean.getManualPriceAllowed().equalsIgnoreCase("Y")){ %>
<TD>
<hbj:button
id="buttonItemPrice"
text="<%= rushOrderLanguageBean.getButtonChangeOrderItemPriceText() %>"
onClick="MoveManualPriceClicked"
onClientClick="checkFlag()"
disabled="<%= rushOrderDataBean.getViewEditIccDisabled()%>"
design="STANDARD"
jsObjectNeeded="true" />
</TD>
<% } %>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<TABLE width="100%">
<TR>
<TD>
<hbj:tableView
id="orderItemsTableView"
model="rushOrderDataBean.orderItemsModel"
design="ALTERNATING"
headerVisible="false"
footerVisible="true"
fillUpEmptyRows="false"
navigationMode="BYLINE"
selectionMode="SINGLESELECT"
visibleFirstRow="<%=rushOrderDataBean.getOrderItemListVisibleFirstRow() %>"
visibleRowCount="100"
width="100%"
onNavigate="orderItemsNavigation" >
<%
orderItemsTableView.setUserTypeCellRenderer(new OrderItemCellRenderer());
orderItemsTableView.setOnClientRowSelection("setFlag()");
%>
</hbj:tableView>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD width="100%" BGCOLOR="snow" BORDERCOLOR="snow">
<hbj:textView
id="message"
design="HEADER2"
text="<%=rushOrderDataBean.getMessage() %>" />
</TD>
</TR>
<SPAN STYLE="visibility: hidden">
<hbj:button id='searchCustomerEvent'
text=""
onClick="getCustomerByNumber">
<% getCustomer = myContext.getParamIdForComponent(searchCustomerEvent); %>
</hbj:button>
<hbj:button id='searchShipToCustomerEvent'
text=""
onClick="getShipToCustomerByNumber">
<% getShipToCustomer = myContext.getParamIdForComponent(searchShipToCustomerEvent); %>
</hbj:button>
<hbj:button id='searchMaterialEvent'
text=""
onClick="getMaterialByNumber">
<% getMaterial = myContext.getParamIdForComponent(searchMaterialEvent); %>
</hbj:button>
<hbj:button id='searchMaterialInListEvent'
text=""
onClick="getMaterialInList">
<% getMaterialInList = myContext.getParamIdForComponent(searchMaterialInListEvent); %>
</hbj:button>
<hbj:button id='shipChangedEvent'
text=""
onClick="shipChanged">
<% shipChanged = myContext.getParamIdForComponent(shipChangedEvent); %>
</hbj:button>
<hbj:button id='returnsChangedEvent'
text=""
onClick="returnsChanged">
<% returnsChanged = myContext.getParamIdForComponent(returnsChangedEvent); %>
</hbj:button>
</SPAN>
<SCRIPT language = "JavaScript">
function getCustomer()
document.all.<%=getCustomer%>.click();
function getShipToCustomer()
document.all.<%=getShipToCustomer%>.click();
function getMaterial()
document.all.<%=getMaterial%>.click();
function getMaterialInList()
document.all.<%=getMaterialInList%>.click();
function shipChanged()
document.all.<%=shipChanged%>.click();
function confirmDelete() {
var agree=confirm("<%= deleteYesNo%>");
if (agree) {
if (checkFlag()==true) {
return true ;
} else return false;
} else {
htmlbevent.cancelSubmit = true;
return false ;
var flag = false;
function setFlag(){
flag = true;
function checkFlag(){
if(flag == false) {
alert("<%= selectARow%>");
htmlbevent.cancelSubmit="true";
return false;
function validate(){
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
var rb1 = eval(func("rbOrderType" + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
var rb2 = eval(func("rbOrderType" + htmlb_radiobuttonmodifier.substring(3,7)+ "2"));
var inpOh = eval(func("orderHandler"));
var valOh = inpOh.getValue();
if ((!rb1.getChecked())&&(!rb2.getChecked())) {
alert("<%= orderTypeMissing%>");
htmlbevent.cancelSubmit="true";
} else {
if (((valOh==" ")||(valOh==""))&&(<%= rushOrderUserBean.getOrderHandlerMandatory().equalsIgnoreCase("Y")%>)){
alert("<%= orderHandlerMissing%>");
htmlbevent.cancelSubmit="true";
if ('<%= internalNote %>' != '') {
alert("<%= internalNote%>");
</SCRIPT>
</TABLE>
</hbj:form>
</hbj:page>
</hbj:content>
Similar Messages
-
Set cursor in a specific view of transaction MM01/MM02
Hi,
We have to check a condition in the user-exit EXIT_SAPLMGMU_001, for transaction MM01/MM02, and if the condition fails the client wants to set the cursor in a specific field from a specific view. Is it possible? I tried to use the sentence SET CURSOR referenced to a remote program but it doesn't work.
Does anybody knows how to solve this problem?
Thanks in advance
Regards
MaribelHi
I hope, you have read the documetation attached with this Standard Enhancement - MGA00001.
EXIT_SAPLMGMU_001
Where Is the Customer Exit - EXIT_SAPLMGMU_001 called?
The customer exit is in function module MATERIAL_UPDATE_ALL. The
function module checks the data for errors (logical relationships,
foreign keys, fixed domain values, and so on) when the material master
is updated.
Use
o New fields
You can make checks possible for new fields of your own. These
checks must be identical to the checks that you carry out for your
new fields in online maintenance.
o Existing fields
For existing fields, you can extend and intensify the checks.
You can also change data for descriptions and general material data
(MARA). For example, the descriptions can be generated from attributes
of the material.
Limitations
You cannot bypass existing checks.
Interface to Application
The respective data of the current logical transaction is contained in
the structures, for example, in structure WMARA for MARA. Nonrelevant
structures are transferred with their initial values.
General material data that can be changed (CMARA) has the structure
MARU. This MARA view contains fewer internal fields than MARA itself. If
WMARA is filled, CMARA is also filled when accessed.
The customer exit contains the exception APPLICATION_ERROR for your
self-defined error situations.
Using the language element MESSAGE .. RAISING APPLICATION_ERROR, you can
terminate the current (logical) transaction and display your message in
the log.
Also, I guess, have you put some code in the Includes available with the EXITS and then activated the Project in CMOD.
<b>Reward points</b>
Regards -
Set cursor in Control String component
Hello:
I would like to set cursor in "Control String" automatically when I open my VI. If I open my VI, cursor should be seen automatically in the text field of "Control String". The user hasn`t set cursor by mouse into this field. Has anybody an idea how can I do?
Thanks!Create a property node for the control on your block diagram and set the Key Focus property value to TRUE.
http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/ctrl_key_focus/
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness -
Make sure both attached files (Run LabVIEW_Cursor_TestCase.vi, SimpleVI.vi) are in the same folder. Run LabVIEW_Cursor_TestCase.vi notice that the -3 error code is returned from "Set Cursor.vi" after it has been called with 30 different panel refs. If "Set Cursor.vi" is replaced with "Set Busy.vi" the same error occurs.Is there a workaround for this problem other that setting the cursor image manually in user32.dll? I must be able to open more than 30 panels and set them all to busy. In the test case I used a single VI, simply to demonstrate the error.
Message Edited by Jerred on 05-04-2007 10:06 AM
Attachments:
LabVIEW_Cursor_TestCase.vi 68 KB
SimpleVI.vi 13 KBThis bug is fixed in LabVIEW 8.0 and later. Unfortunately, I know of no workaround in LabVIEW 7.x. When I encountered this bug in one of my UIs in LabVIEW 7.x, my "fix" was simply to ignore the error outputs from the cursor VIs, and to live with the fact that I had no custom cursors after 30 windows had been opened.
-D
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
How do I set cursor.index to anywhere in the graph array?
I am using LV 8.5.1 and feeding an XY graph with an X-Y array of data. Only a section of the array is displayed on the graph. I have a cursor (single-plot).
I would like to set Cursor.Index property node of the cursor associated with the plot to the maximum index value of the graphed array regardless of the XScale range. I don't seem to be able to do it. I cannot set it beyond a certain number. When I rescale the graph I have a new maximum number. Is this what should happen?
To get around this, I am momentarily setting the XScale.ScaleFit property to 1, which then allows me to set Cursor.Index to maximum (I then immediately reduce my scale range appropriately). I am having to do this before every occurrence of setting the Cursor.Index in case the new setting exceeds the currently allowed maximum value. Just seems a bit clunky.
Thanks for any help.This is no longer a problem. My data is too big to feasibly be fed into a graph so am having to chop it up and use my own index pointer.
-
How to set cursor in table control?
I have a table control (Screen 300) to display invoice number and amount. For some checks we have around 200 invoices to be displayed. When user enters the invoice number in invoice text box and click on OK, it should highlight the invoice number and amount row or set the cursor position.
I have another problem.
Screen 300 is being called from Screen 200. When the user clicks on OK in 300, 300 is getting closed. Acutally it should be displayed with Cusor position or highlighted row.
I appreaciate your help ... ThanksI believe that you can use the SET CURSOR statement to do the first part of your requirement. Something like this should work:
SET CURSOR FIELD w_field LINE w_line.
Here's the info from SAP help:
Effect
: The cursor is positioned on the screen element whose name is contained in upper case in field. The data object field must be character-type and flat. The screen layout or a table control is scrolled in the display so that the screen element on which the cursor is positioned is visible. If the specified screen element is not found, the statement is ignored.
If the specified screen element is part of a table control or a step loop, the line of the table control or group of the step loop in which the cursor is positioned on the specified screen element must be specified using the addition LINE. For the data object line, the type i is expected. If there is no line or group for the value of line, or the addition LINE is not specified, the statement is ignored. The statement is also ignored if the addition LINE is specified and the screen element is not part of a table control or step loop.
I hope this helps.
- April King -
Set cursor alv grid (not using objects)
I got a question on ALV GRID (not using objects), please let me know if you have pointers. Thanks.
Output has 2 screens both has different contents. The output is generated using internal table1 and 2 and using FM 'REUSE_ALV_GRID_DISPLAY_LVC' (both screen use same FM).
First screen has multiple pages of output (say 10 pages). User scrolled page 5 and line 10 of first screen and then double clicked it takes to screen #2. After completion of screen #2, the back arrow should get back to page 5 and line 10 of screen #1. Currently the back arrow gets to screen#1 page 1 and line 1. How to remember the cursor position in alv grid and instruct the cursor to go there?
Appreciate the input.
Note: I tried "set cursor line n" with "Scroll" command but no luck. http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba47e35c111d1829f0000e829fbfe/content.htmThanks for the inputs.
FYI, I got it implemented using method CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
The method is called by 'REUSE_ALV_GRID_DISPLAY_LVC' form 'PF_STATUS_SET' when the ALV grid output is presented each time.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_bypassing_buffer = 'X'
i_callback_program = gc_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = lwa_layout
it_fieldcat_lvc = git_fc_lvc
i_default = ' '
TABLES
t_outtab = git_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM alv_event_pf_status_set USING rt_extab
TYPE slis_t_extab.
DATA lo_ref1 TYPE REF TO cl_gui_alv_grid.
*Get the reference to class "lo_ref1" for the ALV report
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_ref1.
*set the focus of cursor in ALV
CALL METHOD lo_ref1->set_current_cell_via_id
EXPORTING
is_row_no = gv_row. "row number where you want to focus the cursor
ENDFORM. -
How to set cursor in perticular field Table Maintence generator?
Hi
All
I have created a table with 2 fields Start_date and End_date. Now my requirement is i have to validate the both date field as Start_Date must be LESS than or EQUAL to End_Date. In table maintenance maintenance generator i have created a event VALIDATE_DATE in event 21. Its validating perfectly. The issue is after the ERROR message the Cursor is going to the key field. I want to set the cursor at End_Date field.
I used
data:ly_pos type i.
IF NOT start_date LE end_date.
SET CURSOR FIELD 'TABLE_NAME-END_DATE' LINE sy-linno OFFSET lv_pos.
MESSAGE exxx(MsgClass).
ENDIF.
Its working for the FIRST time i am entering the new data. Next time the cursor going to the KEY field. I have been asked not to write code in SE80. Anyhow i have to set the cursor in table maintenance maintenance generator event.
Can anybody help?Hi Sourav,
Please follow the below method:
Go to Maintainance Screen (where you want the cursor setting). Goto Status - > Remember the screen name -> Double click on Program name.. Open Object list and expant Screen Tree -> double click on the same screen Number -> Go to its first tab attributs -> Change Mode -> Do F4 on Cursor Position field -> Choose the field where you want the cursor.
But this way will always set the cursor at the HardCoded Field Name.
Thanks,
Preyansh -
Set cursor on error field in selection screen
Hi ALL,
How to place the cursor on a particular selection screen field?I am doing validation if validation fails for a particular field the program should give error mesg and the cursor should place on the error field only but it's going to the Ist field on the selection can somebody tell me how do this? I tried with set cursor field <fieldname) but not working I am doing validations on at-selection screen.
Thanks&Regard
maheshHi chandrasekhar find my code below
this code i am writing under at selection-screen.
*& Form Z_VALIDATE_TVKOV
FORM z_validate_tvkov .
DATA: i_vtweg LIKE vbak-vtweg.
IF NOT s_vtweg-low IS INITIAL.
SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
WHERE vtweg = s_vtweg-low.
IF sy-subrc <> 0.
set cursor FIELD 'S_VTWEG-LOW'.
MESSAGE e000(z_sd) WITH text-052.
ENDIF.
ENDIF.
IF NOT s_vtweg-high IS INITIAL.
SELECT SINGLE vtweg FROM tvkov INTO i_vtweg
WHERE vtweg = s_vtweg-high.
IF sy-subrc <> 0.
MESSAGE e000(z_sd) WITH text-052.
ENDIF.
ENDIF.
ENDFORM. " Z_VALIDATE_TVKOV -
Hi guys,
I generated a report which gives out put in ALV grid.
In the ALV grid output, I have some editable fields.
Lets suppose, there are some editable fields with no data in it.
I have userdefined pushbutton in Application toolbar, when I press the pushbutton the cursor should go to the empty field in the ALV grid output.
Can this be possible through SET CURSOR statement?
Thanks,
Shivaa......Hi,
You can set the cursor field on the output list that too for the output fields which are vissible on the screen only.
syntax
SET CURSOR 11 3. ---> 11Coloumn and 3 line
for dynamically setting cursor, first you have to search for the empty fields then set the cursor dynamically.
look at this help document it might be helpful
http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba47e35c111d1829f0000e829fbfe/content.htm
Regards
Bala KRishna -
Set-Cursor In TableControl Help Help Help
Hello Friends
Please HelpOut for Sure
i had an table control which is filled by internal Table itab_emp
i m applying condition on that internal table
its giving error message
i want that cursor should be placed to that position that gives errormessage
i m sending u code
Just tell me changes
LOOP AT ITAB_EMP WHERE MARK = 'X' .
IF SY-SUBRC = 0.
ITAB_TEST[] = ITAB_EMP[].
DELETE ADJACENT DUPLICATES FROM ITAB_TEST.
LOOP AT ITAB_TEST.
CLEAR SUM .
LOOP AT ITAB_EMP WHERE PERID = ITAB_TEST-PERID.
SUM = SUM + ITAB_EMP-OTIME.
IF SUM > '100000'.
MESSAGE E018.
<b>ELSEIF ITAB_EMP-OTIME > '010000'.
MESSAGE E017.
SET CURSOR FIELD ITAB_EMP-OTIME .</b> ELSE.
MOVE-CORRESPONDING ITAB_EMP TO ITAB_OTAPP .
ITAB_OTAPP-OBJID = 1.
ITAB_OTAPP-INACT = 'X'.
ITAB_OTAPP-TODTE = ZHR_PR_M_OTAPP-TODTE.
ITAB_OTAPP-FRDTE = ZHR_PR_M_OTAPP-FRDTE.
ITAB_OTAPP-IMMHD = ZHR_PR_M_OTAPP-IMMHD.
ITAB_OTAPP-CRETM = SY-UZEIT.
ITAB_OTAPP-CREON = SY-DATUM.
ITAB_OTAPP-CREBY = SY-UNAME.
APPEND ITAB_OTAPP.
ENDIF.
ENDLOOP.
ENDLOOP.
endif.
endloop.
LOOP AT ITAB_OTAPP INTO WA_ITAB_OTAPP.
MODIFY ZHR_PR_M_OTAPP FROM WA_ITAB_OTAPP.
ENDLOOP.
BOLD lines are the condition checking
if check all the lines and then if any of the line gives error it reflects now i want to place cursor on that field which is giving error
sy-tabix will work
BUT HOW?????
Hope this time any of the genius gotmy problem
With Best Regards
RubySome of the logic is a bit confusing (would be easier to read if you used the "Code" button in the SDN message editor)... for example:
LOOP AT ITAB_EMP WHERE MARK = 'X' .
IF SY-SUBRC = 0.
... the "IF SY-SUBRC" won't be reached unless there is at least one row where "mark = 'X'.''...
Anyhow, where is this code implemented currently?... the usual approach to validating a table control is to have a module called inside the "loop at table control" in the PAI of the screen flow... then the contents of each row on the screen will get passed into your logic a row at a time automatically and the "set cursor field" + "message e999(zz)" type code should work as it will refer to the current row being checked.
Jonathan -
hey guys,
MODULE PAI_CHECK.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
SET CURSOR FIELD 'LTAB-KUNNR'
MESSAGE E005.
END MODULE.
does not allow me to put cursor at KUNNR field, instead
it stands in first column itself..
what could be the reason here..
ambichanTry setting the cursor field in the PBO.
If this is to point the user at the error which is occuring, then it should happend automatically if you are coding it correctly.
This statement should actually be in its own module.
MODIFY MYTAB FROM LTAB INDEX ZTABDISP-CURRENTLINE transporting KUNRR STATUS.
The checks should be in their own modules.
MODULE CHECK_KUNNR.
IF ltab-kunnr is initial.
message E005.
endif.
ENDMODULE.
In your flow logic, in the PAI, you should be coding your checks like this.
LOOP AT LTAB.
MODULE YOUR_MODIFY_STATEMENT.
FIELD LTAB-KUNNR MODULE CHECK_KUNNR.
ENDLOOP.
Regards,
Rich Heilman -
Hi experts,
I want to position the cursor in a screen field.
I gave SET CURSOR FIELD GS_ASSEMBLY-SERNR in PAI.
But still the cursor is not in required position.
Pls help me to do this.
Thanks.Hi Murugan ....
in the screen example 100- > in <b>Attribute's tab</b> ( first tab ) there is Other Attriubutes block which is 3rd selection screen in the screen..
<b>Exactly below the <b>Next Screen</b> field that is the <b>Cursor position</b> .
<b>for setting the cursor on the screen</b>
<b>there do the F4</b> it will show the <b>list of the fields which are all declared in the screen by you ..</b>
<b>just select the field</b> ..... inwhich field you want to set the cursor .</b>then <b>activate</b> it ... execute and see ...
the cursor will be there on the cursor selected field .
reward points if it is usefull ...
Girish -
hi experts,
wt is diff b/w get cursor and set cursor?
thanks in advance.Hi Deepak.
Firstly, We can set the cursor at any event.
For example: set/get cursor field.
May be any event, the cursor is set/the cursor position of that field is obtained/set. The cursor position at which event you want to get/set for that event triggering.
Coming to the differences:
Simply, GET CURSOR deals with knowing the cursor position of that field, line, etc during triggering of an event.
SET CURSOR deals with placing the cursor at a particular position / field/ line, etc.
[To Find the cursor position - Get cursor|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbabf135c111d1829f0000e829fbfe/frameset.htm]
[To set the cursor position|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac0b35c111d1829f0000e829fbfe/frameset.htm]
Good Luck & Regards.
HARSH -
Set the input cursor i.e. "set cursor" in ABAP
In ABAP Dynpro, I have the possibility to set the cursor to a specified input field using the "set cursor" command.
In ABAP Web Dynpro it seems that I always have to place the cursor first using the mouse. Is there an equivalent to "set cursor" in ABAP Web Dynpro?you can use the following method REQUEST_FOCUS_ON_VIEW_ELEM of IF_WD_VIEW.
data: lv_v_elem type ref to if_wd_view_element.
lv_v_elem = view->get_element( 'INP_PAR_LIFNR' ).
if lv_v_elem is bound.
view->request_focus_on_view_elem( lv_v_elem ).
endif.
Maybe you are looking for
-
Safari "Top Sites" and Belkin wireless router
Have been experiencing a problem with Safari / Belkin router for the past 3 days. I have noticed it occurs most often when using the "top sites" function of Safari. It seems that whenever I use top sites it causes a disconnect between my macbook and
-
Hi Everybody Is there any tools available for mass upload of documents into server? please provide me the information. Thanks Prasad
-
HT4061 I can't not use my AirPrint from my I pad 2
I can't print from my I pad 2
-
Audio bug with WAV files: use mp3, not wav for syncing long audio files
Just a tip: I've noticed another audio bug in Presenter (including 7.05) but there is a workaround. I often export the audio as a single, long clip from pre-recorded lecture videos, and sync it with the powerpoint slides in Presenter. I've found it e
-
I was looking at my apps and noticed that I have 3 iMovie apps. I realize that Numbers and Pages have two because of the two versions but why 3 iMovie apps? How do I tell which one to remove if any? The 3 have the following folders and files. 1) fold