Selecting data dynamically
Hi all,
I have a table ZADDRESS which has fields like MOLGA,FIELD1, FIELD2, FILED3, FIELD4, FIELD5---FIELD8. Based on MOLGA, the values stored in the table would be names of the fields of infotype 6. Say STRAS is sotred in FIELD1, LOCAT in FIELD2. For every different MOLGA i would get different values of the field in the table ZADDRESS. I need to get the data from infotype 6 for only those fields mentioned for that MOLGA in ZADDRESS. Can any one help how this can be done?
Thanks in advance.
Warm regards,
Harshad.
Hi,
You can programatically concatenate the fields you want to be selected into a variable say - lv_select_clause.
Then use that variable in the select clause:
SELECT (lv_select_clause) from ....
Hope this helps,
Wenonah
Similar Messages
-
Need help in selecting data dynamically in combobox
i am taking some values in combobox from database
and i want that on selection of the option in 1st combobox the another set of values should come in 2nd combobox ,& that also from database
i have saved the file as .php and also given the database in the zip file, to solve my problem please can anyone help me plz....
the file link is - http://www.dandylink.com/combotest.zip
advance thanks for any help..php? Did you see the sign on the door when you came in? If you have some java code you want people to look, where java code is something stored in a .java file, then post it. Or, are you a hacker trying to spread viruses?
-
How to select column dynamically with sharepoint list as data source in ssrs report
Hi all,
I am creating reports from SharePoint list but i have requirements to select the column name dynamically with SharePoint list as data source. I didn't find any way of doing this..
Can anyone help me to resolve this issue..
There is no way of specifying column name dynamically here in data set query
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>test list</ListName>
<ViewFields>
<FieldRef Name="ID" />
<FieldRef Name="ContentType" />
<FieldRef Name="Title" />
<FieldRef Name="Modified" />
<FieldRef Name="Created" />
<FieldRef Name="Author" />
<FieldRef Name="Editor" />
<FieldRef Name="_UIVersionString" />
<FieldRef Name="Attachments" />
<FieldRef Name="Edit" />
<FieldRef Name="LinkTitleNoMenu" />
<FieldRef Name="LinkTitle" />
<FieldRef Name="DocIcon" />
<FieldRef Name="ItemChildCount" />
<FieldRef Name="FolderChildCount" />
<FieldRef Name="test_x0020_date" />
<FieldRef Name="title2" />
</ViewFields>
</RSSharePointList>Hi MNRSPDev,
Sorry for the delay.
According to the current description, I understand that you want to specify column name in dataset query designer dynamically when using SharePoint list data source.
Based on my research, this is not supported by default. As a workaround, you can use XML data source. The XML content can be embedded directly within the query. This lets you use the expression capabilities within the processing engine to build queries and
data dynamically within the report. And it can be used for retrieving XML data directly from an external data source, passing it using parameters, and embedding it within the query.
Reference:
http://www.codeproject.com/Articles/56817/Dynamic-Reports-with-Reporting-Services
Hope this helps.
Regards,
Heidi Duan
Heidi Duan
TechNet Community Support -
Dynamically select data with 20 input parameters
Hi Experts,
Now i have created a subscreen with more than 20 fields on it. these fields are defined by parameters, not select options. user can input any fileds for these input parameters.
So now i should write codes to select data from database according the user input. Is there any easy way for me to write it? I heard about dynamically SQLs, but i don't know how to use it.
Thanks a lot!you forgot to mention why you needed dynamic SQL : I guess that when user lets a field blank, you must not perform selection on it.
The easiest is ( FIELD1 = P_FIELD1 OR FIELD1 = space ) AND ( FIELD2 = P_FIELD2 OR FIELD2 = space ) AND etc. Even if it seems repetitive, I advise you to keep the SQL static instead of dynamic, because in this latter case, I think the code will be a little bit less clear.
Of course, if you argue that there are other requirements, then maybe it's worth re-evaluating the solution.
If you need more information, just look at ABAP examples in your system (SE38, Environment, Examples, ABAP examples -> ... -> Dynamic conditions) -
Selecting data from Multiple Partitions in a single select stmt.
Hi all,
My Database is very large & my tables are partitioned.
My question is:
1) If my data is spread across multiple partitions, is there any way to select data from multiple partitions in a single query?
If we dont mention partition name also it works fine, but perofmance wise it will be very slow. (Using EXPLAIN PLAN)
(Note:I dont want to make use of Union concept, i want to do it in a single select statement)
For ex:
qry1.sql:
select empno from emp_trans partition (P012000)
This above query(qry1.sql) will work fine.
qry2.sql:
select empno from emp_trans partition (P012000,P022000)
The above query(qry2.sql) will return will return the following error:
ORA-00933: SQL command not properly ended
If anybody has any solution for this, pls mail me immediately.
Thanks in advance
bye
nullAll my queries are dynamically generated. All my tables are also indexed partition wise based on date field. My question is, if i want to mention multiple partition names at the time of generating my query(select), then with parformance will be good. I have refered some books, inthat what they say is to use UNION concept, i dont want to use that, instead i want in a single select statement.
Thaks for ur reply
Bye
null -
How to select data from a PL/SQL table
Hi,
I am selecting data from database after doing some screening i want to store it in a PL/SQL table (temporary area) and pass it to oracle reports.
Is there any way to select the data from a PL/SQL table as a cursor. Or is there any other way of holding the temporary data and then pass it back as a cursor.
Regards
KamalA PL/SQL "table" is anything but a table. Whoever came up with this term in PL/SQL to describe what is known as dynamic arrays (the correct programming terminology that existed since the 70's if not earlier and what is used in all other programming languages I'm familiar with)... well, several descriptions come to mind and none of them are complimentary.
You cannot "select" from a PL/SQL dynamic array as it is not a table within the Oracle context of tables.
Thus you need to convert (cast) a PL/SQL dynamic array into a temporary Oracle data set/table in order to select from it. This is in general a Bad Idea (tm). Oracle tables and SQL and concurrency controls and all that are especially designed for processing data. PL/SQL arrays is a very simplistic data structure with very limited usage. Why would you want to use that in SQL via a SELECT statement when you can use Oracle tables (or proper temp tables) instead? Besides that, it is also slow to cast a dynamic PL/SQL array into an Oracle SQL data set structure (context switching, copying of memory, etc).
The proper way to use PL/SQL to generate data sets for use via the SQL engine is pipelined table functions.
This is not to say that you should never use PL/SQL arrays and casting in SQL.. simply that you need to make sure that this is the correct and scalable way to do it. And that will also always be an exception to the rule when you do. -
How to get the opening balances for lessthan selected date in cubes.
Hi All,
my task is to get the opening balances for the selected date.
Ex: If I select date say 31-1-2013, I should get the sum of values which are less than the selected date.
in sql:
select sum(balance) from banktrans where banktrans.transdate < 31-1-2013;
BankTable BankTrans
BankId BankId
balance
transdate
BankTable (records):
SCB
BankTrans(records):
a) SCB, 15000, 10-02-2013
b) SCB, 20000, 31-01-2014
c) SCB, 50000, 21-09-2012
If I select date as 31-01-2014, I should get the value as 65000
If I select date as 10-02-2013, I should get the value as 50000
Date will be dynamic selection from years months days hirearchy ( time dimension)
How can i achieve this?
any help is much appreciated.
Thanks,
RakeshDear David,
I've tried the below with static date but i'm not getting the values which are sum of less than the given date.
I've given 1st jan 2013 as static date and I need to get the sum of values which are less than the 1st jan date.
CREATE
MEMBER
CURRENTCUBE.[Measures].[OPENBALANCE]
AS
Sum({Null:[Time].[Years
Quarters Months Weeks Days].[Days].&[2013-01-01T00:00:00]},[Measures].[AmountCur]]),
FORMAT_STRING
= "Standard",
VISIBLE
= 1
can you plz check the above once and guide me.
Thankyou,
Rakesh -
How to change the select options selection text dynamically in webdynpro abap ?
I am using standard interface WDR_SELECT_OPTIONS.... i want to change the Selection text dynamically in my select options.I.E. if the select option is for VBELN field than i want to change its description SALES ORDER Number through Code to some other text.
If anyone can please help me in this.Hi,
You can achieve your requirement as below
Get the range table of your selection field as below
data lt_range_table type ref to data.
wd_this->m_handler->GET_RANGE_TABLE_OF_SEL_FIELD(
exporting
i_id = 'VBELN'
receiving
rt_range_table = lt_range_table ).
Update the selection field with new description - 'Your New Text'
wd_this->m_handler->UPD_SELECTION_FIELD(
exporting
I_ID = 'VBELN'
I_DESCRIPTION = 'Your New text'
I_IS_AUTO_DESCRIPTION = abap_false
IT_RESULT = lt_range_table ).
You can also pass the other parameters as per your requirement
Hope this helps you.
Regards,
Rama -
URGENT - how to get the checkbox selected data from datatable.
Hi
I have some dynamic data. which will be displayed as checkbox. User can select the checkboxes in jsp. after selection when I submit the page I wanted to get the list of checkbox data the user selected.
Here is the following code. when I submit the form the method which is mapped in bean (dostuff() method) is not calling. it is simply displaying the same page. Could you please tell me where I am doing wrong.
please give me suggestion what I should to get the checkbox data in bean.
My Code JSP:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<h:form>
<h:dataTable id="xxx" var="person" value="#{checkboxBean.beans}" >
<h:column><h:selectBooleanCheckbox value="#{person.checked}"/></h:column>
<h:column><h:outputText value="#{person.id}"/></h:column>
</h:dataTable>
<h:commandButton id="details" action="#{checkboxBean.doStuff}" value="do Stuff"></h:commandButton>
</h:form>
</f:view>
public class CheckboxBean {
private static final Logger logger = Logger.getLogger(CheckboxBean.class);
private List beans = null;
public CheckboxBean() {
logger.debug("CheckboxBean()");
public String doStuff() {
logger.debug("doStuff()");
logger.debug("Some Bean selected data :" );
return "test";
public List getBeans() {
beans = new ArrayList();
SomeBean[] someBeans = new SomeBean[3];
someBeans[0] = new SomeBean("first Person", false);
someBeans[1] = new SomeBean("2nd Person", true);
someBeans[2] = new SomeBean("third person", false);
beans.add(someBeans[0]);
beans.add(someBeans[1]);
beans.add(someBeans[2]);
logger.debug("Inside getBeans()");
return this.beans;
<managed-bean>
<description>Checkbox bean.</description>
<managed-bean-name>checkboxBean</managed-bean-name>
<managed-bean-class>com.view.bean.CheckboxBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
* Created on Mar 17, 2006
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
package com.view.bean;
public class SomeBean {
private boolean checked = false;
private String id ;
public SomeBean() {
public SomeBean(String anId, boolean bool) {
super();
this.id = anId;
this.checked = bool;
public String getId() {
return this.id;
public void setId(String id) {
this.id = id;
public boolean isChecked() {
return this.checked;
public boolean getChecked() {
return this.checked;
public void setChecked(boolean checked) {
this.checked = checked;
public String toString() {
return "Id: " + id + ", checked :" + checked;
}Hello,
If you post in ASP.NET forums, you'll get more help.
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Extracting Multiple Table Data Dynamically..Table is an Input parameter
Hi All
Can any one update the Program/design of extracting multiple table data as a list or to an excel sheet
For eg:- Mutliple Tables are entered in selection screen and upon executing the output should be to an excel sheet sequenctially according to the table names entered in the selection screen
Awaiting for your update
Regards
Shiva
Edited by: shivakumar bandari on May 29, 2009 9:35 PMHI Naimes
Thanks for youe reply
your second step says to select data from 'table' here tables are dynamic in nature I mean they are an input parameters..how can I write select on a table..
I can get the table existence from DD02L table and pass the retrieved tables to FM Get_Component_List to get the fields existing for the particular table,
But I cannot pass the dynamic table value to select query to retrieve the data..Please update me if you have anything on retrieving data from dynamically inputted value
Can I do this
Select * from <dyntable>
Any suggestions will be appreciated
thank you -
Filter data dynamically in reports
Hello,
Is it possible to filter a report dynamically?
Ex:I have a table with 1 million rows.In a report i want the data to be displayed dynamically based on a dashboard prompt.
I know i can do static filters for a column like ticket number in ('123','234').But, what i want to do is "select date,year where ticket number in (prompt for ticketnumber)" some thing like this instead of static values.
Is it possible?Please let me know.
Thanks in advanceYes. You can do it. I assume that you talk about answer when you write report.
Check this oracle by example tutorial : Section "Using Dashboard Prompts and Presentation Variables"
http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html#t8 -
Adding fields on selection screen dynamically
Hi all,
Can we add some fields to selection screen dynamically on pushbutton click?
Regards,
Dnyaneshjust have look below code
REPORT zrsdvsr1
LINE-SIZE 220
LINE-COUNT 65(5).
TYPE-POOLS : slis.
TABLES
TABLES: vbak.
DATA DECLARATIONS
Ranges
RANGES: r_posnr FOR vbap-posnr.
DATA: BEGIN OF t_veramt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
END OF t_veramt.
DATA: BEGIN OF t_disamt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
netwr_v TYPE vbap-netwr,
mwsbp_v TYPE vbap-mwsbp,
disc_val TYPE vbap-mwsbp,
END OF t_disamt.
*& ALV FIELDS
DATA : alv_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
alv_layout TYPE slis_layout_alv.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_ver RADIOBUTTON GROUP g1 USER-COMMAND rad DEFAULT 'X',
p_sab RADIOBUTTON GROUP g1 .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln NO INTERVALS MODIF ID gr1.
PARAMETERS: p_dwfile TYPE rlgrap-filename
DEFAULT 'C:\test1.txt' MODIF ID gr2, "#EC NOTEXT
p_upfile TYPE rlgrap-filename
DEFAULT 'C:\test.txt' MODIF ID gr3. "#EC NOTEXT
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_upfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dwfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_dwfile.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_sab = 'X'.
IF screen-group1 = 'GR1' OR screen-group1 = 'GR2'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ELSE.
IF screen-group1 = 'GR3'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION
START-OF-SELECTION.
Check Radio Button
IF p_ver = 'X'.
PERFORM get_details_open_so_vertex.
ELSE.
PERFORM get_details_open_so.
ENDIF.
Display the output.
PERFORM diplay_report .
regards
vinod -
Select data into deep internal table
Dear Experts.
I created a dynamiv deep internal table.
while selecting data , into the internal table it is giving a dump. saying that deep structure.
SELECT OBJTY OBJID ARBPL WERKS from crhd
INTO CORRESPONDING FIELDS OF TABLE <f_tab>
where WERKS = pr_werks.
I used the field catalog also.even same error is comming.
how to get data into deep internal table by select statement.
Please help me,
Regards,
RahulHI,
Try creating dynamic internal table like:
Field-symbols: <dyn_table> type standard table,
<dyn_wa> ,
<dyn_field>.
Data: dy_table type ref to data,
ifc type lvc_t_fcat ,
xfc type lvc_s_fcat ,
Count type i ,
Count1 type i ,
Index type i ,
dy_line type ref to data.
Data counter type i.
Data: line type string ,
List like table of line.
Data: idetails type abap_compdescr_tab,
xdetails type abap_compdescr .
Data: ref_table_des type ref to cl_abap_structdescr.
*Looping at field cat internal table to populate another field cat to be passed
* In method used below for creating final dynamic internal table
Loop at fieldcat into fieldcat1.
Clear xfc.
Xfc-fieldname = fieldcat1-fieldname.
Xfc-datatype = fieldcat1-datatype.
Xfc-intlen = fieldcat1-intlen.
Append xfc to ifc.
endloop.
Clear fieldcat1.
*Method called to create dynamic internal table on the basis of field catalog created above
Call method cl_alv_table_create=>create_dynamic_table
Exporting
it_fieldcatalog = ifc u201Cfield catalog appended above
Importing
ep_table = dy_table. u201CDynamic internal table which will be created
Assign dy_table->* to <dyn_table>.
*Create dynamic work area and assign to FS
Create data dy_line like line of <dyn_table>.
Assign dy_line->* to <dyn_wa>.
Then use this dynamic internal table created from above method
in the Select Query.
Hope it helps
Regards
Mansi -
Populating select-options dynamically
Hey Everybody,
I've done some reports with Select-options, but all the fields directly related to some field in a transparent table. As many of you might have experienced, things changed with the latest report that I have to develop.
I have to derive the drop-down for the select-options dynamically.
Could anybody provide me with the details, code snippets, hints on how to do this.
Thank You.
Sumit.Here is an example program where you are generically defining the select-option and building its F4 help at runtime.
report zrich_0001 .
data: begin of ihelp occurs 0,
field type char10,
ftext type char50,
end of ihelp.
data: a_field(20) type c.
select-options s_field for a_field.
initialization.
ihelp-field = 'A'.
ihelp-ftext = 'Description A'.
append ihelp.
ihelp-field = 'B'.
ihelp-ftext = 'Description B'.
append ihelp.
ihelp-field = 'C'.
ihelp-ftext = 'Description C'.
append ihelp.
at selection-screen on value-request for s_field-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'FIELD'
dynprofield = 'S_FIELD'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ihelp.
start-of-selection.
REgards,
Rich Heilman -
Error while selecting date from external table
Hello all,
I am getting the follwing error while selecting data from external table. Any idea why?
SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
2 SE_CUST_ID NUMBER(38),
3 SE_TRAN_AMT_LCY FLOAT(126),
4 SE_REVERSAL_MARKER VARCHAR2(255))
5 ORGANIZATION EXTERNAL (
6 TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY ext_tables
8 ACCESS PARAMETERS (
9 RECORDS DELIMITED BY NEWLINE
10 FIELDS TERMINATED BY ','
11 MISSING FIELD VALUES ARE NULL
12 (
13 country_code CHAR(5),
14 country_name CHAR(50),
15 country_language CHAR(50)
16 )
17 )
18 LOCATION ('SE2.csv')
19 )
20 PARALLEL 5
21 REJECT LIMIT UNLIMITED;
Table created.
SQL> select * from se2_ext;
SQL> select count(*) from se2_ext;
select count(*) from se2_ext
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04043: table column not found in external source: SE_REF_NO
ORA-06512: at "SYS.ORACLE_LOADER", line 19It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
HTH -- Mark D Powell --
Maybe you are looking for
-
Excel 2013 PowerPivot Error - "PowerPivot is unable to load the Data Model"
I'm attempting to use the PowerPivot add-on in Excel. When clicking 'Manage Data Model' or attempting to 'Load to data model,' I receive the error 'We couldn't load the Data Model. This may be because the Data Model in this workbook is damaged.', f
-
MDM7.1 Relationship Tables
Hi Everyone, We are working on MDM 7.1 and we have 3 different main tables. We have a scenario to import relationships between different remote systems. The records from both the remote systems are maintained as company. But we are trying to import
-
Power mac g4 given to me. How can i change the password? No disc was provided
I recently inherited a Power Mac G4 from my work. The computer came from an office that had left it behind and donated it. I do not have any password to it to log into it. How can i change the password? I didnt recieve and disc or anything with this.
-
Any update on Vista-64 driver situation for Treo 700W?
I've read enough threads to learn that mine is not a unique problem - but I haven't been able to tell whether the problem yet has a solution. Treo 700W - Active Sync works superbly on Windows Vista 32-bit - However, it doesn't work on Vista 64-bit. T
-
Photoshop CS5: no photoshop application help available
I did Photoshop Mac CS5 install (upgrade). The application seems to be functioning normally. However, when searching for Photoshop help under the 'Help' menu there do not seem to be any PS help available. When doing search for any topic the only retu