Urgent : How to modify the line type and table type
I am working on ALV Grid Control, i need to know how to modify the line type values to table type.
ls_celltab-fieldname = 'ZSAVINGS '.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
Here ls_celltab is line type and pt_celltab is table type.
Please give me the suggestion ASAP.
C.Bharath Kumar
Hi,
Here is the example
DATA: BEGIN OF LINE,
LAND(3) TYPE C,
NAME(10) TYPE C,
AGE TYPE I,
WEIGHT TYPE P DECIMALS 2,
END OF LINE.
DATA ITAB LIKE SORTED TABLE OF LINE
WITH NON-UNIQUE KEY LAND NAME AGE WEIGHT.
LINE-LAND = 'G'. LINE-NAME = 'Hans'.
LINE-AGE = 20. LINE-WEIGHT = '80.00'.
INSERT LINE INTO TABLE ITAB.
LINE-LAND = 'USA'. LINE-NAME = 'Nancy'.
LINE-AGE = 35. LINE-WEIGHT = '45.00'.
INSERT LINE INTO TABLE ITAB.
Regards
Sudheer
Similar Messages
-
Difference between line type and table type
hi,
can any one explain the difference between line type and table type . and how to declare a internal table and work area in BSP'shi,
Go through this blog, this might help you.
/people/tomas.altman/blog/2004/12/13/sdn-blog-how-to-do-internal-tables-in-bsp
People who have worked with ABAP for a while sometimes forget that the internal table concept is rather different than what exists in most programming languages. It is very powerful, but at the same time can be confusing.
In SAP it is possible to have a table which is the rows and a headerline which is the working area or structure which can then be commited to the table.
With a BSP, if we try to create an internal table within the BSP event or layout we will get the following error: mso-bidi-
"InternalTableX" is not an internal table - the "OCCURS n" specification is mso-bidi- missing.
class="MsoNormal"><![if !supportEmptyParas]>The problem we are seeing as an inconsistency has to do with the difference between classic ABAP and ABAP Objects. When SAP introduced ABAP Objects they decided to clean up some of the legacy syntax and create stricter rules. However they didn't want to break the millions of line of code that already existed, so they only implemented these stricter checks when OO is being used. Therefore you can declare a table with a header line in a regular ABAP program or Function Module but you can't have one with a header line in OO.
Because everything in BSP generates ABAP OO classes behind the scenes, you get these same stricter syntax checks. My suggestion is that you have a look in the on-line help at the section on ABAP Objects and always follow the newer syntax rules even when writing classic ABAP programs.
In a BSP when we need to work with a table we must always do the following:
1, in the Types definitions create a structure:
types : begin of ts_reclist,
mso-bidi- style='mso-tab-count:2'> receiver type somlreci1-receiver,
mso-bidi- style='mso-tab-count:2'> style='mso-tab-count: 1'> rec_type type somlreci1-rec_type,
mso-bidi- style='mso-tab-count:2'> end of ts_reclist.
mso-bidi- <![if !supportEmptyParas]> <![endif]>
but we must remember this is only a structure definition and we cannot store anything in it, although we can use it elsewhere as a definition for Structures(WorkAreas)
2, in our Types definitions (this is the best place for this one as we can then access it from many areas without having to create it locally) so in the Types definitions we must create a TableType:
class="MsoNormal"> types : tt_reclist type table of ts_reclist.
class="MsoNormal"><![if !supportEmptyParas]> <![endif]> this TableType is our table definition and again we cannot store anything in it, but we can use it elsewhere as a definition for InternalTables
3, now that you have laid the foundations you can build and in the event handler, it is now simply a case of creating the InternalTable based upon the Table definition:
data: t_reclist type tt_reclist.
and creating the structure based upon the structure definiton:
<![if !supportEmptyParas]> <![endif]> data: s_reclist type ts_reclist.
as described above, the structure becomes the work area and this is where you assign new values for elements of the table eg:<![endif]>
s_reclist-receiver = '[email protected]'. "<-- change address
mso-bidi- <![if !supportEmptyParas]> <![endif]>
mso-bidi- s_reclist-rec_type = 'U'.
and then once the data is in the elements of the structure, the structure can be appended to the internal table as follows: class="MsoNormal">
append s_reclist to t_reclist.
<![if !supportEmptyParas]> <![endif]>
the internal table will then be readable for the ABAP function and can be applied for example as follows: class="style1"> style='mso-tab-count:1; font-family: "Courier New", Courier, mono;'>
class="style1">CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
style='mso-tab-count:2'> document_data = docdata
style='mso-tab-count:2'> DOCUMENT_TYPE = 'RAW'
style='mso-tab-count:2'> PUT_IN_OUTBOX = 'X'
style='mso-tab-count:2'> COMMIT_WORK = 'X' "used from rel.6.10
TABLES
mso-bidi-font-size: style='mso-tab-count:2'> receivers = t_reclist
class="style1"> <![if !supportEmptyParas]> <![endif]>
<![if !supportEmptyParas]>F inally, a comment from Thomas Jung,
<![if !supportEmptyParas]> when defining my work area for an internal table I like to use the like line of statement. That way if I change the structure of my table type, I know that my work area will still be OK. Second, your types and table types don't have to just be declared in your code. You can create a table type in the data dictionary and use it across multiple programs(also great for method and function parameters). I really push hard for the other developers at my company to use the Data Dictionary Types more and more.
Hope this helps, Do reward. -
How does a record type and table type works
Hi,
How a record type and table type work for the ref cursor,
below i m giving an example but its giving me errors
can any one help me for this?
declare
type empcurtyp is ref cursor;
type rectype is record (veid t.emp_id%type, vename t.ename%type);
TYPE tabtype IS TABLE OF rectype;
empcv empcurtyp;
vtab tabtype;
begin
open empcv for select emp_id,ename from t;
loop
fetch empcv into vtab;
exit when empcv%notfound;
dbms_output.put_line(vtab.vename||vtab.veid);
end loop;
close empcv;
end;
here we hav table t and i m taking only two fields of the table t which r emp_id and ename.Hi,
What errors are you getting with this? From experience you don't need a loop to put the records into the ref cursor its usually done on block.
HTHS
L :-) -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
How could I retrieve metadata about Array Type and Table Type?
I use DatabaseMetaData.getUDTs() method for obtain metadata about Object Types, but this method doesn't work with Array Type and Table Type.
JJ,
Go into the diagrams of the DBTools List Columns and DBTools Get Properties respectively. When you inspect this diagram, you will see the raw ActiveX properties and methods called to get the size information. The value of -1 means the requested recordset is already closed. This is the sort of thing that is controled by the driver (ODBC, OLE DB, Jet, etc) you are using. Notice that you can right click on the property and invoke nodes and get more information about these specific items directly from the ADO online help.
Crystal -
Calling Oracle Stored proc with record type and table Type
I have a oracle SP which takes record type and table Type which are used for order management.
Is there anay way to populate parameters with these datatypes and call the stored procedure using ODP.NET?
Please help.
Thanks in advanceHi,
ODP supports associative arrays and REF Cursors. There is no support for PLSQL table of records.
Jenny -
How to modify the window name and field name in EBS -Subinventories
Hi All,
I would like to ask how to modify the standard form window name "Subinventories" to "INV Subinventories" in EBS.
Thanks in advance.
Regards,
DianeHi 873422 ,
Thank you for immediate response. I tried to do the instruction and only the menu has been changed. I would like to change the window screen.
Navigation: Inventory responsibility
1. Setup->Organization->Subinventories.
Then the window pop-up. I would like to change the window name "Subinventories Summary".
Thanks.
Regards,
Diane
Edited by: peopsquik08 on 18-Jun-2012 01:18 -
How to modify the window name and field name in standard oracle forms
Hi All,
I am new to the forms. I would like to ask how to modify the standard form window name "Subinventories" to "INV Subinventories" in EBS.
Please help.
Thank you.
Regards,
Dianehi
plz move your thread to EBS forum.
sarah -
How to get the column name and table name with value
Hi All
I have one difficult requirement
I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
Thanks & Regards
Srikkanth.MSearching all the database for a word...
Courtesy of michaels...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
11g upwards
SQL> select table_name,
column_name,
:search_string search_string,
result
from (select column_name,
table_name,
'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
from cols
where table_name in ('EMP', 'DEPT')),
xmltable (str columns result varchar2(10) path '.')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME es RESEARCH
EMP ENAME es JAMES
EMP JOB es SALESMAN
EMP JOB es SALESMAN
4 rows selected. -
How to modify the port number and use subdomains
Couple of things ...
1 - default port for installation is on 7777 and 7778. Would it be possible to run everything on port 80? I would like to hide the port number and not have people type in http://domain.com:7778
2 - how can we use subdomains for certain services? For example, webmail should be http://webmail.domain.com and the RTC should be http://conference.biztech.com
thxwe're using OCS both inside and outside our network.
I had my dba modify the port so now everything runs on port 80. However, I dont know how to get virtualhost to work correctly.
conference.domain.com -> RTC piece
webmail.domain.com -> webmail piece
i.e.... -
Purpose of Row type, line type and Table Type..
Hi All,
Just Im started working with OOABAP. Whenever I open some structures, most of the components in the structures have the below three words. What is the exact difference b/w the below words. What is purpose those?
Row type, line type
Table type:
Please let me know.hi,
Line Type
The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
Table type
The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are known generically as index tables.
Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
At tables with structured row type, the standard key is formed from all character-type columns of the internal table. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty. At tables with non-structured row type, the standard key consists of the entire row. If the row type is also a table, an empty key is defined.
The user-defined key can contain any columns of the internal table that are no internal table themselves, and do not contain internal tables. References are allowed as table keys. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
Internal tables are always completely specified regarding row type, key and access type
Hope this helps. -
How to get the column name and table name from xml file
I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?
Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
begin
dbms_xmlschema.registerSchema(
schemaURL => 'my_schema.xsd'
, schemaDoc => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
, local => true
, genTypes => false
, genTables => true
, enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
, options => dbms_xmlschema.REGISTER_BINARYXML
end;
genTables => true : means that a default schema-based XMLType table will be created during registration.
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
SQL> select table_name
2 from user_xml_tables
3 where xmlschema = 'my_schema.xsd'
4 and element_name = 'employee';
TABLE_NAME
employee1121_TAB
(warning : the name is case-sensitive)
To annotate the schema and control the naming, modify the content to :
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
<xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
<xs:complexType>
Next step : create a resource, or just directly insert an XML document into the table.
Example of creating a resource :
declare
res boolean;
doc xmltype := xmltype(
'<employee>
<details>
<emp_id>1</emp_id>
<emp_name>SMITH</emp_name>
<emp_age>40</emp_age>
<emp_dept>10</emp_dept>
</details>
</employee>'
begin
res := dbms_xdb.CreateResource(
abspath => '/public/test.xml'
, data => doc
, schemaurl => 'my_schema.xsd'
, elem => 'employee'
end;
The resource has to be schema-based so that the default storage mechanism is triggered.
It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
SQL> declare
2
3 res boolean;
4 doc xmltype := xmltype(
5 '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:noNamespaceSchemaLocation="my_schema.xsd">
7 <details>
8 <emp_id>1</emp_id>
9 <emp_name>SMITH</emp_name>
10 <emp_age>40</emp_age>
11 <emp_dept>10</emp_dept>
12 </details>
13 </employee>'
14 );
15
16 begin
17 res := dbms_xdb.CreateResource(
18 abspath => '/public/test.xml'
19 , data => doc
20 );
21 end;
22 /
PL/SQL procedure successfully completed
SQL> set long 5000
SQL> select * from "employee1121_TAB";
SYS_NC_ROWINFO$
<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
<details>
<emp_id>1</emp_id>
<emp_name>SMITH</emp_name>
<emp_age>40</emp_age>
<emp_dept>10</emp_dept>
</details>
</employee>
Then use XMLTABLE to shred the XML into relational format :
SQL> select x.*
2 from "employee1121_TAB" t
3 , xmltable('/employee/details'
4 passing t.object_value
5 columns emp_id integer path 'emp_id'
6 , emp_name varchar2(30) path 'emp_name'
7 ) x
8 ;
EMP_ID EMP_NAME
1 SMITH -
How to remove the lines above and below header in sqlplus report
I run a sql*plus report whch i want to be outputted to XLS file. But the format is not matching. I am using data->texttocolumns feature of excel , which is manual .
As the headers are coming dynamically from query . i CAN NOT set header off.
So first of all ,
I want to get rid of the first blank line above the hearder.
i want to get rid of the dotted line below header .Hi,
You are not being clear here,
As the headers are coming dynamically from query . i CAN NOT set header off. You are saying that you have SQL*Plus script but can't use the SET command?
Besides, that I thing you want SET PAGES 0, instead of SET HEADER OFF.
If you could paste your SQL*Plus script here (Perhaps replacing the actual query with a very simple one, then perhaps we can help.
Regards
Peter -
How to fix the column length and table length?
Hi Experts/Gurus,
I want to fix the column lenght so that if data exceeds it should be in the same colum. But the size of the table should not get changed.. I used the width property of both table and column. But its not working..
Regards,
YugeshHi Yugesh,
For column wrapping you can use the SET_WRAPPING of cl_salv_wd_header and the data.....you have got cell editor for that column right...then using the cell edtior reference you can get the specific cell tyep(like cl_salv_wd_text_view type check this)
this is object reference and you can use the set_wrapping of this class. using this you can get the wrapping functionality for the data also....
DATA: lr_column TYPE REF TO cl_salv_wd_column,
lr_column_header type ref to cl_salv_wd_header,
lr_editor type ref to cl_salv_wd_uie,
lr_textview type ref to cl_salv_wd_uie_text_view.
wd_this->alv_value->if_salv_wd_table_settings~set_fixed_table_layout( ABAP_TRUE ).
lr_column = wd_this->alv_value->if_salv_wd_column_settings~get_column( 'EDITION' ).
lr_column->set_width( '55' ).
lr_column_header = lr_column->get_header( ).
lr_column_header->set_wrapping( abap_true).
lr_editor = lr_column->get_cell_editor( ).
lr_textview ?= lr_editor.
lr_textview->set_wrapping( abap_true ).
Now for the column and it's data the wrapping is set...
Regards,
Lekha.
Edited by: Lekha on Nov 16, 2009 2:12 PM -
How to manage the space between a table and its title?
Have tables where titles are very close to the main text and need a couple of points to separate these elements. How to reshape this space?
1. Titles were separated by a return that is not visible... (any code is revealed by ID)
2. When a Return is inserted after the title, nothing happens aparently, but this return is now visible and could be used as a «paragraph space after» value:
3. A solution could be Grep to catch the end of paragraph assigned to titles to insert a return;
but Grep only catches the right border of the table (the yellow mark shows the big blinking cursor);
Grep cannot see the end of paragraph in the tables's title.
It another method?
Basically, how to modify the space between a table and ists titleI think you and Bob are not in synch here.
Bob suggested that you could use paragraph spacing, but for that to work you do need to use separate paragraphs for the title and table, which you don't seem to be doing. Using GREP to find the end of the paragraph only works if there IS and end to the paragraph. As far as I know there is now meta-character to use in Find/Change that would allow you to find a table and insert a paragraph break ahead of it, but I bet it could be scripted.
I'm not quite sure what you were trying to find in the GREP you posted. Did you actually have a paragraph return inserted already after the title? In that case you only need to redefine the style for that paragraph to add the space (or redefine the style for the paragraph that holds the table itself). You don't need the GREP. But the reason it does nothing is that you've found a location -- the end of the paragraph, but haven't found any actual text to modify. To do anything you would need to use something like .$
But back to NOT having a separate paragraph... If you put the cursor in any table cell and go to Table Options > Table Setup tab you'll see fields to set space before and after the table that should do what you want. That was the second part of what he posted.
Maybe you are looking for
-
I've re installed itunes but my ipod isn't recognised Please help!!!
Ive installed itunes 10.5 and my ipod isn't being recognised I've done the recovary thing but it doesn't work please help me i need new music
-
IPod Touch 4G Battery Life Is Awful on v4.3.2
Hi there, I own a iPod Touch 4G on v4.3.2 & the battery life on it is awful & decreases way too fast. Please do something about it please, Apple. Maybe release a new update to under-clock the device..? I don't know, something to increase the battery
-
Use of Table Valued Parameter to restore databases
I'm a noob with table valued parameters. Not sure if I can use TVP for what I need to do. I want to restore/refresh multiple databases from arbitrary number of .BAK files. I can successfully populate a TVP with the needed source information which
-
I want to use iChat video and file sharing with Windows users
Nowadays, iChat is compatible with AOL/AIM, Google Talk, Jabber, Mac.com and MobileMe instant messaging services. I know that Yahoo Messenger support will be available soon in Mac OS X Lion. I tried using AOL/AIM and Google Talk natively in iChat in
-
TS3274 Pictures don't display on video apps
I am trying to watch video on Sky go and bbc iplayer, but with both apps the sound plays, but the video screen is blank. Any ideas how to rectify?