How to assign table name for select query in loop.
Hi friends my requirement is count the no of records of all the database table which comes into an internal table ."Check the below coding". Iam fetching the tables from dd03l table into an internal table .plz give me a sujjesion how to assign a table name in select query in a loop.
SELECT tabname FROM dd09l
INTO TABLE i_dd09l
WHERE protokoll = 'X'.
IF sy-subrc = 0.
SORT i_dd09l BY tabname.
ENDIF.
LOOP AT i_dd09l.
SELECT COUNT(*) INTO val FROM i_dd09l-tabname.
IF sy-subrc = 0.
i_dd09l-count = val.
ENDIF.
MODIFY i_dd09l INDEX sy-index.
CLEAR val.
ENDLOOP.
error : 'I_DD09L-TABNAME' is not defined in the abap dictionary as a table.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat,
dy_field type ref to data.
LOOP AT i_dd09l.
perform get_structure using i_dd09l-tabname .
CREATE DATA dy_table TYPE TABLE OF (_dd09l-tab_name).
UNASSIGN <dyn_table>.
ASSIGN dy_table->* TO <dyn_table>.
SELECT COUNT(*) INTO val FROM <dyn_table>.
IF sy-subrc = 0.
i_dd09l-count = val.
ENDIF.
MODIFY i_dd09l INDEX sy-index.
CLEAR val.
ENDLOOP.
form get_structure using p_table.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails = ref_table_des->components.
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform. "get_structure
Try like this hope it will work.
Regards,
madan.
Similar Messages
-
How to find Table names for PO & Invoices in SRM Standalnoe system SRM 7.0?
Hi,
How to find Table names for PO & Invoices in SRM Standalnoe system SRM 7.0? Please let me know.
Thanks,
MonicaHi,
In SRM for all objects like SC ( BUS21210),BID,PO(BUS22010),Confirmation (BUS2203),invoice etc all the data stored
in BBP_PDHGP and BBP_PDBEI tables only, These is no separate tables..
for your reference below are the few SRM tables
BBP_PDACC Account Assignment
BBP_PDATT Document Attachment
BBP_PDBEH Backend Specific Header Data
BBP_PDBEI Backend Specific Item Data
BBP_PDBGP Partner Extension Gen. Purchasing Data
BBP_PDBINREL Transaction Object Linkage (EBP)
BBP_PDHCF Set for Tabular Customer and Solution Fields on Hdr
BBP_PDHGP Business Transaction Purchasing Information
BBP_PDHSB Bid Invitation
BBP_PDHSC Header Extension for Customer Fields
BBP_PDHSS Hdr Extension for SAP Internal Enhancements (IBUs and so on)
BBP_PDICF Set for Tabluar Customer and Solution Fields on Itm
BBP_PDIGP Business Transaction Item-Purchasing Information
BBP_PDISB Bid Invitation/Bid-Specific Item Data
BBP_PDISC Item Extension for Customer Fields
BBP_PDISS Item Ext. for SAP Internal Enhancements (IBUs and so on)
BBP_PDLIM Value Limit
BBP_PDORG Purchasing Organizational Unit
BBP_PDPSET Further Procurement Information
BBP_PDTAX Tax
CDCLS Cluster structure for change documents
CDHDR Change document header
CDPOS_STR Additional Change Document - Table for STRINGs
CDPOS_UID Additional Table for Inclusion of TABKEY>70 Characters
CRM_JCDO Change Documents for Status Object (Table JSTO)
CRM_JCDS Change Documents for System/User Statuses (Table JEST)
CRM_JEST Individual Object Status
CRM_JSTO Status Object Information
CRMD_LINK Transaction - Set - Link
CRMD_ORDERADM_H Business Transaction
CRMD_ORDERADM_I Business Transaction Item
CRMD_PARTNER Partners
SROBLROLB Persistent Roles of BOR Objects
SROBLROLC Persistent Roles of Business Classes
SRRELROLES Object Relationship Service: Roles
Thanks & Regards,
Prasad S -
How to find table name for the fields from Standard Extractor in CRM system
How to find table name of fields from the standard extractor in CRM system ?
e.g. We use LBWE TCode in R/3 system to find table name for the field from Extractor VCSCL(e.g.).
Likewise is there any way to find table name for the fields from Standard extractor like 0CRM_LEAD_I.Hi ,
Please find the link below for understanding BW CRM analysis.
http://help.sap.com/bp_biv135/html/bw.htm
activate the CRM DSs by scenario:
1) Activate the application component hierarchy (tcode RSA9). Changes made to the application component hierarchy in the CRM system can be transferred to the BW using the "Edit Application Component Hierarchy" (SBIW - Postprocessing of DataSources).
SAP Note 434886 must be implemented in CRM 3.0 before the application component hierarchy is activated.
2) Activate the Business Content DataSources (tcode RSA5).
Select/enter the application component and choose Execute (F8).
To compare the shipped and active versions, choose the 'Select Delta' pushbutton. If there is no active version of the DataSource, it is selected automatically.
To activate the shipped version, choose the 'Transfer DataSources' pushbutton.
3) Management of the versions of the BW-Adapter metadata (tcode BWA5). All DataSources are displayed that are managed by the BW Adapter.
As in transaction RSA5 (Service API Metadata Activation), the 'Select Delta' function can be used to select the inactive DataSources or compare shipped and active versions.
You can also go directly to the screen for maintaining DataSources that are managed by the BW Adapter.
The 'Compare Version' function makes a detailed comparison of the shipped and active versions.
All BW-Adapter metadata is considered when versions are compared:
Header information (Table SMOXHEAD)
Mapping information (Table SMOXRELP)
Global selection conditions (Table SMOXGSEL)
Attribute key fields (Table SMOXAFLD)
Hope this helps.
Regards,
csm reddy -
Table name for BW Query Where used list
Hi,
I am looking for Table name where the information of " where used list " of a BW query stores.
Any help ?
Thanks
SatyaVani,
I dont think it is available...
whats your exact requirement???
you can make use of these below tables
RSZELTDIR Directory of the reporting component elements
RSZELTTXT Texts of reporting component elements
RSZELTXREF Directory of query element references
RSRREPDIR Directory of all reports (Query GENUNIID)
RSZCOMPDIR Directory of reporting components
RSZRANGE Selection specification for an element
RSZSELECT Selection properties of an element
RSZELTDIR Directory of the reporting component elements
RSZCOMPIC Assignment reuseable component <-> InfoCube
RSZELTPRIO Priorities with element collisions
RSZELTPROP Element properties (settings)
RSZELTATTR Attribute selection per dimension element
RSZCALC Definition of a formula element
RSZCEL Query Designer: Directory of Cells
RSZGLOBV Global Variables in Reporting -
How user variable table names in select statement
Dear all,
I have three table gp1,gp2,g3. i want user variable table in sql query
for example at oracle forms have a list table showing table names gp1,gp2,gp3
at form i want user this query
select gpno from :table where gpno=120;
how i can specify table name Dynamicly in select query
ThanksForms_DDL is a one-way street: You can only pass DDL commands TO the database; you cannot get data back using Forms_DDL.
Exec_SQL is the Forms package that enables dynamic sql within a form. But to retrieve data, you have to make a Exec_SQL call for every column in every row. So it is not a good thing to use, either.
The ref cursor method should work. You could also retrieve the data into a record group using populate_group_with_query -- it also enables dynamic data retrieval.
But if you already know you have three distinct tables and you know their names, I would keep it simple and just write three sql select statements. -
Dynamically assigning table name in select statement
how can i assign the table name dynamically in Select statement?
i tried following code
create or replace procedure proc1
as
x varchar2(100);
y varchar2(10);
begin
x='UNIT_MASTER';
execute immediate 'select unit_code into y from x where
rownum=1';
dbms_output.put_line(y);
end;
the procedure is created but when i execute the procedure the
error is shown in the execute immediate statementDo the following :
Create or replace procedure pro1 as
x varchar2(100);
y varchar2(10);
begin
x := 'UNIT_MASTER';
EXECUTE IMMEDIATE 'select unit_code from '||x||' where rownum
= 1' INTO y;
dbms_output.put_line(y); -
How to find table name for a structure field
There is a field in contract display screen (VA43). Item overview tab. The name of the field is Value released (RV45A-AWERT). Can anybody let me know the name of the table and field that has this value. I have to display this value in a custom report.
Hi Chandra,
You can the see list of tables used for VA43 through transaction SE80.
If you want to see the field is used by tables then go to transaction code SE84.
1) Select ABAP dictionary->Data elements.
2) Give the field name in the Data element under Standard selections and click on execute.
3) Check the data element and click on where-used-list(CtrlshiftF3)
4)Check table fields
5)It will display list of table fields used by this field.
Thanks,
Vinay -
How to assign one name for upper/lower/upperlower?
Dear,
i am using JDev Version: 11.1.2.1.0
In my form i have employee field . First time i am entering damby(lowercase) in that field.
if a enter second time DAMBY(uppercase) it should show me error that name is already exists.
employee field is coming from view but i can save data any cases in db either upper/lower/upper lower
Thanks
Damby
Edited by: 910346 on Jan 10, 2013 3:33 AM
Edited by: 910346 on Jan 10, 2013 3:41 AM
Edited by: 910346 on Jan 10, 2013 3:41 AMwll you might have missed to get my point, lemme give you an example:
in your validator,After getting your view Iterator
for(Row row:iter1.getAllRowsInRange){ \\here iter1 is your view iterator
if(valueEnteredByuser.equalIgnoreCase(row.getAttribute("col1").toString())){ \\here col1 is your attribute that contains the value and valueEnteredByuser is the value entered by user
throw new validatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,"Data Exists"));
}let me know if you need some other help :) -
How to use bind variable value for table name in select statement.
Hi everyone,
I am having tough time to use value of bind variable for table name in select statement. I tried &p37_table_name. ,
:p37_table_name or v('p37_table_name) but none worked.
Following is the sql for interactive report:
select * from v('p37_table_name') where key_loc = :P37_KEY_LOC and
to_char(inspection_dte,'mm/dd/yyyy') = :P37_INSP_DT AND :p37_column_name is not null ;
I am setting value of p37_table_name in previous page which is atm_state_day_insp.
Following is error msg:
"Query cannot be parsed, please check the syntax of your query. (ORA-00933: SQL command not properly ended) "
Any help would be higly appreciated.
RajInterestingly enough I always had the same impression that you had to use a function to do this but found out from someone else that all you need to do is change the radio button from Use Query-Specific Column Names and Validate Query to Use Generic Column Names (parse query at runtime only). Apex will substitute your bind variable for you at run-time (something you can't normally do in pl/sql without using dynamic sql)
-
Hi Experts,
I want to find out total queries for some data targets for this i am using "RSBCTCB_QUERY" table but i am getting Query technical name only, i want Description also.. so can you please give me table name for this?
Many thanks
DavidHi Naida,
solved my problem with your solution, thanks
I have only info provider name and i need to find out total queries along with description, so which table gives full information.
RSBCTCB_QUERY----- this table gives only total info provider query technical names only ( not description)
RSBCTCB_QRY_T_V----
> this table gives description only what ever we provide query technical name
but,
if i give info provider name i want to know the total queries with description.
Thanks
David
Edited by: david Rathod on Jan 19, 2011 12:37 PM
Edited by: david Rathod on Jan 19, 2011 12:38 PM
Edited by: david Rathod on Jan 19, 2011 12:38 PM -
Need table name for Output Types and Account Assignment Types
Hi
pl let me know the table name for
1. Account Assignment Type
2. Output Types (All)
I need to download some company code specific data for both
Pl confirm
Warm Regards
VikcyHi Thanks for reply
You mean to say that Account Assignment Types = Account Assignment Category ????
Secondly In Table NAST, i can not see field "Output Type"
Pl confirm once which field give me company code specific "Output Type" data
Regards
Vicky -
What is the syntax for creating global temporary table using a select query
hii
I'm creating a global temporary table using a select query ..how to mention 'on commit preserve rows' that?
create global temporary table t1 as select * from trn_ordbase on commit preserve rows;
but this is invalid syntax,so how to mention on commit preserve rows in this???if i dont mention it ,by default its considering as on commit delete rows.
Please help me out of this problem.create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif -
How can I find table names for Interaction Record
Hi
I need the table names for Interaction Record Notes, Description Field, Reason Code & IC Agent. Please assist.Hi Sunglad,
The header data of the interaction record (incl. description) is saved in table CRMD_ORDERADM_H.
The reason code can be found in table CRMD_SRV_SUBJECT.
The connection between CRMD_ORDERADM_H and the CRMD_SRV_SUBJECT is rather complex:
CRMD_ORDERADM_H --> CRMD_LINK --> CRMD_SRV_OSSET --> CRMD_SRV_SUBJECT
get transaction guid from crmd_orderadm_h.
get guid_set from crmd_link where crmd_link-guid_hi = transaction guid and objtype_set = 29.
select guid from crmd_srv_osset where guid_set = guid_set found above in crmd_link table.
select * from crmd_srv_subject where guid_ref is in all guid's found above.
The text can be found in table STXH. I guess you need a function module (READ_TEXT) to
retrieve the text.
Hope this helps.
regards,
Wim Olieman -
Bex Query: Too many table names in the query The maximum allowable is 256
Hi Experts,
I need your help, Im working on a Query using a multiprovider of 2 datastores, I need to work with cells to assign specific acconts values to specific rows and columns, so I was creating a Structure with elements from a Hierarchy, but I get this error when I'm half way of the structure:
"Too many table names in the query. The maximum allowable is 256.Incorrect syntax near ')'.Incorrect syntax near 'O1'."
Any idea what is happening? is ti possible to fix it? do I need to ask for a modification of my Infoproviders? Some one told me is possible to combine 2 querys, is it true?
Thanks a lot for your time and pacience.Hi,
The maximum allowable limit is 256 holds true. It is the max no. of characteristics and key figures that can be used in the column side. While creating a structure, you create key figures (restricted or calculated) and formulas etc.. The objects that you use to create these should not be more than 256.
http://help.sap.com/saphelp_nw70/helpdata/EN/4d/e2bebb41da1d42917100471b364efa/frameset.htm
Not sure if combination of 2 query's is possible. You can use RRI. Or have a woorkbook with 2 queries.
Hope it helps. -
How to populate table name dynamically to a ref cursor
Hi,
I came accross with a requirement that in ref cursor how can i pass the table name
for ex
open ref_cur for select * from emp;Like that i've some 100 tables , instead of typing each and every time the table name
that should be dynamically changed
Like below
open ref_cur for select * from &tbl_nm;How can i do that??
Thank youI assume you are using SQL*Plus:
SQL> variable ref_cur refcursor;
SQL> begin
2 open :ref_cur for select * from &tbl_nm;
3 end;
4 /
Enter value for tbl_nm: emp
old 2: open :ref_cur for select * from &tbl_nm;
new 2: open :ref_cur for select * from emp;
PL/SQL procedure successfully completed.
SQL> print ref_cur
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 12/17/1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 02/20/1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 02/22/1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 04/02/1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 09/28/1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 05/01/1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 06/09/1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 04/19/1987 00:00:00 3000 20
7839 KING PRESIDENT 11/17/1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 09/08/1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 05/23/1987 00:00:00 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 12/03/1981 00:00:00 950 30
7902 FORD ANALYST 7566 12/03/1981 00:00:00 3000 20
7934 MILLER CLERK 7782 01/23/1982 00:00:00 1300 10
14 rows selected.
SQL> begin
2 open :ref_cur for select * from &tbl_nm;
3 end;
4 /
Enter value for tbl_nm: dept
old 2: open :ref_cur for select * from &tbl_nm;
new 2: open :ref_cur for select * from dept;
PL/SQL procedure successfully completed.
SQL> print ref_cur
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> SY.
Maybe you are looking for
-
Ipod Nano no longer recognised
Nothing happens when plugging in my ipod Nano to any usb port - it was working fine previously. Two other nano's still work perfectly using same usb port and cable. Occasionally the following message appears on the faulty nano screen:'Firewire connec
-
BizTalk produces control characters at the beginning of the file when producing output xml. Is there any change we can implement to the pipeline to remove the control characters at the beginning of the file. I have opened the output xml file in notep
-
We have the following problemswith a PC Installation:Processor: Intel Pentium 4 - 1400 MhzPlatform: Windows 2000 prof. SP1Software: JDK1.2.21. Problem - Weblogic---------------------- Software: weblogic 5.1- At the end of the installation, the dialog
-
Hi! I need the text component for image and text or only the text output. I also need scrolling, if it is needed, and auto line wrapping. In general, I need multiline JLabel with scrolling, line and word wrapping.
-
Hi all, Can you give me an idea on how to make a multi-lingual form. Lets say I have a form and I want it to accept Chinese language or convert it into a Chinese language. How will I do this stuff? Because we are developing a system here which will b