How to make certain rows editable in hierachy alv
HI,
i have called one alv function module where i have done certain fields editable by making fieldcatalog-edit = 'X' and fieldcatalog-input = 'X'.But i have to make the selected rows (based on checkbox in the output list) editable.any idea?
Hello Priya,
1) If u want to make fields of an ALV to be editable based on certain conditons then see the following code.
First create an extra field in ur internal table.
celltab TYPE lvc_t_styl,
After that pass this field to the layout.
gw_layout-stylefname = 'CELLTAB'.
Here the layout structure is defined as
gw_layout TYPE lvc_s_layo
now based on the condition u can set the fields editable or non editable.U can check the following code.
DATA: ls_celltab TYPE lvc_s_styl.
ls_celltab-fieldname = 'CHK'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
MODIFY gw_final-celltab FROM ls_celltab
TRANSPORTING style
WHERE fieldname = ls_celltab-fieldname.
IF sy-subrc NE 0.
INSERT ls_celltab INTO TABLE gw_final-celltab.
ENDIF.
Now if ur using OO-ALV then pass the layout to the method.
If ur going by Function modules then u need to call the following function module.
gw_layout-stylefname = 'CELLTAB'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = sy-cprog
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = gw_layout
it_fieldcat_lvc = gi_fieldcat
TABLES
t_outtab = gi_final
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.
2) If u want to read the changed contents from ALV grid back to ur program then use the following function modules.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_ref1.
CALL METHOD l_ref1->check_changed_data
IMPORTING
e_valid = lv_valid.
Shafi
Similar Messages
-
How to make a row editable in a click to edit table programatically?
I have a table in my page in which I can do inline addition as well as select and add addition (which will programatically add multiple rows). And my table is click to edit (there are few editable columns in the table).
So, suppose if I add a row say R1 by inline addition, then this row is coming as highlighted as well as selected (i.e editable). But now suppose I add another row R2 through Select and Add (which will open a popup table from where I can select multiple rows, and clicking on OK, I will add those rows programatically in the table VO), it is coming as highlighted but it is not coming as selected i.e now R1 is selected and editable but R2 is highlighted. (I have done setCurrentRow programatically but that is only making the row highlighted and not editable. Is there any way to make the row editable also programatically?try setEditingMode method. See if it helps.
http://docs.oracle.com/cd/E28389_01/apirefs.1111/e10684/oracle/adf/view/rich/component/rich/data/RichTable.html#setEditingMode_java_lang_String_ -
How to make Certain rows in the structure to be displayed as bold
I have two structures in the query. There is a requirement that all values in Certain rows should be bold I am talking about values and not the headers. The users are going to use the query through BEx Analyzer.
I tried the Highlighted Display but it makes it only that row values BLUE. (this change makes them bold only on web).
Please let me know if there is any way to display perticular row values in a structure in Bold.
We have both versions 3.5 and 7.0 of BEx analyzer. The Query is on 7.0
Thanks in Advance.
2. I also have a requirement that all values from a perticular selection from column structure to be displayed as bold.
........................................Company Code1 Company Code 2 Comapany Code 3
No Of Male Employees..................10.....................200........................30
No Of Female Employees...........500.................70........................77
So here All values in the row Female Employees should be bold and All values under Company Code 3 should be bold
Edited by: Abhijit N on Dec 23, 2008 11:54 PMHi Abhjit,
Please check formating option in bex analyzer for this.
Plz check here......
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a55d2e09411d2acb90000e829fbfe/content.htm
Regards,
Vijay. -
How to make all the rows editable in webdynpro alv output
Hi,
How to make all the rows editable in webdynpro alv output.
Thanks
RaksharHi Rakshar,
Check this wiki:
http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
Regards -
How to make table as "editable false"
Dear Forum,
i am user of jDeveloper jClient/Swing .jpr.
cutomer table having following attributes-
1.cust_id (primary key)
2.cust_name
3.cust_add
Suppose customerview bind with jTable1.
Using ViewObjectEditor, i set "updateable never" for all fields.
This show error, when data insert into table " cust_id as
read only".
Help me, Using jClient Binding how to make Table as "editable false".Overriding method prepareEditor() for new table:
private JTable tableList = new JTable(){
public Component prepareEditor(TableCellEditor editor, int row, int column) {
// 1 and 2 column is not editable
if(column == 0 || column == 1){ return null; }
return super.prepareEditor(editor, row, column); -
How to make some rows not selectable in AdvancedDataGrid
Hi there,
I have an advanced data grid which allows to select multiple rows. I need to make certain rows not selectable dependent on the row data. How can this be done?
Help is greatly appreciated. Thanks in advance.
--CharmaineHi, You can view same demo here
Thanks and Best regards,
Pallavi Joshi | [email protected] | www.infocepts.com -
RE:ALV grid (oops concept)-to make selected row editable
Hi,
I have an object oriented alv which is having 5 rows of data.I have a pushbutton to make any row in editable mode.My requirement is i will select any row in oops alv grid and press
the button to make the row editable.How can i do this in oops alv.
thanks,
AlexHi,
Use the Link [http://www.sapdev.co.uk/reporting/alv/alvgrid_editable.htm]
Check demo pgm BCALV_EDIT_05.
*& Report ZUS_SDN_ALVGRID_EDITABLE_8
*& Description: editable ALV -> ENTER jumps to next row
*& Dynpro flow logic: no screen elements, ok_code = GD_OKCODE
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
REPORT zus_sdn_alvgrid_editable_8.
DATA:
gd_repid TYPE syst-repid,
gd_okcode TYPE ui_func,
gt_fcat TYPE lvc_t_fcat,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid TYPE REF TO cl_gui_alv_grid.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING
er_data_changed
e_onf4
e_onf4_before
e_onf4_after
e_ucomm
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_data_changed.
define local data
cl_gui_cfw=>set_new_ok_code( 'NEXT_ROW' ). " not possible on 4.6c
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'NEXT_ROW'
IMPORTING
RC =
" Triggers PAI of dynpro with ok_code = 'NEXT_ROW'
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '2000' OBLIGATORY.
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = p_bukrs.
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 ALV grid
CREATE OBJECT go_grid
EXPORTING
i_parent = go_docking
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.
" Triggers event DATA_CHANGED when ENTER is pushed
CALL METHOD go_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter
EXCEPTIONS
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.
SET HANDLER:
lcl_eventhandler=>handle_data_changed FOR go_grid.
Build fieldcatalog and set hotspot for field KUNNR
PERFORM build_fieldcatalog_knb1.
Display data
CALL METHOD go_grid->set_table_for_first_display
CHANGING
it_outtab = gt_knb1
it_fieldcatalog = gt_fcat
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
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_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.
ok-code field = GD_OKCODE
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
SET TITLEBAR 'xxx'.
CALL METHOD go_grid1->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
go_grid->check_changed_data( ).
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
" NOTE: ENTER button alone works apparently only if the cursor
" is placed within the command window (left-upper corner)
WHEN 'ENTER' OR
'NEXT_ROW'.
PERFORM set_cursor_next_row.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_FIELDCATALOG_KNB1
text
--> p1 text
<-- p2 text FORM build_fieldcatalog_knb1 .
define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'KNB1'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_fcat INTO ls_fcat
WHERE ( fieldname = 'ZUAWA' ).
ls_fcat-edit = abap_true.
ls_fcat-col_opt = abap_true.
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG_KNB1
*& Form SET_CURSOR_NEXT_ROW
text
--> p1 text
<-- p2 text FORM set_cursor_next_row .
define local data
DATA:
ls_row TYPE lvc_s_row,
ls_col TYPE lvc_s_col.
CALL METHOD go_grid->get_current_cell
IMPORTING
E_ROW =
E_VALUE =
E_COL =
es_row_id = ls_row
es_col_id = ls_col
ES_ROW_NO =
ADD 1 TO ls_row-index. " next row
CALL METHOD go_grid->set_current_cell_via_id
EXPORTING
is_row_id = ls_row
is_column_id = ls_col
IS_ROW_NO =
ENDFORM. " SET_CURSOR_NEXT_ROW
HTH
Regards,
Dhruv Shah -
How to make an checkbox editable and uneditable within a single alv output.
Hi,
How to make an checkbox editable and uneditable within a single alv output depending on condition.
I have used Reuse_alv_grid_display.
In my output every checkbox is editable. i have used edit = 'X'.
I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv>
Mukilansap wrote:
> I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv
Use alv styles to achieve this, set the style for each record before displaying the ALV. Structure LVC_S_STYL.
Take a look at the example BCALV_EDIT_02, it is OOPS based, but check how the style table is filled.
regards,
Advait -
How to make the row as a hyperlink in Crystal 2008
Hi,
Could you give me advise on how to make the row as a hyperlink and call another report.
Thank you in advance.
RoseHi Sastry,
I was able to create the subreport and its working.
Thank you so much.
Regards.
Rose -
How to make first row as selected in af:table
Hi,
I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
In all the pages across my application we have multi select enabled for the table[af:table].
But when the pages are displayed,the first row is not selected by default.
My requirement is to display first row as selected across all the tables in my app.
I have the selectionListenerset as for example selectionListener="#{bindings.RSCMapVO2.collectionModel.makeCurrent}" in all the pages.
Please suggest on how to make first row as selected.
Regards,
PraveenHi
Put these codes in your selection listner method(You have to define a selectionListner method in your backing bean and put this code segment
(Special thanks go to Franks how posted this code segment. threadID=1089583)
RichTable yourTable = (RichTable) selectionEvent.getSource();
//the Collection Model is the object that provides the structured data
//for the table to render
CollectionModel yourTableModel = (CollectionModel) yourTable.getValue();
//the ADF object that implements the CollectionModel is JUCtrlHierBinding. It
//is wrapped by the CollectionModel API
JUCtrlHierBinding yourTableBinding = (JUCtrlHierBinding) yourTableModel.getWrappedData();
//Acess the ADF iterator binding that is used with ADF table binding
DCIteratorBinding yourTableIteratorBinding = yourTableeBinding.getDCIteratorBinding();
//the role of this method is to synchronize the table component selection
//with the selection in the ADF model
Object _selectedRowData = yourTable.getSelectedRowData();
//cast to JUCtrlHierNodeBinding, which is the ADF object that represents
//a row
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding) selectedRowData;
//get the row key from the node binding and set it as the current row in the
//iterator
Key rwKey = nodeBinding.getRowKey();
tableIteratorBinding.setCurrentRowWithKey(rwKey.toStringFormat(true));
Thanks
Padma -
How to make Single row of an entire collumn of table control- Changeable
Hi ,
In Module Pool , in table control , I've all the rows in a specific column as "read only". However, with a specific "if statement" I want one row of that column as editable.
For example ,
if itab-name1 = 'PRITHVI'.
Make that row, editable.
Keep the rest of the column unaffected.
I used the following code in my program in PBO:
module STATUS_0005 output.
Loop AT SCREEN .
if screen-name = '%#AUTOTEXT009'
AND I_MARKLIST-STUDENT_NAME1 = 'SUNIL SHARMA'.
SCREEN-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endmodule.
I've tried this, but in vain .. ! Please give me suitable solutions ASAP.Hi,
try like this..
in the PBO of screen flow logic..
loop at I_MARKLIST with control tc.
MODULE CHANGE.
endloop.
IN THAT CHANGE MODULE WRITE...
IF I_MARKLIST-STUDENT_NAME1 = 'SUNIL SHARMA'.
LOOP AT SCREEN.
IF SCREEN-NAME = '%#AUTOTEXT009'.
SCREEN-INPUT = 1.
ELSE.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
SCREE-INPUT = 0.
MODIFY SCREEN.
ENDLOOP.
ENDIF. -
How to make field is editable in ALV CL_SALV_TABLE only)
Hi,
How to make field is editable in ALV CL_SALV_TABLE only)
Any one has tried to make field si editable by using CL_SALV_TABLE class.
*I know how to do it in REUSEALV function module and CL_GUI_ALV class.*_
Please reply only if you riedin CL_SALV_TABLE class method.
Regards
Rajesh V
Moderator message: not supported, please read class documentation and search for previous discussions.
Edited by: Thomas Zloch on Mar 17, 2011 2:07 PMHi Chad,
Please refer the link,
Edit field in alv
Regards,
Hema.
Reward points if it is useful. -
How to make Date fields Editable or Non-Editable based on Call Staus
Hi,
We are using CRM2007 Web GUI for Service call creation. We are using date profile to populate the dates. Here my requirement is if call status is 'Call created' then some set of date fields to be appeared in display mode(Non Editable) and some set of date fields to be appeared in change mode(Editable). How to achieve this. Kindly suggest me.
Regards,
SteveHello,
Kindly check the following thread which is giving many solutions for your requirement:
Re: how to make field non-editable (display mode)
Kind regards,
Nicolas Busson. -
Is it possible to make certain rows mandatory in ALV custom Grid display?
Hi experts,
Is it possible to make certain columns mandatory in the ALV custom grid control just as we give in a selection screen ?
Thanks in advance
regards,
Ashwinfieldcat-key = 'X'.
Regards,
Amit -
How to make 1st column as header in ALV grid
Hi Experts,
How to make 1st column as header in ALV grid as attached. Please help.
Thanks in advance.Hi manoj,
Try with,
FM REUSE_ALV_HIERSEQ_LIST_DISPLAY
Regards,
Venkat.
Maybe you are looking for
-
White Balance: can you apply setting from one image to a series of other images?
I like to make a grey card reference image whenever the light changes and use the image of the grey card to set the white balance. In Bridge, it was possible to set the white balance on any number of other images by applying the setting made on the r
-
Use apple tv without turning on TV or Projector
Hi. Can anyone tell me how (if possible) I can sit at my computer and choose the playlist and stream directly to the Apple TV? I have a setup, where the apple tv is connected to my receiver, which is connected to my projector, and it kind of miss my
-
New apps in iTunes default to "off" in Apps tab on iPad, but "on" on iPhone
I am using iTunes 9.1.1 on a Mac. When I buy new apps in iTunes, on the "Apps" tab for the iPhone these new apps default to on (i.e. with a check-mark next their to name). But on my iPad, the same new app defaults to off (i.e. with no check-mark). I
-
Hi all, Is there any way of creating a spool request or printing OTF data directly from an internal table. Scenario is that I have read a spool request with multiple pages into OTF format and now have an internal table with OTF data. I have then spli
-
Disabling prompts blocks InfoPath publishing
I have a SharePoint 2010 Enterprise environment with InfoPath 2010. Using several forms published as content types in several site collections, all working fine. Users are getting prompted Open/Save of documents in libraries (word, excel) - Office W