How to find out the primary key of oracle apps tables
Hii,,
My Question is How to find the primary key in the apps table...Is there any Query or other way to find out???
for eg.
I want to find out the primary key of the AP_INVOICES_ALL table...just tell me how can i get the primary key of this table.
I am currently using toad for the query..
Please guide me...
you can define the primary key when you create table
or add the primary key after the table creation by 'ALTER TABLE ... ADD constraint pk_nme primary key (col1, col2)';
you could use below sql to check the detail of primary key:
1) check out the table definition directly:
select dbms_metadata.get_ddl('TABLE','EMP') FROM DUAL;
2) check out the columns of primary key:
select * from user_constraints where constraint_type='P' AND table_NAME='EMP';
select * from user_cons_columns where CONSTRAINT_NAME='PK_EMP';And BTW, it is madam, not sir. :)
Edited by: PhoenixBai on Dec 17, 2010 1:07 PM
Similar Messages
-
How to find out the primary key column of a database table?
Hi
Given the following scenario :
Given an inputfield, the user can enter a table name. The code behind will base on the table name given and extract out the fieldname of the primary key and concatenate the two field to become a unique string.
Eg. Order ID and Product ID make out a primary key.
How do i achieve that? Any code sample?
Regards,
RaydenCheck the below code :
REPORT zTest no standard page heading.
data : i_DD03P like DD03P occurs 0 with header line.
data v_table like DCOBJDEF-NAME.
parameters : p_table like dd02l-tabname.
start-of-selection.
v_table = p_table.
CALL FUNCTION 'BDL_DDIF_TABL_GET'
EXPORTING
NAME = v_table
STATE = 'A'
LANGU = 'E'
IMPORTING
GOTSTATE =
DD02V_WA =
DD09L_WA =
TABLES
DD03P_TAB = i_DD03P
DD05M_TAB =
DD08V_TAB =
DD12V_TAB =
DD17V_TAB =
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at i_DD03P.
if i_dd03p-KEYFLAG = 'X'.
write:/ 'Key fields', i_dd03p-FIELDNAME.
endif.
endloop.
Thanks
Seshu -
From my session how to find out the version of my oracle client ?
From my session how to find out the version of my oracle client ?
Thanks in advanceClient version?
BTW, trying all forums? -
How to find out the primary and failover DNS name
Hi;
This sounds very stupid, but could some one please tell me how to find out the name/dns name of the primary and failover server without using the CDS console.
any help is appreciatedIs this what you want?
$ /usr/lib/ldap/ldap_cachemgr -g
cachemgr configuration:
server debug level 0
server log file "/var/ldap/cachemgr.log"
number of calls to ldapcachemgr 12729
cachemgr cache data statistics:
Configuration refresh information:
Previous refresh time: 2005/08/07 23:54:59
Next refresh time: 2005/08/08 00:55:00
Server information:
Previous refresh time: 2005/08/14 15:15:00
Next refresh time: 2005/08/15 03:15:00
server: ldap1.example.com, status: UP
server: ldap2.example.com, status: UP
server: ldap3.example.com, status: UP
Cache data information:
Maximum cache entries: 256
Number of cache entries: 0
Gary -
How to find out the infoProvider for a given dimension table?
Experts:
In RSA1, I want to find out the infoProvider for a given dimension table.
But I am not sure how to display the tables linked to a given infoProvider.
Could you provide a way to display all tables linked to a given infoProvider?
Thanks a lot!See, The dimension table starts with Dcubename1 and incremental Dcubename2 .... so on
Ex.ZSD_C01 is your cube name
Dim tables starts for this is /BIC/DZSD_C011 /BIC/DZSD_C012 ...
Goto - LISTSCHEMA - derive cube name from given dim table and enter cube name - execute - will show you all the tables -
How to find out the Area Menu for a Report/ Table/Function Module
Hi,
Is there any procedure to find out the <b>"AREA MEANU"</b> for a Report/Table/Function Module...
Or is there any Transaction code / Report is available to find out all the report for a particular "AREA MENU".
Thank you for your quick response...
Regards,
Thiru
<b></b>Hi,
Check these below threads:
user log in & log out time SAO
How to find user log-out time ?
Regards,
Nitin -
How to find out the date when an oracle database is upgraded
Hi,
I would like to know the date when an oracle database is upgraded (for example 10.2.0.4 to 11.2.0.3).
Can you help me to find out these details.
Thanks,
Sarayuuser13312943 wrote:
Hi Ed and SB,
Thanks for your replies. How about this option?
Let us assume I am interested in checking when my database is upgraded to any 11g version.
Will this query help?
select min(first_usage_date) from dba_feature_usage_statistics where version like '11%';
I understand this may not be a generic solution , but with this idea I may be able to build up a query to get the result.
Thanks,
Sarayu
How is it that you or nobody knows when the DB was upgraded?
I would have expected a formal testing & upgrade plan.
Does the organization practice safe software & utilize any source code repository?
Does everyone suffer from amnesia?
How could a MAJOR database upgrade slip by everyone who should care about such a detail? -
Hi All,
I have to find out all the Domains which are related to Only Transaction Tables, that Domains should not be used or related to Master Tables, pls let me know is there any way to find out?
Akshitha.Step 1:
Select TABNAME from DD09L where TABART = 'APPL1'.
Select DOMNAME from DD03L where TABNAME = TABNAME (got from the above statement)
By this way you will get all the domains used in Transaction table
Step 2:
Select TABNAME from DD09L where TABART = 'APPL0'.
Select DOMNAME from DD03L where TABNAME = TABNAME (got from the above statement)
By this way you will get all the domains used in Master table
Step 3:
Display all the domains got from step 1 and not in step 2.
Hopefully this will fulfill your requirement.
Please reward if useful..
-Tushar -
How to find out the rows inserted between a time period.
Hi,
Please help me to solve this.
Table - emp.
Colmns - empno(Primary Key),ename, mgr
How to find out the rows inserted between a time period.
For eg:- Between 02-Oct-2006 1 PM and 03-Oct-2006 2 PM.
regards,
Mathew.Hi,
Maybe work:
For each row, ORA_ROWSCN returns the conservative upper bound system change number (SCN) of the most recent change to the row. This pseudocolumn is useful for determining approximately when a row was last updated. It is not absolutely precise, because Oracle tracks SCNs by transaction committed for the block in which the row resides
e.g.:
SGMS@ORACLE10> create table test(cod number);
Table created.
SGMS@ORACLE10> insert into test values (1);
1 row created.
SGMS@ORACLE10> insert into test values (2);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> insert into test values (3);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> select SCN_TO_TIMESTAMP(ora_rowscn),ora_rowscn,cod from test;
SCN_TO_TIMESTAMP(ORA_ROWSCN) ORA_ROWSCN COD
06/11/06 08:56:56,000000000 727707205 1
06/11/06 08:56:56,000000000 727707205 2
06/11/06 08:57:05,000000000 727707210 3Cheers -
How to find out the Transactions used per month & the USER who used that
Hi,
1)How to find out the Transactions used per month & the USER who used that?
2)and can i get the above same for minimum 20 month?
System : SAP- Enterprise Core Component.You can use my program...
*& Report Z_ABAP_TCODE_MONITOR
*****& Program Type : Report *
*****& Title : Z_ABAP_TCODE_MONITOR *
*****& Transaction code : ZTCODE_USAGE *
*****& Developer name : Shailendra Kolakaluri *
*****& Deveopment start date : 26 th Dec 2011 *
*****& Development Package : ZDEV *
*****& Transport No : DEVK906086 *
*****& Program Description : This program is to display
*List all tcodes executed during previous day.
*& Show the number of users executing tcodes
*& Modification history
REPORT Z_ABAP_TCODE_MONITOR.
*& List all tcodes executed during previous day.
*& Show the number of users executing tcodes
TYPE-POOLS : slis.
DATA: ind TYPE i,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
layout TYPE slis_layout_alv,
variant TYPE disvariant,
events TYPE slis_t_event WITH HEADER LINE,
heading TYPE slis_t_listheader WITH HEADER LINE.
*REPORT z_report_usage.
TYPES: BEGIN OF zusertcode,
date TYPE swncdatum,
user TYPE swncuname,
mandt TYPE swncmandt,
tcode TYPE swnctcode,
report TYPE swncreportname,
count TYPE swncshcnt,
END OF zusertcode.
*data : date type n.
DATA: t_usertcode TYPE swnc_t_aggusertcode,
wa_usertcode TYPE swncaggusertcode,
wa TYPE zusertcode,
t_ut TYPE STANDARD TABLE OF zusertcode,
wa_result TYPE zusertcode,
t_result TYPE STANDARD TABLE OF zusertcode.
PARAMETER: month TYPE dats DEFAULT sy-datum.
*PARAMETER: date TYPE dats.
*select-options : username for wa_usertcode-account.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_fieldcatalog.
PERFORM set_layout.
PERFORM get_event.
PERFORM get_comment.
PERFORM display_data.
FORM get_data .
*date = sy-datum - 2 .
After start-of-selection add this line (parameter Month required 01 as day).
concatenate month+0(6) '01' into month.
CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
EXPORTING
component = 'TOTAL'
ASSIGNDSYS = 'DEV'
periodtype = 'M'
periodstrt = month
TABLES
usertcode = t_usertcode
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
wa-date = month.
*wa-date = date.
wa-mandt = sy-mandt.
wa_usertcode-account = username.
LOOP AT t_usertcode INTO wa_usertcode.
wa-user = wa_usertcode-account.
IF wa_usertcode-entry_id+72 = 'T'.
wa-tcode = wa_usertcode-entry_id.
wa-report = space.
ELSE.
wa-tcode = space.
wa-report = wa_usertcode-entry_id.
ENDIF.
COLLECT wa INTO t_ut.
ENDLOOP.
SORT t_ut BY report ASCENDING.
CLEAR: wa, wa_result.
endform.
FORM get_fieldcatalog .
fcat-tabname = 't_ut'.
fcat-fieldname = 'DATE'.
fcat-seltext_l = 'Date'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'MANDT'.
fcat-seltext_l = 'Client'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'USER'.
fcat-seltext_l = 'User Name'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'TCODE'.
fcat-seltext_l = 'Transaction Code'.
fcat-key = 'X'.
APPEND fcat.
ENDFORM.
*& Form SET_LAYOUT
text
--> p1 text
<-- p2 text
FORM set_layout .
layout-colwidth_optimize = 'X'.
ENDFORM. " SET_LAYOUT
*& Form GET_EVENT
text
--> p1 text
<-- p2 text
*FORM get_event .
events-name = slis_ev_top_of_page.
events-form = 'TOP_OF_PAGE'.
APPEND events.
*ENDFORM. " GET_EVENT
**& Form GET_COMMENT
text
--> p1 text
<-- p2 text
*FORM get_comment .
DATA: text(30).
text = 'Billing Report'.
heading-typ = 'H'.
heading-info = text.
APPEND heading.
*ENDFORM. " GET_COMMENT
**& Form top_of_page
text
--> p1 text
<-- p2 text
*FORM top_of_page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
*ENDFORM. " top_of_page
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
sort t_ut[].
DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = layout
it_fieldcat = fcat[]
i_save = 'A'
is_variant = variant
it_events = events[]
TABLES
t_outtab = t_ut
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " DISPLAY_DATA -
How to find out the selected column in Table Control
Hi all,
How to find out the selected column in Table Control?
Thanks & Regards,
YJRHi,
Let your table control name in Screen painter be TC1.
READ TABLE TC1-COLS INTO WA_COLS (some wok area)
WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
CLEAR: W_DUMMY, W_COL_NAME.
SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
W_COL_NAME.
endif.
W_COL_NAME gives you the column name.
Hope it helps.
cheers
sharmistha -
How to find out the table name
hi,
how to find out the table name in which the data from a particular structure in a particular screen is saved,
please tell me the procedure to find out the table name for saving the structure data that is inputted at runtime.
Thanks,
chinnuHi Chinnu,
Below are the tables that are referred to find out the table names
DD02L Table contains the SAP Tables.
DD02T Table contains the SAP Table Texts.
DD01L Table contains the Domains
DD01T Table contains the Domain Texts.
DD03L Table contains the Table Fields.
DD03T Table contains the Table Field Texts. (Language Dependent)
DD04L Table contains the Data Elements.
DD04T Table contains the Data Element Texts.
DD05s Table contains the Foreign Key Fields
last words with L and T only. L->Database Fetch T-> Text
And the procedure to retrive the table name is as follows
1. Go to se11
2. Enter table name DD03T and execute
3. In the next screen you can find Tables, fields, test etc. there you can enter the field name in the fields
and execute.
4. you can get all tables which contains the field.
I hope this will solve your problem
Regards,
Chandru -
How to find out the standard info stucture for a customized IS in LIS
Hi All
I have to run the statistical set up for the customized info structure S763 for the application plant maintenance in LIS. But i dont know whether it was copied from a standard SAP info structure or it was enhanced from a standard info structure.
I have even checked out all the standard IS for plant maintenance but it is not matching. The closest match is S063 but a few characteristics and a key figure is missing.
Could anybody guide me how to find out the standard info structure?
Any help would be of great help.
Regards
SaddyHi Ganesh
No..it didnt solve my problem. MC23 only displays the info structures. I have a customized info structure S763 which was created long time back. Im not sure whether it was copied from a standard info structure or enhanced from a standard info structure.
I have to give the source info structure name to run statistical set up. The closest one which matches with the S763 is S063 but it is missing few characteristics and key figure.
does it means that the IS S063 was enhanced?? Am i right?? If it was enhanced how will i run the statistical setup for the same...
I hope i have explained clearly.
Do provide ur valuable input.
Regards
Saddy -
How to find out the exact BAdI
hi all,
can any one tell me how to find out the exact badi for the given transactionHi,
Execute this report !
It gives you all the badis and user exits present for that particular transaction !
REPORT z_user_exits_n_badis.
TABLES:
tstc,
tadir,
modsapt,
modact,
trdir,
tfdir,
enlfdir,
sxs_attrt ,
tstct.
DATA: jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA: field1(30).
DATA: v_devclass LIKE tadir-devclass.
PARAMETERS:
p_tcode LIKE tstc-tcode,
p_pgmna LIKE tstc-pgmna .
DATA:
wa_tadir TYPE tadir.
u2022 START-OF-SELECTION *
START-OF-SELECTION.
IF NOT p_tcode IS INITIAL.
SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
ELSEIF NOT p_pgmna IS INITIAL.
tstc-pgmna = p_pgmna.
ENDIF.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.
IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name EQ enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
SELECT * FROM tadir INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object IN ('SMOD', 'SXSD')
AND devclass = v_devclass.
SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/(105) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
u2022 Sorting the internal Table
SORT jtab BY object.
DATA : wf_txt(60) TYPE c,
wf_smod TYPE i ,
wf_badi TYPE i ,
wf_object2(30) TYPE c.
CLEAR : wf_smod, wf_badi , wf_object2.
u2022 Get the total SMOD.
LOOP AT jtab INTO wa_tadir.
AT FIRST.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Enhancement/ Business Add-in',
41 sy-vline ,
42 'Description',
105 sy-vline.
WRITE:/(105) sy-uline.
ENDAT.
CLEAR wf_txt.
AT NEW object.
IF wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
ELSEIF wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
ENDIF.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 sy-vline,
2 wf_object2,
105 sy-vline.
ENDAT.
CASE wa_tadir-object.
WHEN 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE modtext INTO wf_txt
FROM modsapt
WHERE sprsl = sy-langu
AND name = wa_tadir-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WHEN 'SXSD'.
u2022 For BADis
wf_badi = wf_badi + 1 .
SELECT SINGLE text INTO wf_txt
FROM sxs_attrt
WHERE sprsl = sy-langu
AND exit_name = wa_tadir-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
ENDCASE.
WRITE:/1 sy-vline,
2 wa_tadir-obj_name HOTSPOT ON,
41 sy-vline ,
42 wf_txt,
105 sy-vline.
AT END OF object.
WRITE : /(105) sy-uline.
ENDAT.
ENDLOOP.
WRITE:/(105) sy-uline.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
DATA : wf_object TYPE tadir-object.
CLEAR wf_object.
GET CURSOR FIELD field1.
CHECK field1(8) EQ 'WA_TADIR'.
READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
MOVE jtab-object TO wf_object.
CASE wf_object.
WHEN 'SMOD'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
WHEN 'SXSD'.
SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE.
Thanks
Sarada -
How to find out the Sales order no based on spool no
Hi Experts,
Anyone tell me how to find out the Sales order no based on Spool no.
Thanks and regards,
AmjadHello Mohammed,
Please check the following SAP Spool tables for your spool request.
You will find your required document number as an Object key in these tables.
TSCMSTAT --> Field OBJNO
SOOS --> Field APPLKEY (Document number will be a part of this key)
If your document is getting printed by SAP Script, then dont forget to take SCR value in the OBJTP field while searching for your record.
Thanks and Best Regards,
Vikas Bittera.
***Points for Usefull answers ***
Maybe you are looking for
-
Background Color doesnt changed !
hi everyone, I try to create an image in JSP, the image shows on browser OK, but the background color always is black even I try to set to another color g.setBackground(Color.pink); There is no error. Could anyone explain to me? How can I change the
-
Hi, since I do not have a good knowledge of oracle, hopefully somebody may help me to understand better how export/import work (oracle 9) A colleague as run an export from a production server, now he needs to run the import on a test server but it fa
-
How to convert String into Clob in Java?
Hi all, from a form i have a String body = request.getParameter("body_name"); i want to insert the string body to a clob field in oracle. string is from a textarea where the user enter html contents and i want to storeit as a clob in the database. ca
-
When we will see Air 3.2 RC or Released?
You have fixed an important bug for us: https://bugbase.adobe.com/index.cfm?event=bug&id=3052338 But our users (40 000 ) have a bad experience because until you publish it they cant use our software properly, do you know when you will release a new v
-
Can I set a track from iTunes as my ringtone?
Can I set a track from iTunes as my ringtone?