Dynamic variable value based on a value from xml
I have a invoice template and it is for 4 different companies in my organization. Based on the organization I need to have a different value for a variable that adds blank lines to the end of the invoice. Is there anyway to assign a value to variable based on the value of a xml tag.
Thanks
I should have explained better before. I have one invoice template and we want to keep it one template for all companies. Each invoice is run individually, each companies footer is different, I am calling multiple headers and footers based on each company. Since the headers and footers are different I need to be able to add different amounts of lines and the end of each invoice depending on that company. I have accounted for the page break in my logic based on the amount lines the page is long. I just need a dynamic variable that I can assign different values on the fly.
Thanks
Similar Messages
-
How to derive a variable value from another variable of a different IO?
Hi Gurus,
I am aware that using BEx variables and Customer Exit you are able to derive a variable value from another variable of the same infoobject (for example, Fiscal Year/Period (0FISCPER) and Calendar Day (0CALDAY)).
However, is is possible, using the same approach to derive a variable value from another variable that is in a different InfoObject? (for example, Input Fiscal Year/Period (0FISCPER) but derive Output of Required Start Date (0REQSTDAT))?
There are 2 BEx variables involved,
1) A user entry variable that is restricted in 0FISCPER
2) A customer exit variable that is restricted in ZREQSTDAT
In CMOD under EXIT_SAPLRRS0_001, Include ZXRSRU01, the code (I assume, correct me if I'm wrong) should perform 3 functions in I_STEP = 2,
1) After the pop up, capture user entry of Fiscal Year/Period
2) Identify or convert Fiscal Year/Period to Calendar Day range (unsure on how to code this portion)
3) Use the Calendar Day to lookup on matching Required Start Date and display all Required Start Date that matches. (unsure on how to code on this portion)
Hope to hear your thoughts soon.
Regards,
EricHi Shanthi,
I've made the necessary adjustments. The only difference in my code is,
Instead of,
If I_VNAM = 'ZREQSTDAT'
I use,
CASE I_VNAM.
Instead of,
PARAMETERS: ZFISCPER TYPE /BI0/OIFISCPER.
ZYEAR = ZFISCPER(4).
ZMM = ZFISCPER+4(3).
I use ,
This is the Customer Exit Variable in ZREQSTDAT
WHEN 'ZRSD_CX'.
The loop I use for the User Entry Variable in 0FISCPER-ZFYP_IN
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZFYP_IN'.
IF SY-SUBRC = 0.
CLEAR L_S_RANGE.
ZYEAR = LOC_VAR_RANGE(4).
ZMM = LOC_VAR_RANGE+4(3).
The codes were checked with no errors.
However, when I input the Fiscal Year/Periods and hit 'Execute'. The report went blank, not sure what is the cause. I've tried it several times. No error message appeared.
Regards,
Eric -
How to transfer variable value from one query to another query?
I create two queries which contain the same variable "Year" and "Month".
In the wad,Query1 is used to be a table and Query2 is used to show the chart in the condition with the same variable value of Query1
So I want to transfer the variable value from query1 to query2.
Can anyone help me ?Let me explain the issue in detail.
In Query Designer, both the year and month variables are defined by user exit function to read current year and month and can be modified during the query runtime.
In WAD, Query1 is used to be a table with a table interface to hyperlink a chart which is defined by Query2 with the same variable value of Query1.
During the runtime of template, if I change the variable value of Query1 , I want the variable of Query2 to be changed automatically with the same new value.
So in the table interface of Query1 , I write the ABAP code in "SE24" and related source code to the variable is following:
concatenate
'function fire_urlJGSP_Col(filter) {'
Cl_rsr_www_renderer=>c_lf
'chart_url="' url '" + "&CMD=LDOC'
'&TEMPLATE_ID=GCCHART_9' "WEB ID of the work book
'&PAGEID=Graphics' "Name of the view
'&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VAR_NAME=Z2MYEAR&VAR_VALUE_EXT=" + filter'
Cl_rsr_www_renderer=>c_lf
'openWindow(chart_url,"chart_window","dependent=yes","600",'
'"450","true")'
Cl_rsr_www_renderer=>c_lf
into l_coding.
In this way , I can only transfer the year variable value from Query1 to Query2 and not two variables .
So , how shall I do to transer the two variable value in the same? -
Passing variable values from WAD to BEx
Hi Experts,
I am working with a query which is included in a web template. At the top of this template, I have several variables included in drop down boxes for the user to navigate through the data.
With clicking at "open in Excel" a BEx-Query is started.
My question: How can I pass the variable values from those drop down boxes to my Query in BEx?
The current HTML code for starting the Excel BEx-Query looks like this:
http://sapserver:port/x/x/x/rsr_bex_launch/bexanalyzerportalwrapper.htm?QUERY=Queryname
Thanks in advance
MarcoIf you export your report after selecting required drop down values, your report will be saved to Excel as it was filtered. You do not need any HTML code for this.
My question: How can I pass the variable values from those drop down boxes to my Query in BEx?
Why do you want to re-execute your query when you have already ouptut in the first screen shot? -
Passing global variable values from databse to forms
I am using forms 6i and database is oracle 9i.
I am trying to run a form stand alone ( by pressing CTRL-R) without putting it in the application.
since when this form is placed in the application menu it works fine as it has been passed global variables values from the database .
now i am trying to run the form without menu and thus i want to pass the values of global variables .please let me know where should i pass these values in form .is it be WHEN-NEW-FORM-Instance trigger or in Pre-form trigger.
i know what are the global variable values passing into the form from database.
i can hard code any values to check if the form runs well or not.If you intend to do this sort of testing regularly you might want to consider creating a seperate form with a control block which allows entry of the name of the form you want to run, the names of the globals and their values, and do a CALL_FORM.
-
How to get string value from xml in JSF??
In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF
Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization. -
How to retrieve value from xml file
hi all,
can somebody pls tell me how to retrieve value from xml file using SAXParser.
I want to retrieve value of only one tag and have to perform some validation with that value.
it's urgent .
pls help me out
thnx in adv.
rituhi shanu,
the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
pls have a look at the following code snippet.
public class XMLValidator {
static ArrayList strXXX = new ArrayList();
public void validate(){
factory.setValidating(true);
parser = factory.newSAXParser();
//all factory code is here only
parser.parse(xmlURI, new XMLErrorHandler());
public void setXXX(String pstrXXX){
strUpn.add(pstrXXX);
public ArrayList getXXX(){
return strXXX;
class XMLErrorHandler extends DefaultHandler {
String tagName = "";
String tagValue = "";
String applicationRefNo = "";
String XXXValue ="";
String XXXNo = "";
XMLValidator objXmlValidator = new XMLValidator();
public void startElement(String uri, String name, String qName, Attributes atts) {
tagName = qName;
public void characters(char ch[], int start, int length) {
if ("Reference".equals(tagName)) {
tagValue = new String(ch, start, length).trim();
if (tagValue.length() > 0) {
RefNo = new String(ch, start, length);
if ("XXX".equals(tagName)) {
XXXValue = new String(ch, start, length).trim();
if (XXXValue.length() > 0) {
XXXNo = new String(ch, start, length);
public void endElement(String uri, String localName, String qName) throws SAXException {
if(qName.equalsIgnoreCase("XXX")) {
objXmlValidator.setXXX(XXXNo);
thnx & Regards,
ritu -
How to Pass values from XML to JSP??? Urgent Please Help me
Hi guys,
I am new to XML, I want to pass values from XML to JSP. I have a xml file with attributes, I should send this values to a JSP file. How is it??? Please Help guys.... its very urgent. Please send me how to do it with an example or atleast any urls related that....
Looking for ur favourable reply.
Thanks in advance,
Sridharin a servlet :
parse your xml file (see how at the end of the post) and
put the values you want in the request attributes
request.setAttribute("value1", value1);
...redirect to the jsp
in the JSP:
get the wanted attributes:
String value1=(String)request.getAttribute("value1");To learn how to parse a xml file, pay a look at this page, it explains how to read the XML document to build an object representation, and then how to navigate through this object to get the data
http://labe.felk.cvut.cz/~xfaigl/mep/xml/java-xml.htm -
XML parser for fatching multiple values from XML
Hi,
In my scenirio i have to facth multiple values from XML file and then set in to Table in webdynpro...
Fo example my xml has values like...
<xml>
<item>
<item1>
<quantity>
100
</quantity>
<price>
50
</price>
</item1>
<item2>
<quantity>
200
</quantity>
<price>
20
</price>
</item2>
<item3>
<quantity>
300
</quantity>
<price>
10
</price>
</item3>
</item>
</xml>
then i have to fcath those quantity and price and set in to table...
How to do taht in webdynpro and does any one have parser code for retriving multiple values...Hi,
1) You need to use JDOM parser.
2) The code for parsing XML using JDOM parser is readily available if you search on google.
3) You will have to check the attribute during every parsing and then if attribute is quantity you can fetch the corresponding tags.
4) Something similar to this:
org.jdom.Document document = parser.build(file);
org.jdom.Element rootElement = document.getRootElement();
org.jdom.Element childElement = rootElement.getChild("file");
Element xmlElement = childElement.getChild("item");
if (xmlElement != null) {
List itemElementsList = xmlElement.getChildren("item1");
if (itemElementsList != null) {
Iterator iterator3 = itemElementsList.iterator();
while (iterator3.hasNext()) {
//For each group get quantity
Element itemElement = (Element) iterator3.next();
List quantityElementsList =
itemElement.getChildren("quantity");
if (quantityElementsList != null) {
Iterator iterator2 =
quantityElementsList.iterator();
while (iterator2.hasNext()) {
// Your code
You might need to make some changes as per your rquirement. Just use this sample to understand how you need to parse the xml
Hope it helps.
Regards.
Rajat
Edited by: Rajat Jain on Jan 22, 2009 9:51 AM -
Want to retrieve null value from xml?
i m writing this code to get the tag name and values from xml file.
Now the problem is that
if my xml file contain any tag whose value is not defined like
<root>
<firsttag>first</firsttag>
<Second></Second><Third>third</Third>
</root>
Now look if second tag doesnt contain anything ,then i want to add "null" to vector,but it throws null pointer exception because second tag is empty.
Vector<String> CSWFinfo = new Vector<String>();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new File(xml));
Element root = doc.getDocumentElement();
NodeList node = root.getChildNodes();
for (int i = 0; i < node.getLength(); i++) {
Node currentNode = node.item(i);
if (isTextNode(currentNode))
continue;
CSWFinfo.addElement(currentNode.getNodeName());
if (null != currentNode.getFirstChild().getNodeValue()) {
CSWFinfo.addElement(currentNode.getFirstChild()
.getNodeValue());
} else {
CSWFinfo.addElement("null");
}//end of for loop block
System.out.println(CSWFinfo);
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
}I am using dom parser .
Can any one know how to do it????
Edited by: chauhan2003 on 16 Jun, 2008 12:06 PMAre you sure that all currentNode have a firstChild ????
If your node has no value, it has no child
So i 'd change code to like look something like:
if (currentNode.getFirstChild() != null) {
CSWFinfo.addElement(currentNode.getFirstChild().getNodeValue());
} else {
CSWFinfo.addElement("null");
} -
Hi all :
I try to read Boolean value from xml file , please see attach file , all the time this error rise
I know that The XML tag describing the type of data does not match, how can I get Boolean value " 1" or "0 "
Thanks
wisam
Attachments:
untitled1.JPG 115 KBYou are not trying to read boolean.. you are trying to read a DBL.
To read a DBL you must first write a DBL to XML.
To read a boolean replace the DBL with a boolean -
1.6 Dynamic Photo Gallery - alt and title attributes from xml file?
Hi!
I would like to attach information to my gallery images from
the XML-file used by the gallery.
Especially the alt and title attributes for the "img
id="mainImage"-tag would add a bit more user friendliness.
I found
this
example about adding caption to images very help full and
everything worked just fine, thanks to clear information!
(http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadi d=1306782&enterthread=y)
Could someone come up with an example of adding title/alt
attributes values from XML file?
I'm sure there are quite a few out ther who would like to see
a solution to this ;)You need to add your info to the XML.
So something like:
<photo
path = "travel_01.jpg"
width = "263"
height = "350"
title="my title"
alt_text="Alt Text"
thumbpath = "travel_01.jpg"
thumbwidth = "56"
thumbheight = "75">
</photo>
Then in your detailregion:
<img src="{dsData::large/@base}{@path}" alt="{@alt_text}
title="{@title}" />
I am using
http://www.adobe.com/devnet/dreamweaver/articles/spry_photo_album.html
as the source of my samples...
So, just add the data to the XML and then you will have these
attributes available as data references.
Hope this helps.
Don -
Error while fetching variable value from sqlserver database in 11g
Hi
We created a dynamic variable to fetch data from sqlserver database in 11g.But when we test it, it is erroring out as follows: "nqserror: 27024 the execute physical statement must specify a physical sql statement to execute".
Please help to overcome this issue.
Thanks.Hello,
First make sure that you're able to retreive data from the repository (right click on a table and view data?)
To create a session variable follow these steps:
From the Administration Tool menu bar, choose Manage > Variables.
In the Variable Manager dialog box, from the menu bar, choose Action > New > Session > Variable.
In the Session Variable dialog box, type a variable name.
Names for all variables should be unique. The names of system session variables are reserved and cannot be used for other types of variables.
For session variables, you can select the following check boxes:
Enable any user to set the value
Check box that allows you to set the session variables after the initialization block has populated the value (at user login) by calling the ODBC store procedure NQSSetSessionValue(). For example, this allows non-Oracle BI Administrators to set this variable for sampling.
Use the Initialization Block drop-down list to select an initialization block that will be used to refresh the value on a continuing basis.
To add a Default initializer value, perform one of the following steps:
To use the Expression Builder, click the ellipsis button to the right of the Default initializer work space.
Type the value into the Default initializer text box.
Click OK.
you can do the same for a repository variable except that you will have to specif a refresh interval.
Make sure the sql your are issuing is correct by running it first using a client.
Regards
PS: Please don't forget to close the thread and assign points when your question is answered -
Get variable values from a stored procedure
I am using SQL 2008R2 and I want to replace a view inside a stored procedure with a new stored procedure to return multiple variable values. Currently I am using the code below to get values for 4 different variables. I would rather get the 4 variables
from a stored procedure (which returns all of these 4 values and more) but not sure how to do so. Below is the code for getting the 4 variable values in my current sp.
DECLARE @TotalCarb real;
DECLARE @TotalPro real;
DECLARE @TotalFat real;
DECLARE @TotalLiquid real;
SELECT @TotalCarb = ISNULL(TotCarb,0),
@TotalPro = ISNULL(TotPro,0),
@TotalFat = ISNULL(TotFat,0),
@TotalLiquid = ISNULL(TotLiq,0)
FROM dbo.vw_ActualFoodTotals
WHERE (MealID = @MealID);You can replace the view with inline table valued user-defined function:
http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
See example: SQL create INLINE table-valued function like a parametrized view
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
How to implement Check box in the Rtf based on the value from XML datafield
Hello All ,
It would be great if any one can help me in implementing check box in the rtf based on the data filed value from the XML data.
I need to get in the out put checked boxes like what we say Radio button Yes or No ( If Yes it should be marked ).
If any one worked on this please help us...
Thanks in Advance...Did you check the user guide,
we have a section over there :)
http://blogs.oracle.com/xmlpublisher/2007/05/22
Maybe you are looking for
-
Report for Material consumption quantity & its cost in Repetitive MFG.
Hello, Is there any Standard Report available in SAP to check the Quantity of raw / intermediate material consumed & their cost in Repetitive manufacturing Backflush transaction MFBF? Thanks
-
Upgraded to 10.4.9 on MBP 15", now, I can't mount external hard disk!
Hi all, I have a LaCie 500GB drive that I've been using perfectly since I've gotten it, but alas, I upgraded to 10.4.9 and it no longer mounts either by it's USB interface or by its Firewire interface. My machine is a MBP 15" (2.16 GHz, 2 GB Ram), wh
-
Why is my itunes missing text? and how can I fix it?
A couple of months ago I upgraded to Itunes 10.5 and ever since, I have had no text across the top (where it would usually say file, edit, view, ect.) and also when I plug in my iphone or ipad and click on them in order to sync or back them up, all o
-
Getting a error while running creating a sample page on sharepoint 2013 and visual studio 2013
hi, When i trying to create a sample web service for create page dynamically to sharepoint 2013 using visualstudio 2013 getting a error message while consume the web service browser itself. so i have tried to change the target platform but to 32
-
Partial Payments- Customer Clearing
Hi I have a partial payment which was received from a customer . I received another partial payment againt the same invoice which completes the invoice . In both instances f-28 was used. The system still shows the invoice as open . Is there anyway i