Openscript - unable to get value in adfinputtext
Hi,
I am not able to get value from adfinputtext field using the following command
String value = adf.inputText("/web:window[@index='1' or @title='http://wlintqatest2.wfs.com/TripPlanningFunctional/faces/com/wfs/tripPlanning/functional/ui/Welcome.jspx?_adf.ctrlstate=q8nte391j_4']/web:document[@index='0']/web:ADFInputText[@label='Local Currency' and @absoluteLocator='pt1:r1:t6[0]:it20']").getAttribute("value").trim();
info("value is ..."+value);
Kindly suggest a solution for this.
Regards,
Mohan.
This below test case works absolutely fine:
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<f:loadBundle basename="resources.application" var="bundle"/>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
function editValue(){
var spanObj = document.getElementById('testForm:dCode1');
if(spanObj.innerHTML == ''){
spanObj.innerHTML = 'Delivery Code';
}else{
spanObj.innerHTML = '';
return false;
</script>
</head>
<body>
<h:form id="testForm">
<h:outputText id="dCode1" styleClass="font_size" value="Delivery Code"/>
<h:commandButton value="Hide" onclick="return editValue();"/>
<h:commandButton value="Show" onclick="return editValue();"/>
</h:form>
</body>
</html>
</f:view>Still if things doesn't work for you, I am afraid your issue has got nothing to do with JSF.
~SirG
Similar Messages
-
I am getting the following error with IE9 and Firefox 26 with application express 3.2:
SCRIPT5007: Unable to get value of the property 'nodeName': object is null or undefined
apex_ns_3_1.js, line 589 character 10
this.dialog.check2 = function (e){
var tPar = html_GetTarget(e);
var lEl = $x('apexir_col_values_drop');
var l_Test = true;
****** while(tPar.nodeName != 'BODY'){
tPar = tPar.parentNode;
if(tPar == lEl){l_Test = false;}
if(l_Test){$x_Remove('apexir_col_values_drop')}
This happens when I click the Gear Icon, then Filter, then I click the dropdown arrow under expressions and pick an expression from the list.
If I set (through IE Developer tools) back to IE8 mode, I don't get the error.Guess no one is using 3.2 any longer or no one else gets this error..... Guess I can edit the JavaScript file to trap the error since it really doesn't seem to cause an issue. Just didn't want to have to go that route.
-
Hi All,
I already calculated a row(Add Total row) like Gross profit within Group1 (a,b,c,d,e which are sub groups) using Previous and current scope column group values. ex: Gross Profit = a - b. (within group1)
Gross Profit = Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value) in Group1
Now, I want to get values for Net income like Net income = a - b - c in Group1. (OR)
Net income = Gross Profit - c in Group1 (Using Gross Profit textbox values using Reportitems!textbox.value). but, values different. Since Expression got new calculation)
Please help me.
Thanks Advance.
- Prem Kumar T D http://www.sharepointbasic.com/Hi Premtd,
As per my understanding, there are group and subgroups in the report, you added total to a group with the expresson: Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value). You want to add a text box to the report to calculate Net income
with the expression: Previous(Sum(Fields!Trans_amount.Value)) - Sum(Fields!Trans_amount.Value) - Sum(Fields!Trans_amount.Value). In order to improve the efficiency of troubleshooting, I need to ask several questions:
• “I already calculated a row(Add Total row) like Gross profit within Group1 (a,b,c,d,e which are sub groups)” What’s the meaning of Group1 and subgroup a, b, c, d, e ? Could you please mark Gross profit and the groups in the screenshot?
• How to calculate Net income? Please provide some more detailed information of your requirements. I would be appreciated it if you could provide sample data and clear screenshot of the report.
This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu -
Unable to get the values from PAYLOAD
Hi,
i'm unable to get the values of payload. When i use
currentTask = client.getTaskQueryService().getTaskDetailsById(workflowContext, taskID);
Element payload = (Element)currentTask.getPayloadAsElement();
node = (Element)payload.getFirstChild();
System.out.println(node.getElementsByTagName("documentName").item(0).getNodeValue());
I get null but i instantiate the bpel process with a value and i have
- <payload>
- <ns1:DocumentReviewProcessRequest xmlns:ns1="http://xmlns.oracle.com/bpel/Review">
<ns1:documentTitle>vbvnmbvn</ns1:documentTitle>
<ns1:documentName>bvnbvnvn</ns1:documentName>
<ns1:URI>http://www.first.pt</ns1:URI>
<ns1:assignees>gestdoc</ns1:assignees>
<ns1:groups />
</ns1:DocumentReviewProcessRequest>
</payload>
if i use System.out.println(node.getElementsByTagName("HELLO").item(0).getNodeValue());
I get a normal erro 'cause this variable don't exist...
Can someone please help me?
Thanks!!I think the problem is UME related. I had the same problem once. Try using a system user for searching, instead of the logged on user.
Like this:
com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getUser("cmadmin_service");
Please reward the points if this helps. -
I currently am using PPT to expose data from a Microsoft Analysis Server cube. The cube is wide open and requires no permissions to access.
The behavior of my filters is odd as sometimes they work perfectly fine, and other times I receive the following error upon report run:
Unable to get filter values.
An unexpected error occurred. Error 10828. Additional details have been logged for your administrator.
I have looked at the ULS logs and found the following:
An unexpected error occurred. Error 10828. Exception details: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PerformancePoint.Scorecards.Server.PmServer.QueryTimeIntelligenceInternal(DataSource dataSource, DateTime currentTime, String formula)
at Microsoft.PerformancePoint.Scorecards.Server.PmServer.QueryTimeIntelligence(RepositoryLocation dataSourceLocation, DateTime currentTime, String formula)
An exception occurred while rendering a Web control. The following diagnostic information might help to determine the cause of this problem: Microsoft.PerformancePoint.Scorecards.BpmException: Unable to get filter values. PerformancePoint Services
error code 20700.
This is odd to me, as I can trick the report to run by changing the date filters to another day, then back to the original days that error'ed out and everything is fine. Some guidance would be appreciated.Hi,
Do you mean that you have Office 2007 and Office 2010 both installed in you computer?
Based on my test, I copy a Access 2010 database into a computer only installed Offic 2007, then using Excel 2007 to import Access database data, no error occurred.
So double click the Access database to see whether the databased is opened with Access 2007 or Access 2010. If it is opened with Access 2010, then try to save it as Access 2007 to
check the issue.
Jaynet Zhang
TechNet Community Support -
Why iam unable to get the valu from combobox
when i run this code
everytime iam getting blank alert
y iam unable to get the selected item from combo box
thank u
<%@ page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%><%@page import="java.sql.*,java.util.*,java.text.*,java.util.ArrayList, java.util.List,org.joda.time.DateTimeConstants,org.joda.time.LocalDate,
org.joda.time.Weeks"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Reading Data From Text Fields</TITLE>
</HEAD><BODY onload=Datevalue()>
<form name="form1" action ="" method="post" onSubmit="update();">
<img src="nendrasys_logo.gif" align="right"></img>
<b><font color="669900"><h4 align="left">UserName:</font>
<jsp:useBean id="user" scope="session" class="nendrasys.User" />
<jsp:getProperty name="user" property= "name"/>
    
<b><font color="90be00"><h4 align="left">Designation:</font>
<jsp:getProperty name="user" property= "designation"/>
<br><font color="669900"><h4 align="right">Project:</font>
<select name="Projects">
<option>Project:1</option>
<option>Project:2</option>
<option>Project:3</option>
<option>Project:4</option>
<option>Project:5</option>
</select>
<%! String s; %>
<% DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
//out.println(dateFormat.format(date));
s= dateFormat.format(date);
%>
<select name="Dates" sizes=1 id="dates" onchange="Datevalue(this.value)">
<script type="text/javascript">
<!--//
var begDate = new Date("10/01/2008");
var endDate = new Date();
var previousDate =new Date();
var presentDate =new Date("<%=s %>");
endDate.setDate(presentDate.getDate()+14);
begDate.setDate(begDate.getDate()+(6-begDate.getDay()));
while (begDate <= endDate) {
var datestring=[begDate.getDate(),(begDate.getMonth()+1),begDate.getFullYear()].join('/');
// var datestring=[begDate.getDate().padZero(2),(begDate.getMonth()+1).padZero(2),begDate.getFullYear()].join('/');
if(previousDate < presentDate && presentDate <= begDate )
document.writeln('<option selected>'+(datestring)+'</option>')}
else
document.writeln('<option>'+(datestring)+'</option>')};
previousDate.setDate(begDate.getDate());
previousDate.setMonth(begDate.getMonth());
previousDate.setYear(begDate.getYear());
begDate.setDate(begDate.getDate()+7);
document.writeln('</select>');
//-->
</script>
<br><br>
<TABLE BORDER="2" BORDERCOLOR="#336699" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
<TR>
<TD>   </TD>
<TD bgcolor="669900"><label id="sun"></label></TD>
<TD bgcolor="90be00"><label for="mon" id="Mon">Mon</label></TD>
<TD bgcolor="669900"><label for="tue" id="tue">Tue</label></TD>
<TD bgcolor="90be00"><label for="wed" id="wed">Wed</label></TD>
<TD bgcolor="669900"><label for="thu" id="thu">Thu</label></TD>
<TD bgcolor="90be00"><label for="fri" id="fri">Fri</label></TD>
<TD bgcolor="669900"><label for="sat" id="sat">Sat</label></TD>
<TD bgcolor="90be00"><label for="tot" id="tot">Total</label></TD>
</TR>
<tr>
<th>Project Work</th>
<td bgcolor="669900"><input type="text" name="c11" size="2" value="7" onBlur="javascript:document.frm.c12.value = document.frm.c11.value"></td>
<td bgcolor="90be00"><input type="text" name="c12" size="2" value="3"></td>
<td bgcolor="669900"><input type="text" name="c13" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c14" size="2"></td>
<td bgcolor="669900"><input type="text" name="c15" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c16" size="2"></td>
<td bgcolor="669900"><input type="text" name="c17" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c18" size="4"></td>
</tr>
<tr>
<th>Internal N/C</th>
<td bgcolor="669900"><input type="text" name="c21" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c22" size="2"></td>
<td bgcolor="669900"><input type="text" name="c23" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c24" size="2"></td>
<td bgcolor="669900"><input type="text" name="c25" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c26" size="2"></td>
<td bgcolor="669900"><input type="text" name="c27" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c28" size="4"></td>
</tr>
<tr>
<th>Public Holidays</th>
<td bgcolor="669900"><input type="text" name="c31" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c32" size="2"></td>
<td bgcolor="669900"><input type="text" name="c33" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c34" size="2"></td>
<td bgcolor="669900"><input type="text" name="c35" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c36" size="2" ></td>
<td bgcolor="669900"><input type="text" name="c37" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c38" size="4"></td>
</tr>
<tr>
<th>Holidays Taken</th>
<td bgcolor="669900"><input type="text" name="c41" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c42" size="2"></td>
<td bgcolor="669900"><input type="text" name="c43" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c44" size="2"></td>
<td bgcolor="669900"><input type="text" name="c45" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c46" size="2"></td>
<td bgcolor="669900"><input type="text" name="c47" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c48" size="4"></td>
</tr>
</TABLE>
<br>
<center><input type="submit" value="Submit" /> </center>
<%
String username = request.getParameter("userid");
String pwd = request.getParameter("pwd");
String connectionURL = "jdbc:mysql://localhost:3306/timestamp";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
String sql=null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root","nendrasys");
statement = connection.createStatement();
//rs=statement.executeQuery(sql); %>
</form>
<SCRIPT language='Javascript'>
function update()
alert("ciaoooooo");
<%
try
String value=request.getParameter("c11");
String value1=request.getParameter("c12");
// if(value!=null)
// System.out.println(value);
// System.out.println(value1);
catch(NullPointerException n)
%>
</script>
<SCRIPT language='Javascript'>
function Datevalue(date)
// document.getElementById("dates").innerHTML=document.getElementById("sun").value;
alert(date);
// alert( document.getElementById("dates"))
<% System.out.println("bye");%>
</SCRIPT>
</BODY>
</HTML>You mixed Java and Javascript in the expectation that they runs simultaneously.
You are Wrong.
You need to distinguish between the server side languages and client side languages. Java/JSP runs at the server side and produces a HTML page with other client side stuff in it like CSS and Javascript. When the HTML page is finished, it will be sent to the client and then Java/JSP stops. Once the HTML page is arrived at the client, there is no one line Java code in it, only its output/result. Do a View Source in your favourite web browser to see it. Only from that moment on, Javascript runs and/or can be invoked.
Whenever you want to use Java variables in Javascript, you need to print them out as a Javascript variable. Whenever you want to use Javascript variables in Java, you need to invoke a request to the server and pass them as parameters. The request can be either synchronous (a link or a form submit) or asynchronous (ajaxical). -
Unable to get the item value in cursor
I have function which returns organization_id for each item selected in Sales Order window.
From this function I will populate warehouse value in shipping tab whenever i am tabbing out from ordered item in Sales Order Form.
But my cursor is unable to get the item id value (Ex: FOR cur_rec IN cus_l (l_item_id)). It is directly going to last return statement and displaying default value.
Please help me out.
FUNCTION custom_default_rule (
p_database_object_name IN VARCHAR2,
p_attribute_code IN VARCHAR2
RETURN NUMBER
AS
l_line_type_rec oe_order_cache.line_type_rec_type;
l_item_id NUMBER;
p_org_id NUMBER;
CURSOR cus_l (p_item_id IN NUMBER)
IS
SELECT a.organization_id, b.element_name, b.element_value
FROM mtl_parameters a,
mtl_descr_element_values b,
mtl_system_items_b c
WHERE b.inventory_item_id = c.inventory_item_id
AND a.organization_id = c.organization_id
AND a.organization_id = c.organization_id
AND c.inventory_item_id = p_item_id
AND a.organization_id <> a.master_organization_id
ORDER BY a.organization_id;
CURSOR cur_org (p_org_id IN NUMBER)
IS
SELECT organization_code
FROM mtl_parameters
WHERE organization_id = p_org_id;
BEGIN
l_line_type_rec :=
oe_order_cache.load_line_type
(ont_line_def_hdlr.g_record.line_type_id);
l_item_id := ont_line_def_hdlr.g_record.inventory_item_id;
FOR cur_rec IN cus_l (l_item_id)
LOOP
IF cur_rec.element_name IN
('Frequency',
'Emission Norms',
'Voltage',
'Duty Rating',
'Phase',
'Product Family'
AND cur_rec.element_value IN
('50',
'Dual',
'Euro',
'210',
'230',
'440',
'Low',
'Medium',
'Heavy',
'Three',
'QSK60',
'QSK15',
'QSK10',
'DQK50'
THEN
RETURN cur_rec.organization_id;
If u want more info. abt function refer: Refer "PL/SQL API + Defaulting Rules in OM" in Forums.oracle.com
(OR)
PL/SQL API + Defaulting Rules in OM
Please help me out. This is very urgent.
Thanks & Regards,
Sateesh KumarHi Suresh,
I tried like below:
create or replace FUNCTION custom_default_rule (
p_database_object_name IN VARCHAR2,
p_attribute_code IN VARCHAR2
RETURN NUMBER
AS
l_line_type_rec oe_order_cache.line_type_rec_type;
l_line_rec OE_AK_ORDER_LINES_V%ROWTYPE;
l_item_id NUMBER;
p_org_id NUMBER;
CURSOR cus_l (p_item_id IN NUMBER)
IS
SELECT a.organization_id, b.element_name, b.element_value
FROM mtl_parameters a,
mtl_descr_element_values b,
mtl_system_items_b c
WHERE b.inventory_item_id = c.inventory_item_id
AND a.organization_id = c.organization_id
AND a.organization_id = c.organization_id
AND c.inventory_item_id = p_item_id
AND a.organization_id <> a.master_organization_id
ORDER BY a.organization_id;
CURSOR cur_org (p_org_id IN NUMBER)
IS
SELECT organization_code
FROM mtl_parameters
WHERE organization_id = p_org_id;
BEGIN
l_line_type_rec :=
oe_order_cache.load_line_type(ont_line_def_hdlr.g_record.line_type_id);
l_line_rec := ONT_line_Def_Hdlr.g_record;
-- l_item_id := l_line_rec.inventory_item_id;
-- FOR cur_rec IN cus_l (l_item_id)
FOR cur_rec IN cus_l(l_line_rec.inventory_item_id)
LOOP
IF cur_rec.element_name IN
('Frequency',
'Emission Norms',
'Voltage',
'Duty Rating',
'Phase',
'Product Family'
AND cur_rec.element_value IN
('50',
'Dual',
'Euro',
'210',
'230',
'440',
'Low',
'Medium',
'Heavy',
'Three',
'QSK60',
'QSK15',
'QSK10',
'DQK50'
THEN
RETURN cur_rec.organization_id;
FOR cur_rec_org IN cur_org (p_org_id)
LOOP
RETURN cur_rec_org.organization_code;
END LOOP;
END IF;
END LOOP;
RETURN '204';
EXCEPTION
WHEN OTHERS
THEN
IF oe_msg_pub.check_msg_level (oe_msg_pub.g_msg_lvl_unexp_error)
THEN
oe_msg_pub.add_exc_msg ('OE_Default_PVT', 'CUSTOM_DEFAULT_RULE');
END IF;
RAISE fnd_api.g_exc_unexpected_error;
END custom_default_rule;
This function executed without errors. But it is displaying final return statement value (i.e., 204).
I am not getting inventory_item_id value to my cursor.
Please help me out...It is very urgent.
Thanks & Regards,
Sateesh Kumar S
Message was edited by:
user610830 -
Unable to get the selection value of OAMessageChoiceBean
Hi,
From our 11i to R12 upgrade, in Customer Advance Search page, we are unable to get the proper handle for OAMessageChoiceBean (in extendedCO).
The code snippet for handling the bean is as follows:
OAMessageChoiceBean PartyStatusFilter = (OAMessageChoiceBean)vOAPageContext.getRootWebBean().findChildRecursive("xxfeF426PartySearchStatus");
String xxTest= PartyStatusFilter.getSelectionValue(vOAPageContext);
The value for above xxTest (in R12 env.) is coming as null. Whereas, the same code is working in 11i enviroment and the output of xxTest="A".
Hence, we are unable to get the selection value of the messagechoicebean in our R12 environment. Moreover, I've already looked into similar previous posts of this forum, also tried using getSelectionText(vOAPageContext) or getSelectedValue(), but it didn’t worked too.
Any pointers please?
Many Thanks,
ZahidHi Keerthi,
I'm still unable to get the value using your provided code. The referenced snippet I used is as follows:
String messageChoiceValue = null;
vOAPageContext.writeDiagnostics(s, "Before the IF LOOP", 2);
if(vOAPageContext.getParameter("xxfeF426PartySearchStatus")!= null ) {
vOAPageContext.writeDiagnostics(s, "Inside the IF LOOP ", 2);
messageChoiceValue = vOAPageContext.getParameter("MessageChoiceID");
vOAPageContext.writeDiagnostics(s, "Value of MessageChoice... "+messageChoiceValue, 2);
if( messageChoiceValue != null ) {
l++;
saveFilterRow(SSLineVO, HeaderId, new oracle.jbo.domain.Number(l), "C", "Status", messageChoiceValue);
vOAPageContext.writeDiagnostics(s, "After the IF LOOP", 2);
The resultant output is as follows:
"Before the IF LOOP", "After the IF LOOP"
It doesn't goes inside the IF condition as the valuie is null. Any other alternative?
Regards,
Zahid -
Unable to get VO attribute values from CO extension
Hi All,
I have extended a standard controller. Screen has view link. There are fields updatable in both master and child VOs'.
If i change these fields (messageTextInput), Im able to get the modified values of master VO.
But Child VO gives me the database value and not the modified value.
this is the code im using to get values.
OAViewObject vo = (OAViewObject)am.findViewObject("PosViewLinesVO");
OAViewObject vo1 = (OAViewObject)am.findViewObject("PosViewShipmentsVO");
Row row = vo.first();
while(row != null)
Number poLineId = (Number)row.getAttribute("PO_LINE_ID");
Number lineTotal = (Number)row.getAttribute("Total");
Row row1 = vo1.first();
while(row1 != null)
Number poLineId1 = (Number)row1.getAttribute("PoLineId");
if(poLineId1.equals(poLineId))
Number lineLocId = (Number)row1.getAttribute("LINE_LOCATION_ID");
Number price = (Number)row1.getAttribute("NewPrice");
row1 = vo1.next();
row = vo.next();
Please help. Am i missing sometihng.
Thanks in advanceare you getting any null pointer ??
and check OAViewObject vo = (OAViewObject)am.findViewObject("PosViewLinesVO");// is this PosViewLinesVO or PosViewLinesVO1
Thanks
--Anil -
Unable to get parameter values from a remote database
I am linking to a remote database view via a synonym in Oracle and trying to retrieve parameter values from it. The username and password are the same for the local and remote database and I can run the SQL query using SQL plus against the database and values are returned. However, when I try and run the same query in Crystal Reports (XI) I receive an Oracle error:
"An attempt was made to connect or log in to a remote database using a connection description that could not be found.
Action:
Specify an existing database link. Query the data dictionary to see all existing database links. See your operating system-specific Net8 documentation for valid connection descriptors. "
How can it be that Crystal cannot run the query when it is valid in SQL plus?
Any tips/info would be appreciated.
many thanks
Claire
Oracle is version 10When running one of the reports in VS.Net this is the error I receive:
"A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Failed to retrieve data from the database.
Details: [Database Vendor Code: 2019 ]
Failed to retrieve data from the database.
Error in File C:\DOCUME1\CLAIRE1.REE\LOCALS~1\Temp\{0C6C6DD5-B958-4E10-A2AA-928C58E1B7CE}.rpt:
Failed to retrieve data from the database.
Details: [Database Vendor Code: 2019 ]"
When running the same report in Crystal Reports designer I receive this error message:
"Prompting failed with the following error message: 'List of Values failure: fail to get values. [Cause of error: Failed to retrieve data from the database. Details: [Database Vendor Code: 2019]. Failure to retrieve data from the database. Error in File UNKNOWN.RPT. Failure to retrieve data from the database. Details: [Database Vendor Code: 2019]]'.
Error source: prompt.dll Error code: 0x8004380D"
So this one is also failing in the designer.
All the parameters in the main report are static and the ones in the subreport are passed in from the main report. -
Unable to get Material No and Description from VBAP
Hi Gurus
Can anyone please help me to get material number and description from vbap table, The report is fine but I am unable to get material no and description.
regards
report ZCHGDOC_BY_SALES no standard page heading
line-size 132.
type-pools:
slis. " ALV types
Tables
tables:
cdhdr, " Change documents: Header
cdpos, " Change documents: Items
vbak, " Sales order: Header
mara, " Material No
user_addr, " User Address
vbap. " Contract order: Items
Types
types:
begin of ty_cdhdr,
objectclas like cdhdr-objectclas, " Object class
objectid like cdhdr-objectid, " Object value
changenr like cdhdr-changenr, " Document change number
username like cdhdr-username, " Changed by
udate like cdhdr-udate, " Changed on
utime like cdhdr-utime, " Changed at
tcode like cdhdr-tcode, " Transaction code
end of ty_cdhdr,
ty_it_cdhdr type ty_cdhdr occurs 0,
begin of ty_cdpos,
objectclas like cdpos-objectclas, " Object class
objectid like cdpos-objectid, " Object value
changenr like cdpos-changenr, " Document change number
tabname like cdpos-tabname, " Table name
tabkey like cdpos-tabkey, " Table key
fname like cdpos-fname, " Field name
chngind like cdpos-chngind, " Change indicator
value_new like cdpos-value_new, " New value of field
value_old like cdpos-value_old, " Old value of field
end of ty_cdpos,
ty_it_cdpos type ty_cdpos occurs 0,
begin of ty_dd03l,
tabname like dd03l-tabname,
fieldname like dd03l-fieldname,
as4local like dd03l-as4local,
as4vers like dd03l-as4vers,
rollname like dd03l-rollname,
end of ty_dd03l,
ty_it_dd03l type ty_dd03l occurs 0,
begin of ty_dd04t,
rollname like dd04t-rollname,
ddlanguage like dd04t-ddlanguage,
as4local like dd04t-as4local,
as4vers like dd04t-as4vers,
scrtext_l like dd04t-scrtext_l,
end of ty_dd04t,
ty_it_dd04t type ty_dd04t occurs 0,
begin of ty_kna1,
kunnr like kna1-kunnr, " Customer number
name1 like kna1-name1, " Customer name
end of ty_kna1,
ty_it_kna1 type ty_kna1 occurs 0,
begin of ty_user_addr,
bname like user_addr-bname, " user no
name_textc like user_addr-name_textc , " Username
end of ty_user_addr,
ty_it_user_addr type ty_user_addr occurs 0,
begin of ty_vbap,
matnr like vbap-matnr, " Material No
arktx like vbap-arktx, " Production Description
end of ty_vbap,
ty_it_vbap type ty_vbap occurs 0,
ty_text(500) type c,
ty_lines type tline,
ty_it_lines type ty_lines occurs 0,
begin of ty_merged,
vbeln like vbak-vbeln, " Sales order number
erdat like vbak-erdat, " Created on
auart like vbak-auart, " Order type
faksk like vbak-faksk, " Billing block in SD document
netwr like vbak-netwr, " Net value
waerk like vbak-waerk, " Currency
vkorg like vbak-vkorg, " Sales organisation
vtweg like vbak-vtweg, " Distribution channel
vkbur like vbak-vkbur, " Sales office
fkara like vbak-fkara, " Proposed billing type
kunnr like vbak-kunnr, " Sold-to party
bname like vbak-bname , " User No
xblnr like vbak-xblnr, " Reference
fbuda like vbkd-fbuda, " Date services rendered
username like cdhdr-username, " Changed by
udate like cdhdr-udate, " Changed on
utime like cdhdr-utime, " Changed at
tcode like cdhdr-tcode, " Transaction code
tabname like cdpos-tabname, " Table name
tabkey like cdpos-tabkey, " Table key
fname like cdpos-fname, " Field name
chngind like cdpos-chngind, " Change indicator
value_new like cdpos-value_new, " New value of field
value_old like cdpos-value_old, " Old value of field
scrtext_l like dd04t-scrtext_l, " Description of field
intnote type ty_text, " Internal note
hdrnote type ty_text, " Header note
name1 like adrc-name1, " Sold-to party name
matnr like vbap-matnr, " Material No
arktx like vbap-arktx, " Product Description
end of ty_merged,
ty_it_merged type ty_merged occurs 0,
begin of ty_vbak,
vbeln like vbak-vbeln, " Sales order number
erdat like vbak-erdat, " Created on
auart like vbak-auart, " Order type
faksk like vbak-faksk, " Billing block in SD document
netwr like vbak-netwr, " Net value
waerk like vbak-waerk, " Currency
vkorg like vbak-vkorg, " Sales organisation
vtweg like vbak-vtweg, " Distribution channel
vkbur like vbak-vkbur, " Sales office
fkara like vbak-fkara, " Proposed billing type
kunnr like vbak-kunnr, " Sold-to party
xblnr like vbak-xblnr, " Reference
objectid like cdhdr-objectid, " Change document object
end of ty_vbak,
ty_it_vbak type ty_vbak occurs 0,
begin of ty_vbkd,
vbeln like vbkd-vbeln, " Sales order number
posnr like vbkd-posnr, " Sales order item
fbuda like vbkd-fbuda, " Date services rendered
end of ty_vbkd,
ty_it_vbkd type ty_vbkd occurs 0.
Internal tables
data:
it_cdhdr type ty_it_cdhdr,
it_cdpos type ty_it_cdpos,
it_fieldcat type slis_t_fieldcat_alv,
it_kna1 type ty_it_kna1,
it_user_addr type ty_it_user_addr,
it_merged type ty_it_merged,
it_vbak type ty_it_vbak,
Material No
it_vbap type ty_it_vbap,
it_vbkd type ty_it_vbkd.
data:
wa_vbak type ty_vbak.
data:
st_tvariant like disvariant,
st_variant like disvariant.
constants:
co_as4local_a like dd03l-as4local " Active version
value 'A',
co_objectclas_verkbeleg like cdhdr-objectclas
value 'VERKBELEG',
co_posnr_initial like vbkd-posnr " Initial item number
value is initial,
co_posnr_initial_2 like vbap-posnr " Initial item number
value is initial,
co_save_u type c " User display variant
value 'U', " saving allowed.
co_trvog_0 like vbak-trvog " Sales order
value '0'.
data:
va_exit type c, " ALV display
va_tabix like sy-tabix.
selection-screen: begin of block b1 with frame title text-001.
select-options:
s_vkorg for vbak-vkorg OBLIGATORY, " Sales organisation
s_vkbur for vbak-vkbur, " Sales office
s_vtweg for vbak-vtweg, " Distribution channel
s_vbeln for vbak-vbeln, " Sales order number
s_usrnme for cdhdr-username, " Changed by
s_udate for cdhdr-udate. " Changed on
selection-screen: end of block b1,
begin of block b2 with frame title text-002.
parameters:
p_varint like disvariant-variant. " Display variant.
selection-screen: end of block b2.
Initialization
initialization.
Load display variant.
if not p_varint is initial.
move st_variant to st_tvariant.
move p_varint to st_tvariant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = co_save_u
changing
cs_variant = st_tvariant.
st_variant = st_tvariant.
else.
clear st_variant.
st_variant-report = sy-repid.
endif.
at selection-screen on value-request for p_varint.
Provide display variant list for this program.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = st_variant
i_save = co_save_u
importing
e_exit = va_exit
es_variant = st_tvariant
exceptions
not_found = 2.
if sy-subrc eq 2.
message id sy-msgid type 'S'
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
if va_exit eq space.
st_variant = st_tvariant.
p_varint = st_tvariant-variant.
endif.
endif.
At selection screen
at selection-screen.
Load display variant.
if not p_varint is initial.
move st_variant to st_tvariant.
move p_varint to st_tvariant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = co_save_u
changing
cs_variant = st_tvariant.
st_variant = st_tvariant.
else.
clear st_variant.
st_variant-report = sy-repid.
endif.
Start of selection
Extract order details from VBAK
select vbeln erdat auart faksk netwr waerk vkorg vtweg vkbur fkara
kunnr xblnr
from vbak
into table it_vbak
where vkorg in s_vkorg
and vkbur in s_vkbur
and vbeln in s_vbeln.
if sy-subrc ne 0.
No data found for selection
message s001(zgen).
exit.
endif.
loop at it_vbak into wa_vbak.
va_tabix = sy-tabix.
wa_vbak-objectid = wa_vbak-vbeln.
modify it_vbak from wa_vbak
index va_tabix
transporting objectid.
endloop.
if sy-subrc ne 0.
No data found for selection
message s001(zgen).
exit.
endif.
loop at it_vbak into wa_vbak.
va_tabix = sy-tabix.
wa_vbak-objectid = wa_vbak-vbeln.
modify it_vbak from wa_vbak
index va_tabix
transporting objectid.
endloop.
Extract Change data
select objectclas objectid changenr username udate utime tcode
from cdhdr
into table it_cdhdr
for all entries in it_vbak
where objectclas eq co_objectclas_verkbeleg
and objectid eq it_vbak-objectid
and username in s_usrnme
and udate in s_udate.
if sy-subrc eq 0.
select objectclas objectid changenr tabname tabkey fname chngind
value_new value_old
from cdpos
into table it_cdpos
for all entries in it_cdhdr
where fname NE 'CMPRE_FLT'
and objectclas eq it_cdhdr-objectclas
and objectid eq it_cdhdr-objectid
and changenr eq it_cdhdr-changenr.
endif.
Extract customer details from KNA1
select kunnr name1
from kna1
into table it_kna1
for all entries in it_vbak
where kunnr eq it_vbak-kunnr.
---- Changes are made here -
Extract Material details from vbap
select matnr arktx
from vbap
into table it_vbap
for all entries in it_vbak
where
vbeln eq it_vbak-vbeln
and posnr eq co_posnr_initial.
-----------------End of Change ----------------------*
Extract Contract No from vbkd.
select vbeln posnr fbuda
from vbkd
into table it_vbkd
for all entries in it_vbak
where vbeln eq it_vbak-vbeln
and posnr eq co_posnr_initial.
perform merge_data tables it_cdhdr
it_cdpos
it_kna1
it_user_addr
it_merged
it_vbak
it_vbap
it_vbkd.
if it_merged[] is initial.
message s001(zgen).
exit.
endif.
Release memory no longer required.
free: it_cdhdr,
it_cdpos,
it_kna1,
it_user_addr,
it_vbak,
it_vbap,
it_vbkd.
Build field catalog for call to report function
perform build_field_catalog tables it_fieldcat.
Output report.
perform output_report tables it_fieldcat
it_merged.
*& Form merge_data
text
form merge_data tables pa_it_cdhdr type ty_it_cdhdr
pa_it_cdpos type ty_it_cdpos
pa_it_kna1 type ty_it_kna1
pa_it_user_addr type ty_it_user_addr
pa_it_merged type ty_it_merged
pa_it_vbak type ty_it_vbak
pa_it_vbap type ty_it_vbap
pa_it_vbkd type ty_it_vbkd.
Local internal tables
data:
lit_dd03l type ty_it_dd03l,
lit_dd04t type ty_it_dd04t.
Local work areas
data:
lwa_cdhdr type ty_cdhdr,
lwa_cdpos type ty_cdpos,
lwa_dd03l type ty_dd03l,
lwa_dd04t type ty_dd04t,
lwa_kna1 type ty_kna1,
lwa_user_addr type ty_user_addr,
lwa_merged type ty_merged,
lwa_vbak type ty_vbak,
lwa_vbap type ty_vbap,
lwa_vbkd type ty_vbkd.
Local variables
data:
lva_dd03l_tabix like sy-tabix,
lva_dd04t_tabix like sy-tabix.
Sort Data
sort pa_it_cdhdr by objectid changenr.
sort pa_it_cdpos by objectid changenr tabname tabkey fname.
sort pa_it_kna1 by kunnr.
sort pa_it_user_addr by bname.
sort pa_it_vbak by vbeln.
sort pa_it_vbkd by vbeln.
loop at pa_it_vbak into lwa_vbak.
clear lwa_merged.
Assign sales order fields to reporting work area
lwa_merged-vbeln = lwa_vbak-vbeln.
lwa_merged-erdat = lwa_vbak-erdat.
lwa_merged-auart = lwa_vbak-auart.
lwa_merged-faksk = lwa_vbak-faksk.
lwa_merged-netwr = lwa_vbak-netwr.
lwa_merged-waerk = lwa_vbak-waerk.
lwa_merged-vkorg = lwa_vbak-vkorg.
lwa_merged-vtweg = lwa_vbak-vtweg.
lwa_merged-vkbur = lwa_vbak-vkbur.
lwa_merged-fkara = lwa_vbak-fkara.
lwa_merged-kunnr = lwa_vbak-kunnr.
lwa_merged-bname = 1wa_user_addr-bname.
lwa_merged-xblnr = lwa_vbak-xblnr.
Assgin Material to reporting work area
lwa_merged-matnr = lwa_vbap-vbeln.
Get name of sold-to party from PA_IT_KNA1
clear lwa_kna1.
read table pa_it_kna1 into lwa_kna1
with key kunnr = lwa_vbak-kunnr
binary search.
lwa_merged-name1 = lwa_kna1-name1.
Get name from PA_it_user_addr
clear lwa_user_addr.
read table pa_it_user_addr into lwa_user_addr
with key = lwa_user_addr-bname
binary search.
lwa_merged-username = lwa_user_addr-name_textc.
Get business data from PA_IT_VBKD.
clear lwa_vbkd.
read table pa_it_vbkd into lwa_vbkd
with key vbeln = lwa_vbak-vbeln
binary search.
lwa_merged-fbuda = lwa_vbkd-fbuda.
Get Material Data
clear lwa_vbap.
read table pa_it_vbap into lwa_vbap
with key matnr = lwa_vbap-matnr
with key vbeln = lwa_vbak-vbeln
binary search.
lwa_merged-arktx = lwa_vbap-arktx.
Get internal note text for sales order
perform read_text using '0002'
'1'
lwa_merged-vbeln
'VBBK'
lwa_merged-intnote.
Get header note 1 text for sales order
perform read_text using 'Z002'
'1'
lwa_merged-vbeln
'VBBK'
lwa_merged-hdrnote.
Determine if change documents exist for sales order.
clear lwa_cdhdr.
read table pa_it_cdhdr into lwa_cdhdr
with key objectid = lwa_vbak-objectid.
if sy-subrc ne 0.
continue.
endif.
loop at pa_it_cdhdr into lwa_cdhdr
from sy-tabix.
lwa_merged-username = lwa_cdhdr-username.
lwa_merged-udate = lwa_cdhdr-udate.
lwa_merged-utime = lwa_cdhdr-utime.
lwa_merged-tcode = lwa_cdhdr-tcode.
clear lwa_cdpos.
read table pa_it_cdpos into lwa_cdpos
with key objectid = lwa_cdhdr-objectid
changenr = lwa_cdhdr-changenr
binary search.
loop at pa_it_cdpos into lwa_cdpos
from sy-tabix.
lwa_merged-tabname = lwa_cdpos-tabname.
lwa_merged-tabkey = lwa_cdpos-tabkey.
lwa_merged-fname = lwa_cdpos-fname.
lwa_merged-chngind = lwa_cdpos-chngind.
lwa_merged-value_new = lwa_cdpos-value_new.
lwa_merged-value_old = lwa_cdpos-value_old.
Get description for field - determine date element
clear lwa_dd03l.
read table lit_dd03l into lwa_dd03l
with key tabname = lwa_cdpos-tabname
fieldname = lwa_cdpos-fname
binary search.
lva_dd03l_tabix = sy-tabix.
if sy-subrc ne 0.
select single tabname fieldname as4local as4vers rollname
from dd03l
into lwa_dd03l
where tabname eq lwa_cdpos-tabname
and fieldname eq lwa_cdpos-fname
and as4local eq co_as4local_a.
if sy-subrc eq 0.
insert lwa_dd03l into lit_dd03l
index lva_dd03l_tabix.
endif.
endif.
If data element was found, get description
if not lwa_dd03l is initial.
clear lwa_dd04t.
read table lit_dd04t into lwa_dd04t
with key rollname = lwa_dd03l-rollname
ddlanguage = sy-langu
binary search.
lva_dd04t_tabix = sy-tabix.
if sy-subrc ne 0.
select single rollname ddlanguage as4local as4vers scrtext_l
from dd04t
into lwa_dd04t
where rollname eq lwa_dd03l-rollname
and ddlanguage eq sy-langu.
if sy-subrc eq 0.
insert lwa_dd04t into lit_dd04t
index lva_dd04t_tabix.
else.
lwa_dd04t-scrtext_l = 'Description for field not found'.
endif.
endif.
endif.
lwa_merged-scrtext_l = lwa_dd04t-scrtext_l.
append lwa_merged to pa_it_merged.
at end of changenr.
Only process field changes for this change document.
exit.
endat.
endloop.
at end of objectid.
Initialise work area so we know change document for order has
been processed.
clear lwa_merged.
Only process change documents for this sales order.
exit.
endat.
endloop.
endloop.
endform. " merge_data
*& Form build_field_catalog
text
form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
data:
Local variable
lva_col_pos type slis_fieldcat_alv-col_pos,
Local structure
st_fieldcat type slis_fieldcat_alv.
lva_col_pos = 0.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VBELN'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VBELN'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VKBUR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VKBUR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '6'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VKORG'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VKORG'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '6'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'KUNNR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'KUNNR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
st_fieldcat-outputlen = '6'.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'NAME1'.
st_fieldcat-ref_tabname = 'KNA1'.
st_fieldcat-ref_fieldname = 'NAME1'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '15'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'MATNR'.
st_fieldcat-ref_tabname = 'VBAP'.
st_fieldcat-ref_fieldname = 'MATNR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
st_fieldcat-outputlen = '6'.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'SCRTEXT_L'.
st_fieldcat-ref_tabname = 'DD04T'.
st_fieldcat-ref_fieldname = 'SCRTEXT_L'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '20'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'UDATE'.
st_fieldcat-ref_tabname = 'CDHDR'.
st_fieldcat-ref_fieldname = 'UDATE'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '10'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'USERNAME'.
st_fieldcat-ref_tabname = 'CDHDR'.
st_fieldcat-ref_fieldname = 'USERNAME'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '6'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'FNAME'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'FNAME'.
st_fieldcat-row_pos = '4'.
st_fieldcat-outputlen = '8'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'CHNGIND'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'CHNGIND'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '8'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'WAERK'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'WAERK'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '5'.
st_fieldcat-col_pos = lva_col_pos..
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VALUE_NEW'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'VALUE_NEW'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '20'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VALUE_OLD'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'VALUE_OLD'.
st_fieldcat-row_pos = '1'.
st_fieldcat-outputlen = '20'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
endform. " build_field_catalog
*& Form output_report
text
form output_report tables pa_it_fieldcat type slis_t_fieldcat_alv
pa_it_merged type ty_it_merged.
Local variables
data:
lva_formname type slis_formname,
lva_repid like sy-repid.
lva_repid = sy-repid.
lva_formname = 'ALV_USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = lva_repid
i_callback_user_command = lva_formname
i_save = 'A'
is_variant = st_variant
it_fieldcat = pa_it_fieldcat[]
tables
t_outtab = pa_it_merged
exceptions
program_error = 1
others = 2.
endform. " output_report
*& Form alv_user_command
text
form alv_user_command using pa_ucomm like sy-ucomm
pa_selfield type slis_selfield.
Local work areas
data:
lwa_merged type ty_merged.
clear lwa_merged.
read table it_merged into lwa_merged
index pa_selfield-tabindex.
case pa_selfield-fieldname.
when 'VBELN'.
Contract Number
set parameter id 'AUN' field lwa_merged-vbeln.
call transaction 'VA03' and skip first screen.
S_BCE_68001393
when 'USERNAME'.
Username
set parameter id 'username' field lwa_merged-username.
call transaction 'S_BCE_68001393' and skip first screen.
when 'KUNNR'.
Customer number
set parameter id 'KUN' field lwa_merged-kunnr.
set parameter id 'VKO' field space.
set parameter id 'VTW' field space.
set parameter id 'SPA' field space.
call transaction 'XD03' and skip first screen.
endcase.
endform. " alv_user_command
*& Form read_text
text
form read_text using pa_id
pa_inline_count
pa_name
pa_object
pa_text.
Local internal tables
data:
lit_inlines type ty_it_lines,
lit_lines type ty_it_lines.
Local work areas
data:
lwa_lines type ty_lines.
Local variables
data:
lva_tdname like thead-tdname.
refresh: lit_inlines,
lit_lines.
lva_tdname = pa_name.
call function 'READ_TEXT_INLINE'
exporting
id = pa_id
inline_count = pa_inline_count
language = sy-langu
name = lva_tdname
object = pa_object
tables
inlines = lit_inlines
lines = lit_lines
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
others = 7.
loop at lit_lines into lwa_lines.
concatenate pa_text
lwa_lines-tdline
into pa_text separated by space.
endloop.
endform. " read_text ENDLOOP.Hi
As per your code here:
"-------------- Changes are made here ----------------
*Extract Material details from vbap
select matnr arktx
from vbap
into table it_vbap
for all entries in it_vbak
where
vbeln eq it_vbak-vbeln
and posnr eq co_posnr_initial. " Here the condition specifies you want to select sales order items where there is no item number, which i beleive shouldnt be the case
" -----------------End of Change ----------------------
Try as below by commenting the Item Number is INITIAL condition:
select matnr arktx
from vbap
into table it_vbap
for all entries in it_vbak
where
vbeln eq it_vbak-vbeln.
"and posnr eq co_posnr_initial.
Regards
Eswar -
DropDrown unable to get data in ALV
Hi,
I'm trying to put an dropdown by key (or index) into an ALV but I'm unable to get data in the dropdown. Can someone please help me with this?
I was watching this threads on topics at the forum, but I can not solve this problem.
Copy my code.
DATA: lr_col TYPE REF TO cl_salv_wd_column,
lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_key,
l_cmp_usage TYPE REF TO if_wd_component_usage,
l_alv_model TYPE REF TO cl_salv_wd_config_table,
l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table.
l_cmp_usage = wd_this->wd_cpuse_doc_measure( ).
IF l_cmp_usage->has_active_component( ) IS INITIAL.
l_cmp_usage->create_component( ).
ENDIF.
l_ref_interfacecontroller = wd_this->wd_cpifc_doc_measure( ).
l_alv_model = l_ref_interfacecontroller->get_model( ).
l_alv_model = l_ref_interfacecontroller->get_model( ).
l_alv_model->if_salv_wd_table_settings~set_read_only( abap_false ).
lr_col = l_alv_model->if_salv_wd_column_settings~get_column(
id = 'VALEUR_DIFF' ).
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'VALEUR_DIFF '.
lr_col->set_cell_editor( lr_dropdown ).
DATA:
lo_nd_ctx_tab TYPE REF TO if_wd_context_node,
lo_ndinfo_ctx_tab TYPE REF TO if_wd_context_node_info,
lt_value_set TYPE TABLE OF wdr_context_attr_value,
ls_value_set TYPE wdr_context_attr_value.
ls_value_set-value = '01'.
ls_value_set-text = 'One'.
APPEND ls_value_set TO lt_value_set.
ls_value_set-value = '02'.
ls_value_set-text = 'Two'.
APPEND ls_value_set TO lt_value_set.
lo_nd_ctx_tab = wd_context->get_child_node( 'DOC_MEASURE' ).
lo_ndinfo_ctx_tab = lo_nd_ctx_tab->get_node_info( ).
lo_ndinfo_ctx_tab->set_attribute_value_set(
name = 'VALEUR_DIFF' value_set = lt_value_set ).
DATA: lt_valueset TYPE TABLE OF wdr_context_attr_value,
ls_valueset TYPE wdr_context_attr_value,
lr_node TYPE REF TO if_wd_context_node,
lr_nodeinfo TYPE REF TO if_wd_context_node_info.
lr_node = wd_context->get_child_node( 'DOC_MEASURE' ).
lr_nodeinfo = lr_node->get_node_info( ).
lr_nodeinfo->set_attribute_value_set(
EXPORTING
name = 'VALEUR_DIFF'
value_set = lt_valueset
Thanks.
Matías.Hi,
In your code, you are trying to do set_attribute_value_set twice. If you read your code carefully, you are setting the values once using lt_value_set where you have correctly filled the values. But after this, you are again trying using lt_valueset without filling any values. This is why your previous value-list gets overwritten and you see nothing in the dropdown. Remove the following lines in your code and it will work fine.
DATA: lt_valueset TYPE TABLE OF wdr_context_attr_value,
ls_valueset TYPE wdr_context_attr_value,
lr_node TYPE REF TO if_wd_context_node,
lr_nodeinfo TYPE REF TO if_wd_context_node_info.
lr_node = wd_context->get_child_node( 'DOC_MEASURE' ).
lr_nodeinfo = lr_node->get_node_info( ).
lr_nodeinfo->set_attribute_value_set(
EXPORTING
name = 'VALEUR_DIFF'
value_set = lt_valueset
Please get back if you are facing any more issues.
Regards,
Nithya -
Unable to get parameter by using a controller in OAF
Hi!
I'm new using OAF and will appreciate your help a lot!!
FYI:
Basically I have to add 2 descriptive flexfields in a page (by creating a VO) and I have to update the table with the information registered on those dff (I've done all the logic already).
I created a Controller (CO) which calls a method declared in an Application module (AM) that executes a store procedure (the CO and AM have been created by me and they extend a standard CO and AM).
Problem:
However, just before updating.. I'm having a problem because I'm unable to get a parameter by using paramContext.getParameter("reqHeaderId"); that will help me to identify which row I need to update.
Since the instruction is not capturing the value, it returns null and I got the following error when I try to convert it to Number: oracle.apps.fnd.framework.OAException: java.lang.NumberFormatException: null
It's really important to mention that before getting to the page where I click the submit button that does the logic mentioned.. there are 2 pages before the one where I'm trying to capture the parameter and the parameter needed is set on the 1st page. I've been checking each standard CO of the 3 pages and they use the instruction pageContext.putParameter("reqHeaderId"); to pass it between the 3 pages (As far as I know, if not please correct me). On the 3rd and last standard CO it uses pageContext.getParameter("reqHeaderId"); to get the value and do some other logic.
So why Im not getting the value if I do the same thing (pageContext.getParameter("reqHeaderId");) on my xxController (which extends the standard CO)?
Here is the code of the controller:
public class xxController extends standardController {
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String str;
str = pageContext.getParameter("_FORM_SUBMIT_BUTTON");
if ((str != null) && (str.equals("SubmitButton")))
String ReqHeaderId = pageContext.getParameter("reqHeaderId");
String ReqLineId = pageContext.getParameter("reqLindId");
Serializable[] parameters1 =
ReqHeaderId
,ReqLineId
,pageContext.getParameter("xxavtBienServicio") //dff
,pageContext.getParameter("xxavtAttribute3") //dff
String var = (String)am.invokeMethod("updateAttributes", parameters1); // updateAttributes is the method that converts ReqHeaderId to number and executes my store procedure
thank you for your help in advance!You need to verify that the parameter is being added to the pageContext from the first page to the last. You can do this by downloading the pages and all the class files to your development environment and put them into the myClasses directory. Then once you get it so it can be run in JDeveloper, you can actually invoke the debugger and do a watch on the page context for that parameter. It is important to note that you may need to download more than just those specific pages depending upon the setups of the supporting pages. I generally find it easier to just download everything for a particular application to my classes directory so I am not forever trying to find missing class files. Even then if they call some utility classes, you will need to download them to the JDevelper on your PC into the classes directory. But once you are able to run the pages in JDeveloper you will be able to do a lot more with the debugger.
Kristofer -
WUO-709: Unable to get Property: Open == Forms application using Webutil
Hi everyone,
I have configured Webutil and tested a demo application for loading excel data into a forms application. The application works just fine. Here is the code:
DECLARE
application Client_OLE2.Obj_Type;
workbooks Client_OLE2.Obj_Type;
workbook Client_OLE2.Obj_Type;
worksheets Client_OLE2.Obj_Type;
worksheet Client_OLE2.Obj_Type;
filename varchar2(2000);
cell Client_OLE2.OBJ_TYPE;
args Client_OLE2.OBJ_TYPE;
cell_value varchar2(100);
eod boolean:=false;
j integer:=1;
BEGIN
-- The following set up communication with the excel spreadsheet
application := Client_OLE2.create_obj('Excel.Application');
Client_OLE2.set_property(application,'Visible','false');
workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
args := Client_OLE2.CREATE_ARGLIST;
Client_OLE2.add_arg(args, 'c:\test\test.xls');
workbook := Client_OLE2.GET_OBJ_PROPERTY(workbooks,'Open',args);
Client_OLE2.destroy_arglist(args);
worksheets := Client_OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
worksheet := Client_OLE2.GET_OBJ_PROPERTY(application,'activesheet');
--Go to the first record
go_block('planets');
first_record;
loop
If :system.record_status <> 'NEW' then
create_record;
end if;
exit when eod;
for k in 1..3 loop --3 fields per record
args:= Client_OLE2.create_arglist;
Client_OLE2.add_arg(args, j);
Client_OLE2.add_arg(args, k);
cell:= Client_OLE2.get_obj_property(worksheet, 'Cells', args);
Client_OLE2.destroy_arglist(args);
cell_value :=Client_OLE2.get_char_property(cell, 'Value');
if upper(cell_value) = 'EOD' then
eod:=true;
Message('End of Data');
exit;
end if;
--Could be done this way also ->
/*if k =1 then
:dept.deptno:=cell_value;
end if;
if k =2 then
:dept.dname:=cell_value;
end if;
if k =3 then
:dept.loc:=cell_value;
end if;
--Less code this way ->
copy(cell_value,name_in('system.cursor_item'));
next_item;
end loop; --for
j:=j+1;
end loop;--main loop
-- Release the Client_OLE2 object handles
Client_OLE2.release_obj(cell);
Client_OLE2.release_obj(worksheet);
Client_OLE2.release_obj(worksheets);
Client_OLE2.release_obj(workbook);
Client_OLE2.release_obj(workbooks);
Client_OLE2.invoke(application,'Quit');
Client_OLE2.release_obj(application);
END;
-- cell_value :=Client_OLE2.get_num_property(cell, 'Value');
The issue comes when I try to supply filename and path (here, c:\test\test.xls) through a file open dialog. I tried each of these:
1.
filename := client_get_file_name
(directory_name => 'C:\'
,file_name => 'test'|| '.xls'
,file_filter => 'Excel (*.xls)|*.xls|'
,message => 'Select client side filename where App Server file will be saved'
,dialog_type => OPEN_FILE
,select_file => TRUE
2.
filename := Client_Get_File_Name(directory_name => 'C:\'
,file_name => null
,file_filter => null
,message => null
,dialog_type => null
,select_file => null
3.
filename := client_get_file_name ('','','','Select a file to Upload ',null,TRUE);
On using the above, I DO get a file open box. However, after browsing and selecting a file, I am getting the error message:
WUO-709 [OleFunctions.get_obj_property_args()] Unable to get Property: Open; Exception com.jacob.com.ComFailException: Can't map name to dispid: Open
I have checked the documentation on 'WUO-709' but cannot seem to figure out why it's not working.
Sorry for the lengthy description. Would greatly appreciate help on this.
- AmitI forgot to mention that in the modified code, I am supplying 'filename' as:
filename := client_get_file_name ('','','','Select a file to Upload ',null,TRUE);
args := Client_OLE2.CREATE_ARGLIST;
Client_OLE2.add_arg(args, filename);
Thanks,
Amit -
Unable to get RequestDispatcher for Context
Eclipse 3.3.0
Tomcat 6.0.16
Java 1.5.0_13
Mac OS X 10.5.6
Greetings:
I'm attempting to retrieve information cross context in my web application. I've attempted to enable cross context access by three means.
- I've added "crossContext=true" to the <Context> element in the server.xml of the Tomcat configuration under the Servers project of my workspace.
- I've added "crossContext=true" to the <Context> element in a META-INF/context.xml in the WebContent folder of my project.
- I've added "crossContext=true" to the <Context> element of the context.xml file in the conf directory of the Tomcat installation directory.
Yet despite these changes I'm still seeing "Unable to get RequestDispatcher for Context....Verify values and/or enable cross context access" in the console. What do I need to do to enable cross context access using Eclipse? Thanks for any help.
ETA - I've had this working before. I believe that I upgraded to Tomcat 6 from Tomcat 5.5 and that's when the jstl cross context actions broke.
ETA - I've got it working in Tomcat 6. The problem arises when I change the name of my webapplication from "foo" to ROOT inside eclipse. I want a jsp page in the ROOT web application to be able to access a servlet in the "bar" web application.
Edited by: nantucket on May 17, 2009 2:17 PM
Edited by: nantucket on May 17, 2009 2:26 PMThanks for your reply evnafets.
How many times do you declare your context???I know, I know... I got frustrated. :o)
But seriously, since my post I've discovered that it is "working" but not in the manner I had expected within the IDE. That is, if I access the page at
http://localhost:8080/ROOT/myPage.jspThen I can see the contents retrieved from the context bar. But if I use.
http://localhost:8080/myPage.jspI can see that the page somehow has been deployed to the root context, but the error code 500 appears in place of where the content from the bar context should be.
However, if I export war files for these two web applications and run them in Tomcat 6 outside of Eclipse, everything works as it should. So this is an eclipse issue with respect to deploying a web application to the root context. Maybe there is some configuration about that I must make somewhere.
I hope that makes sense.
Anyhow, the server.xml file contains the following..
<Context crossContext="true" docBase="bar" path="/bar" reloadable="true" source="org.eclipse.jst.j2ee.server:bar"/>
<Context crossContext="true" docBase="ROOT" path="/ROOT" reloadable="true" source="org.eclipse.jst.j2ee.server:ROOT"/>The jstl code in the jsp page accessing the context bar is the following.
<c:import url='/helloworld?action=view' context='/bar' />
Maybe you are looking for
-
How do I get the music I don't have downloaded off my music app?
After downloading iOS 7 I went to my music app and noticed it showed all the music I ever bought even though I don't have most of it downloaded. It shows the iCloud button next to the song almost asking if I want to download it. I'm sick of seeing al
-
Photos from photo booth being saved with weird titles?
On my imac, when you save a photo from photobooth, its named the same as it was in photo both (such as Photo 1189.jpg) But on my macbook, when i save photos they save as Photo on 2010-10-13 at 15.54 #3.jpg Is there any way to change how they are save
-
Couldn't get t38 protocol to work for fax
Hello, i am using a 1751V router with ios version 12.2 connecting to a 3725 voice gateway that connects toa PBX. i couldn't send fax successfully from the 1751V router to an extension on the PBX connected to the 3725 router. each time a get the fax t
-
Error -31000 when trying to print
I've recently started getting an error message that says, "Error: pstopdffilter/pstocupsraster failed with err number -31000" whenever I try to print. I've tried recreating the PDF file, using Reader X instead of Reader 9, and restarting the printer
-
Hello, I have an HP Pavilion a1210n running Windows Vista 32bit. I'm missing the audio drivers and can't seem to find them. Can you point me to a link for these drivers? Thanks, It's much appricieated!