Intenal table with out headerline
hi,
i have a doubt,please clarify.
data:itab like <databse table> occurs 0 with header line.
or
data:itab like <databse table>occurs 0,
wa like line type of itab.
in above two cases , in my view no difference.
in first case there will be one workarea will be created with same name itab,
in second case we are explicitly creating work area.
ok.
here my doubt is in what cases it is madatory to create internal table with explicitly work area?
thanks in advance.
venu
hi,
abap object oriented programming in higher versions doesn't allow internal table with header line, so we can create internal table with out header line.
for that one we follow two approches...
1)
TYPES: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA : ITAB TYPE STANDARD TABLE OF LINE,
WA TYPE LINE.
2) In second case create line type(structure) and row type by using SE11.
SE11->select DATA ELEMENT object> here select STRUCTURE object and provide required fields>now select ROW TYPE object here provide LINE TYPE( STRCTURE which is created in previous)-> SAVE and activate.
IN the above case STRCTURE acts as WORK-AREA AND ROW TYPE acts as body.
object oriented programming doesn't support to using LIKE key word.
regards,
Ashok
Similar Messages
-
Business user needs to view tables with out SE16 access
Hi ,
There is a requirement where business user ( Data team) need to view some master and transactional data tables in production . But , as per our process , end users will not be given SE16 access .
Is there any solution where we can allow the end user to view tables with out SE16 access ?
Thanks in advance .
Thanks .
Dharma.Hi,
Using Function Module C160_TRANSACTION_CALL you can call any tcode which dont have access..
Create a report and call function module and pass se16 to parameter .
CALL FUNCTION 'C160_TRANSACTION_CALL' "
EXPORTING
i_tcode = 'SE16' " sy-tcode
EXCEPTIONS
ILLEGAL_INPUT = 1 "
INTERNAL_ERROR = 2 "
. " C160_TRANSACTION_CALL
now create a tcode for this report as ZSE16.,
hope this helps u.,
You can also create Data browser ( SE16 ) in report and display as ALV., using Field Symbols and RTTS.
Thanks & Regards,
Kiran -
Internal table with out header line
Hi friends,
Can u send me code for internal table with out header line : how to declare ,how to populate data and how to access the data
Regards,
vijayHi Vijay
There are several ways to declare an internal table without header line:
A) You can define a type table
TYPES: BEGIN OF TY_ITAB OCCURS 0,
INCLUDE STRUCTURE ZTABLE.
TYPES: END OF TY_ITAB.
and then your intrnal table:
DATA: ITAB TYPE TY_ITAB.
B) DATA: ITAB TYPE/LIKE STANDARD TABLE OF ZTABLE.
C) DATA: ITAB TYPE/LIKE ZTABLE OCCURS 0.
All these ways create a STANDARD TABLE
You can create other types of internal table, for example SORTED TABLE or HASHED TABLE.
These kinds of table can allow to improve the performance because they use different rules to read the data.
When it wants to manage a table without header line, it need a work area, it has to have the same structure of table.
DATA: WA LIKE ZTABLE.
DATA: T_ZTABLE LIKE STANDARD TABLE OF ZTABLE.
A) To insert the record:
If you use INTO TABLE option you don't need workarea
SELECT * FROM ZTABLE INTO TABLE T_ZTABLE
WHERE FIELD1 = 'Z001'
AND FIELD2 = '2006'.
but if you want to append a single record:
SELECT * FROM ZTABLE INTO wa WHERE FIELD1 = 'Z001'
AND FIELD2 = '2006'.
APPEND WA TO T_ZTABLE.
ENDSELECT.
Now you need workarea.
B) To read data: you need always a workarea:
LOOP AT T_ZTABLE INTO WA WHERE ....
WRITE: / WA-FIELD1, WA-FIELD2, WA-FIELD3.
ENDLOOP.
or
READ T_ZTABLE INTO WA WITH KEY FIELD3 = '0000000001'.
IF SY-SUBRC = 0.
WRITE: / WA-FIELD1, WA-FIELD2, WA-FIELD3.
ENDIF.
Anyway if you want to know only if a record exists, you can use the TRANSPORTING NO FIELDS option, in this case it doesn't need a workarea.
READ T_ZTABLE WITH KEY FIELD3 = '0000000001'
TRANSPORTING NO FIELDS.
IF SY-SUBRC = 0.
WRITE 'OK'.
ENDIF.
C) To update the data: it always needs a workarea
LOOP AT T_ZTABLE INTO WA WHERE FIELD3 = '0000000001'.
WA-FIELD3 = '0000000002'.
MODIF T_ZTABLE FROM WA.
ENDLOOP.
or
READ T_ZTABLE INTO WA WITH KEY FIELD3 = '0000000001'.
IF SY-SUBRC = 0.
WA-FIELD3 = '0000000002'.
MODIF T_ZTABLE FROM WA INDEX SY-TABIX
ENDIF.
AT the end you can use the internal table to update database:
MODIFY/UPDATE/INSERT ZTABLE FROM T_ZTABLE.
See Help online for key words DATA, you can find out more details.
Max
Message was edited by: max bianchi -
Deletion of duplicates in the table with out using rowid
How can I delete duplicates in the table with out using ROWID .
hi
sleect count(coulmnname),columnname from table
group by columnname
having count(columnname) > 1;
find the primary key of the table
apply the below query
delete from table
where (primary key,repeated column name )
not in
( select min(primary key), repeated column
from employee group by repeated column );
use this in the primary key column use empid ,,,the repated column is ename
empid ename
1 sankar
2 sankar
try this one -
Last 10 records of a table with out using count
How can i get last 10 records of a table with out using count() method? if there is some page size(eg 10) , and if we want last page. is it posible without ount()? if posible how?
Message was edited by:
user480375"is there any other way without nesting?"
Not correctly, no. What is your problem with nesting? Nested queries are not inherently slower than unnested queries. In some cases, such as this, they are the only correct way to do the query. Even an analytic version of the Top N needs to be nested because:
SQL> SELECT object_name
2 FROM t
3 WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
4 /
WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
ERROR at line 3:
ORA-30483: window functions are not allowed hereTTFN
John -
How to fetch the data to the internal table with out using mandt
Hi all,
Iam giving my code please observer... and give me the reasonable solution.
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT mandt
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
By removing MANDT from select query, it is going to dump.
ex:
SELECT
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
> Now it is going to dump ( here i removed the mandt field ).
Please give me a solution to fetch the data by removing mandt in select statement, with out chaning the internal table structure.
Thanks,
Ravihi Ravi,
i also had to avoid move-corresponding and the following is what i did...its extra work and goes around but it will
do the needed work..............
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT *
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
the above gets you all the fields ...but if you still want to narrow it down to just two fields
*****Declaring structure with 2 fields
data:begin of fs_data.
data:werks type z_mar-werks,
lifnr type z_mar-lifnr ,
data:end of fs_data.
*******internal table of above
data:int_data like fs_data occurs 0 with headerline.
*****moving the only 2 required fields
loop at t_mar.
t_mar-werks = int_data-werks.
t_mar-lifnr = int_data-lifnr.
append int_data.
endloop.
Hope you found it useful...
Regards
Bx -
Selecting records from DB table with out using internal tables
hi,
i need to retrieve values from a database table based on few fields and date as well. however, i need to check whether the date is less or equal to the current date and along with that i should get the appropriate record. how can i do that with out using internal table.
field1-----date---
11111----
20070219
11111--20070214 <---
11111----
20070205
in the above scenario i should get the second record
Regards,
Kranthi.Try:
REPORT ztest MESSAGE-ID 00.
TABLES bkpf.
SELECT * FROM bkpf
UP TO 1 ROWS
WHERE budat <= sy-datum
ORDER BY budat DESCENDING.
ENDSELECT.
Rob -
How to use common object from two tables with out join.
HI,
I have two tables called A & B In A table i have the following objects
1.weekend
2.S1(measure)
3.S2(measure)
4.S3(measure)
5.S4(measure)
And In B table i have followning columns
1.week end
2.p1(measure)
3.p2(measure)
4.p3(measure)
5.p4(measure)
Now in universe i created all the measure objects i.e.s1,s2,s3,s4,p1,p2,p3,p4 A.weekend,B.weekend.
instead of using week end two times i wnt to use only once because this is common in both table.
if i use join between these tables i am getting values fine
But With out join is there any thing to do in universe level to create common objects to use from both the tables..I tried using aggregate awareness but while reporting it is taking as two SQL.which is not synchronized.
Please help me on this ...hi,
Although Weekend column is present in both tables, by creating a single Object in Universe, Universe can identify relationship with only table referenced in Object Creation.
So, there will be no identification of relationship with other table measures.
Obviously, you need to create 2 Weekend objects in Universe (in two classes).
Case 1: You need not join these two tables in Universe. When you create 2 Queries in WEBI, automatcially Weekend objects are synchronized (if both are of same datatype)
Case 2: If you join these two tables in Universe, Obviously,
your SQL may contain Weekend from Table1, measures from Table 2
or
your SQL may contain Weekend from Table2, measures from Table 1
Finally, You need to create 2 objects in Universe. But your query may contain a single Object based on Case 2.
Regards,
Vamsee -
How to change recon.account directly in Table with out changing customizing
Hi Gurus,
I want to change Customer reconciliation account but this is not possible any more due to display option for reconciliation account in customizing.
I know I can change customizing and then change the reconciliation account, but there is a better way doing this.
We can change this directly in the table without changing customizing, but I don't know how to do this. Does any one know how to change directly in the table?
Many thanks in advanceHi there,
The steps that you should take include:
1. go to SE16
2. put knb1
3. on the field selection input the customer you want to edit
4. Execute
5. type to the transaction field /h and press Enter
6. double click to the customer line item you want to change the recon
7. this will navigate you to the debug environment
8. on the debug environment press find/search button -or- CTRL+F to find a keyword code
9. you should see if code = 'SHOW'.
10. now please double click on the word "code" to set the Breakpoint
11. Press F7
12. you will see the program routine will stop at if code = 'SHOW'.
13. Double click on the word 'code'
14. 'code' will appear on the righ hand side with value = 'SHOW'
15. change the value of 'SHOW' to 'EDIT' by double clicking the Edit icon (pencil) and replacing the value of SHOW to EDIT
16. press Enter
17. press F8
18. you can now change the recon field
19. Press SAVE button
20. Double click 2x (or more) on the STOP sign, until your breakpoint is gone
21. press F8 and you should see the message of "Database Record successfully created"
Good luck!
Regards,
Fausto
Edited by: Fausto Jahja on Jul 21, 2009 5:26 PM
Edited by: Fausto Jahja on Jul 21, 2009 5:50 PM -
How to make entriesinto table with out first field not edited
hi everyone,
I'm new to SAP ,the task provided to me is to display the data in the display fields when the particular cell in table is selected
at the same time a button is provided make new entries into the table by clicking a button
but when iclick the new entry button the row which is already selected getting erased temporarily
but when i update the new record and save it it is also shown along with new record
the code i used is here below
method onactioncreate .
DATA:
node_expenseset TYPE REF TO if_wd_context_node,
elem_expenseset TYPE REF TO if_wd_context_element,
stru_expenseset TYPE if_exp_main=>element_expenseset .
* navigate from <CONTEXT> to <EXPENSESET> via lead selection
node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).
* @TODO handle not set lead selection
IF ( node_expenseset IS INITIAL ).
ENDIF.
* get element via lead selection
elem_expenseset = node_expenseset->get_element( ).
* @TODO handle not set lead selection
IF ( elem_expenseset IS INITIAL ).
ENDIF.
clear stru_expenseset.
* get all declared attributes
elem_expenseset->set_static_attributes(
exporting
static_attributes = stru_expenseset ).
* data:
* node_expenseset1 type ref to if_wd_context_node,
* elem_expenseset1 type ref to if_wd_context_element,
* stru_expenseset1 type if_exp_main=>element_expenseset1 .
** navigate from <CONTEXT> to <EXPENSESET1> via lead selection
* node_expenseset1 = wd_context->get_child_node( name = if_exp_main=>wdctx_expenseset1 ).
** get element via lead selection
* elem_expenseset1 = node_expenseset1->get_element( ).
** alternative access via index
** Elem_Expenseset1 = Node_Expenseset1->get_Element( Index = 1 ).
** @TODO handle non existant child
** if ( Elem_Expenseset1 is initial ).
** endif.
*clear stru_expenseset1.
** get all declared attributes
* elem_expenseset1->get_static_attributes(
* importing
* static_attributes = stru_expenseset1 ).
endmethod.
here both table and drill down report are binded to same node
can any one send me the code to clear only drill down report contents
thanks & Regards
MadhuHi madhu,
Try the following code to create new entries in the table on action of the create button
DATA:
node_expenseset TYPE REF TO if_wd_context_node,
elem_expenseset TYPE REF TO if_wd_context_element,
stru_expenseset TYPE if_exp_main=>element_expenseset .
navigate from <CONTEXT> to <EXPENSESET> via lead selection
node_expenseset = wd_context->get_child_node( 'EXPENSESET' ).
@TODO handle not set lead selection
IF ( node_expenseset IS INITIAL ).
ENDIF.
create new element
elem_expenseset = node_expenseset->create_element( ).
*Bind the element to the node
node_expenseset->bind_element(
new_item = elem_expenseset
set_initial_elements = abap_false
*set the created element as lead selected
node_expenseset->set_lead_selection( element = elem_expenseset ).
Edited by: krishna chandra on Nov 29, 2010 1:30 PM -
Want to load excel data into oracle table with out changing it to CSV
Hello all,
I have a requirement in dumping excel data into oracle database table without changing it to CSV file and this has to be used in normal sql/plsql environment i.e., pkg/procedure cant be used in the forms also...
so, can u guys can help me out in this
thanks.............The link Pavan provided discusses Oracle Heterogeneous Services. This allows you (using ODBC) to create a database link from Oracle to a non-Oracle data source like Excel. This would allow you to query the Excel data source from SQL*Plus or any other client tool. But that is probably going to require that your Oracle database is running on Windows since I'm not aware of any Excel ODBC drivers for Unix.
Another potential option would be to write a Java stored procedure that parsed the file. There are a few different Java libraries that can read and write Excel data files. You could load one of those libraries into the database's JVM and then write Java code that parsed the file. You would then be able to call your Java stored procedure from PL/SQL.
Justin -
How to Centre tables with out centreing the text in elements?
Ok so this bug has been boggling my brains for a while. When i create a table and center it, all the text inside the table also center justifies (in the output and preview, but is not visible in HTML editor), no matter what the justification is for the cells, the cells will always justify as the table is justified.
I have Robohelp ver.8
In editor
In outputok that solved the alignment problem. But now, i had a flaoting object in my header with navigation buttons. It is no longer floating.
here is my master page code:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="topic-comment" content="" />
<meta name="generator" content="Adobe RoboHelp 8" />
<title>SHARQ_Master_MO_2_1_2011</title>
<link rel="StyleSheet" href="SHARQ_MO_2_1_2011.css" type="text/css" />
<style type="text/css">/*<![CDATA[*/
div.floating-menu {
position: fixed;
background: #000000;
border: 0;
width: 150px;
z-index: 100;
div.floating-menu a,
div.floating-menu h3 {
display: block;
margin: 0 0.5em;
/*]]>*/</style>
</head>
<body>
<?rh-region_start type="header" style="width: 100%; height: 26px; background-color: #ffffff;" ?>
<div class="floating-menu" style="width: 100%; border-left-width: 1px;
border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px;
float: none; background-color: #ffffff;">
<table style="border: Solid 2px #66ccff; background-attachment: scroll;
background-image: url('Images/header background.png');
background-repeat: Repeat-X; left: 0px; top: 0px; height: 50px;"
cellspacing="0" background="Images/header background.png"
width="99%">
<col width="48" />
<col width="764" />
<col width="521" />
<tr style="height: 42px;">
<td style="vertical-align: top;"><p style="margin-left: 5pt;
margin-top: 5pt; margin-bottom: 0pt;"><img
src="Images\sharq_logo.png" alt="" style="border: none;"
width="40" height="28" border="0" /></p></td>
<td style="vertical-align: top;"><p style="margin-bottom: 0pt;
font-family: Garamond, serif;
color: #00337a; font-weight: bold;
margin-left: 5pt;
margin-top: 1pt; font-size: 20pt;">Mechanical
Engineer Training Manual</p></td>
<td><p style="margin-bottom: 0pt; margin-right: .15in;
margin-top: 5pt; color: #0064ae;" align="right"><input
type="image" name="image" src="Images\home.png" title="Home page"
onclick="window.location.href='Disclaimer.htm'" style="width: 23px;
height: 21px;" /> <input type="image" value="Go Back"
onclick="history.go(-1)"
src="Images\Go Back.png"
name="image" title="Go back to previous page"
style="width: 77px; height: 21px;" /> <script
type="text/javascript">var sForward = canGo(true);
var sBackward = canGo(false);
//Get the path of the root of the project
var sRelPath = _getRelativePath(document.location, gsStartPage);
if(sBackward == true)
document.write('<img src="'+sRelPath+'/images/left_out.png" title="Previous topic" onclick="onPrev()" style="cursor: pointer"/>');
else
document.write('<img src="'+sRelPath+'/images/left_in.png" title="No more topics to display"/>');
if(sForward == true)
document.write('<img src="'+sRelPath+'/images/right_out.png" title="Next topic" onclick="onNext()" style="cursor: pointer"/>');
else
document.write('<img src="'+sRelPath+'/images/right_in.png" title="No more topics to display"/>');</script></p></td>
</tr>
</table>
</div>
<?rh-region_end type="header" ?>
<p style="margin-bottom: 1pt; line-height: Normal; margin-top: 1pt;"> </p>
<?rh-placeholder type="breadcrumbs" ph-align="2" sep-char=" -|- " home="Home"
usetopicformat="0" ph-style="font-family:Calibri;font-size:8pt;font-weight: normal;font-style: normal;text-decoration: none; margin-top: 5pt" ?>
<?rh-region_start type="body" ?>
<p> </p>
<?rh-region_end type="body" ?>
<?rh-region_start type="footer" style="width: 100%; position: relative;" ?>
<table style="left: 0px; top: 232px; height: 36px;" cellspacing="0"
width="100%">
<col style="width: 100%;" />
<tr>
<td style="vertical-align: bottom;"><p style="margin-top: 30px;"><span
style="font-family: Calibri, sans-serif; color: #c0c0c0;">Copyright
<?rh-symbol_start name="Copyright" ?>©<?rh-symbol_end ?> </span></p></td>
</tr>
</table>
<?rh-region_end type="footer" ?>
</body>
</html> -
How to map a table with out a primary key with a pojo?
hello
Is it possible to map a pojo with a table, table don't have primary key. I m using hibernate,How to do that in hibernate.
Thanks &Regards
snimiHello,
EclipseLink has support for database object-relational datatypes, but they are not supported or exposed through JPA. Instead, you will need to leave it unmapped and then change the mapping, using a customizer to create the mapping described:
http://wiki.eclipse.org/Introduction_to_Object-Relational_Data_Type_Mappings_(ELUG)#Object-Relational_Data_Type_Array_Mapping
Best Regards,
Chris -
How to use Read table with out key fields
Hi Experts,
I need to retrieve the 2 internal tables data into single table.
I have 3 common fields between the 2 tables but I don't have the Key fields. Then how to use the read table in this.
Thanks in Advance.
Edited by: satish4abap on Mar 10, 2010 9:39 AMHi Satish,
Key fields are nothing but the common fields with which you can pick the data from the second internal table.
If you can paste your Internal table fields then we will be able to assit you better.
However, in genral scenarios you can use it as below :
In this scenario, we are putting data from 3 internal table to another single internal table.
LOOP AT T_PRGEN INTO WA_PRGEN.
WA_FINAL-GUID_PR = WA_PRGEN-GUID_PR.
WA_FINAL-ATTR20A = WA_PRGEN-ATTR20A.
WA_FINAL-ATTR05A = WA_PRGEN-ATTR05A.
WA_FINAL-ATTR05B = WA_PRGEN-ATTR05B.
WA_FINAL-ATTR05C = WA_PRGEN-ATTR05C. " + DG1K902190
WA_FINAL-ATTR10A = WA_PRGEN-ATTR10A.
READ TABLE T_V_TCAV201 INTO WA_V_TCAV201 WITH KEY ATTRV20 = WA_PRGEN-ATTR20A BINARY SEARCH.
IF SY-SUBRC = 0.
WA_FINAL-TEXT1 = WA_V_TCAV201-TEXT1. "SUBID-TEXT1
ENDIF.
READ TABLE T_PNTPR INTO WA_PNTPR WITH KEY GUID_PR = WA_PRGEN-GUID_PR BINARY SEARCH.
IF SY-SUBRC = 0.
WA_FINAL-PRVSY = WA_PNTPR-PRVSY. "PROD NO
WA_FINAL-GRVSY = WA_PNTPR-GRVSY. "LOGICAL SYS GROUP
ENDIF.
append wa_final to t_final.
endloop. -
How to fill set up tables with out missing the delta records
Hi,
I would like fill set up tables in the productioon system of apllication of logistics.
Can you please guide me how do we perform.?
What are points to be considered?
Because,when i start the filling set up table by 10.AM if there are any posting at 10:05,10:06....like that
how can collect them i.e will i miss any records in second delta run?What setps to be taken care?
Thanks in advance
Naresh.Hi.
You can fill the set-up tables during normal operation hours ,if you load the data into ODS and the update queue is 'Queued delta' .Downtime is needed to avoid the duplicates .But if you use 'Direct delta' you miss the delta documents. Hence it is better to go for downtime approach for this case.
Initially your delta records will be stored in the extraction queue and then when you run the collective job, records will be moved into delta queue. You can run the collective job (LBWE) anytime after the init run.If you need a daily delta ,then schedule this job before the delta loading. You can schedule this job either hrly or daily .This will move your records into delta queue. At the time of delta loading ,all your delta queue records will be moved into BW .
Thanks.
Maybe you are looking for
-
Time Capsule: IPv6 works, but IPv4 does not
I have a Time Capsule (running 7.7.3) and a Mac Pro (2010, running 10.10.1) connected via ethernet. My ISP (Webpass) has IPv6 support. The Mac Pro can communicate over IPv6 (e.g. ping6 google.com works; I can load google.com over IPv6 using Safari).
-
Can we define a complex type that is equivalent to java.util.List?
hi everyone is it possible to define a complexType that is equivalent to java.util.List? all i know now is how to define an array of some type using either <xs:list> for simpleType or the minOccurs and maxOccurs of the element tag. i was wondering if
-
Product category mandatory in the shopping cart ?
Hi everybody, We are studying shopping carts functionalities in SRM in activating ECS. We are not using articles, but only product categories. We would like to know if the product category is necessary mandatory in the shopping cart? Indeed, if the s
-
Slow Motion w/60fps DVCPro50
Hello, I've just gotten an HVX200 which allows me to shoot 60fps in DVCPro50 at 30pn and I was expecting more from my slow-motion shots. I shot some hummingbirds (as an experiment). . .while I didn't expect to see wings clearly when I slowed it down,
-
I've updated the title, author and image of my podcast and refreshed it in iTunes. However when I search for it in the iTunes store (emma's media) the old metadata still shows up. I updated the the title last week so I'd have expected to see a change