Dynamic table from an structure
Hi,
I want to create one alv grid using function REUSE_ALV_GRID_DISPLAY,for this i have passing the fieldcatalog to slis_t_fieldcat_alv.i have been passing my fieldnames ,and col,sel_text_m to fieldcatalog.instead of passing the fields can we assign fields catalog dynamically from the structure.....i have all the fieldnames in one structure for to be displayed in alv list.
pls read the below for reference....
DATA : BEGIN OF wa_inv,
lifnr LIKE rbkp-lifnr,
belnr LIKE rbkp-belnr,
bldat LIKE rbkp-bldat,
END OF wa_inv.
fieldcatalog-fieldname = 'LIFNR'.
fieldcatalog-seltext_m = 'Vendor'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-sp_group = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
*.....this following part will be avaid ..and it should *..be assigned to dynamically
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-col_pos = 1.
fieldcatalog-seltext_m = 'Invoice No'.
fieldcatalog-key = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BLDAT'.
fieldcatalog-seltext_m = 'Invoice Date'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gd_repid
IS_LAYOUT = gd_layout
IT_FIELDCAT = fieldcatalog[]
Prakash
Hi ,
here's an example for fm REUSE_ALV_FIELDCATALOG_MERGE
-> fields of itab must be defined with like not with type!
DATA : BEGIN OF itab1,
f1 LIKE vbak-vbeln,
f2 LIKE vbap-posnr,
f3 LIKE vbak-netwr,
END OF itab1.
rep = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = rep
i_internal_tabname = 'ITAB1'
i_client_never_display = 'X'
i_inclname = rep
CHANGING
ct_fieldcat = fcat.
regards Andreas
Similar Messages
-
Defining table from DDIC-structure dynamically
Hi folks!
Does anybody know whether it is possible to build an internal table from DDIC-structures dynamically?
I have a deep structured itab_upload(whose structure is defined in the DDIC), which contains 2 fields(Number Name) and a third field which contains itab_desc.
This itab_desc can contain either 2 fields(Number Name) and a third field which contains another itab_desc <b>or</b> 3 fields for numbers(without any other itab).If itab_desc contains another itab_desc, the second itab_desc contains only 3 fields for numbers and names...
help will be very appreciated and points will be rewarded!
FelixHi Felix,
Please find below the material which will help you to solve your problem :-
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
Please reward points if helpful.
Regards.
Srikanta Gope.
[email protected] -
EA3, Unhooking a table from a structured type
When I reset the drop down 'Based on Structured Type:' on the 'Table Properties' window for a relational model, the attributes that were inherited from the underlying structure which are displayed as columns in the table are not removed. I'm not sure if that is by design or by accident. I would prefer that if the table is unhooked from the object type that the object attributes would be removed from the table.
This is in Data Modeler EA3 3.1.0.691
Thanks,
ScottK
Edited by: ScottK on Jan 17, 2012 1:10 PMIn SDDM 3.3 EA2 if I unhook an object table from the structured type the columns remain. I can then replace one of those columns as the primary column, replacing the object table generated column value Oid. If I rehook (based on structured type) that table back to an object type, I am not able to use any of those inherited attributes as a column value within the primary key structure.
In a normal object table definition or an object relation table the structured type's attributes can be used as a primary key column. The problem only surfaces if I accidentally un-define the setting on (based on structured type) and then try to reset it. -
HR Logical database PNP. OO to fill table dynamic table from PNP ?
Hi all
I want to get some stuff from the HR logical database into a dynamic table
Here's a real simple example that writes info out to a normal list.
(report is based on using Logical DB PNP)
tables: pernr.
INFOTYPES: 0001, "Organizational Assignment
0002. "Personal Data
SELECT-OPTIONS: language FOR p0002-sprsl.
INITIALIZATION.
pnptimed = 'D'.
GET pernr.
PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda.
CHECK language.
WRITE: / p0002-pernr,
sy-vline,
p0001-ename,
sy-vline,
p0002-sprsl,
sy-vline,
p0002-gbdat.
ENDPROVIDE.
endform.
Now what I want to do is replace the write stuff by appending the entries into a dynamic table which I will display as an ALV Grid.
so I add my structure in the data declarations
types: begin of s_elements,
pernr type p0002-pernr,
ename type p0001-ename,
sprsl type p0002-sprsl,
gbdat type p0002-gbdat.
drop_down_handle type int4.
types: end of s_elements.
include zz_jimbo_incl.
build the dynamic table
create data dref type s_elements.
assign dref->* to <fs>.
i_routine = 'POPULATE_DYNAMIC_ITAB'.*
i_names = 'NAME_COLUMNS'.
i_gridtitle = 'HR TEST'.
invoker = sy-repid.
i_zebra = 'X '.
i_edit = ' '.
call function 'ZZ_CALL_SCREEN'
exporting
invoker = invoker
my_line = <fs>
i_gridtitle = i_gridtitle
i_edit = i_edit
i_zebra = i_zebra
i_names = i_names
i_routine = i_routine
importing
z_object = z_object
dy_table = dy_table.
Now to populate the dynamic Itab the routine below is entered.
form populate_dynamic_itab changing dy_table.
assign dy_table->* to <dyn_table>.
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
However I can't use GET / PROVIDE / ENDPROVIDE in a Form.
Anyway round this ---seems HR has an aversion to OO.
Cheers
jimboHi,
well, GET_PERNR is a so called event_statement. It has nothing to do with ABAP 00.
Normally it will be like this:
START-OF-SELECTION.
GET_PERNR.
PROVIDE ....
END-OF-SELECTION.
-> and here the CALL SCREEN NNNN for ALV-Display.
Provide-statements you can use in forms of course, and as many times you want during GET and END-OF-SELECTION.
But as I understood : you just want to save the write-statements?
I always develop a DDIC-Structure, declarate the data objects in the programm, read the data via Provide into the infotypes, and then make a move-corresponding to my structure. and display it.
Normally no problem.
kind regards
maik -
Hi,
can someone tell me, how I create a table from a POJO. The table must grow dynamically.
My problem is, that I didn't find a way to insert an array or a list to my report.
Thanks for your help.
Best regards
ChristianI think, that I solved the problem. But now I have a new problem: I give Crystal Reports a Collection with 3 objects, and I want to display the object in the body. One attribute of the POJO is a name. I want, that CR display them in a list, the second after the first and so on. But CR genartes a PDF with 3 pages, every name has his own page.
Has someone an idea what I make wrong? Thanks for your help!!
Best regards
Christian -
Generating Dynamic UI from XML structure
Hi All,
I have a requirement in which I need to select an entry in the first view and based on this, the second view would come come. But there are 30 different values that can be selected and each of them will have a different set of UI elements in the second screen. So if I go for normal static UI creation, then I need to create 30 odd views which is something we do not want.
The second option is to dynamically generate the UI elements in wdDoModify() method. But for 30 different conditions to check all the time will lead to performance issue.
So we are thinking if there is a way for webdynpro to dynamically read an XML structure that defines attributes and generates a layout for us dynamically.
Please provide your inputs on this. Also kindly suggest any other better ways for the solution.
Thanks and Regards,
Sayan GhoshHello!
I think you should go with second one. But I don't know any "ready to use" solutions, so you have to
- Create your own XML structure, something like
<section type="yourCondition">
<input name="somePropertyName" type="text"/>
<!-- and so on -->
</section>
- Parse this XML into Java Model (on application startup for example)
- On user selection choose requred UI Model from memory and pass it to view
- In wdDoModify() build UI(elements, context attributes, mappings etc.) according to this model
It will be rather complicated for huge UI, but possible.
Thanks, Mikhail -
NEED HELP... Creating dynamic table from data file...
Hi
I'm writing an application for data visualization. The user can press the "open file" button and a FileChooser window will come up where the user can select any data file. I would like to take that data file and display it as a table with rows and columns. The user needs to be able to select the coliumns to create a graph. I have tried many ways to create a table, but nothing seems to work! Can anyone help me?! I just want to read from the data file and create a spreadsheet type table... I won't know how many rows and columns I'll need in advance, so the table needs to be dynamic!
If you have ANY tips, I'd REALLY appreciated.....Thank you for your help. I tried to use some of the code in the examples... I'm really new at this, so I'm not sure how to set it up. I added the code, but when I open a file, nothing happens. Here's the code I have so far...
package awt;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.text.*;
import javax.swing.border.*;
import javax.swing.table.*;
* @author
public class Main {
public static void main(String[] args) {
JFrame frame = new ScatterPlotApp();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
class ScatterPlotApp extends JFrame implements ActionListener{
private JButton openButton, exitButton, scatButton, refreshButton;
private JMenuBar menuBar;
private JMenuItem openItem, exitItem;
private JFileChooser chooser;
private JMenu fileMenu;
private JTextPane pane;
private JTable table;
private DefaultTableModel model;
private JScrollPane scrollPane;
private Container contentPane;
/** Creates a new instance of ScatterPlotApp */
public ScatterPlotApp() {
setTitle("Data Visualizer");
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
int width = 867;
int height = 800;
setBounds((d.width - width)/2, (d.height - height)/2, width, height);
contentPane = getContentPane();
JPanel panel = new JPanel();
//pane = new JTextPane();
panel.setLayout(new FlowLayout(FlowLayout.CENTER));
contentPane.add(panel, BorderLayout.SOUTH);
//contentPane.add(pane, BorderLayout.NORTH);
scatButton = new JButton("Create ScatterPlot");
scatButton.addActionListener(this);
openButton= new JButton ("Open File");
openButton.addActionListener(this);
exitButton = new JButton ("Exit");
exitButton.addActionListener(this);
refreshButton = new JButton ("Reload Data");
refreshButton.addActionListener(this);
panel.add(openButton);
panel.add(scatButton);
panel.add(refreshButton);
panel.add(exitButton);
fileMenu = new JMenu("File");
openItem = fileMenu.add(new JMenuItem ("Open", 'O'));
openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK));
openItem.addActionListener(this);
exitItem = fileMenu.add(new JMenuItem ("Exit", 'X'));
exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK));
exitItem.addActionListener(this);
JMenuBar menuBar = new JMenuBar();
fileMenu.setMnemonic('F');
menuBar.add(fileMenu);
setJMenuBar(menuBar);
public void actionPerformed(ActionEvent e){
Vector columnNames = new Vector();
Vector data = new Vector();
try{
Object source = e.getSource();
if (source == openButton || e.getActionCommand().equals("Open")){
chooser = new JFileChooser(".");
int status =chooser.showOpenDialog(this);
if (status ==JFileChooser.APPROVE_OPTION)
File file = chooser.getSelectedFile();
FileInputStream fin = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(fin));
String line;
//StringBuffer bf = new StringBuffer();
StringTokenizer st1 = new StringTokenizer(br.readLine(), ";");
while( st1.hasMoreTokens() )
columnNames.addElement(st1.nextToken());
// extract data
while ((line = br.readLine()) != null)
StringTokenizer st2 = new StringTokenizer(line, ";");
Vector row = new Vector();
while(st2.hasMoreTokens())
row.addElement(st2.nextToken());
data.addElement( row );
br.close();
model = new DefaultTableModel(data, columnNames);
table = new JTable(model);
scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane, BorderLayout.NORTH );
while((line=br.readLine())!=null)
bf.append(line+"\n");
pane.setText(bf.toString());
//pane.setText(bf.toString());
else if (source == scatButton){
else if (source == exitButton || e.getActionCommand().equals("Exit")){
System.exit(0);
else if (source == refreshButton){
catch (Exception ex){
ex.printStackTrace();
} -
How to find out the tables from extract structures
Hi All,
As I know my data sources are 2lis_04_p_matnr,2lis_04_p_comp,2lis_04_p_arbpl.
How to find out the tables concerned with the fields in the extract structure.
ThanksPl check this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/29/79eb3cad744026e10000000a11405a/frameset.htm
OR navigate to: help.sap.com - netweaver - bi content - supply chain - look for your application area and the extractor and you will see the source tables and fields.
Ravi Thothadri -
Here's how to use DYNAMIC tables for almost any structure (4.6C onwards)
Hi guys
I'm describing a feature here that has been around since 4.6C that is not really well known but can really simplfy programming where you need to get data into some sort of internal table and then display it either as a classical list or as al ALV grid.
This feature is RTTI which allows you to retrieve your structure, build a dynamic FCAT (Field catalog) and a Dynamic table.
Here's a really quick little program which reads 200 entries from VAPMA into a dynamic table. Any structure will work if you use the code sample shown.
To pass it to an ALV GRID is then really simple as you've already got the Field Catalog, Table and Data.
The method I'm showing below will work for almost ANY structure you care to name whether or not the fields are in the data dictionary.
I create a dynamic FCAT and dynamic table based on the FCAT and then populate it.
You can create field catalogs dynamically quite simply by using the new RTTI facility available from 4.6C onwards.
(From here it's only a small step to dynamic tables and EASY ALV grid displays)
Example to create dynamic FCAT and table and populate it with 200 entries from VAPMA
PROGRAM ZZ_BUILD_FLDCATALOG.
tables: vapma.
Define any structure
types: begin of s_elements,
vbeln type vapma-vbeln,
posnr type vapma-posnr,
matnr type vapma-matnr,
kunnr type vapma-kunnr,
werks type vapma-werks,
vkorg type vapma-vkorg,
vkbur type vapma-vkbur,
status type c,
end of s_elements.
end of your structure
data lr_rtti_struc type ref to cl_abap_structdescr .
data:
zog like line of lr_rtti_struc->components .
data:
zogt like table of zog,
wa_it_fldcat type lvc_s_fcat,
it_fldcat type lvc_t_fcat ,
dy_line type ref to data,
dy_table type ref to data.
data: dref type ref to data.
field-symbols: <fs> type any,
<dyn_table> type standard table,
<dyn_wa>.
*now I want to build a field catalog
*First get your data structure into a field symbol
create data dref type s_elements.
assign dref->* to <fs>.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( <fs> ).
zogt[] = lr_rtti_struc->components.
Now build the field catalog. zogt has the structure in it from RTTI.
loop at zogt into zog.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = zog-name .
wa_it_fldcat-datatype = zog-type_kind.
wa_it_fldcat-inttype = zog-type_kind.
wa_it_fldcat-intlen = zog-length.
wa_it_fldcat-decimals = zog-decimals.
wa_it_fldcat-coltext = zog-name.
wa_it_fldcat-lowercase = 'X'.
append wa_it_fldcat to it_fldcat .
endloop.
Let's create a dynamic table and populate it
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
select vbeln posnr matnr kunnr werks vkorg vkbur
up to 200 rows
from vapma
into corresponding fields of table <dyn_table>.
from here you can pass your table to a GRID for display etc etc.
Cheers
JimboThanks for the info.
I went to their web site and also Googled.
I found a great review on their photographer's books on nikonians.org
They use an HP/Indigo Ultrastream 3000 digital offset press for all hardcover books, which is GREAT!
I did sign up and requested the 45 day trial "photographer" account.
I am curious if Shared Ink offers a size that matches the ONLY current book size from Aperture, the odd 8.5x11.
In the above review, I saw that Shared Ink offers a 12x12 book.. very nice! Except you will need to design that one in CS2
So then, all that Apple really needs to do is simply add the ability to select/create custom book sizes. Then we don't need a printing service from Apple, as there are plenty of options out there, and more arriving on the market each month! -
Structure of Dynamic Table in Function Module
Hi,
I'm trying to find a way to get as OUTPUT a dynamic Table from a Function Module.
I declared a table called T_DATA without a type.
And this table should have a dynamic table back.
The problem that I get the data back but, I only found a data without any field-elements.
The data is there but there's no structure, no table.
Is there any way that I can send the Data in a proper structure?Hi
Try using the following code
type-pools:slis.
data:it_fcat type lvc_t_fcat,
wa_fcat type lvc_s_fcat,
itab type ref to data.
data:it_fcat1 type slis_t_fieldcat_alv,
wa_fcat1 like line of it_fcat1.
data:cl_tab type ref to cl_alv_table_create,
wa_ref type ref to data.
field-symbols:<itab> type table,
<wa> type any,
<comp>.
create object cl_tab.
refresh:it_fcat.
wa_fcat-fieldname = 'NAME'.
wa_fcat-inttype = 'C'.
wa_fcat-intlen = '10'.
wa_fcat1-fieldname = 'NAME'.
wa_fcat1-inttype = 'C'.
wa_fcat1-intlen = '10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
wa_fcat-fieldname = 'NAME2'.
wa_fcat-datatype = 'CHAR10'.
wa_fcat1-fieldname = 'NAME2'.
wa_fcat1-datatype = 'CHAR10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
cl_alv_table_create=>create_dynamic_table(
exporting
I_STYLE_TABLE = I_STYLE_TABLE
it_fieldcatalog = it_fcat
I_LENGTH_IN_BYTE = I_LENGTH_IN_BYTE
importing
ep_table = itab
E_STYLE_FNAME = E_STYLE_FNAME
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
assign itab->* to <itab>.
create data wa_ref like line of <itab>.
assign wa_ref->* to <wa>.
do.
assign component 'NAME' of structure <wa> to <comp>.
<comp> = 'AA'.
unassign <comp>.
assign component 'NAME2' of structure <wa> to <comp>.
<comp> = 'AB'.
insert <wa> into table <itab>.
exit.
enddo.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
IS_LAYOUT = IS_LAYOUT
it_fieldcat = it_fcat1
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
t_outtab = <itab>
EXCEPTIONS
PROGRAM_ERROR = 1
Regards -
Dynamic table pulled from SQL database, Need to Search
My table results are not static, they are pulled into a
dynamic table from a SQL database. Each table displays 10 records
with an option at the bottom to display additional records
(next/previous), for my query. I also have an option set up to
allow users to click for a detail view of a record in the table. If
the table data was static, I would be able to set up a search
option and a results page for it, but I'm dealing with dynamic data
on an .ASP page. I'd like to set up a search box to limit the
records displayed in the table. I haven't found any code samples
that are designed for dynamic data.
Here is a copy of the code from my table.Hi,
I think the code on this URL will get you the solution
http://www.asp.happycodings.com/Array/code3.html
Cheers,
~Maneet -
Livecycle userform with dynamic table
Hi Everyone,
New to Livecycle Designer and was hoping this is possible - Can you have a PDF userform with a dynamic table below it?...
Basically the user fills out a userform then clicks an ADD button - this populates a dynamic table below the userform then clears/resets the userform - as the records fill the table an EDIT button appears in the last column so that if the user makes an error with a record they could click the EDIT button, this would bring the record back into the userform fields so they could change the field(s) they made the error in then a SAVE button would replace the ADD button in this instance, clicking SAVE then changes the record and clears/resets the userform ready for more entries.
At the bottom of the PDF there would be an EXPORT button which attaches the table as a csv or tab-delimited text file to an email message...
If someone could point me in the right direction it would be appreciated - I have googled and searched the forums for an answer but they mostly relate to importing data into a dynamic table from a database or xml file... I was hoping to directly populate the table with the userform.
I also have a PDF example which illustrates what I am trying to achieve... but seems you cannot attach to a post... I can email it if someone has a solution, but needs to see it visually.
CheersYou don't know the names of your columns? hmm you do, because before you created dynamic table you had to create field catalog, so the structure and column names of newly (dynamically) created table will be the same like defined in the field catalog.
The last loop also does not look good, in my opinion should be something like:
LOOP AT lt_datatable +(my first table)+ ASSIGNING <ls_data4>.
AT NEW pernr.
APPEND initial line to <fs_1> assigning <fs_2>.
<fs_2>-pernr = <ls_data4>-pernr.
ENDAT.
ASSIGN COMPONENT <ls_data4>-wage_type OF STRUCTURE <fs_2> TO <fs_5>.
<fs_5> = <ls_data4>-amount.
ENDLOOP.
also keep in mind that number of calls of method cl_alv_table_create=>create_dynamic_table is limited to 36 (?) calls within one program session because it uses dynamic subroutine pool behind so you will have short dump if you will execute that 37 times. -
Hi experts,
how can I handle it to exporting a table from a structure from a methode?
At the moment I export the structure in the methode but I need to export a table.
At the moment:
Parameter Type Typing Methode Associated Type
param_1 Exporting Type structure
I need something like that:
Parameter Type Typing Methode Associated Type
param_1 Exporting Type Table of structure
... but that is not possibleI think he meant something like this
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: get_tab EXPORTING gen_table TYPE table.
ENDCLASS.
CLASS lcl_test IMPLEMENTATION.
METHOD get_tab.
SELECT * FROM sflight INTO TABLE gen_table UP TO 10 ROWS.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: it_sflight TYPE TABLE OF sflight.
lcl_test=>get_tab( IMPORTING gen_table = it_sflight ).
"here IT_SFLIGHT holds what you want
Of course you could make it more generic, meaning query dynamic DB table inside get_tab and create dynamic table outside the method call to get returned data to that table. But basically it shows the idea.
Regards
Marcin -
How to assign values to dynamic table
Hi All,
I am working with a dynamic table and an internal table. My internal table looks like this.
Projno Cust Opt Status
g1234 kkkkk p1 I001
g1234 kkkkk p2 I004
g1234 kkkkk p3 I001
g1234 kkkkk p5 I002
g1256 lmnvw p1 I003
g1256 lmnvw p3 I004
g1256 lmnvw p5 I005
g1256 lmnvw p7 I001
My Dynamic table struture looks like this
Projno Cust p1 p2 p3 p4 p5 p6 p7
I need data in my dynamic table from my internal table as follows
Projno Cust p1 p2 p3 p4 p5 p6 p7
g1234 kkkkk I001 I004 I001 I002
g1256 lmnvw I003 I004 I005 I001.
The problem is these operations may vary thats why i am using dynamic table. Even i cannot use case statement as the operations may vary.
Is it possible to do using Assign component or some other way.
ThanksThis program creates dynamic internal table
copy and paste in your program and test it .. debug it to know how it is creating dynamic internal table and values into that table.
report z_dynamic.
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection.
perform get_structure.
perform create_dynamic_itab.
perform get_data.
perform write_out.
form get_structure.
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.
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
form get_data.
Select Data from table.
select * into table <dyn_table>
from (p_table).
endform.
form write_out .
Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
endform. " write_out -
Hi:
- I am currently prototyping a plug-in but I have some questions:
- 1) At the 'All Metrics' table, what is the intent of the 'Last Upload' field,
and how is this field updated?
- I have created some metrics but for some metrics the 'Last Upload' field
has a timestamp but for other metrics there is no data.
As far as I know, the metrics are similar but I do not know why the behaviour is different.
- 2) Is there a maximum string length that the Oracle agent can accept?
- I have a script which just returns all the environment variables into one cell.
In emagent.trc, the Oracle agent issues the following warning:
2009-08-27 12:38:47 Thread-76336 WARN upload: Truncating value of "STRING_VALUE" from "AGENT_HOME=
- Is the truncation an issue?
- 3) I have created some dynamic tables from performing an snmp walk, but the key that I use
is the index of the SNMP table. The data is collected correctly, but I am not sure that using
the table index as the key for OEM is a good idea because the metrics are stored according to the SNMP table index.
Should the OEM key be the something like 'object name' instead of the index number from performing an SNMP walk ?
For example, when I click a metric, the metric name is: Sensor Index 1.
But should it not be something like 'Fan #1' ?
Thanks JohnMetrics are collected at certain intervals, the Last Upload field indicates the date and time of the last time a metric collection was uploaded. The quicker the interval, the more recent that date should be. If you don't specify a CollectionItem in your default collection file for your metrics, they won't be collected or uploaded.
If your metric column is a STRING type, it is stored in a VARCHAR2(4000)
I'm not sure I understand your last problem... You have a table metric with a set of columns. The column you use as the key is just some tracking index which doesn't really mean anything. As long as your key column(s) make the row unique, the agent will be satisfied. If you want something more meaningful as your key, then it's something you will have to inject into your dataset if it isn't already there.
Maybe you are looking for
-
After updating to iTunes 11.1 how to get home sharing to work on Apple TV?
Updated iTunes to 11.1. Can view home shared iMac computer on one of my Apple TV's but not the other Apple TV. Did Apple TV reset, restore, re-installed iTunes 11.1 on my iMac, checked network (it tested fine), but still cannot get my iTunes librar
-
Error when trying to deploy crystal reports to a web site
I'm using VS 2008. When I add a Crystal Report page to my application I get the following error. Can anyone help be resolve this problem? Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a
-
Some events off by one day in iCal since new upgrade
Since the upgrade, some of my calender events show up one day earlier. There is no true pattern and sometimes they are correct which makes it REALLY hard to know what is correct. I use Exchange to sync all my calenders from Google. I don't know if th
-
Icon printed instead of @V5 in ALV
Hi Friends, I have strange problem, Iam fetching field j_3atltyp from table j_3avast ( AFS ). One of the outputs is @V5 When I am displayin it in ALV, It is showing a stop icon ( default icon) instead of @V5 The strange thing is it is sho
-
NI DMM Soft front panel did not detect any ni-dmm
Hello, has anyone seen this failure? I can´t open soft front panel to setup the dmm. I tried to reinstall VISA and NI-DMM without success. Thanks Robert Solved! Go to Solution. Attachments: NIDMM FrontPanel_Failure.JPG 107 KB