Dynamic Calc referencing another Dynamic Calc
Hi,
I found a problem today in a Dynamic Calc member formula.
Member A has in formula: B;
Member B has in formula: C + D;
Both members are Dynamic Calc and while member B shows the correct result, member A shows nothing in forms. If I switch the formula of member A to C + D; then it shows results.
Is there any problem of Dynamic Calc members referencing another Dynamic Calc members?
Thank you
or change the position of member A/member B in the outline.^^^Exactly, Essbase is calculating the dimension top to bottom and if A needs B, it needs to be after B or as Andre stated, you need to stick a two-pass on A. I prefer not to use two-pass unless i need to as it can FUBAR my YTD and variance calcs. It's just easier to have it work in the "right" order.
Regards,
Cameron Lackpour
Similar Messages
-
Using dynamic VI referencing in combination with Application Builder
Hi.
In this thread (http://forums.ni.com/t5/LabVIEW/How-to-access-a-known-control-in-a-VI-reference/td-p/1255244) I attempted to modify our under development test system, so that we didn't have to change the same main VI for every test that we are adding, since we are several persons who'll be adding tests (i.e. conflicts would arise, that we would have to iron out manually every time). The solution in the thread above works very well, by opening a reference to the test sub VI and calling the reference. I then can pass data to the sub VI, and can get the test results from the sub VI. Great!
The problem came when running the program through the Application Builder. The test system starts up fine, but the above method fails miserably, since the sub VI files are no longer there. It seems that the sub VI's are not a part of the exe binary file coming from the Application Builder.
So I'm drawing a blank here. Does anyone have a suggestion on how to to this? I'm only seeing the two options. Either adding the sub VI's in the same main VI file, but then we have to be very careful on not getting conflicts (or fix the conflicts manually when they arise). Or use the dynamic VI referencing, but then the system doesn't work with the Application Builder (which means that this method is out). Is there a third method of doing this?Hi Mike.
I use LabVIEW 2009.
Well, I actually *can* use the dynamic call solution now. The problem was that (1) the files weren't included in the exe file (fixed by adjusting the Application Builder settings), and (2) the Check if File or Folder Exist VI doesn't work if I try to check if the sub VI is present inside the exe file. The solution here was basically to ommit the whole Check if File or Folder Exist VI, and just do an error check on the Open VI Reference VI. The Open VI Reference VI will fail if trying to open a reference to a file that doesn't exist, so I just wired that to a case loop around the Call By Reference VI. -
Fill dynamic internal table with data from another dynamic table
Hi,
I have a huge dynamic table with a few columns and need to fill another dynamic table with some of the columns, that are also existing in the other one. I first know at runtime, which fields the smaller table contains.
Until now, I did it that way:
LOOP AT <it_tab_structure> ASSIGNING <wa_tab_structure>.
LOOP AT lt_comp_full INTO ls_comp_full.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <structure> TO <column>.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <wa_tab_structure> TO <value>.
<column> = <value>.
ENDLOOP.
APPEND <structure> TO <table>.
ENDLOOP.
lt_comp_full contains the columns of the second table, that have to be filled.
This is taking a very long time, as there can be a lot of columns in the source table and the source table contains at least 100000 records.
Is there therefore any way to fill the other table faster?
Thank you & best regards,
MichaelHey Sharath,
thank you for your answer! Unfortunately I don't have a 7.4 system here, but your example pointed out, that I can also use move-corresponding from one structure to the other, which I thought, was not possible. I'm trying out, if this makes it faster now.
I'll let you all know, if this made the deal.
Thank you & best regards,
Michael & Arne -
JSF with in another dynamic JSF - Urgent Help Needed
Hi,
When i have JSF with in another dynamic JSF it worked fine in weblogic 9.2. But in weblogic 10.3.2 it is thwoing illegal state exception. Ho w can i add another JSP?
<h:form id="frmAssignImpersonate">
<h:inputHidden id="hiddenSoxEditPrivilege" value="#{assignImpersonate.soxEditPrivilege}"/>
<h:inputHidden id="donotdelete" value="#{assignImpersonate.donotDelete}"/>
<table class="TableContentWhite" style="TABLE-LAYOUT: fixed" cellSpacing="0" cellPadding="0" width="400">
<tr>
<td>
<jsp:include page="/jsf/common/a.jsp"flush="false"/>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" align="left" width="500">
<TR class="ColorModuleHeader" height="20">
<TD class="rowHdr" align="left">Assign Impersonation Rights</TD>
</TR>
<tr>
<td valign="top" Class="TableContentwhite" align="left">
<jsp:include page="/jsf/common/b.jsp"flush="false"/>
</td>
</tr>
</table>
</h:form>
<%@ include file="/jsf/common/bdeFooter.jsp" %>
Exception:
java.lang.IllegalStateException
at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:258)
at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:215)
at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:466)
at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:651)
at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1097)
Truncated. see log file for complete stacktracewrong forum, you will not get answer here
-
How to forward a JSP page to another dynamically generated JSP
Hi gurus,
I have a problem with forwarding a JSP page, to another dynamic jsp page.
I have to forward a jsp page to (say X1 ) to another JSP page (say X2).
Iam choosing the name of the page X2, dynamically from a list of JSP pages in a directory depending upon some parameters.
Here is my code for ur better understanding...
<java>
// this gives me the name of the page X2 to which my page X1 should be forwarded.
<TR> <TD><%=request.getParameter("codeins")%></TD></TR>
<%
if(request.getParameter("codeins").length() != 0)
%>
// if i use this forward tag i get the error
<a href="
<jsp:forward page=Ins/<%=request.getParameter("codeins")%">.jsp">
<jsp:param name="a" value="<%=request.getParameter("a")%>" />
<jsp:param name="b" value="<%=request.getParameter("b")%>" />
<jsp:param name="c" value="<%=request.getParameter("c")%>" />
<jsp:param name="p" value="<%=request.getParameter("p")%>" />
<jsp:param name="q" value="<%=request.getParameter("q")%>" />
</jsp:forward>">GNSS Instantiation</a>
<%
else {
out.println("No entry in the database! ");
} %>
</java>
I am getting the exceptions like
<java>
org.apache.jasper.JasperException: /Newspg.jsp(162,67) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:169)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:136)
at org.apache.jasper.compiler.Parser.parseForward(Parser.java:517)
at org.apache.jasper.compiler.Parser.parseAction(Parser.java:661)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:803)
at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
at org.apache.jsp.SPVariablesg_jsp._jspService(SPVariablesg_jsp.java:425)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:534)
</java>
please help me out to let me know, where iam doing wrong.
Thanx
mark.Hi,
in reference to the above subject i did like to know what is wrong in the following code of mine:
<%
String name = "admin"; // this is line which is being indicated in error message
int password = 4589;
%>
<!-- <script language="javascript" src="init.js"></script> -->
<head>
<script>
function checking()
if name != document.test.user.value || password != document.test.password.value)
alert("ur not authorised to view the requested url");
forward("Firstpage.jsp");
%>
</script>
its says :
org.apache.jasper.JasperException: /webpg/Dec2Firstpage.jsp(4,21) equal symbol expected
any solutions?
thanx in advance -
Dynamic Select Query including Dynamic Tables with For all Entries
Hello everyone,
I need to create a select query which involves using of Dynamic Tables.
Suppose I have a dynamic table <d1> which consist of let say 10 records.
Now i need to make a select query putting data into another dynamic table <d2>
CONCATENATE keyfield '=' '<d1>' INTO g_condition SEPARATED BY space.
CONCATENATE g_condition '-' keyfield INTO g_condition.
SELECT * FROM (wa_all_tables-name) INTO CORRESPONDING FIELDS OF TABLE <d1>
FOR ALL ENTRIES IN <d1>
WHERE (g_condition).
But it is giving dump.
Please help me on this....Short text
A condition specified at runtime has an unexpected format.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZNG_CUSTOMWRITE" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
not caught in
procedure "WRITE_ARCHIVE_PROD" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The current ABAP program has tried to execute an Open SQL statement
which contains a WHERE, ON or HAVING condition with a dynamic part.
The part of the WHERE, ON or HAVING condition specified at runtime in
a field or an internal table, contains the invalid value "ZCOURIER-ZCOURIERID".
CONCATENATE keyfield '=' g_header INTO g_condition SEPARATED BY space.
CONCATENATE g_condition '-' keyfield INTO g_condition.
SELECT * FROM (wa_all_tables-name) INTO CORRESPONDING FIELDS OF TABLE <dyn_table1>
FOR ALL ENTRIES IN <dyn_table>
WHERE (g_condition). -
Sum for Dynamic Fields in a Dynamic Table with Field Symbol
Hi All,
I currently have an report which I am looking to update with some totals. The information is currently output in an ALV which is fed data from a dynamic table defined with a field symbol. The modification that needs to be applied is a summation per currency code where each of the fields to be summed is a dynamically named field at runtime. I am now just looking to see if anyone has any recommendations on how to obtain these totals it would be appreciated. I have no problem doing the leg work in piecing the solution together but am just stuck on which approach I should be investigating here. I have looked into several options but do to the fact that the totals are for dynamic fields in a dynamic table and it is a field symbol I am having some difficulties thinking of the easiest approach to obtain these totals.
Below is a simple sample of what the report currently looks like and what we are looking to add.
====================================================================================
As-Is Report:
DETAILED DATA ALV
Company Code | Plant | 2006 Total | 2007 Total | 2008 Total | CURRENCY
0001 | ABCD | 1,500 | 1,200 | 1,700 | USD
0001 | BCDE | 2,300 | 4,100 | 3,600 | GBP
0003 | DBCA | 3,200 | 1,600 | 6,200 | USD
Addition 1:
TOTALS PER CURRENCY
Currency | 2006 Total | 2007 Total | 2008 Total |
USD | 4,700 | 2,800 | 7,900 |
GBP | 2,300 | 4,100 | 3,600 |
Addition 2:
CONVERSIONS TO USD
| 2006 Curr | 2006 USD | 2008 Curr | 2006 USD |
USD | 4,700 USD | 4,700 USD | 7,900 USD | 7,900 USD |
GBP (1.5GBP/1 USD) | 2,300 GBP | 1,150 USD | 2,300 GBP | 1,800 USD |
====================================================================================
Any recommendations will be appreciated.Hi,
We cannot use the key word SUM in the loop at assigning statement.
The way i see is
When you are creating the first dynamic internal table , create one more with the structure below:
Currency | 2006 Total | 2007 Total | 2008 Total |
Then while populating the data into first itab,also move the contents to the second itab using collect statement. -
How to pass values in dynamic structure and then dynamic table
Hi,
we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic table type is any its not allowing an index operation like modify etc etc.
Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.Hi Friends,
This is the piece of code.After creating dynamic work area and dynamic table what i should do?
TYPES: BEGIN OF STR,
ID TYPE I,
NAME(30) TYPE C,
END OF STR.
data: v_lines type i.
STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
STR_COMP = STR_TYPE->GET_COMPONENTS( ).
APPEND LINES OF STR_COMP TO COMP_TAB.
COMP-NAME = 'NAME1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
P_LINE_TYPE = NEW_STR
P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
P_UNIQUE = ABAP_FALSE ).
CREATE DATA DREF TYPE HANDLE NEW_TAB.
CREATE DATA DREF1 TYPE HANDLE NEW_str. -
Creating a Dynamic Node for a Dynamic Graphic - Tutorial
Hi everyone,
I'm sharing my first tutorial, hope it'll be helpful for you.
In the Layout tab, it's possible to create an UI element "Business Graphic". It's a very simple tool that only requires a context node with a category attribute (that means, the values that will appear in the 'x' axis) and one or more series (each one with a color, generally a numerical value). It's possible to add a label for each series for better understanding of the Graphic.
Although it's a very powerful tool, there are some problems when we must create a graphic with N series and different labels. If the graphic use an ALV or internal table to fetch data, during runtime we can have more or less series. The definition of a static node and generic series is not enough in this case. That's why I'd like to present you this little tutorial to create a dynamic node that fetchs a dynamic graph:
In the WDDOINIT or Event Handler method that starts the application (once the data is available) we should create the dynamic node in the following way:
DATA: lr_node_info TYPE REF TO if_wd_context_node_info,
lt_attributes TYPE cl_abap_structdescr=>component_table,
attribute LIKE LINE OF lt_attributes,
struct_type TYPE REF TO cl_abap_structdescr,
lo_dyn_node TYPE REF TO if_wd_context_node.
* Let's suppouse we can LOOP at the data table, so we can fetch the
* category data type (for example company name, month, year, ...)
* and each series with a numeric type
attribute-name = 'CATEGORY'.
attribute-type ?= cl_abap_datadescr=>describe_by_name( 'STRING' ).
INSERT attribute INTO TABLE lt_attributes.
attribute-name = 'SERIE1'.
attribute-type ?= cl_abap_datadescr=>describe_by_name( 'I' ).
INSERT attribute INTO TABLE lt_attributes.
attribute-name = 'SERIE2'.
attribute-type ?= cl_abap_datadescr=>describe_by_name( 'I' ).
INSERT attribute INTO TABLE lt_attributes.
* Once we have all the attributs for the node, we create a formal structure
struct_type = cl_abap_structdescr=>create( lt_attributes ).
* Now we can get the context information to add a new node
lr_node_info = wd_context->get_node_info( ).
* Create the node
lr_node_info = lr_node_info->add_new_child_node(
name = 'GRPH_DYN'
IS_MANDATORY = ABAP_false
IS_MULTIPLE = ABAP_true
STATIC_ELEMENT_RTTI = struct_type
IS_STATIC = ABAP_false ).
* Now we should populates the node, I'll create a hardcoded table,
* simulating the internal table that you should already have
TYPES: BEGIN OF tw_alv,
category TYPE string,
SERIE1 TYPE i,
SERIE2 TYPE i,
END OF tw_alv.
TYPES: tt_alv TYPE STANDARD TABLE OF tw_alv.
DATA: lw_alv TYPE tw_alv,
lt_alv TYPE tt_alv.
lw_alv-category = 'Alfa'.
lw_alv-serie1 = 3.
lw_alv-serie2 = 8.
APPEND lw_alv TO lt_alv.
lw_alv-category = 'Beta'.
lw_alv-serie1 = 4.
lw_alv-serie2 = 4.
APPEND lw_alv TO lt_alv.
lw_alv-category = 'Gamma'.
lw_alv-serie1 = 1.
lw_alv-serie2 = 3.
APPEND lw_alv TO lt_alv.
* Now let's call the recently created node and bind the lt_alv table.
* Get node from context
lo_dyn_node = wd_context->get_child_node( name = 'GRPH_DYN' ).
* Bind table with ALV Container
CALL METHOD lo_dyn_node->bind_table
EXPORTING
new_items = lt_alv.
* It's always good to check if the table was succesfully binded.
* I refresh the lt_alv table and get the values from the node for controlling
REFRESH lt_alv.
lo_dyn_node->get_static_attributes_table( IMPORTING table = lt_alv ).
There are other ways of adding a node structure in the method add_new_child_node, but it works for me only with STATIC_ELEMENT_RTTI. The node is now created and has the data required for the graphic. Now, we should go to WDDOONMODIFYVIEW, or save the target view as a parameter, to create the graphic, bind the category and series and show it on the screen.
DATA: lr_graph TYPE REF TO cl_wd_business_graphics,
lr_cat TYPE REF TO cl_wd_category,
lr_series1 TYPE REF TO cl_wd_simple_series,
lr_series2 TYPE REF TO cl_wd_simple_series,
lr_container TYPE REF TO cl_wd_uielement_container,
lr_flow TYPE REF TO cl_wd_flow_data.
* Get the root element from the Layout or the specific
* container you have created for the graphic
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
* Creates a line busniess graph
lr_graph = cl_wd_business_graphics=>new_business_graphics(
BIND_SERIES_SOURCE = 'GRPH_DYN'
CHART_TYPE = cl_wd_business_graphics=>e_chart_type-lines
HEIGHT = 340
WIDTH = 750
ID = 'GRAPH' ).
* Create the flow data for the new UI Element business graphic
lr_flow = cl_wd_flow_data=>new_flow_data( element = lr_graph ).
* Set graph in the root container from the Layout tab
lr_container->add_child( lr_graph ).
* Bind the category from the dynamic node to the dynamic graphic
lr_cat = cl_wd_category=>new_category(
view = view
bind_description = 'GRPH_DYN.CATEGORY'
tooltip = 'Company Name' ).
lr_graph->set_category( lr_cat ).
* Bind the two series from the dynamic node to the dynamic graphic
lr_series1 = cl_wd_simple_series=>new_simple_series(
bind_value = 'GRPH_DYN.SERIE1'
label = 'Sales'
view = view
tooltip = 'Average Sales' ).
lr_graph->add_series( lr_series1 ).
lr_series2 = cl_wd_simple_series=>new_simple_series(
bind_value = 'GRPH_DYN.SERIE2'
label = 'Purchases'
view = view
tooltip = 'Average Purchases' ).
lr_graph->add_series( lr_series2 ).
Finally we have created our business graphic. Test the application and you'll see something like the attached image.
Hope you'll find it useful.
Daniel Monteros.Hi,
http://htmldb.oracle.com/pls/otn/f?p=26372
then ApEx>Trees and pick a level.
Use Help for more information.
I you think that tree could help I will put more explanation into help page.
Konstantin -
Absolute dynamic select query with dynamic join and where
Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
SELECT (FIELDS) INTO TABLE IT_TABLES
FROM ( (ME->TABLE1) inner join ( me->table2 )
on ( on_condition ) )
WHERE (me->where_fields).
Ags.It worked for me in a following way:
select * into corresponding fields of table <result_table>
from (join_string)
where (l_where).
Where the contents of join_string were dynamically build using concatenation. So it will be something like
concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
<...>
add here matching/reference colums, something like
concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
concatenate join_string temp1 '=' temp2 into join_string separated by space.
<...>
concatenate join_string ')' into join_string separated by space.
And then use similar approach for l_where variable. -
Dynamic select query with dynamic where condition
Hi all,
I want to use the dynamic select query with dynamic where condition. For that I used the below code but I am getting dump when using this code.
Please advice, if there is any other way to achieve this requirement.
Thanks,
Sanket Sethi
Code***************
PARAMETERS: p_tabnam TYPE tabname,
p_selfl1 TYPE edpline,
p_value TYPE edpline,
p_where1 TYPE edpline .
DATA: lt_where TYPE TABLE OF edpline,
lt_sel_list TYPE TABLE OF edpline,
l_wa_name TYPE string,
ls_where TYPE edpline,
l_having TYPE string,
dref TYPE REF TO data,
itab_type TYPE REF TO cl_abap_tabledescr,
struct_type TYPE REF TO cl_abap_structdescr,
elem_type TYPE REF TO cl_abap_elemdescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp_fld TYPE cl_abap_structdescr=>component.
TYPES: f_count TYPE i.
FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
* <ls_outtab> TYPE ANY,
<l_fld> TYPE ANY.
struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
elem_type ?= cl_abap_elemdescr=>describe_by_name( 'F_COUNT' ).
comp_tab = struct_type->get_components( ).
comp_fld-name = 'F_COUNT'.
comp_fld-type = elem_type.
APPEND comp_fld TO comp_tab.
struct_type = cl_abap_structdescr=>create( comp_tab ).
itab_type = cl_abap_tabledescr=>create( struct_type ).
l_wa_name = 'l_WA'.
CREATE DATA dref TYPE HANDLE itab_type.
ASSIGN dref->* TO <lt_outtab>.
*CREATE DATA dref TYPE HANDLE struct_type.
*ASSIGN dref->* TO <ls_outtab>.
* Creation of the selection fields
APPEND p_selfl1 TO lt_sel_list.
APPEND 'COUNT(*) AS F_COUNT' TO lt_sel_list.
** Creation of the "where" clause
*CONCATENATE p_selfl1 '= '' p_value ''.'
* INTO ls_where
* SEPARATED BY space.
*APPEND ls_where TO lt_where.
* Creation of the "where" clause
APPEND p_where1 TO lt_where.
* Creation of the "having" clause
l_having = 'count(*) >= 1'.
* THE dynamic select
SELECT (lt_sel_list)
FROM (p_tabnam)
INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>.
* WHERE (lt_where).Hi Sanket,
The above given logic of mine works for you, put the code in the If condition and try-
just like below:
IF NOT P_EBELN IS INITIAL.
lt_where = '& = ''&'' '.
REPLACE '&' WITH p_ebeln INTO lt_where.
REPLACE '&' WITH field_value INTO lt_where.
SELECT (lt_sel_list) INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>
FROM (p_tabnam)
WHERE (lt_where).
ENDIF.
thanks\
Mahesh -
ALV display using dynamic field catalog and dynamic internal table
hi ,
please guide me for ALV display using dynamic field catalog and dynamic internal table.
Thank you.Hi Rahul,
maybe thread dynamic program for alv is helpful for you. More information about the [SAP List Viewer (ALV)|http://help.sap.com/saphelp_nw70/helpdata/EN/5e/88d440e14f8431e10000000a1550b0/frameset.htm]. Also have a look into the example programs SALV_DEMO_TABLE*.
Regards Rudi -
OSB Dynamic service call or dynamic route and transactions
Hello,
I've got the following problem in my OSB architecture for asynchronous incomming services.
OSB version is 10.3.1
ConnectionFactory is XA
Problem domain:
Dynamic service call or dynamic route within transaction boundary
Elements within transaction:
1. JMS Queue ->
2. Upper Proxy Service (De-queue) ->
3. Lower Proxy Service (Canonical Service) ->
4. Business Service (Data Service) ->
5. Database Adapter->
6. Database
Dynamic element
Upper Proxy Service (De-Queue) must be able to determine which Lower Proxy Service (Canonical Service) has to be called on the basis of the message taken from the JMS Queue without losing the transaction (this doesn’t work yet).
Already tried possible solutions:
• Make a service call dynamic by setting the $inbound name attribute. This results in a this property is read-only error.
• Use a Dynamic route instead of a service-call. This results in a loss of transaction. The message is deleted from the Queue without taking failure or success into account.
• Use a Dynamic route with a quality of service set to exactly once in the header. This seems to be ignored, results in a loss of transaction.
• Use a Dynamic route with an explicit reply with failure for errors. Results in a loss of transaction.
• Use a Dynamic Publish. This doesn’t fit the required flow because it has no response.
I hope someone can shed some light on this because I'm at a total loss. I found some references in the forum to what seems to be the same problem but without definite answers. A work-around is also a viable answer.
Regards,
Bas MulHi,
I'll try to clarify.
Upper proxy dequeues a message.
Depending on a value of a specific tag within the message a canonical proxy service (out of 5 at the moment but this numer could increase) has to be called (and be dynamic transform transformed to the format of the specific canonical).
The canonical service must then pass the message to a database adaper's business service which is responsible for the database insert/update/read.
If something in the chain from dequeue to database action goes wrong the message may not dissapear from the queue.
Somehow a dynamic route in the message flow between dequeue proxy and canonical proxy breaks the transaction.
Bas -
Dynamic Context Dynamic and UI table Dynamic
Hello,
I created a dynamic context and a dynamic table that use this dynamic context. I have the following error:* * The following error text was processed in the system XAP : Could not find attribute AMOUNT2009**
The error occurred on the application server sat190_XAP_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
Method: GET_ATTRIBUTE_INFO of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
AMOUNT2009 is a new attribute that add to my context, i made the next code, can you review and say me where i have the error? I start with the second year is for this reason that i use a count.
Reading FINCATYGROUP
DATA lo_nd_fincatygroup TYPE REF TO if_wd_context_node.
DATA lo_el_fincatygroup TYPE REF TO if_wd_context_element.
DATA ls_fincatygroup TYPE wd_this->element_fincatygroup.
DATA : lv_year type STRING,
ls_attribute type wdr_context_attribute_info, "To create dynamic node in the context
lr_container TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
lr_table TYPE REF TO CL_WD_TABLE,
lr_input_field TYPE REF TO CL_WD_INPUT_FIELD,
lr_cell_editor TYPE REF TO if_wd_table_cell_editor,
lr_column TYPE REF TO CL_WD_TABLE_COLUMN,
lr_column_header TYPE REF TO CL_WD_CAPTION,
lv_headerColumn TYPE STRING,
lv_id_input_field TYPE STRING,
lv_name TYPE STRING,
lv_id_table_column TYPE STRING.
DATA: lr_node_info TYPE REF TO if_wd_context_node_info, "To get node info
lr_table_type TYPE REF TO cl_abap_tabledescr, "To get table and stuct descriptor
lr_line_type TYPE REF TO cl_abap_structdescr,
lt_components TYPE cl_abap_structdescr=>component_table, "To get component table
ls_components_line LIKE LINE OF lt_components, "One line of component table
lr_elem_type TYPE REF TO cl_abap_elemdescr.
LOOP AT lv_periods_tt INTO lv_periods_ts.
get all declared attributes
lv_periods_ts->get_static_attributes(
IMPORTING
static_attributes = ls_wa_period ).
navigate from <CONTEXT> to <FINCATYGROUP> via lead selection
lo_nd_fincatygroup = wd_context->get_child_node( name = wd_this->wdctx_fincatygroup ).
IF lv_cont = 1 OR lv_cont = 2.
lv_cont = lv_cont + 1.
ELSE.
Create dynamic context and dynamic view
get node_info
lr_rootnodeinfo = lo_nd_fincatygroup->get_node_info( ).
lv_year = ls_wa_period-zyear.
SHIFT lv_year BY 15 PLACES LEFT.
CONCATENATE 'AMOUNT' lv_year INTO lv_name.
put attributes of add_attrbute node
CONCATENATE 'Y' lv_year INTO ls_attribute-name.
ls_attribute-name = lv_name.
ls_attribute-type_name = '\TYPE=/RPM/TV_CURR_AMOUNT'.
lr_rootnodeinfo->add_attribute( "Add attribute for amount of year
EXPORTING
attribute_info = ls_attribute ).
********************* table *******************************************************
Get ROOTUIELEMENTCONTAINER
lr_container ?= view1->get_element( 'ROOTUIELEMENTCONTAINER ' ).
Get TABLEFCG
lr_table ?= view1->get_element( 'TABLEFCG' ).
Create cell_editor
CONCATENATE 'TABLEFCGIF_Y' lv_year '_EDITOR' INTO lv_id_input_field.
lr_input_field = cl_wd_input_field=>new_input_field(
id = lv_id_input_field bind_value = ls_attribute-name ).
CONCATENATE 'TABLEFCG_Y' lv_year '_EDITOR' INTO lv_headerColumn.
lr_column_header = cl_wd_caption=>new_caption( id = lv_headerColumn ).
lr_column_header->set_text( ls_attribute-name ).
Create table column
CONCATENATE 'TABLEFCG_' lv_year 'COLUMN' INTO lv_id_table_column.
lr_column = cl_wd_table_column=>new_table_column( id = lv_id_table_column ).
lr_column->set_table_cell_editor( lr_input_field ).
lr_column->set_header( lr_column_header ).
lr_table->add_grouped_column( lr_column ).
********************* end table *******************************************************
ENDIF.
ENDLOOP.
Thanx.1.
Code if the Transparent container's layout is Matrix ( method WDDOMODIFYVIEW )
data lr_container type ref to cl_wd_transparent_container.
data lr_input type ref to cl_wd_input_field.
data lr_layout_data type ref to cl_wd_matrix_head_data.
lr_container ?= view->get_element( '<Transparent container ID>' ).
lr_input = cl_wd_input_field=>new_input_field( bind_value = '<node>.<attribute>'
view = view
ID = 'INP' ).
lr_layout_data = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_input width = '100%' ).
2.
Dynamic Context Attribute in a node.
data lr_node type ref to if_wd_context_node.
data lr_info type ref to if_wd_context_node_info.
data ls_attr type WDR_CONTEXT_ATTRIBUTE_INFO.
lr_node = wd_context->get_child_node( '<Node_name>' ).
lr_info = lr_node->get_node_info( ).
ls_attr-name = '<attribute_name>'.
ls_attr-type_name = 'STRING'.
lr_info->add_attribute( ls_attr ). -
Dynamic REF Cursor with Dynamic Fetch - Urgent
i have a pl/sql package with generates dynamic SQL statments. my problem is i want to open this SQL statment dynamically and fetch data in dynamic variable.
declare
type type_temp is REF CURSOR;
cur_temp type_temp;
mv_sql varchar2(4000);
begin
-- this will be dunamically generated and
-- hence could have any no. of columns.
mv_sql := select f1, f2, f3, f4 from table_temp;
open cur_temp for mv_sql;
fetch cur_temp into c1, c2, c3, c4;
close cur_temp;
end;
problem is my sql statment will have N no. of columns how can i fetch this N no. of columns.Very hard problem, because ref cursors do not (directly) support description!
Se mine (non-ideal) solution (it may be doable, but it isn't very practical
or easily maintainable):
1. "Generic" package
CREATE OR REPLACE PACKAGE dyn_fetch IS
TYPE ref_cur_t IS REF CURSOR;
g_query VARCHAR2 (32000);
g_count NUMBER;
g_desc_tab DBMS_SQL.DESC_TAB;
varchar2_type CONSTANT PLS_INTEGER := 1;
number_type CONSTANT PLS_INTEGER := 2;
date_type CONSTANT PLS_INTEGER := 12;
rowid_type CONSTANT PLS_INTEGER := 11;
char_type CONSTANT PLS_INTEGER := 96;
long_type CONSTANT PLS_INTEGER := 8;
raw_type CONSTANT PLS_INTEGER := 23;
mlslabel_type CONSTANT PLS_INTEGER := 106;
clob_type CONSTANT PLS_INTEGER := 112;
blob_type CONSTANT PLS_INTEGER := 113;
bfile_type CONSTANT PLS_INTEGER := 114;
PROCEDURE describe_columns;
FUNCTION record_def RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY dyn_fetch IS
PROCEDURE describe_columns IS
l_cur INTEGER;
BEGIN
l_cur := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (l_cur, g_query, DBMS_SQL.NATIVE);
DBMS_SQL.DESCRIBE_COLUMNS (l_cur, g_count, g_desc_tab);
DBMS_SQL.CLOSE_CURSOR (l_cur);
EXCEPTION
WHEN OTHERS THEN
IF DBMS_SQL.IS_OPEN (l_cur) THEN
DBMS_SQL.CLOSE_CURSOR (l_cur);
END IF;
RAISE;
END;
FUNCTION record_def RETURN VARCHAR2 IS
l_record_def VARCHAR2 (32000);
l_type VARCHAR2 (100);
l_col_type PLS_INTEGER;
l_col_max_len PLS_INTEGER;
l_col_precision PLS_INTEGER;
l_col_scale PLS_INTEGER;
BEGIN
FOR i IN 1..g_count LOOP
l_col_type := g_desc_tab(i).col_type;
l_col_max_len := g_desc_tab(i).col_max_len;
l_col_precision := g_desc_tab(i).col_precision;
l_col_scale := g_desc_tab(i).col_scale;
IF l_col_type = varchar2_type THEN
l_type := 'VARCHAR2(' || l_col_max_len || ')';
ELSIF l_col_type = number_type THEN
l_type := 'NUMBER(' || l_col_precision || ',' || l_col_scale || ')';
ELSIF l_col_type = date_type THEN
l_type := 'DATE';
ELSIF l_col_type = rowid_type THEN
l_type := 'ROWID';
ELSIF l_col_type = char_type THEN
l_type := 'CHAR(' || l_col_max_len || ')';
-- ELSIF l_col_type = ...
-- long_type, raw_type ...
END IF;
l_record_def := l_record_def || ' col_' || i || ' ' || l_type || ',';
END LOOP;
l_record_def := RTRIM (l_record_def, ',');
RETURN l_record_def;
END;
END;
Note that procedure "record_def" creates columns names as col_1 (col_2 ...)
because SELECT clause in your query can be without aliases, for example
"SELECT deptno || dname FROM dept".
2. Your package which returns query nad ref cursor
CREATE OR REPLACE PACKAGE test IS
PROCEDURE set_query (p_query VARCHAR2 := NULL);
FUNCTION ref_cur RETURN dyn_fetch.ref_cur_t;
END;
CREATE OR REPLACE PACKAGE BODY test IS
PROCEDURE set_query (p_query VARCHAR2 := NULL) IS
l_query VARCHAR2 (32000) :=
' SELECT e.empno, e.ename,' ||
' e.deptno, d.dname' ||
' FROM emp e,' ||
' dept d' ||
' WHERE e.deptno = d.deptno';
BEGIN
IF p_query IS NULL THEN
dyn_fetch.g_query := l_query;
ELSE
dyn_fetch.g_query := p_query;
END IF;
END;
FUNCTION ref_cur RETURN dyn_fetch.ref_cur_t IS
l_ref_cur dyn_fetch.ref_cur_t;
BEGIN
OPEN l_ref_cur FOR dyn_fetch.g_query;
RETURN l_ref_cur;
END;
END;
Why we need two separate procedures (functions) in your package ?
a) Receiving program must use dynamic SQL, but in dynamic block we can access
only PL/SQL code elements that have global scope (standalone functions and procedures,
and elements defined in the specification of a package).
Unfortunately, cursor variables cannot be defined in the specification of a package
(cannot be global variables).
b) Receiving program must get the column list before ref cursor.
So, we have two options: call (in receiving program) the same function two times
(once to get the column list and once to return a ref cursor)
or use one procedure (or function) for returning query (to get the column list)
and second function for returning a ref cursor.
3. Your receiving program
CREATE OR REPLACE PROCEDURE test_fetch_ref_cur (p_query VARCHAR2 := NULL) IS
l_statement VARCHAR2 (32000);
FUNCTION process_def RETURN VARCHAR2 IS
l_process_def VARCHAR2 (32000);
BEGIN
l_process_def := 'DBMS_OUTPUT.PUT_LINE (';
FOR i IN 1 .. dyn_fetch.g_count LOOP
l_process_def := l_process_def || ' l_record.col_' || i || ' || ''>>'' || ';
END LOOP;
l_process_def := RTRIM (l_process_def, ' || ''>>'' || ') || ');';
RETURN l_process_def;
END;
BEGIN
test.set_query (p_query);
dyn_fetch.describe_columns;
l_statement :=
' DECLARE' ||
' TYPE record_t IS RECORD (' ||
dyn_fetch.record_def || ');' ||
' l_record record_t;' ||
' l_ref_cur dyn_fetch.ref_cur_t;' ||
' BEGIN' ||
' l_ref_cur := test.ref_cur;' ||
' LOOP' ||
' FETCH l_ref_cur INTO l_record;' ||
' EXIT WHEN l_ref_cur%NOTFOUND;' ||
process_def ||
' END LOOP;' ||
' CLOSE l_ref_cur;' ||
' END;';
EXECUTE IMMEDIATE l_statement;
END;
You can test this with:
SET SERVEROUTPUT ON;
EXECUTE test_fetch_ref_cur;
Note that we can try to use more generic solution:
CREATE OR REPLACE PACKAGE dyn_fetch IS
-- SAME AS BEFORE, PLUS:
PROCEDURE fetch_ref_cur (
p_function_ref_cur VARCHAR2,
p_process_def VARCHAR2);
END;
CREATE OR REPLACE PACKAGE BODY dyn_fetch IS
-- SAME AS BEFORE, PLUS:
PROCEDURE fetch_ref_cur (
p_function_ref_cur VARCHAR2,
p_process_def VARCHAR2)
IS
l_statement VARCHAR2 (32000);
BEGIN
l_statement :=
' DECLARE' ||
' TYPE record_t IS RECORD (' ||
record_def || ');' ||
' l_record record_t;' ||
' l_ref_cur dyn_fetch.ref_cur_t;' ||
' BEGIN' ||
' l_ref_cur := ' ||
p_function_ref_cur || ';' ||
' LOOP' ||
' FETCH l_ref_cur INTO l_record;' ||
' EXIT WHEN l_ref_cur%NOTFOUND;' ||
p_process_def ||
' END LOOP;' ||
' CLOSE l_ref_cur;' ||
' END;';
EXECUTE IMMEDIATE l_statement;
END;
END;
CREATE OR REPLACE PROCEDURE test_fetch_ref_cur (p_query VARCHAR2 := NULL) IS
FUNCTION process_def RETURN VARCHAR2 IS
-- SAME AS BEFORE
END;
BEGIN
test.set_query (p_query);
dyn_fetch.describe_columns;
dyn_fetch.fetch_ref_cur (
p_function_ref_cur => 'test.ref_cur',
p_process_def => process_def);
END;
Regards,
Zlatko Sirotic
Maybe you are looking for
-
My iphone does not charge or show up as a device in itunes when i plug it into my computer
I've never had a problem connecting my phone to the computer, but in the last two or so weeks I have been unable to sync or charge my iphone 4 through my MacBook Pro (OSX). The phone does not charge and it does not show up in the "devices" section of
-
How do i turn off "find my iphone"?
my phone is in for repairs and the shop say that I have to turn off "find my iphone", because otherwise they can not make it. How do I turn it off when I'm on computer?
-
Vector does not like polymorphism ?
Hello, It seems like only concrete types can be used for vector types, not interfaces or abstract classes. All those examples won't work : private var vector : Vector.<UIComponent>; private function doSomething( input : Vector.<IUIComponent> ) : void
-
when i am trying to install ECC 6 i had receive the error msg as <u><b>msg server connected nie_conn connection refused</b></u>
-
How to get links to open in new tabs?
How do I make links open in a new tab rather than opening another browser? This also happens when I check gmail inbox or if I highlight something to "Search in Google". How do I get all this to open in the current active browser? I've checked the pre