Merging of 2 Cells in WD ABAP ALV Header & Dynamically change the header
Hello Experts,
I have two main requirements with respect to WD ABAP - ALV report creation
1) Two feilds in the header of ALV GRID created in the WD ABAP screen must be merged as shown below(Month Column) ,
| January | February |
| Col 1 | Col2 | Col 1 | Col2 |
2) The header value(Month) should dynamically change based on the current date.
For Eg: If June 2011 is the current month , the ALV table should start from June 2011 and displayed till May 2012.
Looking forward for your valuable inputs @ the earliest
Regards,
Sriram
Hi Sriram,
For merging..
Pleaese go through this
Merge of Cells in ALV table in ABAP webdynpro.
ABAP WD: ALV merge cells
For Header Change..
How to set title/text for ALV table column header in WD ABAP
Change column header in ALV to another DDIC Element type
Change label of a column in ALV
Cheers,
Kris.
Similar Messages
-
Alle experts:
In ALV layout report, how to dynamic change the layout int ABAP porgram?
e.g. I have save 5 layout, I need to change them base the my selection in ABAP program? How to do this?
Thanks in advance!Try to call fieldcatlog dymnamically. Refer tofollowing code. Reward if helpful.
REPORT zfir0001 MESSAGE-ID ztax.
Tables
TABLES : glt0, t001, skat.
Internal Tables
DATA: BEGIN OF itab OCCURS 0,
racct LIKE glt0-racct, "Account number
txt20 LIKE skat-txt20, "G/L account short text
co_1000 LIKE glt0-hslvt, "Balance carried forward for company code 1000
co_1100 LIKE glt0-hslvt, "Balance carried forward for company code 1100
co_1200 LIKE glt0-hslvt, "Balance carried forward for company code 1200
DATA : BEGIN OF itab1 OCCURS 0,
bukrs LIKE glt0-bukrs,
waers LIKE t001-waers,
END OF itab1.
DATA : BEGIN OF it_itab1 OCCURS 0.
INCLUDE STRUCTURE glt0.
DATA : END OF it_itab1.
Data Declarations
DATA : w_total LIKE glt0-hslvt,
w_count LIKE glt0-bukrs,
w_flg TYPE c,
lv_count TYPE i.
w_slash TYPE c VALUE ' '.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE tit1.
SELECT-OPTIONS : s_bukrs FOR glt0-bukrs OBLIGATORY,
s_racct FOR glt0-racct OBLIGATORY,
s_ryear FOR glt0-ryear OBLIGATORY,
s_rldnr FOR glt0-rldnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
tit1 = 'Please select:'(004).
TYPE-POOLS: slis. "ALV Declarations
DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
********Geting the selected company code in table itab1****
START-OF-SELECTION.
IF NOT s_bukrs-high IS INITIAL.
itab1-bukrs = s_bukrs-low.
APPEND itab1.
w_count = s_bukrs-low.
DO.
IF s_bukrs-high = w_count.
EXIT.
ELSE.
w_count = w_count + 1.
ENDIF.
SELECT SINGLE * FROM t001
WHERE bukrs = w_count.
IF sy-subrc = 0.
itab1-bukrs = w_count.
APPEND itab1.
CLEAR itab1.
ENDIF.
ENDDO.
ELSE.
itab1-bukrs = s_bukrs-low.
APPEND itab1.
ENDIF.
SELECT * FROM glt0 INTO CORRESPONDING FIELDS OF TABLE it_itab1
WHERE rldnr IN s_rldnr
AND bukrs IN s_bukrs
AND ryear IN s_ryear
AND racct IN s_racct.
SORT it_itab1 BY bukrs.
LOOP AT it_itab1.
AT END OF racct.
w_flg = 'X'.
ENDAT.
SELECT SINGLE txt20 INTO (itab-txt20) FROM skat
WHERE spras = sy-langu
AND saknr = it_itab1-racct.
PACK it_itab1-racct TO it_itab1-racct.
itab-racct = it_itab1-racct.
w_total = it_itab1-hsl01 + it_itab1-hsl02 + it_itab1-hsl03 + it_itab1-hsl04 +
it_itab1-hsl05 + it_itab1-hsl06 + it_itab1-hsl07 + it_itab1-hsl08 +
it_itab1-hsl09 + it_itab1-hsl10 + it_itab1-hsl11 + it_itab1-hsl12 +
w_total + it_itab1-hslvt.
IF w_flg = 'X'.
READ TABLE itab1 WITH KEY bukrs = it_itab1-bukrs.
IF sy-subrc = 0.
SELECT SINGLE * FROM t001
WHERE bukrs = itab1-bukrs.
IF t001-waers = 'JPY' OR
t001-waers = 'HUF'.
w_total = w_total * 100.
ENDIF.
CASE it_itab1-bukrs.
WHEN '1000'.
itab-co_1000 = w_total.
WHEN '1100'.
itab-co_1100 = w_total.
WHEN '1200'.
itab-co_1200 = w_total.
ENDCASE.
COLLECT itab.
CLEAR: itab, w_flg, w_total.
ENDIF.
ENDIF.
ENDLOOP.
SORT itab BY racct.
IF NOT itab[] IS INITIAL.
PERFORM field_cat1.
lv_count = 1.
LOOP AT itab1.
PERFORM field_cat USING itab1-bukrs.
ENDLOOP.
PERFORM display_alv_report .
ELSE.
MESSAGE s000 WITH 'No records Found'(003).
ENDIF.
*& Form display_alv_report
text
FORM display_alv_report .
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
is_layout = gd_layout
it_fieldcat = i_fieldcat[]
i_save = 'X'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "display_alv_report
*& Form field_cat1
text
FORM field_cat1 .
i_fieldcat-col_pos = 0.
i_fieldcat-fieldname = 'RACCT'.
i_fieldcat-seltext_m = 'Account'(001).
i_fieldcat-fix_column = 'X'.
i_fieldcat-emphasize = 'X'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
i_fieldcat-col_pos = 1.
i_fieldcat-fieldname = 'TXT20'.
i_fieldcat-seltext_m = 'Description'(002).
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
ENDFORM. "field_cat1
*& Form field_cat
text
-->XV_BURKS text
FORM field_cat USING xv_burks TYPE char4.
lv_count = lv_count + 1.
i_fieldcat-col_pos = lv_count.
CONCATENATE 'CO_' xv_burks INTO i_fieldcat-fieldname.
i_fieldcat-seltext_m = xv_burks.
i_fieldcat-just = 'C'.
i_fieldcat-no_zero = 'X'.
i_fieldcat-do_sum = 'X'.
APPEND i_fieldcat TO i_fieldcat.
CLEAR i_fieldcat.
ENDFORM. "field_cat
Edited by: dhanashree wadkar on Apr 30, 2008 6:00 AM -
Dynamically change the cell editor in the table control
Hi..
I have 3 columns in a table . of which in one column we need to change the cell editor dynamically at runtime.
i.e for example i have columns as carrid, connid and fldate.
For the first 2 rows the cell editor for the carrid clomn shud be a dropdown and from there on in the next rows for the same carrid column it shud be a input field.
Can experts plz help me how to achieve this as this is very high priority issue....
Regards,
Madhu...This is actaully fairly simple to do. You will need to add a cellVariant to your table column. You can then dataBind a context attribute to the selectedCellVariant property of the column to control which cellVariant will be used. This allows you to control row-by-row which cell editor you want to output.
http://help.sap.com/saphelp_nw70/helpdata/EN/bd/5d9041d3c72e7be10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/56/5e9041d3c72e7be10000000a1550b0/frameset.htm
Also here is an example that I did the other day that uses Cell Variants within ALV. This process is actually a little more complicated because you have to go through the ALV APIs. To do this in a normal table is actually easier because you can create the cellVariant in the layout designer.
Re: Freely-programmed value help for a single ALV cell -
ABAP Query : code to change the display
Hi all,
I have created an Abap Query and generated it. I see the output now as follows:
<u>Bill.doc</u> <u>Item</u> <u>Net value</u> <u>Total amt</u>
900000 10 100 600
900000 20 200 600
900000 30 300 600
900001 10 250 250
900002 10 300 500
900002 20 200 500
Now I want the total amt to be displayed only once for each billing document only for the first item and for the other line items it should be blank as shown below.
<u>Bill.doc</u> <u>Item</u> <u>Net value</u> <u>Total amt</u>
900000 10 100 600
900000 20 200
900000 30 300
900001 10 250 250
900002 10 300 500
900002 20 200
Can someone please explain me where and how I should write the code to get this working?
Thanks,
N
Helpful answers will be awarded for sure.Hi Manohar,
I am getting the total amount from a field which exists in one of the tables which i used in the abap query.
the total amount is appearing correctly...i dont need to modify that. i just need to display it only once for each billing doc for the first item.
i want to know where i should do the coding...i mean in the Infoset or the Abap Program that gets created when i generate the infoset.
Thanks!
N
Message was edited by:
Narmada Mallavaram
null -
HR ABAP - OM Issue (to change the manager for an employee)
Hi Experts,
What is the procedure to follow to change the managerial position for an employee. Is there any function module to change the manager of an employee? Please suggest me how to acheive this..
Thanks,
Sudha.Hi Mohan,
Thanks for the reponse. Is it enough to create a record by giving the new manager position with A012 relation?
Here i am trying to create a record through PP01 transaction.
when i give the relation as A012 and saving the data its not accepting.
And please suggest me the function module (if any) to change this data .
Thanks
Sudha. -
Setting new cell variant for an alv table column
Hi,
I want to set a new cell variant for a column. Therefore I did the following steps:
1. Create an object of CL_SALV_WD_CV_STANDARD
2. SET_KEY( 'CELLVAR1 )
3. set_cell_design([..]-goodvalue_medium )
4. SET_EDITOR( lr_alv_input_field )
After that I added the cell variant to the column by using the method "add_cell_variant".
The last step is to call method SET_SELECTED_CELL_VARIANT.
I checked my program by using get_selected_cell_variant( ) and the return string was okay.
But when the table is displayed, the new cell variant isn't working. I defined an input field as the cell editor for my new cell variant but when the table is shown, it is just text - no input possible. In addition to that the selected cell design (goodvalue_medium , step 3) isn't working. So I think the cell variant is not used.
Can you help me?
Thanks & Regards,
HendrikHi
I wonder if you can help me please, I too am having issues implementing ALV cell changes in WDA?
I am basically trying to dynamically change the individual color of a cell (not the entire column or row) dependant on certain criteria. I apologies but find that you are the closest resource for any potential information. Please see screen shot below.
Currently my code is as follows:
see: www.picasaweb.google.co.uk/dave.alexander69/Pictures#5244416971466907938
data: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
loop at table 1 row data
loop at table columns
for the date columns only...
IF <fs_column>-id(4) = 'CELL'.
get and set column header dates from select option user input - done
loop at table 2 row data (table 2 contains date ranges for row concerned)
MOVE: ls_zdata-variance TO lv_variance.
method 1 - as in sap press WD4A -:
lr_cv = cl_wd_table_standard_cell=>new_table_standard_cell(
view = view
variant_key = lv_variance ).
as mentioned...
CREATE OBJECT lr_cv.
lr_cv->set_key( 'VARIANCE' ).
lr_cv->set_cell_design( '09' ).
lr_cv->set_editor( lr_input_field ).
lr_column->add_cell_variant( lr_cv ).
lr_column->set_cell_editor( lr_input_field ).
lr_column->set_sel_cell_variant_fieldname( 'VARIANCE' ).
lr_column->set_cell_design_fieldname( value = 'COLOR_CELL' ).
lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
the only way I get cell coloring to work - but this is for entire column?
ls_zdata-color_cell = cl_wd_table_standard_cell=>e_cell_design-one.
MODIFY lt_zdata FROM ls_zdata..
ENDLOOP.
ENDIF.
IF <fs_column>-id = 'COLOR_CELL'.
CALL METHOD lr_column->set_visible( EXPORTING value = '00' ).
ENDIF.
ENDLOOP
ENDLOOP.
As you see I am in the dark a bit regarding cell variants and wonder if you can point me in a better direction.
Many thanks for any help,
Dave Alexander -
Message connected to a cell from an editable alv
hi,
is it possible to connect a message (via message manager) with the changed cell in an editable alv? I mean the changed cell should be marked with an "*" for example.
I am working with the ON_CELL_ACTION event with my alv.Yes you can,
If you have access to the element in the context that is bound to the row in the ALV then you can connect the message. Marking a * is not possible by default with the WD message manager and you willl need to do it manually. Use the element method of the message manager API for this purpose. -
Dynamic Change of FieldCatalog in OO ALV Secondary List
Dear All,
i have Scenario like when i go to secondary list on some event, the fieldcatlog for the info is generated. then again i go back and choose some other event, now the secondary fieldcatalog list should contain few extra fields which are not being displayed. i am refreshing the fieldcatalog and filling the fieldcatalog table with new fields everytime. but the system displays only the first generated fieldcatalog.
any ideas what can be done?
Thanks & Regards
RahulHello Rahul
The following sample report <b>ZUS_SDN_TWO_ALV_GRIDS_A</b> shows how to dynamically change the fieldcatalog of the second ALV list depending on which customer has been selected (by double-clicking) on the first ALV list.
*& Report ZUS_SDN_TWO_ALV_GRIDS_A
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
* PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
* PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
REPORT zus_sdn_two_alv_grids_a.
" Dynamic fieldcatalog on second ALV list
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_row TYPE i.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
md_row = e_row-index.
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
* IS_ROW_ID =
* IS_COLUMN_ID =
is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_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.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1,
ls_fcat TYPE lvc_s_fcat,
lt_fcat TYPE lvc_t_fcat.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
CALL METHOD go_grid2->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = lt_fcat.
" Logic of fieldcatalog modification:
" 1st customer selected -> show 1 column only
" 2nd customer selected -> show 2 columns only
" 3rd customer selected -> show 3 columns
LOOP AT lt_fcat INTO ls_fcat.
IF ( syst-tabix <= ld_row ).
ls_fcat-no_out = ' '.
ELSE.
ls_fcat-no_out = 'X'.
ENDIF.
MODIFY lt_fcat FROM ls_fcat.
ENDLOOP.
go_grid2->set_frontend_fieldcatalog( lt_fcat ).
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
I have make a Merge file from Pages. When I go to print this, the Header and Graphic is only printing on every other page. Can anyone advise?
That is very hard to follow.
We have no idea what you are merging, nor what header or graphic you are referring to as we can not see the document.
My guess is that you are talking about something like a letterhead which has a logo and address only on the first page and none on the following pages.
Each merge is probably running over the 1st page and onto a following blank page. If you want the "Header and Graphic" to appear on subsequent pages as well then you will need to create master pages/objects for the following pages to suit.
This is how you go about doing it for a standard letterhead and follower:
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=182&highlight=letter head&mforum=iworktipsntrick
Just add the graphics to the follower pages as well.
Peter -
WD4A with ALV, populating the header with values from the table
I have WDA application that list schedule agreement headers in one ALV and when you select one the line items show in the second ALV2 below. We show quantity and net value in 13 monthly buckets beginning with the validity data. The function returns the month text in columns I want to change the header based on the months returned. So instead of QNTY1, QNTY2 it would be 01/2008, 01/2008 etc. But ALV2 is initialized when the page is built and if I change the ALV2 settings after the line item function call they are not updated. On the page. Is there anyway I can do this???
It tried put the code in the EXECUTE function method, and I tried WDMODIFYVIEW but the ALV is not refreshed.
Thanks
DavidThanks for your help, I know I am probably doing something dumb but it is driving me crazy.
I have debugged I can see the text change in the debugger but it doesn't show up on the screen. I removed the code from from the WDDOINIT. So am doing everything in the ONACTIONGETDETAIL to ensure that it is not being overwritten. I can change the 'number of lines', remove print button, change a field to an icon etc, but the column header doesn't change. If I put the same code in the WDDOINIT the column header does change. Everything else works in both places.
*First ALV config
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
DATA lo_value TYPE REF TO cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model( ).
*activate extended functions of the alv.
cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
r_model = lo_value ).
lo_value->if_salv_wd_table_settings~set_visible_row_count( '10' ).
lo_value->if_salv_wd_table_settings~set_selection_mode( '06' ).
lo_value->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
DATA lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA lr_column TYPE REF TO cl_salv_wd_column.
DATA lr_column_header TYPE REF TO cl_salv_wd_column_header.
lr_column_settings ?= lo_value.
lr_column = lr_column_settings->get_column( 'VBTYP' ).
lr_column->delete_header( ).
lr_column_header = lr_column->create_header( ).
lr_column_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none ).
lr_column_header->set_text( '200708' ).
*change column to icon
lr_column = lo_value->if_salv_wd_column_settings~get_column( 'AUART_DESC' ).
CREATE OBJECT lr_image.
lr_image->set_source_fieldname( 'AUART_DESC' ).
lr_column->set_cell_editor( lr_image ). "Display images in column
Thanks again.
David -
When I try to add the SUM formula to H1 and press ENTER, the formula automatically moves to every cell within column H and disappears from H1. If I instead press the Function icon then SUM, while in the H1 cell, the formula automatically moves to the last cell in the H column.
It seems that you discovere the wonderful feature which was dropped by iWork '09.
Applying a Formula Once to Cells in a Column or Row
When a table has header cells, you can use them to quickly apply a formula to all the
cells in a row or column. The values in the cells are recomputed using the formula. This
formula is called a header formula.
To apply a header formula to cells in a column or row:
1 Select the header cell for the column or row.
2 Open the Formula Editor. For example, type the equal sign (=).
3 Type the formula you want to apply to each cell in the column or row.
For example, to assign values to the cells of column C that are five times greater than
the corresponding cell in column B, you’d use the formula B*5 or B:B*5.
The formula is duplicated in all the cells in the column or row. In this example, cell C4
would contain the value computed by using the formula B4*5.
4 Click the Accept button or press Return or Enter to save the formula.
Yvan KOENIG (VALLAURIS, France) jeudi 8 septembre 2011 19:01:05
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
Issue regarding cell action in webdynpro for abap alv
hello gurus,
i have one requirement in webdynpro for abap alv.i have one alv table in that i have one coloun employee name.
for that i have provided F4 help and that is editable field.if i select value from F4 help it is getting value correctly and it is showing properly at the same time it is allowing values entered manually insted of from F4 help.but as per my requiremnet it should not allow any manually entered values.how can i get this functinality. i am not aware indepth od WDA.
could you go through my isssue and could you revert me some solution.
thanks in advance.Hi,
I dont think this is possible because when you can change the value using F4 then it would obviously be
possible to enter manually.
You can try using a drop down instead because in drop down you cannot enter values manually,
But this would be good if the values that can be shown in drop down are very low, if the values are more
then again user will face problems selecting values.
Else you can try out what srinivas suggested, But dont know whether we can have two cell editors at a time
inside a single cell of ALV. Please post the answer if you have found any other way to do it. -
Web Dynpro for ABAP alv table cell color
Hello,
I have a question about Web Dynpro for ABAP and ALV. I want to change the color of one cell as yellow. how to do it??in that method possible colors are
cellDesign: badvalue_dark
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-BADVALUE_DARK
cellDesign: badvalue_light
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-BADVALUE_LIGHT
cellDesign: badvalue_medium
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-BADVALUE_MEDIUM
cellDesign: criticalvalue_dark
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-CRITICALVALUE_DARK
cellDesign: criticalvalue_light
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-CRITICALVALUE_LIGHT
cellDesign: criticalvalue_medium
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-CRITICALVALUE_MEDIUM
cellDesign: goodvalue_dark
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GOODVALUE_DARK
cellDesign: goodvalue_light
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GOODVALUE_LIGHT
cellDesign: goodvalue_medium
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GOODVALUE_MEDIUM
cellDesign: group_level1
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GROUP_LEVEL1
cellDesign: group_level2
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GROUP_LEVEL2
cellDesign: group_level3
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GROUP_LEVEL3
cellDesign: key_medium
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-KEY_MEDIUM
cellDesign: negative
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-NEGATIVE
cellDesign: positive
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-POSITIVE
cellDesign: standard
CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-STANDARD
not able to set column color as yellow.... -
what are the sub gropus in ALV reports and how to display them?
The commonly used ALV functions used for this purpose are;
1. REUSE_ALV_VARIANT_DEFAULT_GET
2. REUSE_ALV_VARIANT_F4
3. REUSE_ALV_VARIANT_EXISTENCE
4. REUSE_ALV_EVENTS_GET
5. REUSE_ALV_COMMENTARY_WRITE
6. REUSE_ALV_FIELDCATALOG_MERGE
7. REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_GRID_DISPLAY
9. REUSE_ALV_POPUP_TO_SELECT
Also refer this for some explanations
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : H header, S selection , A - action
Key : only when typ is S.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using REUSE_ALV_FIELDCATALOG_MERGE.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
regards,
srinivas
<b>*reward for useful answers*</b> -
hi folks,
i use an wd abap alv with hierarchy, on EVENT CLICKED on a CELL never gives me the correct R_PARAM->INDEX back as it does without hierarchy.
how can i find out the exactly row which is behind the clicked cell?????
kind regards,
oliverHi Oliver,
Hierarchy is one type of setting in WD ABAP not like in normal ALV. I think there is no way to set the lead selection index in the case of Hiearchy, why becuase you can able to select only the leaf nodes only not all the nodes in the hiearachy. For the leaf nodes you can make the lead selected node. Just try to access the leaf node and find out that how you are accesing depending on that you can set the leaf node as selected.
1. This is link to ALV tutorial, ALV Demo
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9
There are some standard examples also,
2.Please refer to Package called as SALV_WD_DEMO .In this you will get ample of sample examples about ALV .
3. Please search in SDN library you will ALV in WD ABAP you will get many pdfs avilable that will guide you to develope ALV application in WD ABAP.
Hope this will help you.
Cheers,
Darshna.
Maybe you are looking for
-
Start/stop the OMS Services on Same Host
Hi, I have OMS, Repository database and Agent on the same host..... I want to stop and start the services... ========================== FOR Shutdown ===================================== Stop the Agent $cd $ORACLE_HOME/agent10g/bin/emctl stop agent s
-
Hi, I am new to developement Of forms in ABAP HR, Using PE51 Tcode. Can anybody help me to make a form using this TCode. Thanks n Regards, LakshmiNarayan
-
Exporting and Importing Specific Folders in Discoverer
Hi, Can any one tell me how to export and import specific folders in Discoverer using command line.I tried using discoverer admin but the while importing the folders it is going to orphan folders. you help appreciated
-
Adobe form with 2 copies, different headers
Hi gurus, I've created a form that needs to be printed in two copies. I want the header data (a simple text field) to be different each time. I wanted to see if this is possible with the following restrictions: The printing program cannot be changed
-
App aNote continual repurchase
I have been charged for downloading the app aNote 3 times now. The most recent one was a HD version so maybe this is a newer version that I mistakenly selected thinking that it was the same app. They need to display a warning that the apps they sell