Dynamic Columns in table /ALV
Hi ,
I need to decide number of columns at run time out of fixed number of coulmn in table.
one way of doing it through ALV column hiding but problem is what ever coloumns I hide programeticaly user can always to go ALV settings and unhide them and that defeats the purpose.
is there any otherway I can determine my number of columns dynamicaly.
It can be a table or ALV table.
Thanks
Gaurav
Hi gaurav,
In d Do_init method ,
read the table following table
data : ls_function TYPE salv_wd_s_a_function_ref,
Disable Setting on ALV
READ TABLE wd_this->alv_config_table->
if_salv_wd_function_settings~t_functions
INTO ls_function
WITH KEY id = 'SALV_WD_SETTINGS'.
IF sy-subrc = 0.
ls_function-r_function->set_visible( cl_wd_uielement=>e_visible-none ).
ENDIF.
reward If Usefull
Similar Messages
-
Hello friends,
Can any1 pls tell me if there is a function module available which can be used for dynamic column change in ALV.
Pls also elaborate how to use it.....While filling the field catalog you can specify witht IFcondition.
Just see a example below...
FORM field_fill USING pt_fieldcat TYPE slis_t_fieldcat_alv.
DATA : ls_fieldcat TYPE slis_fieldcat_alv,
pos TYPE i VALUE 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'C_ICON'.
ls_fieldcat-seltext_m = 'Change Status'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'BUKRS'.
ls_fieldcat-ref_fieldname = 'BUKRS'.
ls_fieldcat-ref_tabname = 'ANLA'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'ANLN1'.
ls_fieldcat-ref_fieldname = 'ANLN1'.
ls_fieldcat-ref_tabname = 'ANLA'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'ANLN2'.
ls_fieldcat-ref_fieldname = 'ANLN2'.
ls_fieldcat-ref_tabname = 'ANLA'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
IF p_farea = 'X'. " Conditional Based OUTPUT
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'GRUFL'.
ls_fieldcat-ref_fieldname = 'GRUFL'.
ls_fieldcat-ref_tabname = 'ANLA'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'GRUFL_N'.
ls_fieldcat-seltext_l = 'New Floor Area'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ENDIF.
IF p_ldate = 'X'. " Conditional Based OUTPUT
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'LEABG'.
ls_fieldcat-ref_fieldname = 'LEABG'.
ls_fieldcat-ref_tabname = 'ANLA'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'LEABG_N'.
ls_fieldcat-seltext_l = 'New Lease St.Date'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ENDIF.
ls_fieldcat-col_pos = pos.
ls_fieldcat-fieldname = 'MESSAGE'.
ls_fieldcat-seltext_l = 'Status Message'.
ls_fieldcat-tabname = 'IT_OUTPUT'.
APPEND ls_fieldcat TO pt_fieldcat.
CLEAR ls_fieldcat.
pos = pos + 1.
ENDFORM. " field_fill
Regards
Gopi -
Adding dynamic columns in Table Control
Hi All,
Can we add dynamic columns in a table control? The requirement is something like this. When the user clicks a button it should add a column to the table. Also is it possible for the same column to refer to different fields of the Internal Table of the Database table. Example. The first row in the table control must refer to MARA-MATNR and the second row must refer to MAKT-MAKTX.
Regards,
SudhindraHello Sudhindra,
If you know all the columns that the table control will ever contain, then I suppose it is possible to add and delete the columns dynamically.
What cannot be dynamic, is the determination of which coulmn would be displayed in the table control.
To elaborate, In SE51, you have to define the table control with all the possible columns. In the program, during the PBO, you can choose to hide some of these columns. When the user performs certain action (PAI), you can determine which opf the hidden columns would be displayed in the table control after the next PBO.
Coming to your second requirement, I don't think it is directly possible in case of table conrols. You will have to do some manipulation to achieve it. But even if you can I think you should not. Because, It is not elegant from a good-UI design perspective. ANd during the course of the necessary manipulations, we might have to forgo some of the features like Automatic Field Validation, Automatic Input Help etc. You can use ALV for the same.
Please be judicious in deciding which approach to consider and if you run into some more problems, please do get back with some more details like how many columns you have, how many different row-types do you want, what are the features for the fields that you wish to provide (eg. F4 help) an so on...
Regards,
Anand Mandalika. -
Dynamic Column Names - Table Maintenance - SM31
Hey Everyone - I hope you are all having a good day )
Basically I have a custom Z table containing a number of different fields. I have created table maintenance for this table so it can be updated via SM31. This table is a generic mapping table that will be used for all mappings.
What I want to do is change the name of the columns based on x criteria when maintained in SM31. So for example.
The user chooses to edit line one, through SM31- for Company Code 123 - at this point I want to change the name of Columns 1 through 5 to relevant names for that Company Code. e.g A, B, C, D, E respectively. If the User chooses Company Code 567 then the names of Columns 1 through 5 will be something else. e.g. F, G, H, I, J respectively.
In the PBO of the overview screen I have implemented code to process this behaviour. From here I can hide fields etc etc. However I dont know where to change the actual Columns names to what I want them to be - i.e overwrite the Field Name coming in from the data element.
I would be very appreciative if anyone could help out on this. As always, thanks for taking the time to read this and I look forward to hearing from you.
Kind Regards
DamienWhen system generates the Table Maintenance, it creates LABEL (text fields) for the column heading in the table control and we can't control this labels from our program. These Label names are as like
*tablename-fieldname E.g. *ZTEST_TAB-FIELD1
So, you can replace these labels with Input Output Text field.
Make sure you give the same name as respective label's name.
Make these fields as "Output Only".
Now, you would be able to change the value of these fields from the PBO.
Word of caution: These of changes would go away if try to recreate the table maintenance.
Regards,
Naimesh Patel -
Dynamic columns in table control
hi,
I need to add some fields in table control in run time based on conditions given.I need to use CXTAB related ones.
Can anyone help me with some related codes with CXTAB.
Edited by: Ramya Ramya on Mar 8, 2011 11:21 AMPROCESS BEFORE OUTPUT.
module operation.
loop at i_vbap into wa_vbap with control tc.
MODULE STATUS_0100.
endloop.
module clear.
PROCESS AFTER INPUT.
loop at i_vbap.
module modify.
endloop.
field VBAK-VBELN MODULE USER_COMMAND_0100 on request.
module sub.
include mzsanpracticetop . " global Data
* INCLUDE MZSANPRACTICEO01 . " PBO-Modules
* INCLUDE MZSANPRACTICEI01 . " PAI-Modules
* INCLUDE MZSANPRACTICEF01 . " FORM-Routines
*& Module STATUS_0100 OUTPUT
* text
module status_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
move-corresponding wa_vbap to vbap.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
module user_command_0100 input.
case ok_code.
when ''.
*if tc-lines ne tc-current_line.
if lv_lines is initial.
select vbeln
erdat
posnr
matnr
matwa
matkl
arktx
from vbap
into corresponding fields of table i_vbap
where vbeln = vbak-vbeln.
*and erdat = vbak-erdat.
move : sy-dbcnt to tc-lines.
endif.
when 'SUB'.
delete i_vbap where mark eq 'X'.
tc-lines = tc-lines - tc-current_line.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Module operation OUTPUT
* text
module operation output.
describe table i_vbap lines lv_lines.
if tc-lines eq 0.
tc-lines = 1.
endif.
endmodule. " operation OUTPUT
*& Module modify INPUT
* text
module modify input.
clear lv_lines.
describe table i_vbap lines lv_lines.
if lv_lines ge tc-current_line.
if wa_vbap-mark eq 'X'.
v_index = tc-current_line .
endif.
modify i_vbap from wa_vbap index tc-current_line.
else.
if wa_vbap-mark eq 'X'.
v_index = tc-current_line .
endif.
append wa_vbap to i_vbap.
clear wa_vbap.
endif.
endmodule. " modify INPUT
*& Module clear OUTPUT
* text
module clear output.
clear : ok_code,
v_index.
endmodule. " clear OUTPUT
*& Module sub INPUT
* text
module sub input.
case ok_code.
when 'SUB'.
delete i_vbap where mark eq 'X'.
tc-lines = tc-lines - tc-current_line.
when 'ADD'.
*loop at i_vbap.
if v_index is not initial.
insert initial line into i_vbap index v_index.
else.
get cursor " field v_fname
line v_line
area v_area.
move : v_line to v_index.
v_index = v_index + 1.
insert initial line into i_vbap index v_index.
endif.
* endloop.
tc-lines = lv_lines + 1.
endcase.
endmodule. " sub INPUT
understand and use it -
Variable Columns Dispaying in ALV Report
Hi ,
I am working on ALV report . I am displaying 40 static fields and variable fields . Those varaible fields dependent on internal table . In the internal table 3 fields are available
if it contains 1 row then in report variable fields are 3 OR
if it contains 2 rows then in report variable fields are 6 OR
if it contains 3 rows then in report variable fields are 9 OR
if it contains n rows then in report variable fields are 3n.
Example : 1) Internal table have 3 fields sd_active , sd_close , sd_term .
Internal table is i_a936 , Work area w _a936 .
w_a936-sd_active = 'A1'.
w_a936-sd_close = 'B1'.
w_a936-sd_term = 'C1'.
append w_a936 to i_a936.
w_a936-sd_active = 'A2'.
w_a936-sd_close = 'B2'.
w_a936-sd_term = 'C2'.
append w_a936 to i_a936.
Then in final internal table it should display 6 columns like w_final-sd_Active1 ,w_final-sd_close1,w_final-sd_term1 , w_final-sd_Active2 ,w_final-sd_close2,w_final-sd_term2 . Columns in Internal table varies from i_a936 rows .
I am trying to use Dynamic internal table .
Regards
Srihari NerellaHi,
I think this may help you . Use CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
see the link
Dynamic fields to be displayed in ALV
Dynamic column change in Alv
Dynamic Number of Columns in ALV -
Hi All,
The requirement is to display columns in the form dynamically based on the user input. For example if a country is chosen, each of the states is to come as a column. So based on the country, the no. of states is likely to change. This would call for dynamically changing the no. of columns in the smartform based on the country chosen. Is this possible to achieve in smartforms?
Regards,
Divya.You cannot have dynamic columns in smartform instead create all the required columns and display them based on the conditions passed from the program.
Refer the link -
Re: smartforms - dynamic column of tables
Regards,
Amit
Reward all helpful replies. -
ALV with multiple header & dynamic columns
Hello All,
I have a requirement where in I need to print multiple header in alv.
For eg.
User Name : <Name_1>
Channel : <Channel_1>
Sale Org : <Sales Org_1>
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
User Name : <Name_2>
Channel : <Channel_2>
Sale Org : <Sales Org_2>
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
no of columns (Col1 , col2 ) are dynamic . Which would be the best alv type do I need do use? Is it possible using simple alv grid display. How to handle dynamic column.
Thnx.it is not possible with normal grid or list.
I guess it is possible by using ALV Block list
Modified below program to get mutiple header
REPORT z_alv_block_list.
Type-pools
TYPE-POOLS: slis.
Data declarations.
DATA: BEGIN OF t_vbak OCCURS 0,
vbeln TYPE vbeln,
bstnk TYPE vbak-bstnk,
erdat TYPE vbak-erdat,
kunnr TYPE vbak-kunnr,
END OF t_vbak.
DATA: BEGIN OF t_vbap OCCURS 0,
vbeln TYPE vbeln,
matnr TYPE vbap-matnr,
netpr TYPE vbap-netpr,
waerk TYPE vbap-waerk,
kwmeng TYPE vbap-kwmeng,
meins TYPE vbap-meins,
END OF t_vbap.
DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
DATA: v_repid TYPE syrepid.
DATA: s_layout TYPE slis_layout_alv.
DATA: v_tabname TYPE slis_tabname.
DATA: t_events TYPE slis_t_event.
start-of-selection event.
START-OF-SELECTION.
v_repid = sy-repid.
Get the fieldcatalog for the first block
PERFORM get_fieldcat1 CHANGING t_fieldcatalog1.
Get the fieldcatalog for the second block
PERFORM get_fieldcat2 CHANGING t_fieldcatalog2.
Get the data for the first block
SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
INTO TABLE t_vbak
FROM vbak WHERE vbeln > '0060000100'.
Get the data for the second block
SELECT vbeln matnr netpr waerk kwmeng meins UP TO 10
ROWS
INTO TABLE t_vbap
FROM vbap WHERE vbeln > '0060000100'.
init
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
First block
v_tabname = 'ITAB1'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = s_layout
it_fieldcat = t_fieldcatalog1
i_tabname = v_tabname
it_events = t_events
TABLES
t_outtab = t_vbak.
Second block
v_tabname = 'ITAB2'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = s_layout
it_fieldcat = t_fieldcatalog2
i_tabname = v_tabname
it_events = t_events
TABLES
t_outtab = t_vbap.
*Display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
FORM GET_FIELDCAT1
Get the field catalog for the first block
FORM get_fieldcat1 CHANGING lt_fieldcatalog TYPE
slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
Order number
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'VBELN'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Customer purchase order.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'BSTNK'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'BSTNK'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Creation date.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'ERDAT'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Customer
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'KUNNR'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
ENDFORM.
FORM GET_FIELDCAT2
Get the field catalog for the second block
FORM get_fieldcat2 CHANGING lt_fieldcatalog TYPE
slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
Order number
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'VBELN'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Material number
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'MATNR'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Net price
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'NETPR'.
s_fieldcatalog-cfieldname = 'WAERK'.
s_fieldcatalog-ctabname = 'T_VBAP'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Currency.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'WAERK'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'WAERK'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Quantity
s_fieldcatalog-col_pos = '5'.
s_fieldcatalog-fieldname = 'KWMENG'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'KWMENG'.
s_fieldcatalog-qfieldname = 'MEINS'.
s_fieldcatalog-qtabname = 'T_VBAP'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
UOM
s_fieldcatalog-col_pos = '6'.
s_fieldcatalog-fieldname = 'MEINS'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'MEINS'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
ENDFORM. -
Display dynamic columns in ALV
Hi All,
I have a requirement in which I have develop a report displaying material master basic data and classification data. The basic data I am getting from MARA and MAKT tables. And for classification data I am getting the class maintained from each material from tables INOB,KSSK and from KLAH, then I am getting the characteristics and its values by calling BAPI u2018BAPI_OBJCL_GETDETAILu2019 for each material .
Now I have to prepare ALV having column name for basic data (would be static) and characteristic name (would be dynamic, and I have to display characteristics values under it, for each material ).
For example: if material u2018CHWOJA4u2019 has 2 characteristics as u2018country (value u2018Franceu2019)u2019 and u2018creation season(value u2018Decu2019)u2019 and second material u2018E50480u2019 has 3 characteristics as u2018Abacus (value u2018yesu2019)u2019 ,u2018country (value u2018Indiau2019)u2019 and u2018 season(value Jank)u2019 , the ALV output would be :
Material Number; Material description; Base Unit of Measure;Material Group; Abacus; Country;season
CHWOJA4; JACKET;PC;Z05; ; France;Dec
E50480;BRAZIL REAL;PC;Z06; yes; India;Jan
In short, my last column of the ALV would be the characteristic name and the content would be the char. value.
Can you please suggest some ways to achieve this? A quick reply would be highly appreciated!
Thanks,
VanithaIdea here is to have many fields for characterstic values in your output internal table.
For eg.
types : Begin of ty_mara,
matnr type matnr_d,
mtext type mktxt,
char1 type string,
char2 type string,
char20 type string.
Check for all the materials which has the maximum characterstic values. So, say for a material, there are 12 characterstics values and that is the maximum compared to anyother materials. Then in the field catalog hide the columns related to charactertics CHAR13 onwards till CHAR20.
Note : I have assumed char20 as the max., which you can alter based on your scenario.
Regards
Ranganath -
Hi Folks,
can any body please give some input on the follwoing.
i want to display material created by and material
created on for each material based on material selection
from selction screen dynamically.
like s_mat = 1, 2,3.
o/p must be
mat1 |creted by | creted on| mat2 |creted by | creted on|mat3 |creted by | creted on|
like if iam inputting 3 materials i need 3*3 = 9 columns in my alv grid o/p.
I have alreaady searched SDN I am not gettting any thing related to my requirement, please post some sample caode as I am new ot OOABAP.
Thanks,
Shwetha.
Moderator message : Not enough re-search before posting, specification dumping not allowed. Thread locked.
Edited by: Vinod Kumar on Nov 24, 2011 1:31 PMmethod handle_data_changed.
data: ls_good type lvc_s_modi,
li_diff type i,
value type p DECIMALS 3,
old_value type p DECIMALS 3,
lw_outtab1 type gt_tab.
clear value.
loop at er_data_changed->mt_good_cells into ls_good.
value = ls_good-value.
old_value = ls_good-value.
if value lt 0 or value gt 1.
MESSAGE 'Value is out of range' TYPE 'I'.
Read table gt_outtab1 into lw_outtab1 index ls_good-row_id .
perform show_alv.
clear ls_good.
ENDIF.
ENDCASE.
ENDLOOP.
I again created the table.. actually data is not changed in the internal table but still it shows the changed value in the alv grid. even in build the table again and call the refersh alv grid method.. -
halo fellow SAPiens,
i need to show dynamic columns for a particular material........the scenario is as follows....
1) there r 7 fixed columns describing the material...
2)when the material returns back to the plant for some reason , i need to insert a column which shows the date and reason(char) of return.
3)again after dispatching the material for some reason it comes back again a new column shld be displayed showin the date and reason(char).
4)if the material doesnt come back...the report shows only 7 columns.
any solution?try <a href="http://www.alvrobot.com.ar/home.php">here</a> ......its a useful tool for dealing with ALV
<b>reward points if useful</b> -
Multiple dynamic column in cross table
Hi all,
I have a cross table which stored the sale's quantity and amount.
The layout in view result likes below:
saler quantity1 quantity2 quantity3 quantitysummary amount1 amount2 amount3 amount4 amountsummary
S3 100 20
S2 50 30
S1 300 40
The layout in view structure likes below:
saler quantity quantitysummary amount amountsummary
S3 100 20
S2 50 30
S1 300 40
the quantity1...n and amount1...n columns is not fixed.the 2 columns is dynamic.
It's easy that only one column is dynamic,but now there are two columns is dynamic,I don't know how to achieve it.
Has anyone an idea how to accomplish this?
Thank you trying to help me!You cant do this on BO , you can add static columns but if you put some dynamic column in the left or right i turns dynamic...
Regards -
Pivot Table with Dynamic Columns and Headers
Hello,
I'm trying to pivot a table of data where the column headers will be dynamic. While I know how to pivot the table to get what I want how will I be able to pick up the table column header from the Pivot to display in the report?
For example:
Unpivoted data is Employee Code, Branch Code, Problem Code, # of Problems.
There is many records for a given Employee and Branch that I want to pivot so the Column headers are the Problem Codes and the data below is the SUM(num_problems) for that Problem.
So the data may look like this for Tech Bob, Branch NY.
Problem = LEAK, Num_problem = 5
Problem = DAMAGE, Num_problem = 2
Problem = OTHER, Num_problem = 3
Which problem codes may appear is unknown but selecting the DISTINCT(problem) across all techs gives me the column headings to use.
So if I pivot this data, I get this Row:
Tech = Bob, Branch = NY, DAMAGE = 2, LEAK = 5, OTHER = 3
So first can SSRS handle having dynamic columns? Only Tech and Branch are known and the remaining columns are dynamic based on how many Problems they worked on.
Second, how can I set the column heading in my Tablix to be the Problem Code?
SherryYou just need to use a matrix container
Use EmployeeCode and BranchCode for row group
ProblemCode as column group and SUM([No Of Problems]) as the data expression and it will generate the columns for you based on ProblemCode values automatically.
See an example here
Sample Matrix
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
HOW to add Dynamic Columns in ADF Faces CORE Table
In ADF im going to display the dynamic column in Coretable,
Header are displaying very fine. but im unable to display rows sucessfuly,how to resolve.
Second thing is that JSF page isn't getting the value from dataList, whats wrong in JSF code.
// JSF PAGE CODE
<af:table binding="#{backing_test1.table1}" id="table1"
value="{backing_test1.dataList}" var="myRec"/>
public void setTable1(CoreTable table1) {
this.table1 = table1;
public CoreTable getTable1() {
//create this table
table1 = new CoreTable();
CoreColumn dynamicCol;
CoreOutputText outText;
Application app=FacesContext.getCurrentInstance().getApplication();
DCIteratorBinding iter = (DCIteratorBinding)bindings.get("listAllMonthsIter");
RowSetIterator rsIter = iter.getRowSetIterator();
rsIter.reset();
Row row;
while (rsIter.hasNext()) {
row = rsIter.next();
String header = (String)row.getAttribute("element");
// element contain the value JAN, FEB...
dynamicCol = new CoreColumn();
dynamicCol.setHeaderText(header);
String currRec = table1.getVar();
outText = new CoreOutputText();
ValueBinding vb = app.createValueBinding("#{myRec.value}");
outText.setValueBinding("value",vb);
outText.setRendererType("Text");
dynamicCol.getChildren().add(outText);
table1.getChildren().add(dynamicCol);
public void setDataList(List dataList) {
this.dataList = dataList;
public List getDataList() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("listAllMonths");
if (operationBinding == null)
return null;
List dataList = (Vector)operationBinding.execute();
return dataList;
}Well issue is that
I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
and in an other page i need a data table having these fruits as coulmns and their details as rows...
how to achieve this..
we can not guess the number of columns before time.. so can make the estimate and hide them. -
How to Freeze Dynamic arrangement of columns in tables a Pivot in OBIEE 11g
HI
I am using OBIEE 11g .
Reports are displayed in dashboards. I want to disable dynamic arranging feature of columns in tables & Pivot table.How to do that.
Thanks
AbdulHi,
Kindly do the below changes in your end..please go to your obiee11g installation folder under
BI11g\Oracle_BI1\bifoundation\web\msgdb\messages\answerstemplates.xml find it the take back up and Edit the copy of the file and
Search with "Sortable" keyword in kuiCriteriaDefaultViewElementsMask element but I'm not sure sortable="False" then restart it
Note: it will afftect entire answres report.
Thanks
Deva
Maybe you are looking for
-
Restriction on date when date is in the rows
Hello and Nappy New Year. I have a problem to create the report based on the business requirements. The report should be based on the General Ledger DSO present two columns: total for the day and total for the previous day (both for the same, selecte
-
This iPod is not under warranty anymore, unfortunately, but I've noticed that it has had a few problems since I got it, but it was never this bad until just recently. The iPod touch screen will not respond to touch in a vertical row on the left side
-
Odd GUI mouse pointer behavior
I have noticed since Lion came out the ability to resize from any window edge has seemed to have brought with it a minor annoyance. The mouse pointer form persists as an up-pointing arrow after the pointer leaves the bottom edge of an application if
-
Trying to install Flash Player on MAC OS X ver. 10.7.1 LION
Many times I've tried installing all the latest versions of Flash Player, but still when running the installing process, it always stops at appr. 4%.
-
i have a jtree, and i want to show some data depending on the level of the tree, for example when i am on level 4 i want to show a comment or when i am on level 2 i want get some data from the database, the issue is the getLevel() function Returns th