How to Gray out a row in ALV ?
Hi Experts,
I am having a requirement to gray a specific row in ALV . Is it possible through List Display ? Or Is it possible through Grid Display ?
If it is possible, please let me know how to achieve this .
Thanks and regards,
Kiran.
Hello kiran kumar ,
you can colour a cell in AlV ie. in turn you can colour entire row in one Colour...just check out the blew given link
http://wiki.sdn.sap.com/wiki/display/Snippets/ColorindividualcellsofanALVGRID
Hope it helps.
Similar Messages
-
How to delete a particular row in ALV table
Hi,
How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
Thanks
Bala DuvvuriHello Bala,
Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
data : lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_config TYPE REF TO cl_salv_wd_config_table.
lr_table_settings ?= lr_config.
** Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
Next delete the selected rows in the action triggered by the button:
METHOD onactiondelete_rows .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_node1 TYPE ig_componentcontroller=>elements_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
row_number TYPE i VALUE 0.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
CALL METHOD wd_node->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_node1.
wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.
If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
Regards,
Uday -
How to find out the rows inserted between a time period.
Hi,
Please help me to solve this.
Table - emp.
Colmns - empno(Primary Key),ename, mgr
How to find out the rows inserted between a time period.
For eg:- Between 02-Oct-2006 1 PM and 03-Oct-2006 2 PM.
regards,
Mathew.Hi,
Maybe work:
For each row, ORA_ROWSCN returns the conservative upper bound system change number (SCN) of the most recent change to the row. This pseudocolumn is useful for determining approximately when a row was last updated. It is not absolutely precise, because Oracle tracks SCNs by transaction committed for the block in which the row resides
e.g.:
SGMS@ORACLE10> create table test(cod number);
Table created.
SGMS@ORACLE10> insert into test values (1);
1 row created.
SGMS@ORACLE10> insert into test values (2);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> insert into test values (3);
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> select SCN_TO_TIMESTAMP(ora_rowscn),ora_rowscn,cod from test;
SCN_TO_TIMESTAMP(ORA_ROWSCN) ORA_ROWSCN COD
06/11/06 08:56:56,000000000 727707205 1
06/11/06 08:56:56,000000000 727707205 2
06/11/06 08:57:05,000000000 727707210 3Cheers -
How to edit only some rows in ALV
Hi Experts,
I have editable ALV. I need to allow edit only for some rows, not generaly all of them.
Do you have any idea how to do it?
I use ALV through FM module REUSE_ALV_GRID_DISPLAY.
Thenks®ards,
JirkaHi,
You need to use events. Sample code from sdn.
TYPE-POOLS:SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
data: begin of it_chg occurs 0,
index type sy-tabix,
end of it_chg.
DATA: X_EVENTS TYPE SLIS_ALV_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
NAME(10) TYPE C,
ZTERM TYPE C,
END OF ITAB.
PERFORM FILL_TABLE.
loop at itab where zterm = 'A'.
it_chg-index = sy-tabix + 3.
" addition 3 IS FOR FIELD LABELS
append it_chg.
clear it_chg.
endloop.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
**fieldcatalog
X_FIELDCAT-FIELDNAME = 'NAME'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'ZTERM'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
**events
REFRESH:IT_EVENTS.
CLEAR:X_EVENTS,IT_EVENTS.
X_EVENTS-NAME = SLIS_EV_END_OF_LIST.
X_EVENTS-FORM = 'MODIFY_LIST'.
APPEND X_EVENTS TO IT_EVENTS.
CLEAR X_EVENTS.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
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.
*& Form FILL_TABLE
text
FORM FILL_TABLE.
ITAB-NAME = 'vijay'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ABC'.
ITAB-ZTERM = 'B'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'TEST'.
ITAB-ZTERM = 'C'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'DILIP'.
ITAB-ZTERM = 'D'.
APPEND ITAB.
clear itab.
ITAB-NAME = '123'.
ITAB-ZTERM = 'E'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'GEN'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALV'.
ITAB-ZTERM = 'F'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALVTEST'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ENDFORM. "FILL_TABLE
*& Form MODIFY_LIST
text
FORM MODIFY_LIST.
data: l_lines type i.
describe table itab lines l_lines.
L_LINES = L_LINES + 3.
"because we have 3 lines extra occupied by lables.
"if we have header,i mean top of page add the no.of lines
"how many ever top of page have + 3 for labels.
DO L_LINES TIMES.
read table it_chg with key INDEX = sy-index.
if sy-subrc = 0.
**This code is for reading the out put line
**and modify accordinlg to our requiremnet.
**don't chnage this.
READ LINE SY-INDEX INDEX SY-LSIND.
IF SY-SUBRC = 0.
MODIFY LINE SY-INDEX INDEX SY-LSIND
FIELD FORMAT ITAB-NAME INPUT.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. "MODIFY_LIST -
How to gray out certain fields on the selection screen based on the radio b
HI All,
I have an ALV report. On the selection screen I have 2 radio buttons ..for eg..A and B.
When radio button A(its on by default) is on..certain fields not relevant to this should be grayed out. Similarly when radio button B is on, certain fields should be grayed out.
I did the AT SELECTION SCREEN OUTPUT and also did the
LOOP AT SCREEN....ENDLOOP logic. The logic works but when I click the radio button B...the screen fields automatically does not gray out. I have to press ENTER and then its grays out.
I know a USER_COMMAND needs to be attached.
Can anyone give me a step by step details of how to do this. I truly appreciate it. if a screen painter thing is required..please give me the tcode and step by step detail to do this.
ThanksTry this one too:
REPORT ztest.
TABLES: mara,
bkpf.
CONSTANTS:
c_pos(3) TYPE c VALUE 'POS',
c_acc(3) TYPE c VALUE 'ACC',
c_all(3) TYPE c VALUE 'ALL',
c_x TYPE c VALUE 'X'.
The Selection Screen Definition
SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_mara FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b_0.
SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-037.
PARAMETER: rb_all RADIOBUTTON GROUP rb1 USER-COMMAND rad default 'X',
rb_acc RADIOBUTTON GROUP rb1.
SELECTION-SCREEN END OF BLOCK b_1.
SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-011. "Acct
SELECT-OPTIONS: s_blrtc1 FOR bkpf-blart MODIF ID acc,
s_blrti1 FOR bkpf-blart MODIF ID acc.
SELECTION-SCREEN END OF BLOCK b_2.
SELECTION-SCREEN BEGIN OF BLOCK b_3 WITH FRAME TITLE text-011. "Acct
SELECT-OPTIONS: s_blrtc2 FOR bkpf-blart MODIF ID all,
s_blrti2 FOR bkpf-blart MODIF ID all,
s_blrtv2 FOR bkpf-blart MODIF ID all.
SELECTION-SCREEN END OF BLOCK b_3.
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
PERFORM f0200_screenfield_hide_logic.
initialization.
PERFORM f0200_screenfield_hide_logic.
FORM f0200_screenfield_hide_logic *
FORM f0200_screenfield_hide_logic.
LOOP AT SCREEN.
IF rb_acc = c_x.
IF screen-group1 = c_all.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
IF rb_all = c_x.
IF screen-group1 = c_acc.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " F0200_SCREENFIELD_HIDE_LOGIC -
Webdyn Pro - Grey out certain rows in ALV?
Hi guys,
I'm quite new to webdyn pro. So please bear with me
I've a webdyn pro component which displays a simple alv output on screen.
I have a requirement where I need to check if lets say Status = 1 or 2 or 3 or 4.
If its either one of those status, grey out those row.
How I'm displaying it is
node_searchinfo = wd_context->get_child_node( name = `SEARCH_DATA` ).
node_searchinfo->bind_table( it_searchdata ).Hi,
You can add new attribute "CellDesign" of type WDUI_TABLE_CELL_DESIGN to your structure.
bind this attribute to alv columns cell design. Something like this
field-symbols <wa_colum> like line of lt_columns.
lt_columns = l_table->if_salv_wd_column_settings~get_columns( ).
loop at lt_columns[] assigning <wa_colum>.
<wa_colum>-r_column->set_cell_design_fieldname( value = 'CELLDESIGN' ).
endloop.
fill the celldesign value 00 (standard) and according to your status fill celldesign value (see domain WDUI_TABLE_CELL_DESIGN ).
This has been discussed many times in SCN , so you could easily find resources if you do a search. -
How to gray out fields in VA01 & VA02
Hi All,
My requirement is to restrict manual entries of line items.
While creating a credit memo with refrence to billing document the items from billing document gets copied to this document.
User wants to restrict entering more line items apart from these.
Therefore the rows after the last line item should be grayed out i.e in display mode. (Not the columns).
This should happen in VA01 & VA02 transaction.
I have found the Userexit_field_modification in include MV45AFZZ.
Also the screen nunmber is 4902 and table control TCTRL_U_ERF_GUTLAST whose screen input should be 0.
Please let me know if there is some other way by which this can be achieved also if this is correct; then how should I proceed with the logic.
Thanks in advance.
Regards,
Darpana.AhireHi,
For doing so you can use the concept of the transaction variants. Using transaction variants, you can do the below:
1) Make fields mandatory on screen
2) Hide fields on the screen
3) Default values on screen fields
4) Make fields input disable on screen.
Hence for doing this, go to SHD0 transaction and do the recording for the standard transaction. Once done Save the transaction variant.
Finally from menu((tab page: Standard Variant in SHD0): Activate as Standard Transactions variant.
Give the Name as your Transaction variant name.
Once you active the transaction variant as the standard variant, then if the std transaction is called, the screens which you defined in the transaction variant will be called.
No code changes need to be done. The transaction variant will only change the appearance of the screens
Regards
Shiva
Edited by: Shiva Kumar Tirumalasetty on Sep 11, 2009 4:41 PM -
ADF table: How to find out which rows were modified by the user
Hi,
I am using ADF table to display data that can be modified by the user (ReadOnly = false in the input text). I need to find out which rows were modified by the user, and only update (persist) those rows in the database.
Is there an easy way to find out which rows were modified by the user.
I am NOT particularly concerned with which columns were modified as I would update the entire row (if any data in that row is modified).
I am using Oracle JDeveloper version 11.1.1.3.
Thanks,
Ash KThanks Timo.
I am using ADF Data Control (which are created from Web Service proxy) to display/update the data.
In the backing bean, the operation that is invoked at the time persisting data is as follows:
public void commitOperation {
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("operationA");
DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("someIterator");
for(int i=0; i<dciter.getViewObject().getEstimatedRowCount(); i++)
Row row=dciter.getRowAtRangeIndex(i);
SomeObject someObject= new SomeObject ();
someObject.setAttr1(row.getAttribute("Attrbute1").toString());
someObject.setAttr2(row.getAttribute("Attribute2").toString());
objectList.add(someObject);
operationBinding.getParamsMap().put("param1", objectList);
ResultObject result = (ResultObject) operationBinding.execute();
Inside the for loop (or any other place in the backing bean), I would like to figure out if the row was modified by the user. Please let me know if how to get that. If ADF provides this automatically, that would be GREAT.
Thanks,
Ash K -
How to grayed out fields in Pop screen in FBL1n while doing mass change
Dear All,
I want encorporate user specific screen with some edit fileds with validations and some grayed out fields in pop screen
in FBL1N Transaction while mass change option.
Can you tell how can achive if any BADI or enhance pont or BTE or any exit .
Regards
AmarHi amar,
try with transaction variant
with transaction variant we can hide or grey out fields
bye
T Bharat Bhushan -
How to identify the modified rows in ALV grid in OO
Hello All,
I have strange problem and i don't know how to solve it?
I have ALV grid and in that ALV grid i have two buttons 'CONT' and 'ALLOC', when the user press 'ALLOC' button i will give a popup to make the user to enter some value.
After entering the value i will do some calicualtions and i will distribute the amount in the fields of ALV grid and i should update the ALVGRID.
Normally we can use CALL METHOD ME->REFRESH_TABLE_DISPLAY.( I have already checked by using this method and it worked fine)
Here is the way my program look like
ALVTREE1
ALVTREE2
|----
ALVGRID
The problem is when i press the other button CONT i am unable to know what values exist in ALVGRID.
How can i find these distributed amount in ALV?
I hope i am clear while explaining problem.
Here is the required code:
method handle_user_command.
data: lt_fields type table of sval,
ls_field type sval,
ls_fieldcatalog type lvc_s_fcat,
ls_merkpl type zvhf_merkpl,
lv_month(2) type n ,
lv_year(4) type n ,
lv_spmon type zvhf_allocation-spmon,
lv_value type p.
field-symbols: <fs> type any,
<ls_merkpl> type zvhf_merkpl.
case e_ucomm.
when 'CNT'.
call method gcl_gui_alv_grid->check_changed_data.
call method dailogbox_container->set_visible
exporting
visible = space.
call method gcl_gui_alv_tree2->frontend_update.
call method gcl_gui_alv_tree2->update_calculations.
clear: gt_merkpl.
when 'ALCT'.
Popup to get the values enterd by the user
ls_field-tabname = 'DD02V'.
ls_field-fieldname = 'DDTEXT'.
append ls_field to lt_fields.
call function 'POPUP_GET_VALUES'
exporting
popup_title = 'Enter value'
start_column = '1'
start_row = '1'
tables
fields = lt_fields
exceptions
error_in_fields = 1
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.
elseif sy-subrc = 0.
read table lt_fields into ls_field index 1.
if sy-subrc = 0.
gv_value = ls_field-value.
Read the table zvhf_allocation with nodekey in order to get percentages
select * from zvhf_allocation into table gt_allocation
where dvkbur = gs_node_info-nodename.
Read gt_merkpl in order to get existing line in ALV grid
loop at gt_merkpl into ls_merkpl.
*Read FCAT inorder to find the field and move proprtinate value
loop at gt_fieldcatlog3 into ls_fieldcatalog.
*Split is required to match ZVHF_ALLOCATION-SPMON with screen text and to proprtinate the value
split ls_fieldcatalog-scrtext_l at '.' into
lv_month lv_year.
concatenate lv_year lv_month into lv_spmon.
Check whether an entry exist or not in ZVHF_allocation
read table gt_allocation into gs_allocation
with key spmon = lv_spmon binary search.
*If an entry exist proprtinate the value as enterd in table
if sy-subrc = 0.
lv_value = gv_value * gs_allocation-prozent.
lv_value = lv_value / 100.
perform assign_value using ls_fieldcatalog-fieldname lv_value
changing ls_merkpl.
modify gt_merkpl from ls_merkpl.
endif.
endloop.
CALL METHOD gcl_gui_alv_grid->frontend_update.
call method gcl_gui_alv_grid->refresh_table_display
exceptions
finished = 1
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.
endloop.
endif.
endif.
endcase.
endmethod. "handle_user_command
If you have any further questions please let me know.
Regards,
LisaHello Vijay,
Thanks for you reply,
The event data_changed is not working because i called method refresh_table_display. So the event changed will not be raised after i press button CONT
If i didn't call this method then i can see the value enterd by the user in ALV grid.
So, do you have an more ideas.
Regards,
Lisa -
How to color a complete row in ALV.
Hi,
My report program is as follows.
1. I have to display entries of an internal table in a ALV list using the Function Module 'REUSE_ALV_LIST_DISPLAY' in which on of the columns is a check box.
2. on displaying the output, the check box is clicked and a button(PF_Status) in application toolbar is clicked.
3. In the at user-command i need to change the contents of the row selected and change the colour of the complete selected line to green.
My problem is i am able to change the contents but <b>am not able to change the colour of the entire row to green</b>.
Only selected row should change to green all other lines remain as they were.
is it possible in ALV, as far as i know we use EMPHAISZE of fieldcatalog to colour a complete column but i want to colour only a particuler row. Please provide me help on this.
Thanks in advance for your ESTEEMED replies.
with warm regards,
Raghavendra Goutham.Hi,
Got this from forum
report .
Use of colours in ALV grid (cell, line and column) *
Table
tables : mara.
Type
types : begin of ty_mara,
matnr like mara-matnr,
matkl like mara-matkl,
counter(4) type n,
free_text(15) type c,
color_line(4) type c, " Line color
color_cell type lvc_t_scol, " Cell color
end of ty_mara.
Structures
data : wa_mara type ty_mara,
wa_fieldcat type lvc_s_fcat,
is_layout type lvc_s_layo,
wa_color type lvc_s_scol.
Internal table
data : it_mara type standard table of ty_mara,
it_fieldcat type standard table of lvc_s_fcat,
it_color type table of lvc_s_scol.
Variables
data : okcode like sy-ucomm,
w_alv_grid type ref to cl_gui_alv_grid,
w_docking_container type ref to cl_gui_docking_container.
parameters : p_column as checkbox,
p_line as checkbox,
p_cell as checkbox.
at selection-screen output.
perform get_data.
perform fill_catalog.
if w_docking_container is initial.
perform create_objects.
endif.
*& Form create_objects
form create_objects.
create object w_docking_container
exporting
ratio = 60
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
create object w_alv_grid
exporting
i_parent = w_docking_container.
Field that identify color line in internal table
move <b>'COLOR_LINE'</b> to is_layout-info_fname.
Field that identify cell color in inetrnal table
move <b>'COLOR_CE</b>LL' to is_layout-ctab_fname.
call method w_alv_grid->set_table_for_first_display
exporting
is_layout = is_layout
changing
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endform.
*& Form get_data
form get_data.
select * from mara up to 5 rows.
clear : wa_mara-color_line, wa_mara-color_cell.
move-corresponding mara to wa_mara.
add 1 to wa_mara-counter.
move 'Blabla' to wa_mara-free_text.
if wa_mara-counter = '0002'
and p_line = 'X'.
<b>Color line</b> move 'C410' to wa_mara-color_line.
elseif wa_mara-counter = '0004'
and p_cell = 'X'.
<b>* Color cell</b>
move 'FREE_TEXT' to wa_color-fname.
move '6' to wa_color-color-col.
move '1' to wa_color-color-int.
move '1' to wa_color-color-inv.
append wa_color to it_color.
wa_mara-color_cell[] = it_color[].
endif.
append wa_mara to it_mara.
endselect.
endform.
*& Form fill_catalog
form fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
data : w_position type i value '1'.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATNR' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATNR' to wa_fieldcat-ref_field.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATKL' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATKL' to wa_fieldcat-ref_field.
Color column
if p_column = 'X'.
move 'C610' to wa_fieldcat-emphasize.
endif.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'COUNTER' to wa_fieldcat-fieldname.
move 'N' to wa_fieldcat-inttype.
move '4' to wa_fieldcat-intlen.
move 'Counter' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'FREE_TEXT' to wa_fieldcat-fieldname.
move 'C' to wa_fieldcat-inttype.
move '20' to wa_fieldcat-intlen.
move 'Text' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
endform.
Check this link to get code for different colors http://www.sapdesignguild.org/resources/ma_guidelines/VisualDesignRules/colors.html
Try this out the same thing will work for Reuse also.
Thanks & Regards,
Judith. -
Hi experts..
i got one requirement like i need to edit some rows particularly in alv....
Edit in alv output....is it possible to get that .....using normal function module with out using oops concept...
could any one pls help me...Hi Pendurti ,
If you want a particular field to be editable , simply define the fieldcatalog as
wa_fieldcatalog-edit = 'X'.
wa_fieldcatalog-input = 'X'.
for that field.
and
Now when you use FM ' Reuse alv grid display '
define USER_COMMAND
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = int_fieldcatalog
is_layout = wa_layout
TABLES
t_outtab = t_disp.
and now in form USER_COMMAND ; code as per following
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
endform.
Regards,
Yogendra Bhaskar -
How to detect a selected row in ALV GRID
Hi,
Can anyone tell me how to detect and catch an event when a row is selected in an ALV GRID?
I would like to catch such event when the end user presses Ctrl + Shif + Space bar.
Thank you and best regards.
Hassane.Hi,
Use this wiki link, to have a checkbox with all the records in ALV Grid and to process those selected records at a user command, as per the requirement.
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bcheckbox%252bto%252bprocess%252bselected%252brecords%252bat%252bruntime
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to gray out textbox and button
Hello, I am new to Java, and I am do not know how to disable a textfield and a button, as in just gray it out. Does anyone know how to do this.
Button max = new Button("Max");
TextField box = new TextField("Enter your name",20);
box.whatDoIputHere(false);
max.whatDoIputHere(false);Thanks for any helpbox.setEnabled(false);
max.setEnabled(false); -
How to pass out multiple rows from EJB method?
I need a sample for passing multiple rows from a EJB query method
(using SQLJ). All I found in existing sample code is query on a
single row and pass out as a bean class e.g Emp class with some
getXX() method.
What I'm currently doing is to convert the Iterator to a Vector
and pass the Vector out, which means I've to code a bean class,
use a Vector and later use a Enumeration to read the result. Is
there a simpler way to receive multiple rows from EJB?
In EJB:
while ( empIter.next() ) {
EmpVect.addElement( new Emp( emps.empNo(), emps.eName(),
emps.job(), emps.deptNo()) );
return EmpVect;
In client:
Vector empVect = empEJB.getEmployees(123);
Enumeration employees = empVect.elements();
while ( employees.hasMoreElements() ) {
emp = ( Emp ) employees.nextElement();
System.out.println(" " + emp.getEName());Hi Ankit,
There is a workarround that requires some excel work.
Here you need to follow the above mentioned steps along with this you need an additional combo box (wont be displayed at runtime, it will fetch the entire data if we select blank for the first combo box).
Now suppose we are using 2 combobox C1 and C2 and our data is from B3 to F6.
Now for C1 (one we are using for selection)
1. select the labels as Sheet1!$B$2:$B$6 (a blank cell is added for all selection)
2. Insertion type as filtered Rows
3. Take source data as Sheet1!$B$2:$F$6 (includeing one blank row)
4. selected Items as none
5. for C2 labels as Sheet1!$A$3:$A$6 source data as Sheet1!$B$3:$F$6 destination as Sheet1!$B$14:$F$17.
6. Selected Item : Sheet1!$B$9 (blank Type dynamic). So it will select the entire table, if nothing is selected.
7. take a Grid component and map it to Sheet1!$H$9:$L$12. use formula as =IF(IF($B$9="",B14,B9)=0,"",IF($B$9="",B14,B9)) on cell H9. Where we take H6 to L12 as final data set. Tis will become the data for next set fo Combo box for further selection.
8. follow the same steps for other combobox selections.
9. control the dynamic visibility of grids on the basis of Destination cell (like B9).
Revert if you need further clarification.
Regards,
Debjit
Maybe you are looking for
-
How do I get documents from iCloud onto my Ipad
I needed to add another wireless connection to my Ipad, and when I did, for some reason all my work in pages just disappeared?!!!! They are backed up on the cloud, as I saw them via my computer, but I want to get them back onto my iPad... How do I do
-
PSE9 Constant Crashes on File Open
I am trying to edit approximately 250 Nikon NEF files and PSE9 crashes almost constantly. I can try to open a file and PSE9 will just close. Other times I can open a few files in the raw converter, one at a time, canceling out each file, and after
-
Calculated Field formula not appearing in Power View Field List panel
Hi, On Power View1 sheet of this workbook, the two PowerPivot calculated Field formulas (First Visit and First date of FY) are not appearing in the Power View Fields panel on the right hand side. I want to drag client and First Visit (calculated Fiel
-
Change Field of FI Document when saving MIRO or MIR7
Hi. i want to change an field of an FI-Dokument when saving the MM-Dokument. i use a badi for this, but i can't find the BKPF stucture. what must i do`? thanks marcus
-
Uploading Images go to Dropbox
History I recently reloaded my Mac with 10.6.8 and after doing so connected my compact flash reader to take off some image and they all uploaded to Dropbox. I have since installed Ilife 11 -> Iphoto 11 Problem Now: When I upload images they go to th