How to display data depend upon ListBox value?
Hi Experts and Particularly Hema,
As I asked before how to display data in the ListBox, I got an very good response from you all(particularly Hema) .
Now what my doubt is asked with sample scenario below:
In Screen Painter -
Two fields namely : One List Box and other is I/O used only for displaying purpose i.e., only for output, not for input purpose.
List Box is filled by primary key field(C1) value from one table(T1) when the screen load.(i.e., such code is written in PBO).
Now what I need is :
If the user select any one value in the List Box then it automatically display the corresponding C2 value from T1 in the I/O field.
I think you may all understand what I am trying to ask.Please let me know the solution.
Thanks in advance,
Regards,
Raghu
Simply attached a function code for the listbox... when the user changes the value, you will be able to pick this up in the PAI and loop back to the PBO and redisplay the corresponding output field.
Jonathan
Similar Messages
-
How to display data elements in the tempalte header
Hello friends
i've this date_from and date_to parameters which are date parameters that user enters..
based on these date parameters I want to display them in the header as
day of date_from(for example if the date_from is 13-nov-2010.then I should display 13)and for date_to it should dispaly as 15 if for example the user enters
16-nov-2010.(date-1's day)
so it should break down to
date_from-13-nov-2010, 13
date_to- 16-nov-2010, 15
I want these two values to be displayed in the header of the template how to do this
pls help
also let me know how to display data elements in the template header
Edited by: erp on Dec 22, 2010 12:44 AMHi Ananth..Thanks for ur timely reply
Can I use it with <? substring(':date_from',1,2)?>
where date_from is an input parameter which user enters at the run time of the report.
I've to capture the date entered by the user and print it in the header..
Pls reply -
Hide Advance table Depending upon the value of dropDown
Hi,
I have 2 advance tables. 1st one has a DropDown. Depending upon the value of the dropdown in 1st advance table, the second advanced table should get rendered.
I tried by getting the value of the dropdown by addingg a PPF and iterating trough the table and I got the value. But when I redirect to the same page, all the selection and other values in 1st advanced table vanish out.
Can someone help me getting the 2nd table hidden and at the same time retaining the values for the 1st advanced table.
Thanks in Advance,
Kaushik RambhiyaKaushik
Implement PPR for this requirement and dont redirect the page
Displaying image based selected value of choice bean
http://oracleanil.blogspot.com/2009/05/ppr.html
Thanks
AJ -
Shading part of a JTable Cell dependent upon the value of the cell
Hi
Was hoping some one woudl be able to provide some help with this. I'm trying to create a renderer that will "shade" part of a JTable cell's background depending upon the value in the cell as a percentage (E.g. if the cell contains 0.25 then a quarter of the cell background will be shaded)
What I've got so far is a renderer which will draw a rectangle whose width is the relevant percentage of the cell's width. (i.e. the width of the column) based on something similar I found in the forum but the part I'm struggling with is getting it to draw this rectangle in any cell other than the first cell. I've tried using .getCellRect(...) to get the x and y position of the cell to draw the rectangle but I still can't make it work.
The code for my renderer as it stands is:
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
public class PercentageRepresentationRenderer extends JLabel implements TableCellRenderer{
double percentageValue;
double rectWidth;
double rectHeight;
JTable table;
int row;
int column;
int x;
int y;
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value instanceof Number)
this.table = table;
this.row = row;
this.column = column;
Number numValue = (Number)value;
percentageValue = numValue.doubleValue();
rectHeight = table.getRowHeight(row);
rectWidth = percentageValue * table.getColumnModel().getColumn(column).getWidth();
return this;
public void paintComponent(Graphics g) {
x = table.getCellRect(row, column, false).x;
y = table.getCellRect(row, column, false).y;
setOpaque(false);
Graphics2D g2d = (Graphics2D)g;
g2d.fillRect(x,y, new Double(rectWidth).intValue(), new Double(rectHeight).intValue());
super.paintComponent(g);
}and the following code produces a runnable example:
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class PercentageTestTable extends JFrame {
public PercentageTestTable()
Object[] columnNames = new Object[]{"A","B"};
Object[][] tableData = new Object[][]{{0.25,0.5},{0.75,1.0}};
DefaultTableModel testModel = new DefaultTableModel(tableData,columnNames);
JTable test = new JTable(testModel);
test.setDefaultRenderer(Object.class, new PercentageRepresentationRenderer());
JScrollPane scroll = new JScrollPane();
scroll.getViewport().add(test);
add(scroll);
public static void main(String[] args)
PercentageTestTable testTable = new PercentageTestTable();
testTable.pack();
testTable.setVisible(true);
testTable.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}If anyone could help or point me in the right direction, I'd appreciate it.
RuanaeThis is an example I published some while ago -
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
public class Fred120 extends JPanel
static final Object[][] tableData =
{1, new Double(10.0)},
{2, new Double(20.0)},
{3, new Double(50.0)},
{4, new Double(10.0)},
{5, new Double(95.0)},
{6, new Double(60.0)},
static final Object[] headers =
"One",
"Two",
public Fred120() throws Exception
super(new BorderLayout());
final DefaultTableModel model = new DefaultTableModel(tableData, headers);
final JTable table = new JTable(model);
table.getColumnModel().getColumn(1).setCellRenderer( new LocalCellRenderer(120.0));
add(table);
add(table.getTableHeader(), BorderLayout.NORTH);
public class LocalCellRenderer extends DefaultTableCellRenderer
private double v = 0.0;
private double maxV;
private final JPanel renderer = new JPanel(new GridLayout(1,0))
public void paintComponent(Graphics g)
super.paintComponent(g);
g.setColor(Color.CYAN);
int w = (int)(getWidth() * v / maxV + 0.5);
int h = getHeight();
g.fillRect(0, 0, w, h);
g.drawRect(0, 0, w, h);
private LocalCellRenderer(double maxV)
this.maxV = maxV;
renderer.add(this);
renderer.setOpaque(true);
renderer.setBackground(Color.YELLOW);
renderer.setBorder(null);
setOpaque(false);
setHorizontalAlignment(JLabel.CENTER);
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
final JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
if (value instanceof Double)
v = ((Double)value).doubleValue();
return renderer;
public static void main(String[] args) throws Exception
final JFrame frame = new JFrame("Fred120");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new Fred120());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
} -
How to display data from a recordset based on data from another recordset
How to display data from a recordset based on data from
another recordset.
What I would like to do is as follows:
I have a fantasy hockey league website. For each team I have
a team page (clubhouse) which is generated using PHP/MySQL. The one
area I would like to clean up is the displaying of the divisional
standings on the right side. As of right now, I use a URL variable
(division = id2) to grab the needed data, which works ok. What I
want to do is clean up the url abit.
So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
I want is clubhouse.php?team=Wings.
I have a separate table, that has the teams entire
information (full team name, short team, abbreviation, conference,
division, etc. so I was thinking if I could somehow do this:
Recordset Team Info is filtered using URL variable team
(short team). Based on what team equals, it would then insert this
variable into the Divisional Standings recordset.
So example: If I type in clubhouse.php?team=Wings, the Team
Info recordset would bring up the Pacific division. Then 'Pacific'
would be inserted into the Divisional Standings recordset to
display the Pacific Division Standings.
Basically I want this
SELECT *
FROM standings
WHERE division = <teaminfo.division>
ORDER BY pts DESC
Could someone help me, thank you.Assuming two tables- teamtable and standings:
teamtable - which has entire info about the team and has a
field called
"div" which has the division name say "pacific" and you want
to use this
name to get corresponding details from the other table.
standings - which has a field called "division" which you
want to use to
give the standings
SELECT * FROM standings AS st, teamtable AS t
WHERE st.division = t.div
ORDER BY pts DESC
Instead of * you could be specific on what fields you want to
select ..
something like
SELECT st.id AS id, st.position AS position, st.teamname AS
team
You cannot lose until you give up !!!
"Leburn98" <[email protected]> wrote in
message
news:[email protected]...
> How to display data from a recordset based on data from
another recordset.
>
> What I would like to do is as follows:
>
> I have a fantasy hockey league website. For each team I
have a team page
> (clubhouse) which is generated using PHP/MySQL. The one
area I would like
> to
> clean up is the displaying of the divisional standings
on the right side.
> As of
> right now, I use a URL variable (division = id2) to grab
the needed data,
> which
> works ok. What I want to do is clean up the url abit.
>
> So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
> all
> I want is clubhouse.php?team=Wings.
>
> I have a separate table, that has the teams entire
information (full team
> name, short team, abbreviation, conference, division,
etc. so I was
> thinking if
> I could somehow do this:
>
> Recordset Team Info is filtered using URL variable team
(short team).
> Based on
> what team equals, it would then insert this variable
into the Divisional
> Standings recordset.
>
> So example: If I type in clubhouse.php?team=Wings, the
Team Info recordset
> would bring up the Pacific division. Then 'Pacific'
would be inserted into
> the
> Divisional Standings recordset to display the Pacific
Division Standings.
>
> Basically I want this
>
> SELECT *
> FROM standings
> WHERE division = <teaminfo.division>
> ORDER BY pts DESC
>
> Could someone help me, thank you.
> -
Hi all,
can any one tell me how to display data in a table when user click on a button. i have created a node with a set of fields from different tables now how to write the logic to display data in that table.
Thanks & Regards,
NaveenDATA lo_nd_professionaltable TYPE REF TO if_wd_context_node.
DATA lo_el_professionaltable TYPE REF TO if_wd_context_element.
DATA ls_professionaltable TYPE wd_this->ElementS_professionaltable. "internaltable
TYPES: BEGIN OF TY_PFTAB,
RATEGROUP TYPE /BIC/OIWRATEGRP,
LEVEL TYPE /BIC/OIWPCSLEVEL,
FROMDATE TYPE /BI0/OIDATEFROM,
FROMTO TYPE /BI0/OIDATETO,
STANDARD TYPE /BIC/OIWSTRATE,
OVERHEAD1 TYPE /BIC/OIWOHRTE1,
OVERHEAD2 TYPE /BIC/OIWOHRTE2,
OVERHEAD3 TYPE /BIC/OIWOHRTE3,
EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
END OF TY_PFTAB.
DATA : IT_PFTABLE TYPE STANDARD TABLE OF TY_PFTAB,
WA_PFTAB TYPE TY_PFTAB.
SELECT /BIC/WRATEGRP /BIC/WPCSLEVEL DATEFROM DATETO /BIC/WSTRATE /BIC/WOHRTE1 /BIC/WOHRTE2 /BIC/WOHRTE3
FROM /BIC/AGLDCPRTS00 INTO TABLE IT_PFTABLE.
*TYPES : BEGIN OF TY_EXCEPTION,
EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
END OF TY_EXCEPTION.
*DATA : IT_EXTABLE TYPE STANDARD TABLE OF TY_EXCEPTION,
WA_EXTABLE TYPE IT_EXTABLE.
*SELECT /BIC/MSECFILER FROM /BIC/AGLDCLMLT00 INTO TABLE IT_EXTABLE.
navigate from <CONTEXT> to <PROFESSIONALTABLE> via lead selection
lo_nd_professionaltable = wd_context->get_child_node( name = wd_this->wdctx_professionaltable ).
get element via lead selection
lo_el_professionaltable = lo_nd_professionaltable->get_element( ).
@TODO handle not set lead selection
IF lo_el_professionaltable IS INITIAL.
ENDIF.
get all declared attributes
lo_el_professionaltable->get_static_attributes(
IMPORTING
static_attributes = ls_professionaltable ).
lo_nd_professionaltable->bind_table( new_items = IT_PFTABLE set_initial_elements = abap_false ). -
How to display Date Calendar in Oracle BI Answers Prompts (parameter)
I'm still new to OBIEE.
How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
Thanks.Hi,
While creating Dash Board prompt choose the control to 'Calendar'.
I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
Go to: Column Properties --> Data Format
Choose override default data format to view the available options in the drop down list.
I would be very happy if anybody acknowledge me that I am wrong.
-Vency -
How to display date and time on jsf page
Hi,
how to display date and time on jsf page
we are using 11.2.0.0 jdeveloper on windows.
thanks
Edited by: user12187801 on 26-Jul-2012 01:42Your question is certainly lacking some information.
If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
If you meant something else, then it's back to you to explain. -
How to display data with the same text and key in the drop down list?
Hi All,
Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
REPORT ZTESTING.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
c(20) type c.
* c = 'select any'.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
data:begin of jtab occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
end of jtab.
PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
default 'SELECT'.
AT SELECTION-SCREEN OUTPUT.
NAME = 'p_list'.
VALUE-KEY = 'Name'. "---> Data for key is the same with text
VALUE-TEXT = 'Name'. "--> Data for text is the same with key
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'Country'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
start-of-selection.
select kunnr name1 up to 20 rows from kna1 into table itab.
select kunnr land1 up to 20 rows from kna1 into table jtab.
case p_list.
when '1'.
loop at itab.
write:/ itab-kunnr,itab-name1.
endloop.
when '2'.
loop at jtab.
write:/ jtab-kunnr,jtab-land1.
endloop.
endcase.
<Added code tags>
Moderator Message: Please use the "code" tags to format your code snippet.
Edited by: Suhas Saha on Nov 17, 2011 11:19 AMshawnTan wrote:
Hi All,
>
> Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
>
>
REPORT ZTESTING.
>
> TYPE-POOLS: VRM.
>
> DATA: NAME TYPE VRM_ID,
> LIST TYPE VRM_VALUES,
> VALUE LIKE LINE OF LIST,
> c(20) type c.
>
> * c = 'select any'.
>
> data:begin of itab occurs 0,
> kunnr like kna1-kunnr,
> name1 like kna1-name1,
> end of itab.
>
> data:begin of jtab occurs 0,
> kunnr like kna1-kunnr,
> land1 like kna1-land1,
> end of jtab.
>
> PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
> default 'SELECT'.
>
> AT SELECTION-SCREEN OUTPUT.
>
> NAME = 'p_list'.
>
> VALUE-KEY = 'Name'. "---> Data for key is the same with text
> VALUE-TEXT = 'Name'. "--> Data for text is the same with key
> APPEND VALUE TO LIST.
>
> VALUE-KEY = '2'.
> VALUE-TEXT = 'Country'.
> APPEND VALUE TO LIST.
>
> CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
>
> start-of-selection.
> select kunnr name1 up to 20 rows from kna1 into table itab.
> select kunnr land1 up to 20 rows from kna1 into table jtab.
>
> case p_list.
> when '1'.
> loop at itab.
> write:/ itab-kunnr,itab-name1.
> endloop.
>
> when '2'.
> loop at jtab.
> write:/ jtab-kunnr,jtab-land1.
> endloop.
> endcase.
>
> <Added code tags>
>
> Moderator Message: Please use the "code" tags to format your code snippet.
>
> Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
This surely seems to be a bug to me(if not by design), did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
-Rajesh. -
How to Display a Calender upon clicking the dropdown list inside a table co
Hi,
I have a Listbox inside my table control and I need to Display a Calender upon clicking the dropdown list.
Can any body help.
SrinivasHi,
Try this:
On your customizing screen,
PROCESS ON VALUE-REQUEST.
Field T_ZT-SDATE
module create_dateselect.
In your main program:
module create_dateselect.
data:p_date like sy-datum.
CALL FUNCTION 'F4_DATE'
EXPORTING
holiday_calendar_id = 'CN'
display = ' '
IMPORTING
select_date = p_date
EXCEPTIONS
OTHERS = 4.
t_zt-sdate = p_date.
endmodule.
Regards,
Pole -
How to display data in detail block from a table.
Dear members,
i have 2 blocks. 1 is master block and another is detail block with multiple records.
the requirement is when i navigate to the detail block the data from a table is displayed in it. using a where clause depend on the value in an item in the master block.
i wrote the following code and tried in when-new-block-instance, when-new-record-instance, pre-block and post-block
but...
DECLARE
CURSOR ITEM_CUR IS
SELECT ITEM_ID, QTY_APPROVED
FROM IN_REQUEST_FORM_DETAIL
WHERE RF_MASTER_ID = :IN_MASTER_PO.RF_ID;
BEGIN
FOR ITEM_REC IN ITEM_CUR LOOP
:IN_PO_DETAIL.ITEM_ID := ITEM_REC.ITEM_ID;
:IN_PO_DETAIL.DIS_APPROVED_QTY := ITEM_REC.QTY_APPROVED;
NEXT_RECORD;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE ('THERE IS NO REQUESTS');
END;thanks dear simon,
i want to display the data from a table not included in this form. and these two tables are connected via a relation.
i have the following tables.
in_master_po
PO_ID pk
PO_DATE
RF_DETAIL_ID fk (in_request_form_detail)
in_po_detail
DETAIL_PO_ID pk
ITEM_ID fk
PO_ID fk (in_master_po)
QTY
the above 2 tables are datablocks connected via relation
the following is the from which i want to bring the data to display
in_request_form_detail
RF_DETAIL_ID pk
ITEM_ID fk (items)
QTY_REQ
i tried my code on the sample tables with scott/tiger there it works good.
thanks
Muhammad Nadeem -
How to display data in Table control?
Hi Experts,
Can anyone please explain me how to display the data from two different tables(those two table is related with 1 field) into a single table control?
For Example: T1 has fields (F1,F2) and
T2 has fields (F3,F4) --> here F3 is foreign key for F1
I need to display the data F1,F2,F3,F4 into the table control.
Can anyone explain me?
Thanks in Advance,
Regards,
RaghuHi,
If F3 is foreign key for F1, then both fields will have same values. Then why do you need to display both F1 and F3? Either one of them is enough. Try the following code.
types: begin of t_table,
F1 type T1-F1,
F2 type T1-F2,
F4 type T2-F4,
end of t_table.
data: i_table type standard table of t_table with header line.
select F1 F2 F4 into table i_table from T1 inner join T2 on T1F1 = T2F3.
You should create three columns in the table control with names i_table-F1, i_table-F2, i_table-F3.
After populating the internal table, refresh the control with the following statement.
REFRESH CONTROL <NAME> FROM SCREEN <SCREEN_NO>.
All the above statements should be in your PBO Module.
Regards,
Hema
Message was edited by:
Sorry, Declarations can be in the common include. Select statement and refresh statement should be in PBO.
Hema Nagarajan -
How to display data stored in a ResultSet
Hello, I have a resultSet that is returned by a stored procedure.
Does someone know how to display that data in a datagrid or something?
Tranks.Hi,
What you need is an <h:dataTable> component.
Try the following code :
<f:view>
<h:form>
<h:dataTable value="#{myHandler.dataModel}" var="variable">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="All Records"/>
</h:panelGroup>
</f:facet>
<h:column>
<f:facet name="header">
<h:outputText value="NAME" />
</f:facet>
<h:outputText value="#{variable.NAME}"/>
</h:column>
</h:dataTable>
</h:form>
</f:view>You can add as many column elements you want. Replace #{variable.NAME}
with the name of the other columns.
And in your handler
private DataModel dataModel;
public DataModel getDataModel()
if (dataModel == null)
dataModel = new ResultSetDataModel();
dataModel.setWrappedData(getResultSetMethod())
return dataModel;
}The getResultSetMethod() must be returning your resultset.
I hope this helps.
Petros -
How to display data horizontally
Hi,
I have to display data the following format.
sales order item description 01/09/2010 02/09/2010 03/09/2010
100 1 test 3 4 6
in currently i am displaying the following format.
sales order date1 date2 date3
item
description
1.how to fill field catelog.
2. i have written code like below,
wa_lvc_cat-fieldname = 'COLUMNTEXT'.
wa_lvc_cat-ref_table = 'LVC_S_DETA'.
APPEND wa_lvc_cat TO lt_lvc_cat.
wa_fieldcat-fieldname = 'COLUMNTEXT'.
wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO lt_fieldcat.
DESCRIBE TABLE i_final.
DO sy-tfill TIMES.
For each line, a column 'VALUEx' is created in the fieldcatalog
Build Fieldcatalog
WRITE sy-index TO wa_lvc_cat-fieldname LEFT-JUSTIFIED.
CONCATENATE 'VALUE' wa_lvc_cat-fieldname
INTO wa_lvc_cat-fieldname.
wa_lvc_cat-ref_field = 'VALUE'.
wa_lvc_cat-ref_table = 'LVC_S_DETA'.
APPEND wa_lvc_cat TO lt_lvc_cat.
Build Fieldcatalog
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = wa_lvc_cat-fieldname.
wa_fieldcat-ref_fieldname = 'VALUE'.
wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
APPEND wa_fieldcat TO lt_fieldcat.
ENDDO.
create dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_lvc_cat
IMPORTING
ep_table = l_dyntable.
ASSIGN l_dyntable->* TO <dynamictable>.
create structure as structure of the internal table
CREATE DATA l_structure LIKE LINE OF <dynamictable>.
ASSIGN l_structure->* TO <header>.
create structure = structure of the internal table
CREATE DATA l_structure LIKE i_final.
ASSIGN l_structure->* TO <ls_table>.
create field catalog from our table structure
wa_fieldcat-fieldname = 'DATE'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'CNT'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'FUNCT'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'ITEM'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'TRANS'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
*call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_structure_name = <LS_TABLE>
changing
ct_fieldcat = lt_fieldcatalogue
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
*IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*ENDIF.
DESCRIBE TABLE lt_fieldcatalogue.
fill the internal to display <dynamictable>
DO sy-tfill TIMES.
IF sy-index = 1.
READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX 1.
ENDIF.
For each field of it_table
ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <dynheader>.
IF sy-subrc NE 0. EXIT .ENDIF.
READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX sy-index.
Fill 1st column
<dynheader> = wa_fieldcat-seltext_m.
IF <dynheader> IS INITIAL.
<dynheader> = wa_fieldcat-fieldname.
ENDIF.
*filling the other columns
LOOP AT i_final INTO <ls_table>.
l_col = sy-tabix + 1.
ASSIGN COMPONENT sy-index OF STRUCTURE <ls_table> TO <dyndata>.
IF sy-subrc NE 0. EXIT .ENDIF.
ASSIGN COMPONENT l_col OF STRUCTURE <header> TO
<dynheader>.
IF sy-subrc NE 0. EXIT .ENDIF.
WRITE <dyndata> TO <dynheader> LEFT-JUSTIFIED.
ENDLOOP.
APPEND <header> TO <dynamictable>.
ENDDO.
*layout for alv output
lt_layout-zebra = 'X'.
lt_layout-no_colhead = 'X'..
lt_layout-colwidth_optimize ='X'.
lt_layout-window_titlebar = 'ALV GRID TRANSPOSED'.
*alv grid output for display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = lt_layout
it_fieldcat = lt_fieldcat
TABLES
t_outtab = <dynamictable>.
Plz correct me code.here's a sample to prepare a alv-fieldcatalog with many similar value-fields:
*get metadata of itab
DESCRIBE FIELD itab INTO td.
LOOP AT td-types INTO watypes.
READ TABLE td-names INTO wanames INDEX watypes-idx_name.
CHECK sy-subrc = 0.
MOVE wanames-name TO fld-name.
READ TABLE td-names INTO wanames INDEX watypes-idx_help_id .
MOVE wanames-name TO fld-def.
WHILE wanames-continue = '*'.
hindex = watypes-idx_help_id + 1.
READ TABLE td-names INTO wanames INDEX hindex.
CONCATENATE fld-def wanames-name INTO fld-def.
ENDWHILE.
APPEND fld.
ENDLOOP.
*build fieldcatalog
LOOP AT fld.
CLEAR katalog.
katalog-fieldname = fld-name.
IF fld-name = 'RCOMP'
OR fld-name ='GSBER'
OR fld-name ='ITEM'
OR fld-name ='FUNKTION'.
katalog-key = 'X'.
ENDIF.
SPLIT fld-def AT '-' INTO t f.
SELECT SINGLE scrtext_m leng
FROM dd03m INTO: (katalog-reptext_ddic, katalog-outputlen)
WHERE tabname = t
AND fieldname = f
AND ddlanguage = sy-langu.
IF sy-subrc <> 0.
katalog-reptext_ddic = fld-name.
ENDIF.
IF fld-name = 'TXT'.
katalog-outputlen = 30.
ELSEIF fld-name = 'GSBER'.
katalog-outputlen = 4.
ELSE.
katalog-tabname = t.
ENDIF.
*here: different value-fields
IF fld-name BETWEEN 'KSL00' AND 'KSL99'.
IF fld-name <> 'KSL99'.
CONCATENATE 'Periode' fld-name+3(2) '/' jahr INTO
katalog-reptext_ddic SEPARATED BY space.
*hide fields
IF NOT fld-name+3(2) IN buper.
katalog-no_out = 'X'.
ENDIF.
ELSE.
katalog-outputlen = 19.
IF ohnevj = 'X'.
katalog-reptext_ddic = 'Summe'.
ELSE.
*previous year
CONCATENATE 'Periode' buper-low '/' vorjahr INTO
katalog-reptext_ddic SEPARATED BY space.
ENDIF.
ENDIF.
katalog-currency = 'EUR'.
katalog-do_sum = 'X'.
katalog-inttype = 'P'.
katalog-datatype = 'CURR'.
ENDIF.
*hide more fields
CASE fld-name.
WHEN 'GSBER'.
MOVE x_gebe TO katalog-no_out.
katalog-reptext_ddic = 'Gsbr'.
WHEN 'ITEM'.
MOVE x_item TO katalog-no_out.
WHEN 'FUNKTION'.
MOVE x_func TO katalog-no_out.
WHEN 'TXT'.
MOVE x_text TO katalog-no_out.
ENDCASE.
APPEND katalog TO cat.
ENDLOOP.
grx
A. -
How to display data in table with dynamic rows, section wise in a page.
Hello all,
I work on report creation in BI Publisher where I need to display data from xml in a table in pdf format.The output page is divided into two vertical sections , containing tables, with exactly same columns on left and right sections. The number of rows in table depends on the output of the fetching query. The page is to be populated in such a way that, at first, the left table is populated, then the next rows fill up the table on the right section of the page, if more rows are left, they fill up the tables on next page[first the left table, and then the right one, in a similar fashion as in page 1]
On a bird's eye view, the data needs to be simply mapped to a table, with dynamic number of rows, and so can span number of pages depending on size of data. On a implementation level, I am stuck in getting the left section of the page populated first, then the right section[in place of the right page], and then the next page.
Please guide me if someone has any idea in getting this achieved.
Thanks in advance.Thanks for the response...
I am able to get the desired functionality. I just need the tables to be inside a bigger table, that also has a dividing line between the two columns. This is was is intended in the req. provided to me. The column formatting option provides me a line ,but that is not further modifiable .Please help me in getting a perpendicular line between the two columns, which I need to be of a specified width and color.
Maybe you are looking for
-
External hard drive documents not read on a MacBook Pro
Hi all, I use my external hard drive to save a document from another PC computer last week when I plugged it back on my Mac the documents cannot be read on a Mac as it says they are not supports by apps software or search for application that will
-
Is Firefox 4.0 compatible with Zorap (video chat)? I have used it perfectly with Firefox 3, but since I d/loaded 4.0 I am unable to use the program. Is there an option that I must adjust? Would appreciatre your help.
-
Computation or Process ?
Hi there, I have the following values in my variable :P4_Linie -9:TEST1:TEST2:TEST3 Now I know how to convert the ":" into "," and how to replace the -9. The -9 is the "all selector" of a checkbox pluging meaning if all checkboxes are checked the val
-
I have a socket connection that I am sending a pdf file down to an Air Application. If I use HTMLLoader.load then it opens the pdf perfectly. When I user HTMLLoader.loadString it just gives me the makeup data of the file ie %pdf-1.3 etc. I can save
-
Change width of all textfields?
Hi, Let's say that I have 10 textfields on my SubForm. How can I change with javasctipt on initialisation of SubForm(s2) ALL textfields.w = "3in"; s2.w = "3in"; s2.Tekstveld2.w = "3in"; tnx.