Defining attribute for internal table within class builder?
Hello there,
I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into the attribute lt_result, that is declared as private and typed with
lt_result TYPE zml_output.
Even the definition of that attribute causes the following error message:
"lt_result" is not an internal table.
I don't have any clue how to type lt_result differently. Actually I would need the following type of typing "TYPE TABLE OF" but that does not exist within the class builder.
Thanks for your help in advanced!
Robert
Hi Konstantinidis ...
Of course I can provide it to you. The code of my methode load_data reads as follows:
method LOAD_DATA.
CALL FUNCTION 'ZDATAGET'
EXPORTING
iv_dat = iv_dat
iv_time1 = iv_time1
iv_delta = iv_delta
TABLES
et_result = lt_result.
endmethod.
Especially the lt_result causes the mentioned error message
The compiler seems to expect something "TABLE" like for attribute lt_result. But whatever I tried it doesn't seem to work out.
Many thanks for help...
Similar Messages
-
Why using workarea for internal table is better in performance
Please tell me
why using workarea for internal table is better in performanceHi Vineet ,
Why would we choose to use an internal table without a header line when it is easier to code one with a header line?
it has following reason.
1)Separate Internal Table Work Area:
The work area (staging area) defined for the internal table is not limited to use with just one internal table.
take ex-
Suppose you want two internal tables for EMPLOYEE one to contain all records and one to contain only those records where country = USA. You could create both of these internal tables without header lines and use only one work area to load data into both of them. You would append all records from the work area into the first internal table. You would conditionally append the USA records from the same work area into the second internal table.
2) Performance Issues: Using an internal table without a header line is more efficient than one with a header line
3) Nested Internal Tables: If you want to include an internal table within a structure or another internal table, you must use one without a header line.
If this one is helpful ,then rewards me
Regards
Shambhu -
How to define selectedRowKeys for a table?
Hi,
I have a table defined in jsff page and it is not defined using searchResultsIterator. Instead it is defined using CollectionModel.
How can I define the selectedRowKeys attribute for this table?
Table code:
<af:table value="#{pageFlowScope.PipeProvidesListBean.pipeProvidesCollectionModel}"
var="row" emptyText="#{inventoryUIBundle.TABLE_EMPTY_TEXT_NO_ROWS_YET}"
selectionListener="#{pageFlowScope.PipeProvidesListBean.providesPipeSelectionListener}"
rowBandingInterval="0" id="t1"
rowSelection="#{pageFlowScope.PipeProvidesListBean.rowSelection}"
binding="#{pageFlowScope.PipeProvidesListBean.resultsTable}">
<af:column sortProperty="id" sortable="false" headerText="#{inventoryUIBundle.ID}" id="c5">
<af:commandLink action="summary" id="cl1" actionListener="#{bindings.openSubTaskForSummary.execute}">
<af:setActionListener from="#{row.oid}" to="#{objectId}"/>
<af:outputText value="#{row.id}" id="ot1"/>
</af:commandLink>
</af:column>
<af:column headerText="#{inventoryUIBundle.NAME}" id="c1">
<af:outputText value="#{row.name}" id="ot5"/>
</af:column>
</af:table>
Thanks
RaviYou can limit the number of rows using a trigger. Below is quick and dirty example that has not been fully tested.
test@ORCL> create table rowlimit (col1 number);
Table created.
Elapsed: 00:00:00.34
test@ORCL> create or replace trigger limit_rows
2 before insert
3 on rowlimit
4 declare
5 v_count number;
6 begin
7 select count(*)
8 into v_count
9 from rowlimit;
10
11 if v_count >= 4 then
12 raise_application_error(-20000, 'Table can have no more then 4 rows');
13 end if;
14 end;
15 /
Trigger created.
Elapsed: 00:00:00.09
test@ORCL> insert into rowlimit values(1);
1 row created.
Elapsed: 00:00:00.03
test@ORCL> insert into rowlimit values(2);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(3);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(4);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(5);
insert into rowlimit values(5)
ERROR at line 1:
ORA-20000: Table can have no more then 4 rows
ORA-06512: at "TEST.LIMIT_ROWS", line 9
ORA-04088: error during execution of trigger 'TEST.LIMIT_ROWS'
Elapsed: 00:00:00.04
test@ORCL> commit;
Commit complete.
Elapsed: 00:00:00.00
test@ORCL> select count(*) from rowlimit;
COUNT(*)
4
Elapsed: 00:00:00.00
test@ORCL> -
How to create a attribute for a table
I am created a table with four columns.
How to create a attribute for each column.........Hi Cranjith Kumar,
First Create a node for ur table.In that give your table name in the dictionary structure then select option add attributes from the structure that will display the fields there u can select the fields then automatically attributes for ur table will be created in the context.
Reward points if useful.
Edited by: srilalitha yerramsetti on Jun 18, 2008 3:23 PM -
Thru code how to create a context node n context attribute for a table
Hi Friends....i need some clarification...according to my requirement i need 2 create contx node n ctx attribute for a table..i.e through the code(implemention NWDS) means this has 2 b done in dynamically...
More clearly according to the structure of a table in MySql DB the same table structure has 2 b designe in my view ..suppose my table(MySql) have 20 col's(name,dept,desig..) n 300 recoreds ..i hav to show that structure in view.
waiting for reply..frndzzzzzzzzHi Rajeshkelam,
Take a Value Node say "Employee".
Create 20 Value attributes (name, dept, desig..) under the Value Node(Employee).
Then Create a Dynamic Table using the "Employee" Value Node.
check this threads.
Dynamic table creation
Dynamic Table
Regards,
Mithu -
System Variable For Internal table count
Can anybody tell me what the system variable for internal table count?
I just wants to know how many recoreds are there in my internal table ?
Regards,
pandu.Hi ,
DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].
If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: T for standard table, S for sorted table, and H for hashed table.
using variable
SY-TFILL
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM -
Aggregate functions for internal table.
Hi Gurus,
I'm just wondering whether we can use aggregate functions for internal table. I wanted to know the max value for a particular column in my internal table. How can I achieve this easily and quickly.
Thanks,
David.sort the table on which you want the maximum value and read it. Please find below example code.
TYPES : BEGIN OF ty_mvke,
matnr TYPE mvke-matnr,
vkorg TYPE mvke-vkorg,
vtweg TYPE mvke-vtweg,
AUMNG type mvke-AUMNG,
END OF ty_mvke.
DATA : wa_mvke TYPE ty_mvke,
it_mvke TYPE STANDARD TABLE OF ty_mvke.
data : temp_AUMNG type AUMNG.
START-OF-SELECTION.
SELECT matnr vkorg vtweg AUMNG FROM mvke INTO
table it_mvke.
sort it_mvke by AUMNG.
read TABLE it_mvke into wa_mvke INDEX 1.
if sy-subrc = 0.
move wa_mvke-AUMNG to temp_AUMNG.
write : temp_AUMNG.
endif.
Thanks,
Sreekala. -
I'm developing a BSP application that uses a application class. I created a table type in the data dictionary and used that as the type for an attribute of the class. In one of the methods of the class I use SELECT statement to fill the attribute but I get an error saying the attribute is not an internal table. Am I missing a step?
Thanks for any help,
RossHello All,
Well I am able to use this method very easily...indeed.....
But I have a slightly different requirement....I have created a table-type in the data-dictionary....but what if I want to use the same method for many different tables....
Actually i was trying to develop a method to read values from active table of a DSO...by just passing the DSO name and Returning the internal table....
But if the table structure is different, then how can we (or can we ?) change the table type dynamically ???
Hope I'm clear... -
Internal Types in Class Builder
Hi Guys,
In am trying to add an internal type to a standard class in <b>Class Builder</b>. I have created a type with Ctrl + F5, But am not sure what to do next. Could any one plz explain me what are all the steps involved?
Thanks in Advance.
Regards,
Rajesh.Hello Rahesh,
I assume you try to add a new type definition. The possibilties there depend on the release of your system.
In release 4.x - 6.20 you can only define types in the protected and private section. Any definition can be used within any method coding. The use of these types within member or method declaration is of course limitied to private or protected ones. You can refer to the types by their name (like to types defined in forms).
With release 6.40 or higher you can also define types in interfaces and the public section of classes. So they are part of the API of the class and can be also used outside. This can be done by following syntax:
data: test_Data type cl_My_Class=>ty_Char_40.
So in effect you may use an interface definition as a new kind of type-pool.
Best Regards
Klaus -
Field catalog for internal table in ALV
In my program the internal table consists many fields from various tables and structure doesn't belong to a single data table.
In order to get output in ALV grid following FM has been used
REUSE_ALV_GRID_DISPLAY
for field catalog the fields are defined specifically.
l_fieldcat-fieldname = 'VBELN'.
l_fieldcat-outputlen = 10.
l_fieldcat-seltext_l = 'Billing doc'.
l_fieldcat-no_zero = 'X'.
l_fieldcat-hotspot = 'X'.
append l_fieldcat to p_fieldtab.
..............and so on for all the fields.
Just wanted to know is there any other method to display all the fields of this internal table automatically so each field is not specified specifically.
anyaHi
Try this instead:
*& Form create_fieldcatalog
* Create a field catalogue from any internal table
* -->PT_TABLE Internal table
* -->PT_FIELDCAT Field Catalogue
FORM create_fieldcatalog
USING pt_table TYPE ANY TABLE
CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA:
lr_tabdescr TYPE REF TO cl_abap_structdescr
, lr_data TYPE REF TO data
, lt_dfies TYPE ddfields
, ls_dfies TYPE dfies
, ls_fieldcat TYPE lvc_s_fcat
CLEAR pt_fieldcat.
CREATE DATA lr_data LIKE LINE OF pt_table.
lr_tabdescr ?= cl_abap_structdescr=>describe_by_data_ref( lr_data ).
lt_dfies = cl_salv_data_descr=>read_structdescr( lr_tabdescr ).
LOOP AT lt_dfies
INTO ls_dfies.
CLEAR ls_fieldcat.
MOVE-CORRESPONDING ls_dfies TO ls_fieldcat.
APPEND ls_fieldcat TO pt_fieldcat.
ENDLOOP.
ENDFORM. "create_fieldcatalog -
XML transformation for internal table
Hi Experts,
Here is the sample transformation code which is generated for a transformation I had created.
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
<tt:root name="ROOT" type="?"/>
<tt:root name="ZPAYLOAD" type="ddic:ZPAYDATA"/>
<tt:template>
<payload-data>
<record>
<rec-data>
<tt:loop ref=".ZPAYLOAD">
<DATA tt:value-ref = 'DATA'/>
</tt:loop>
</rec-data>
</record>
</payload-data>
</tt:template>
</tt:transform>
Here I am passing an internal table with only one field which has three lines say 'Line1', 'Line2',' Line3' to the multi-line structure 'DATA' in the transformation.
when I receive the XML structure from transformation, It looks as like below.
<payload-data>
<record>
<rec-data>
<DATA>Line1</DATA>
<DATA>Line2</DATA>
<DATA>Line3</DATA>
</payload-data>
</record>
</rec-data>
However I want the XML structure like
<payload-data>
<record>
<rec-data>
<DATA>
Line1
Line2
Line3
</DATA>
</payload-data>
</record>
</rec-data>
Is it possible to receive the XML structure like above in the XML transformation?
It would be great, if you can provide the solution at the earliest.
Thanks in Advance.
Regards
K ArasuHi kaushik,
have you found a solution to this problem? I have the same requirement.
Best regards
Gregor -
Sy-tabix for internal table in smartform
Hi friends,
How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
For every record the value of sy-tabix is showing 1 !!
Advance Thanks
AadarshHi Aadarsh,
Give ur sy-tabix at the end of the loop.
loop at itab.
//table node populations.
endloop.
give a seperate loop for this.
loop at itab.
sy-tabix.
endloop
get the total no and print it after the table.
If u r using do loop then give sy-index.
Hope tihs helps u,
Regards,
Nagarajan.
Message was edited by: Nagarajan Kumarappan -
Query statement for internal table
is it possible to use a select statement to select data from an internal table? if yes, can anyone show me the codes to it? thx
Hi Daphne,
You use SELECT statement to read data from database table but not from Internal table.
For reading data from Internal table, you have to use READ statement.
Syntax:
READ TABLE itab { table_key
| free_key
| index } result.
Effect of using read statement:
This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read.
If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
Reward if usefull
thanks
swaroop -
Using aggregation in ABAP code for internal table
I have written following code to get cumulative amount on a date but i have to hit database for each record.
Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
code is:
SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
INTO LV_BALMONTH WHERE DEBITOR = LV_DEBITOR AND
CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON.
I want to put ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
regards,
rakeshHi Rajesh,
types : begin of ty_tab,
date type dats,
DEB_CRE_LC type ..... " delare type & is the filed need to summerized
end of ty_tab,
data: itab type standard table of ty_tab.
SELECT date
SUM( DEB_CRE_LC ) as DEB_CRE_LC FROM /BIC/AZFIAR_O500
INTO corresponding fields of itab
where CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON
group by date. " date is the field available in your ODS/transparent table
simulate the above code in your program...
Hope this will work.. -
How to parse XML for internal table
hi guys, I would like to know how to parse xml for an internal table. I explain myself.
Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the item level. When I received back the pdf completed by mail, I need to parse the xml and get the po qty that has been entered.
This is how I do to get header data from my form
lr_ixml_node = lr_ixml_document->find_from_name( name = ''EBELN ).
lv_ebeln = lr_ixml_node->get_value( ).
How do we do to get the table body??
Should I used the same method (find_from_name) and passing the depth parameter inside a do/enddo?
thanks
Alexandre GiguereAlexandre,
Here is an example. Suppose your internal table is called 'ITEMS'.
lr_node = lr_document->find_from_name('ITEMS').
lv_num_of_children = lr_node->num_children( ).
lr_nodechild = lr_node->get_first_child( ).
do lv_num_of_children times.
lv_num_of_attributes = lr_nodechild->num_children( ).
lr_childchild = lr_nodechild->get_first_child( ).
do lv_num_of_attributes times.
lv_value = lr_childchild->get_value( ).
case sy-index.
when 1.
wa_item-field1 = lv_value
when 2.
wa_item-field2 = lv_value.
endcase.
lr_childchild = lr_childchild->get_next( ).
enddo.
append wa_item to lt_item.
lr_nodechild = lr_nodechild->get_next( ).
enddo.
Maybe you are looking for
-
I am running out of memory on my hard drive and need to delete files. How can I see all the files/applications on my hard drive so I can see what is taking up a lot of room? Thanks! David
-
CR XI R2- Failed to open the connection
I just installed Crystal Reports XI Release 2 and I installed Service Pack 2 and SP5 on my laptop running Windows Vista Business SP1 with 64-bit operating system. I also installed Oracle 10g client on my laptop, configured DSN to connect to our Oracl
-
Imported Powerpoint not playing all animation
I've been testing a couple of Power Point files imported into Cp6. There is an animated chart that just will not play the way it does in PPT. Also cannot play back an embedded YouTube video, and in some cases the background audio doesn't play. Asi
-
Mainstage 2 : The poeples who buy complete version of Logic with Mainstage 2 will not have free update of Mainstage ??? This is outragous !!!
-
WebLogic 10.3.6 Times Out When Starting Web App
When starting our web app on WebLogic 10.3.6 using startWebLogic.sh on OEL (8 cores, 64 GB box), after about 5 to 6 minutes we receive a timeout error from WebLogic saying that it timed out trying to start the web app. The web app has some pre-comput