Radio button in dynamic ALV grid
Hi guys!
I want to implement a dynamical ALV grid with a radiobutton in the first column.
when clicking a button, or processing the program i want to get the information of the selected row and perform other things....
Can someone help me with a code example for this, or just tell me where i can find the necessary information`?
regards
thomas
Hi,
I dont understand why you need Radio button, If you use REUSE_ALV_GRID_DISPLAY the output grid will by default allow you to select only one row.
see the program - BCALV_FULLSCREEN_DEMO for more information
Similar Messages
-
Create standard sap "SAVE" button along with ALV grid buttons
I need to create a standard SAP "Save" button in my ALV GRID display in the application tool bard
I copied the PF-Status 'standard' from a SAP program and assinged it here.
When i try to add the SAP save buttion by using this standard pf-status , its not getting displayed in the application tool bar.
But in STandard TOOl bar (in menu painter ) , when i assign save its displayed in the screen .
I need this to be displayed in the application tool ba
Please suggest me how to do this.
Thanks in advance.Hello,
Application of ALV means the place where the buttons(standard for ALV) like sort,add,delete,copy etc are dipslayed.IF u need need to add a save button on the same toolbar/same place u need to copy the standard GUI status of standard ALV program .For that go to SE80 , give the program name as SAPLSLVC_FULLSCREEN
In the GUI status u'll find the status named as STANDARD_FULLSCREEN ....Right click on it and give the "TO Program " as your program.Now once u activate ur program u'll find the same status there.
add ur save button in the status by edidting it. Now u need to write the FORM ENDFORM for user command and assign the form name in caps to the USER_COMMAND parameter in the func module REUSE_ALV_GRID_DISPLAY.
Hope this help.
Regards,
Neeraj -
How can we add a button on our ALV Grid
Hello,
I need to add a button on the ALV Grid and write a code on that button to download a file on the desktop of the user's machine.
How can we write a code for the same and what would be the syntax of that code.Hi,
you should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
ENTER SAPLKKBL PROGRAM
STATUS STANDARD.
exexute.
select standard check box. copy to your zprogram and your gui status.
Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
then go to se 38 double click on pf status .it goes to me41 screen .
there you can add your button along with predefined buttons on application toolbar.
then write code for button using user command event.
Code:
Form Set_pf_status
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called '%DELETE'.
3). Create the following report:
Code:
Form User_command
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
Detects whether the icon/button for
'Return Tag Deletion' has been pressed. If it has then
detect whether any rows have been highlighted and then
set the delete flag.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: li_count TYPE I.
IF r_ucomm EQ '%DELETE'.
LOOP AT %g00 WHERE mark EQ 'X'.
ADD 1 TO li_count.
ENDLOOP.
IF li_count GT 0.
gc_delete_flag = 'X'.
r_ucomm = '&F03'. "Back arraow
ELSE.
MESSAGE W000 WITH 'Please highlight the rows to be deleted!'.
ENDIF.
ENDIF.
ENDFORM. "User_command
*reward points if usefull -
Can we disable the default push buttons on the ALV Grid
Hi,
Can we disable the default push buttons on the ALV
Grid Control...
If so, pls send me the procedure...
thanks and regards
raghuHi,
In the PBO:
PERFORM f9100_exclude_functions USING :
i_exclude[] '&CHECK',
i_exclude[] '&REFRESH',
i_exclude[] '&LOCAL&CUT' ,
i_exclude[] '&LOCAL©',
i_exclude[] '&LOCAL&PASTE',
i_exclude[] '&LOCAL&PASTE_NEW_ROW',
i_exclude[] '&LOCAL&UNDO' ,
i_exclude[] '&LOCAL&APPEND',
i_exclude[] '&LOCAL&INSERT_ROW',
i_exclude[] '&LOCAL&DELETE_ROW',
i_exclude[] '&SORT_ASC',
i_exclude[] '&SORT_DSC',
i_exclude[] '&FIND',
i_exclude[] '&SUMC',
i_exclude[] '&SUBTOT',
i_exclude[] '&MINIMUM',
i_exclude[] '&MAXIMUM' ,
i_exclude[] '&VGRID' ,
i_exclude[] '&VEXCEL' ,
i_exclude[] '&VCRYSTAL',
i_exclude[] '&HTML',
i_exclude[] '&MAINTAIN',
i_exclude[] '&SAVE',
i_exclude[] '&GRAPH',
i_exclude[] '&HELP',
i_exclude[] '&ALL' ,
i_exclude[] '&SAL' .
* i_exclude[] '&EXCLALLFC'.
*& Form f9100_exclude_functions
* This form exclude buttons from the toolbar.
* -->P_IEXCLUDE text
* -->P_1150 text
FORM f9100_exclude_functions USING pexclude LIKE i_exclude
value(pfunction).
DATA: l_exclude TYPE ui_func.
l_exclude = pfunction.
APPEND l_exclude TO pexclude.
ENDFORM. " f9100_exclude_functions
This will exculde the default push buttons.
Let us know if it works for you.
Regards,
Anjali -
How to add a push button on an ALV grid ?
Hi,
How to add a push button on an ALV grid, using ON_TOOLBAR, ON_USERCOMMAND Methods. Clicking on that push button, a new screen has to be displayed.Hi,
Assuming that you want to have a "push-button" column, i.e. push-buttons within an ALV grid then you need to implement the following steps:
(1) Set the style of the column as button
ls_fcat-style = CL_GUI_ALV_GRID => MC_STYLE_BUTTON.
(2) When the user pushes the button event BUTTON_CLICK is triggered. Thus, define an appropriate event handler method.
<b>Reward points</b>
Regards -
Create deep structure to disable some cells in Dynamic ALV GRID
Hi,
I want to disable some cells in a Dynamic ALV Grid before calling "SET_tABLE_Display" Method.
I check the BCALV_EDIT_02, where some cells are grayed out by assign the CL_GUI_ALV_GRID-MC_STYLE_DISABLED to the field name.
But I want the same using Field symbol.
I'm creating Dynamic table and dynamic structure based on the Dynamic field catalog.
Example: <FT_TAB> TYPE STANDARD TABLE,
<FS_TAB> TYPE ANY,
DATA: INT_TAB is my dynamic table values.
For the INT_TAB internal table, I created dynamic Structure and dynamic field symbol table.
LOOP AT INT_TAB.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <FS_TAB> TO <F_VALUE>
<F_VALUE> = INT_TAB-MATNR.
APPEND <FS_TAB> TO <FT_TAB>
"Here is the problem occurs, I want to grayed out the MATNR value based on some condition.
ENDLOOP.
I would like to set the 'MATNR' value to be grayed out by passing the CL_GUI_ALV_GRID-MC_STYLE_DISABLED.
and update into <FT_TAB>( <FT_TAB> structure will have 2 structures)
Finally the fieldsymbol should have two structure ( <F_TAB> = DYNAMIC STRUCTURE + LVC_S_STYLE )
Display alv grid by passing <FT_TAB> to set_table_display method.
Thanks in advance,
Kumar.Hi,
I am not sure whether I really understand your request. Let me try to help.
> Example: <FT_TAB> TYPE STANDARD TABLE,
> <FS_TAB> TYPE ANY,
>
> DATA: INT_TAB is my dynamic table values.
>
>
> LOOP AT INT_TAB.
> ASSIGN COMPONENT 'MATNR' OF STRUCTURE <FS_TAB> TO <F_VALUE>
> <F_VALUE> = INT_TAB-MATNR.
> APPEND <FS_TAB> TO <FT_TAB>
Here <FT_TAB> must already be assigned to some internal table with a given (dynamic) structure. Did this happen before this piece of code?
What I would do is to create a dynamic table (see documentation to CREATE DATA) with MATNR and the STYLE field (LVC_T_STYL). See the documentation for CREATE DATA - creation of internal tables. When collection the field descriptions for that internal table I would also build the field catalogue for the ALV.
Then assign <FT_TAB> to that newly created internal table, <FS_TAB> to a newly created structure (same as a table line).
Move the MATNR to component 1 (or component 'MATNR') of the table and fill the style table according to your needs. Then insert the <FS_TAB> into <FT_TAB>.
Finally call the ALV SET_TABLE... method with your dynamic table and your field catalogue.
Regards,
Gerd Rother -
Dynamic ALV Grid is not displaying !!
Hi all,
I am trying to create dynamic alv grids and upto five levels(five grids) out put is displaying fine without any problem. But when I try to display the 6th grid, the program is going into infinite loop and getting timed out. Even I tried to increse the height of the grid even though it is not displaying.
Please correct me if any thing is wrong in below code.
*1st Level grid
IF <table1> IS ASSIGNED AND <table1> IS NOT INITIAL.
CREATE OBJECT ob_split1
EXPORTING
parent = ob_custom
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split1 '20'.
CREATE OBJECT ob_grid1
EXPORTING
i_parent = ob_split1->top_left_container.
ELSE.
CREATE OBJECT ob_split1
EXPORTING
parent = ob_custom
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split1 '0'.
ENDIF.
*2nd Level grid
IF <table2> IS ASSIGNED AND <table2> IS NOT INITIAL.
CREATE OBJECT ob_split2
EXPORTING
parent = ob_split1->bottom_right_container
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split2 '20'.
CREATE OBJECT ob_grid2
EXPORTING
i_parent = ob_split2->top_left_container.
ELSE.
CREATE OBJECT ob_split2
EXPORTING
parent = ob_split1->bottom_right_container
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split2 '0'.
ENDIF.
(Created 3rd,4th,5th same like above).
*6th Level grid
IF <table6> IS ASSIGNED AND <table6> IS NOT INITIAL.
CREATE OBJECT ob_split6
EXPORTING
parent = ob_split5->bottom_right_container
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split6 '20'.
CREATE OBJECT ob_grid6
EXPORTING
i_parent = ob_split6->top_left_container.
ELSE.
CREATE OBJECT ob_split6
EXPORTING
parent = ob_split5->bottom_right_container
orientation = cl_gui_easy_splitter_container=>orientation_vertical.
PERFORM set_split_height USING ob_split6 '0'.
ENDIF.
Appreciated your reply. Please let me know for additional info.
Thanks,
Ranjith.
Edited by: Thomas Zloch on Dec 8, 2010 5:44 PM - please use code tagsHi romanch,
defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
<alv_fieldcat>-cfieldname = 'HWAER'.
This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
Regards,
Clemens -
Hi experts,
I am having a dynamic ALV grid. How to create a new grid(second grid) in the same page with different values?
Thanks&Regards,
vinoAdd 2 view containers, create 2 different usages of AVL component and embed the view of these 2 alv components in 2 view containers..
Hope this helps
manas dua -
hi experts,
i have a requirement to create a alv grid report and in the output one column should be editable.(till here every thing is correct what i did)
i have to create a 'update' button to the tool bar of alv output screen so that if i enter my own data in the editable screen,and press 'update' button then my database table should be updated..
can anyone tell me how to create 'update' button and write code for that.
my code is as below:
TABLES: vbak,vbap.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_final,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
matnr LIKE vbap-matnr,
posnr LIKE vbap-posnr,
END OF t_final.
DATA: i_final TYPE STANDARD TABLE OF t_final INITIAL SIZE 0,
wa_final TYPE t_final.
*ALV data declarations
DATA: fieldcatalog 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.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'VBELN'.
fieldcatalog-seltext_m = 'sales order'.
fieldcatalog-col_pos = 0.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ERDAT'.
fieldcatalog-seltext_m = 'date'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'material no.'.
fieldcatalog-col_pos = 2.
fieldcatalog-edit = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'POSNR'.
fieldcatalog-seltext_m = 'line item no.'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
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'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
TABLES
t_outtab = I_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.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT avbeln aerdat bmatnr bposnr FROM vbak AS a
INNER JOIN vbap AS b ON avbeln = bvbeln
INTO TABLE i_final WHERE avbeln = bvbeln.
ENDFORM. " DATA_RETRIEVAL
points will be rewarded.Hi Nani
TO add a button on alv tool bar and to handle it
u have to use object oriented approach
for this u have to define class and implement class in which u will write code inside the method to hadle particlur event
here is the code for it.
*& Class z_cl_9_u_EVENT_RECEIVER this class contains the definition
of methods for handling events
CLASS z_cl_9_u_event_receiver DEFINITION DEFERRED.
DATA : event_receiver TYPE REF TO z_cl_9_u_event_receiver.
*data: create object e1 type ref to cl_alv_event_toolbar_set.
*& Class z_cl_9_u_EVENT_RECEIVER this class contains the definition
of methods for handling events
CLASS z_cl_9_u_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "z_cl_9_u_EVENT_RECEIVER
CLASSES
CLASS lcl_event_receiver DEFINITION DEFERRED.
*& Class (Implementation) z_cl_9_u_EVENT_RECEIVER
Add a Update Button On ALV-Toolbar and put the logic
for handing that button
*& Class z_cl_9_u_EVENT_RECEIVER this class contains the implementation
of methods for handling events.
CLASS z_cl_9_u_event_receiver IMPLEMENTATION.
*& Method HANDLE_TOOLBAR is to handle toolbar.
In event handler method for event TOOLBAR: Append own functions
by using event parameter E_OBJECT.
METHOD handle_toolbar.
In event handler method for event TOOLBAR: Append own functions
by using event parameter E_OBJECT.
DATA: L_T_toolbar TYPE stb_button.
Append an icon to update tables if country is otherthan NZ.
IF g_flag = c_x AND g_back NE c_x.
CLEAR L_T_toolbar.
MOVE 0 TO L_T_toolbar-butn_type.
MOVE 'UPDATE' TO L_T_toolbar-function.
MOVE icon_modify TO L_T_toolbar-icon.
MOVE text-062 TO L_T_toolbar-quickinfo.
MOVE '' TO L_T_toolbar-text.
MOVE ' ' TO L_T_toolbar-disabled.
APPEND L_T_toolbar TO e_object->mt_toolbar.
In a self defined button, you can disable the button with option DISABLED = 'X'
ELSEIF g_back = c_x.
CLEAR L_T_toolbar.
L_T_toolbar-function = 'UPDATE'.
L_T_toolbar-butn_type = 0.
L_T_toolbar-icon = icon_modify.
L_T_toolbar-quickinfo = text-015.
L_T_toolbar-disabled = 'X'.
APPEND L_T_toolbar TO e_object->mt_toolbar.
CLEAR ok_code.
ENDIF.
ENDMETHOD. "handle_toolbar
*& Method HANDLE_USER_COMMAND does processing based on user inputs.
E_UCOMM has the user command.
METHOD handle_user_command.
In event handler method for event USER_COMMAND:
DATA: L_T_Rows TYPE lvc_t_row,
L_Size TYPE sy-tabix.
CASE e_ucomm.
WHEN 'UPDATE'.
REFRESH L_T_Rows.
CALL METHOD alv_grid->get_selected_rows
IMPORTING
et_index_rows = L_T_Rows.
CALL METHOD cl_gui_cfw=>flush.
DESCRIBE TABLE L_T_Rows LINES L_Size.
IF L_Size IS INITIAL.
MESSAGE i071.
ELSE.
Execute this subroutines to capture the changed data
in ALV and pass it to Ztables,
PERFORM f4700_update_table TABLES L_T_Rows.
PERFORM f4800_get_changed_data.
PERFORM f0500_get_analysis_details USING g_socnr g_matnr.
CALL METHOD alv_grid->refresh_table_display.
ENDIF.
ENDCASE.
ENDMETHOD. "handle_user_command
ENDCLASS.
now call these methods wher eever u r calling the alv like in PBO of screen.
IF g_custom_container IS INITIAL.
g_t_lvc_s_layo-info_fname = c_l_line_colour.
g_t_lvc_s_layo-no_keyfix = '1'. "
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CONTAINER_DETAIL'.
CREATE OBJECT alv_grid
EXPORTING i_parent = g_custom_container.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'structre of table'
is_layout = g_t_lvc_s_layo
CHANGING
it_outtab = g_t_outtab[]
it_fieldcatalog = g_t_fieldcat.
*OLY EN01434 BEGIN
->Create Object to receive events and link them to handler methods.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_user_command FOR alv_grid.
SET HANDLER event_receiver->handle_toolbar FOR alv_grid.
ELSE. "SUBSEQUENT ITERATIONS:
F g_custom_container IS INITIAL.
Layout field 'info-fname' points to the field/column in the
OUTTAB that controls the colour attribute. (OUTTAB is
maintained in function Y_DIP_METER_REC_CALCULATION).
g_t_lvc_s_layo-info_fname = c_l_line_colour.
g_t_lvc_s_layo-no_keyfix = '1'. "RSC18Sep02 - allow hor scroll
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CONTAINER_DETAIL'.
CREATE OBJECT alv_grid
EXPORTING i_parent = g_custom_container.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZV9NDMRA'
is_layout = g_t_lvc_s_layo
CHANGING
it_outtab = g_t_outtab[]
it_fieldcatalog = g_t_fieldcat.
*OLY EN01434 BEGIN
->Create Object to receive events and link them to handler methods.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_user_command FOR alv_grid.
SET HANDLER event_receiver->handle_toolbar FOR alv_grid.
ELSE. "SUBSEQUENT ITERATIONS:
*********SAVE IMPORT PARMAETER IS ADDED BY NEEC
PERFORM f4900_set_excluding_buttons." USING sy-dynnr.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZV9NDMRA'
is_layout = g_t_lvc_s_layo
it_toolbar_excluding = g_t_toolbar_excl
CHANGING
it_outtab = g_t_outtab[]
it_fieldcatalog = g_t_fieldcat.
CALL METHOD alv_grid->set_toolbar_interactive.
CALL METHOD alv_grid->refresh_table_display.
I hope it will help to sme extent
Rewards if helpful and if any help required reply back.....
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZV9NDMRA'
is_layout = g_t_lvc_s_layo
it_toolbar_excluding = g_t_toolbar_excl
CHANGING
it_outtab = g_t_outtab[]
it_fieldcatalog = g_t_fieldcat.
CALL METHOD alv_grid->set_toolbar_interactive.
CALL METHOD alv_grid->refresh_table_display. -
How to add the REFRESH button in OOPs ALV grid
how to add the REFRESH button in OOPs ALV grid
Hi Naidu.
Check the below code:
Local Class Definition and implementation For events handeling
CLASS LCL_EVENT DEFINITION .
PUBLIC SECTION.
METHODS :TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT,
USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS.
CLASS LCL_EVENT IMPLEMENTATION.
METHOD TOOLBAR.
WA_TOOL-FUNCTION = 'ZFC1'.
WA_TOOL-TEXT = 'TEST'.
WA_TOOL-ICON = '@EA@'.
APPEND WA_TOOL TO E_OBJECT->MT_TOOLBAR.
ENDMETHOD. "DISPLAY
METHOD USER_COMMAND.
IF E_UCOMM = 'ZFC1'.
ENDIF.
ENDMETHOD. "USER_COMMAND
ENDCLASS. "LCL_EVENT IMPLEMENTATION
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZALV_BTON'.
SELECT * FROM VBAK INTO TABLE GT_VBAK
UP TO 30 ROWS.
**** CREATE CONTAINER OBJECT
CREATE OBJECT MY_CONTAINER
EXPORTING
CONTAINER_NAME = 'CC1'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6 .
****** GRID TO CONTAINER
CREATE OBJECT ALV
EXPORTING
I_PARENT = MY_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
CREATE OBJECT OBJ.
SET HANDLER : OBJ->TOOLBAR FOR ALV.
SET HANDLER : OBJ->USER_COMMAND FOR ALV.
****** ALV DISPLAY
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'VBAK'
CHANGING
IT_OUTTAB = GT_VBAK[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
* text
MODULE USER_COMMAND_0200 INPUT.
IF SY-UCOMM EQ 'BACK'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0200 INPUT
Regards
Kumar M -
How to validate the columns in dynamic alv grid
Hi Friends,
I want to validatethe value of all the columens (min 1 and max 40) which i create dynamically in alv grid.
value must be between 0 and 1 only.
Please help ,, need urgently.method handle_data_changed.
data: ls_good type lvc_s_modi,
li_diff type i,
value type p DECIMALS 3,
old_value type p DECIMALS 3,
lw_outtab1 type gt_tab.
clear value.
loop at er_data_changed->mt_good_cells into ls_good.
value = ls_good-value.
old_value = ls_good-value.
if value lt 0 or value gt 1.
MESSAGE 'Value is out of range' TYPE 'I'.
Read table gt_outtab1 into lw_outtab1 index ls_good-row_id .
perform show_alv.
clear ls_good.
ENDIF.
ENDCASE.
ENDLOOP.
I again created the table.. actually data is not changed in the internal table but still it shows the changed value in the alv grid. even in build the table again and call the refersh alv grid method.. -
How can I hide the marker button in an ALV GRID line?
Hi all,
I am switching an old program from ALV LIST to ALV GRID. In the old list, I put a checkbox on each line to abilify the user to mark some lines. However, there are some lines that I don't want the user to select. In the list, I set the field for the box name to "*" (asterisk) and in the list, the checkbox is not input enabled.
Now in the grid, this does not function any more. all lines are markable. How can I deactivate the marker function for some lines?
Greetings
JörgHi,
use the below snippet in your code
DATA: ls_celltab TYPE lvc_s_styl.
REFRESH pt_celltab.
IF p_mode EQ text-103.
*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
to status "editable".
ls_celltab-fieldname = c_character1.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_character2.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_character3.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = text-107.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_selectionid.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE pt_celltab.
Regards -
Dynamic ALV GRID screen in a class? Possible?
I have created a class(I have done it locally as to be able to use it for mutiple clients) that I include in programs that I want to implement the alv grid for using the FM approach. Doing this allows me to easily implement the ALV quickly. However, I am wanting to use the OO ALV grid approach since there is more flexibility and control doing it this way. But I do not want to have to create a screen for every program that I want to do this for, I would like to just have a method in my existing class that would call a screen and then be able to control it like normal. I know that screens can not be called from a method so I was thinking of doing something similiar to another post using a FM to call the screen. I realize that this could be complicated because certain methods for the ALV GRID are called in the PBO/PAI events. Any help or suggestions would be appreciated.
Note: I am on 6.20 and have searched all over the web before posting.
Thanks.Yes, i have written a function module which calls a generice ALV grid in a dialog box. Everything about the ALV grid is encapsulated in a function module. In this case, all I need to do is send this function module a fieldcatalog and the data, that's about it. Doing this may limit the functionality of event handling or you would just have to handle everything by doing more code for it.. This function module is very simple, not a whole lot to it. You could do something like this only instead of using a model dialog box, you would throw a regular dynpro.
function z_popup_with_alvgrid.
*"*"Global interface:
*" IMPORTING
*" REFERENCE(ENDPOS_COL) TYPE I DEFAULT 90
*" REFERENCE(ENDPOS_ROW) TYPE I DEFAULT 22
*" REFERENCE(STARTPOS_COL) TYPE I DEFAULT 10
*" REFERENCE(STARTPOS_ROW) TYPE I DEFAULT 2
*" REFERENCE(TEXTLINE1) TYPE C OPTIONAL
*" REFERENCE(TEXTLINE2) TYPE C OPTIONAL
*" REFERENCE(TEXTLINE3) TYPE C OPTIONAL
*" REFERENCE(TEXTLINE4) TYPE C OPTIONAL
*" REFERENCE(TITLE) TYPE C OPTIONAL
*" REFERENCE(FIELDCAT) TYPE LVC_T_FCAT
*" TABLES
*" I_ALV
call screen 0200 starting at startpos_col
startpos_row
ending at endpos_col
endpos_row.
endfunction.
* Module STATUS_0200 OUTPUT
module status_0200 output.
set pf-status '0200'.
set titlebar '0200' with title.
data: alv_container type ref to cl_gui_custom_container.
data: alv_grid type ref to cl_gui_alv_grid.
data: xfieldcat type lvc_t_fcat.
xfieldcat = fieldcat.
* Create Controls
create object:
alv_container
exporting
container_name = 'ALV_CONTAINER',
alv_grid
exporting
i_parent = alv_container.
* Set grid for first display
call method alv_grid->set_table_for_first_display(
exporting
i_structure_name = 'I_ALV'
changing
it_outtab = i_alv[]
it_fieldcatalog = xfieldcat[] ).
endmodule.
* Module USER_COMMAND_0100 INPUT
module user_command_0200 input.
case sy-ucomm.
when 'CONTINUE' or 'CANCEL'.
set screen 0.
leave screen.
endcase.
endmodule.
Regards,
Rich Heilman -
Hi experts,
I have a ALV Grid display, for example I selected 2 rows out of 5 from the display ALV, then I have a footer which contains: number of line items selected : v_no_lines. The v_no_lines is the number of rows selected from the display ALV which is 2. The total number of line items selected should be displayed on the bottom section of the ALV Grid.DATA:wf_data TYPE REF TO data,
wf_str TYPE REF TO data.
DATA: wf_alv TYPE REF TO cl_salv_table.
FIELD-SYMBOLS:<fs_tab> TYPE STANDARD TABLE,
<fs_line> TYPE ANY,
<fs_f> TYPE ANY,
<fs_t> TYPE ANY..
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
class = 'ENG-DATA-METALS'
classtext = ' '
classtype = 'Z03'
features = 'X'
language = sy-langu
object = '338127-1'
objecttable = 'MARA' "tcla-obtab
key_date = sy-datum
initial_charact = ' '
change_service_clf = ' '
inherited_char = ' '
change_number = ' '
TABLES
t_class = i_sclass[]
t_objectdata = i_object[]
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
CHECK sy-subrc = 0.
lines = LINES( i_object ). -
Radio button affecting dynamic action
Hi
I am trying to implement Radio Button in apex 4.1.1 , on selecting radio button , it show and hide regions. I got that working
I was wonder if , i include more static value to radio groups and which are only shown , when authenticated user is logged in or is not a public user and then on selecting same non public radio button it show authenticated region only.
All in same radio groups
radio 1 show this to public user
radio 2 (shown on logged in) when selected show this region.
thanks in advanceHi,
>
I am trying to implement Radio Button in apex 4.1.1 , on selecting radio button , it show and hide regions. I got that working
I was wonder if , i include more static value to radio groups and which are only shown , when authenticated user is logged in or is not a public user and then on selecting same non public radio button it show authenticated region only.
All in same radio groups
radio 1 show this to public user
radio 2 (shown on logged in) when selected show this region.
>
Radio buttons are complex HTNL elements. While it is theoretically possible to manipulate then with JavaScripts it is simpler and better to have 2 separate items and hide/show them conditionally.
If you must use one group then you will need to use jQuery selectors to get hold of the buttons individually. Look up the element in HTML DOM using browser "inspection" utilities, e.g. FF+Firebug, and you can work out the selector.
Cheers,
Maybe you are looking for
-
ANNA OR BELLE Support for Nokia E5-00
Is There Any New Software Available for nokia E5-00 The Current Software Version On My Phone Is 102.002 Dated 30/12/2012 RM 632 Solved! Go to Solution.
-
Job termination in source system
Dear All, I am trying to load payroll data using Datasource ZHR_PY_1 . I am doing init data for the first time using infopackage for this datasource. I have tried to pull a couple of years, 2 months, even 1 day of data, but all give me the same
-
Hi All, Currently we are upgrading from 3.0B version to the latest BI 7.0 Netweaver 2004 version I need some help .Currently we use the BEX Browser to deploy Excel queries to the general users. In the new version, the BEX Browser is no longer support
-
I am getting Error code : 50 while installing update on CC
I am getting Error code : 50 while installing update on CC@
-
Unable to find a file...
hey guys, i need help finding a file. i can easily find it using windows7, but can't on OSX. it seems like OSX is searching for strings of text within files rather than actual filenames. i've been using spotlight. thanks