Editable Field in ALV Tree Control
Hello All,
Can anyone tell me how can i make a field editable in an Alv Tree grid. I have tried with fiedcatalog-edit = 'X'. but that doesn't work.
also please provide a piece of code to be clear ...
Thanks,
Ravi Aswani
hI ,
Data : LI_fieldcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat.
IF OKCODE = 'MAIN'.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'ZCUS'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = LI_fieldcat[] .
LOOP AT LI_FIELDCAT INTO LS_FCAT.
CASE ls_fcat-fieldname.
WHEN 'KUNNR'.
ls_fcat-col_pos = 1.
WHEN 'NAME1'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 2.
WHEN 'ORT01'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 3.
ls_fcat-drdn_hndl = '1'.
ls_fcat-outputlen = 20.
WHEN 'LAND1'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 4.
ENDCASE.
MODIFY LI_fieldcat FROM ls_fcat.
ENDLOOP.
ENDIF.
With this The internal Table contains 4 fields Kunnr Name1 Ort01 Land1 Here Kunnr is the Key field so , it is not editable , reaming fields are Editable.
There u must write the Modify statement.
check it once
Regards
Krishna
Similar Messages
-
Editable Field in ALV TREE Display Using OOPs
Hi,
I am trying to make a field editable on the ALV Tree display. I could create an editable check box. But could not make a field Editable. I have made EDIT = 'X' in the fieldcatalog for the particular field. but it is not working.
Please help me in solving this. Its very urgent.You do this with the following code example
DATA: ls_layout TYPE lvc_s_layi.
CLEAR ls_layout.
ls_layout-class = cl_item_tree_control=>item_class_text.
ls_layout-editable = 'X'.
ls_layout-fieldname = your fieldname.
APPEND ls_layout TO lt_layout.
add PO header to tree
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key = space
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_po_item
is_node_layout = wa_layout_node
it_item_layout = lt_layout
Roy -
Editable field in alv tree output using cl_gui_alv_tree
Hi,
i need Editable field with F4 help in alv tree output using cl_gui_alv_tree.
regards,
Nareshsadly, this is not possible. An ALV Tree cannot by editable.
Regards -
Edit a field in ALV tree in a subscreen of a module pool
Hi
I want to make a field editable in the ALV tree based on some condtions in a subscreen of a module pool. I used the edit = 'X' field in the fieldcatalog still it is showing the field as display and not edit.
Please help me to get the field as editable and save it to the database table.
Please not this is ALV TREE
Regards,
MozilaHi Mayank,
Thanks for the reply
I am using oops method.
I tried making the field which is to be made editable as wa_fieldcatalog-edit = 'X'. But its not working. I didnt get you when you said edit in layout object.
I also went through the demo programs but these programs are not having editable fields.
My code is as follows:
IF tree4 IS INITIAL.
* create container for alv-tree
l_tree_container_name = 'TREE4'.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
* create tree control
CREATE OBJECT tree4
EXPORTING
i_parent = l_custom_container
i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
i_item_selection = 'X'
i_no_html_header = 'X'
i_no_toolbar = 'X'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
* create hierarchy
CALL METHOD tree4->set_table_for_first_display
EXPORTING
is_layout = s_layo
CHANGING
it_sort = it_sort
it_outtab = it_final
it_fieldcatalog = it_fieldcat.
ELSE.
CALL METHOD tree4->refresh_table_display
EXPORTING
it_sort = it_sort
EXCEPTIONS
program_error = 1
failed = 2
cntl_system_error = 3
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.
endif. -
How to make some fields in ALV tree editable
Hello All,
Can any one tell me how to make some fields in ALV tree editable.
If possible please post some code.
Regards,
Lisa.Hi Lisa,
I want to make 3 fields in the ALV tree editable and update the saved values in ztable.
I tried making the wa_fieldcat-edit = 'X' But in vain.
Also i made the layout fields wa_layout-edit = 'X' and wa_layout-edit_mode = 'X'.
But still the alv tree field appears as display.
As you have mentioned in the post as answered, So please guide me to make the field editable.
I am using oops method.
Please provide me code if any.
Thanks & Regards,
Mozila -
Disable editable field in ALV grid using OOPS
I have following requirements,
Displaying ALV grid output with most of the fields editable.
Validations on data entered for each fields,for error messages
Query :
I want to make all the fields except the field in ERROR in display only mode
similar to case when we do validation of fields in table controls.HI
check the below links lot of info and examples r there for OOPS
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Check these sample code
data : begin of it_mara occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara.
data : begin of it_mara1 occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara1.
data : begin of it_mara2 occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara2.
data : t_fieldcat type lvc_t_fcat,
t_fieldcat1 type lvc_t_fcat,
s_fieldcat like line of t_fieldcat.
data : s_layout type lvc_s_layo.
data : control type ref to cl_gui_custom_container,
grid type ref to cl_gui_alv_grid.
data: begin of wa ,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of wa.
class lcl_events_box definition.
public section.
methods :
*Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
*imporTing er_data_changed,
Handler_User_Command for event User_Command of cl_gui_alv_grid
imporTing e_ucomm,
Handler_ToolBar for event ToolBar of cl_gui_alv_grid
importing E_object E_interactive.
endclass.
class lcl_events_box implementation.
method Handler_user_command.
PERFORM FORM_USERCOMMAND CHANGING E_UCOMM.
endmethod.
method Handler_ToolBar.
PERFORM FORM_TOOLBAR CHANGING E_OBJECT E_INTERACTIVE
E_OBJECT->MT_TOOLBAR.
endmethod.
ENDCLASS.
start-of-selection.
data : w_events type ref to lcl_events_box.
select matnr mtart meins from mara into corresponding fields of table
it_mara.
call screen 100.
*& Module pbo_module OUTPUT
text
MODULE pbo_module OUTPUT.
if GRID is initial.
CREATE OBJECT CONTROL
EXPORTING
CONTAINER_NAME = 'CUST_CTRL'.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTROL.
PERFORM BUILD_CATALOG.
PERFORM BUILD_CATALOG1.
PERFORM BUILD_LAYOUT.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara[]
IT_FIELDCATALOG = t_fieldcat.
CREATE OBJECT W_EVENTS.
SET HANDLER : W_EVENTS->HANDLER_TOOLBAR FOR GRID,
W_EVENTS->HANDLER_USER_COMMAND FOR GRID.
CALL METHOD GRID->SET_TOOLBAR_INTERACTIVE.
ELSE.
call method grid->refresh_table_display.
ENDIF.
ENDMODULE. " pbo_module OUTPUT
*& Form BUILD_CATALOG
FORM BUILD_CATALOG .
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MARK'.
S_FIELDCAT-CHECKBOX = 'X'.
S_FIELDCAT-eDIT = 'X'.
APPEND S_FIELDCAT TO T_FIELDCAT.
CLEAR S_FIELDCAT.
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT.
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT.
S_FIELDCAT-COL_POS = '4'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT.
ENDFORM. " BUILD_CATALOG
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM BUILD_LAYOUT .
S_LAYOUT-ZEBRA = 'X'.
S_LAYOUT-CWIDTH_OPT = 'X'.
S_LAYOUT-GRID_TITLE = 'Material Details'.
ENDFORM.
" BUILD_LAYOUT////////////////////////////////////
" USER_COMMAND_0100 INPUT
*& Form FORM_USERCOMMAND
text
<--P_E_UCOMM text
form FORM_USERCOMMAND changing p_e_ucomm.
CASE P_E_UCOMM.
WHEN 'INT1'.
DO.
READ TABLE IT_MARA INDEX SY-INDEX TRANSPORTING MARK MATNR.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
IF IT_MARA-MARK = 'X'.
read table it_mara into wa TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING WA TO IT_MARA1.
READ TABLE IT_MARA1 TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING IT_MARA1 TO IT_MARA2.
APPEND IT_MARA2.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara2[]
IT_FIELDCATALOG = t_fieldcat1.
SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
CALL TRANSACTION 'MM02'.
. ENDIF.
ENDIF.
ENDDO.
ENDCASE.
endform. " FORM_USERCOMMAND
*& Form FORM_TOOLBAR
text
<--P_E_OBJECT text
<--P_E_INTERACTIVE text
<--P_E_OBJECT_>MT_TOOLBAR text
FORM FORM_TOOLBAR CHANGING P_E_OBJECT TYPE REF TO
CL_ALV_EVENT_TOOLBAR_SET
P_E_INTERACTIVE
MT_TOOLBAR TYPE TTB_BUTTON.
DATA WAL_BUTTON TYPE STB_BUTTON.
*WAL_BUTTON-ICON = ICON_status_reverse.
WAL_BUTTON-TEXT = 'GO'.
WAL_BUTTON-QUICKINFO = 'PROCEED'.
waL_button-FUNCTION = 'INT1'.
WAL_BUTTON-BUTN_TYPE = 0.
WAL_BUTTON-DISABLED = SPACE.
insert WAL_BUTTON INTO P_E_OBJECT->MT_TOOLBAR index 1.
endform. " FORM_TOOLBAR
*& Module PF-STATUS OUTPUT
text
module PF-STATUS output.
set pf-status 'Z7PSTAT'.
endmodule. " PF-STATUS OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0100 INPUT
*& Form BUILD_CATALOG1
text
--> p1 text
<-- p2 text
form BUILD_CATALOG1 .
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
endform. " BUILD_CATALOG1
check the below link may be useful for you
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
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
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
<b>Reward all helpfull answers</b>
Regards -
Hello all,
How do I get a cursor field on ALV Tree report? I have output with po number, vendor no etc. When I double click PO, i shuold display ME23N and on vendor no 'XK03' etc. Double click event is triggered, but how do I check which field is clicked? Anybody pls suggest me.
Thanks,
ChandniHi,
you can use method to get the select lines:
CALL METHOD TREE->GET_SELECTED_NODES
CHANGING
CT_INDEX_OUTTAB = SELECTED_NODES
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
DP_ERROR = 2
FAILED = 3
OTHERS = 4.
or in double click:
METHODS HANDLE_DOUBLE_CLICK
FOR EVENT ITEM_DOUBLE_CLICK OF CL_GUI_ALV_TREE_SIMPLE
IMPORTING FIELDNAME INDEX_OUTTAB GROUPLEVEL.
just read tables with index_outttab
READ TABLE GT_TAB INTO IGT_TAB INDEX INDEX_OUTTAB.
to check which field is clicked use the FIELDNAME field.
regards -
hiii
when doing editable field in alv
you set
i_fieldcat-edit = C_X
i_fieldcat-input = C_X
P_selfield-refresh = C_X
this is not working when i click on save the internal table is not keeping the change i have edit on the screen and the p_selfield value also has still the old value.
but when i double click the p_selfield is keeping the editable value. Please advise ??hi,
Check out this sample program.The part for 'EDIT' is in Bold..
report zalv_color_display_edit.
type-pools: slis.
tables : zcust_master2.
types : begin of wi_zcust_master2,
zcustid like zcust_master2-zcustid,
zcustname like zcust_master2-zcustname,
zaddr like zcust_master2-zaddr,
zcity like zcust_master2-zcity,
zstate like zcust_master2-zstate,
zcountry like zcust_master2-zcountry,
zphone like zcust_master2-zphone,
zemail like zcust_master2-zemail,
zfax like zcust_master2-zfax,
zstat like zcust_master2-zstat,
field_style type lvc_t_styl,
end of wi_zcust_master2.
data: it_wi_zcust_master2 type standard table of wi_zcust_master2
initial size 0,
wa_zcust_master2 type wi_zcust_master2.
data: fieldcatalog type slis_t_fieldcat_alv with header line.
data: it_fieldcat type lvc_t_fcat,
wa_fieldcat type lvc_s_fcat,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type lvc_s_layo, "slis_layout_alv,
gd_repid like sy-repid.
start-of-selection.
perform data_retrieval.
perform set_specific_field_attributes.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
form build_fieldcatalog.
wa_fieldcat-fieldname = 'ZCUSTID'.
wa_fieldcat-scrtext_m = 'CUSTOMER ID'.
wa_fieldcat-col_pos = 0.
wa_fieldcat-outputlen = 10.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCUSTNAME'.
wa_fieldcat-scrtext_m = 'CUSTOMER NAME'.
wa_fieldcat-col_pos = 1.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZADDR'.
wa_fieldcat-scrtext_m = 'ADDRESS'.
wa_fieldcat-col_pos = 2.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCITY'.
wa_fieldcat-scrtext_m = 'CITY'.
wa_fieldcat-col_pos = 3.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZSTATE'.
wa_fieldcat-scrtext_m = 'STATE'.
wa_fieldcat-col_pos = 4.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCOUNTRY'.
wa_fieldcat-scrtext_m = 'COUNTRY'.
wa_fieldcat-col_pos = 5.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZPHONE'.
wa_fieldcat-scrtext_m = 'PHONE NUMBER'.
wa_fieldcat-col_pos = 6.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZEMAIL'.
wa_fieldcat-scrtext_m = 'EMAIL'.
wa_fieldcat-edit = 'X'. "sets whole column to be editable wa_fieldcat-col_pos = 7.
wa_fieldcat-outputlen = 15.
wa_fieldcat-datatype = 'CURR'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZFAX'.
wa_fieldcat-scrtext_m = 'FAX'.
wa_fieldcat-col_pos = 8.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZSTAT'.
wa_fieldcat-scrtext_m = 'STATUS'.
wa_fieldcat-col_pos = 9.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
Set layout field for field attributes(i.e. input/output)
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
exporting
i_callback_program = gd_repid
is_layout_lvc = gd_layout
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
tables
t_outtab = it_wi_zcust_master2
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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
text
--> p1 text
<-- p2 text
form data_retrieval .
data: ld_color(1) type c.
select zcustid zcustname zaddr zcity zstate zcountry zphone zemail
zfax zstat up to 10 rows from zcust_master2 into corresponding fields of
table it_wi_zcust_master2.
endform. "data_retrieval
*& Form set_specific_field_attributes
populate FIELD_STYLE table with specific field attributes
form set_specific_field_attributes .
data ls_stylerow type lvc_s_styl .
data lt_styletab type lvc_t_styl .
Populate style variable (FIELD_STYLE) with style properties
The following code sets it to be disabled(display only) if 'ZFAX'
is NOT INITIAL.
loop at it_wi_zcust_master2 into wa_zcust_master2.
if wa_zcust_master2-zfax is not initial.
ls_stylerow-fieldname = 'ZFAX' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
"set field to disabled
append ls_stylerow to wa_zcust_master2-field_style.
modify it_wi_zcust_master2 from wa_zcust_master2.
endif.
endloop.
endform. "set_specific_field_attributes
Hope this helps you,
Arunsri -
Editable field in ALV does not accept negative sign values
Hi guys,
We have an editable field in ALV but it does not accept negative sign,,, it is causing an error... We need to input a negative value in that editable field...
How to handle this?
Thanks!Hi Mark,
This topic has been just discussed at this thread:
Problem with OO ALV
Regards,
Chandra Sekhar -
Editable field in alv list display
i WANT TO GIVE COLOR FOR EDITABLE FIELD IN ALV LIST DISPLAY.i TRIED WITH EMPHASIZE IN FIELD CATALOGUE ASSIGNING.bUT,IT IS NOT WORKING.HOW TO DO.tHANX IN ADVANCE.........
HI,
Please refer the link below:
http://www.****************/Tutorials/ALV/Edit/demo.htm
http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
Thanks,
Sriram Ponna. -
Editable field in alv data format
i have a editable field on ALV which is of date format and i need when user enter a date the value will be updated in the database table .
note that i am using alv list and the field catalog is of date format dat 8
the update is not done pleaseee helppp urgentHi,
You need to use the USER_COMMAND in the ALV function module
{CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'GUI_STAT'
*i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
*it_special_groups = gd_tabgroup
*it_events = it_events
i_save = 'X'
*is_variant = z_template
TABLES
t_outtab = i_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
then you need to write the below FORM
* FORM USER_COMMAND *
* --> U_COMM *
* --> RS_SELFIELD *
FORM user_command USING u_comm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.}
Here in the Form, Write the UPDATE statment to update the database table
Regards
Sudheer -
HOW TO READ THE EDITABLE FIELD IN ALV
CAN ANYONE HELP ME IN READING THE EDITABLE FIELD IN ALV.
I AM DOING THE FOLLOWING.
BUT STILL THE EDITABLE FIELD IN NOT READ.
WHEN 'EXE' OR 'EXEC'.
LOOP AT I_RB1 INTO L_WA_STRU.
L_WA_STRU-LIFSK = L_WA_STRU-LIFSK1.
MODIFY I_RB1 FROM L_WA_STRU.
CLEAR L_WA_STRU.
ENDLOOP.
I_RB1 IS MY TABLE WHICH I PASSED IN TABLES OF REUSE_ALV_GRID_DISPLAY.LIFSK1 IS MY EDITABLE FIELD.
AND LIFSK IS THE FIELD WHERE THE DATA SHOULD GET TRANSFERRED WHEN I HIT EXECUTE BUTTON.DATA: lt_display LIKE TABLE OF gt_display.
REFRESH lt_display.
CLEAR lt_display.
lt_display[] = gt_display[].
CLEAR ref_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
IF lt_display[] NE gt_display[].
gv_tosave = 'X'.
ENDIF.
Check this program. It will help you.
awrd points if helpful
Bhupal -
Help required in ALV Tree Control
Hi All,
I am using OO ALV tree Control in my Project every thing is working fine.
in treecontrol 'If we double click on Node I con it displays resultant screen'- its fine for us
'If we double click on Node Text it is displaying nothing means no Event is triggering.
my Requirement is tha 'it should work even if we click on Node Text' . Like in standard Applications SE15 .
Suggest some Methods regarding this. Note All these nodes are Dynamic Nodes comes from Data Base table.
Thanks in Adv.
MurthyJust check Tcode: DWDM.
Good no of example programs for oops tree are available there -
TRIAL BALANCE WITH ALV TREE CONTROL
Hi Friends,
My manager wants to see trial balance with cost centers like ALV tree control display.
Does SAP have any Std trial balance report which can show cost centers also for accounts and activities within those cost centers.
Please help.
ThanksNelow message will appear and not possible technically
Output option ALV Tree Control: Parameter Scaling set to 0/0
Message no. FR098
Diagnosis
You selected output option ALV Tree Control. For technical reasons, only the value 0/0 is possible for the parameter Scaling.
System Response
Parameter Scaling set to the value 0/0.
Procedure
If you want to compare the program output for output options ALV Tree Control and Classical list, you have to also set the parameter Scaling to '0/0' when running the program with output option Classical list. -
Scaling in F.01 with ALV Tree Control
Hi Experts,
Is there any possibility of generating the financial statements in F.01 in ALV tree control with amount scaled to 3 or 5 zero's. When i try to use ALV with scaling, the scaling is reset to 0
Thanks in AdvanceNelow message will appear and not possible technically
Output option ALV Tree Control: Parameter Scaling set to 0/0
Message no. FR098
Diagnosis
You selected output option ALV Tree Control. For technical reasons, only the value 0/0 is possible for the parameter Scaling.
System Response
Parameter Scaling set to the value 0/0.
Procedure
If you want to compare the program output for output options ALV Tree Control and Classical list, you have to also set the parameter Scaling to '0/0' when running the program with output option Classical list.
Maybe you are looking for
-
[SOLVED] Network connection issues - need to make connections twice
I've a strange issue with my network connection that has recently started to appear where if I: - Attempt to install a package with pacman. - Visit a webpage in chromium. - FTP a file using Thunar. - SSH into a server. Then I quite often have to atte
-
Hi! I'm trying to create rdf_model. I use this script EXECUTE SDO_RDF.CREATE_RDF_MODEL('articles', 'articles_rdf_data', 'triple'); and obtain this error message stack: ORA-13199: Model error occurred ORA-06512: on "MDSYS.MD", line 1723 ORA-06512: on
-
How to Create Function Module BAPI_GETGLACCPERIODBALANCES Carry Forward
Dear All, In SAP there is a Function Module BAPI_GETGLACCPERIODBALANCES to carry forward balance GL account. But in this case GL account (Balance Sheet) that i used (BS200150) using IO Number as is cost object, I want to know if there is a function
-
Ok I'm trying to put an image in a full screen JPanel, why isn't it working? package game; import gui.FullScreenDisplay; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.Runnable; import java.lang.Thread; publ
-
If buy a iPad online do the cellular plan come lock to a single provider, or can be use with any provider? If I buy on the USA store can I use it outside the USA?