Usage of insert button in Std ALV toobar (OOPs)
Hi Experts,
I have developed an ALV(oops) with cl_gui_alv_grid. I have the std toolbar and do NOT want to disable it.
what i need is when i click on insert button in std toolbar, i need to make a field editable.
The func code for insert is &LOCAL&INSERT_ROW ( see in e_object->mt_toolbar).
I am unable to trap the func code. i tried to make use of this func code iand use it in the handle_toolbar method (e_ucomm). Its not going into debugging mode even when i set break point.
i want to write code as:
when '&LOCAL&INSERT_ROW'.
further validation.
Can someone help me how to get the sy-ucomm and do my validation?
Thanks
Dan
Hi
You can achieve this by defining Style Table for Cells.
For eg:
Begin of <str>
include structure mara.
celltab TYPE lvc_t_styl,
end of <str>
data: lt_tab type table of <str>,
wa like line of lt_tab,
lt_celltab TYPE lvc_t_styl,
ls_celltab TYPE lvc_s_styl.
LOOP AT lt_tab INTO wa.
IF matnr IS NOT INITIAL.
ls_celltab-fieldname = 'MATNR'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE lt_celltab.
endif.
INSERT LINES OF lt_celltab INTO TABLE ls_profile_tabval-celltab.
endloop.
Thanks
Nisha
Similar Messages
-
Hi all,
Can any body please tell me that in ALV grid, how can i get the drop down for insert button in the tool bar with options "Add 1", "Add 2" ... inserting 1, 2 or 3 lines??
Thanks in advance,
Kulwant1) define following macro
DEFINE toolbar_funcs.
CLEAR ls_toolbar.
MOVE 0 TO ls_toolbar-butn_TYPE.
MOVE &1 TO ls_toolbar-function.
MOVE SPACE TO ls_toolbar-disabled.
MOVE &2 TO ls_toolbar-icon.
MOVE &3 TO ls_toolbar-quickinfo.
APPEND ls_toolbar TO e_object->mt_toolbar.
END-OF-DEFINITION.
2) in the class definition
EVENTS: user_command.
METHODS:
on_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING
e_ucomm
sender,
on_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive.
3) define the handlers
SET HANDLER z_object->on_user_command for grid1.
SET HANDLER z_object->on_toolbar for grid1.
4) in the implementation part code the functions you've given your buttons
for example
METHOD on_user_command.
break-point 1.
CASE e_ucomm.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'EXCEL'.
CALL METHOD me->download_to_excel.
WHEN 'SAVE'.
WHEN 'PROC'.
CALL METHOD me->process.
WHEN 'REFR'.
CALL METHOD me->refresh.
ENDCASE.
ENDMETHOD. "on_user_command
In the toolbar method --use YOUR buttons and functions
Using the macro in step 1) means you have to write a lot less code. Some people don't like macros but in this case we are using it for pure code generation and not complex processing so it's (IMO) still OK.
METHOD on_toolbar.
customize this section with your own Buttons
When a button is pressed method ON_USER_COMMAND is entered
toolbar_funcs 'EXIT' icon_system_end 'Click2exit'.
toolbar_funcs 'SAVE' icon_system_save 'Savedata'.
toolbar_funcs 'EDIT' icon_toggle_display_change 'Edit data'.
toolbar_funcs 'PROC' icon_businav_process 'Process'.
toolbar_funcs 'EXCEL' icon_xxl 'Excel'.
toolbar_funcs 'REFR' icon_refresh 'Refresh'.
ENDMETHOD. "on_toolbar
Change the toolbar button type to what you want. It's all in the ALV documentation. The code above uses standard rather than drop down buttons but the process is the same.
The permitted values and types can be found by looking at the values for domain TB_BTYPE.
I think you want 2 (Menu type button).
Change this line in the macro
MOVE 0 TO ls_toolbar-butn_TYPE.
For a menu set the type to 2.
Include the menu handler in the class definition
handle_menu_button
FOR EVENT menu_button OF cl_gui_alv_grid
IMPORTING e_object e_ucomm,
SET HANDLER z_object->handle_menu_button FOR grid1.
Add your choices when you click the button
METHOD handle_menu_button.
handle own menubuttons
IF e_ucomm = 'DETAIL_MENU'.
CALL METHOD e_object->add_function
EXPORTING fcode = 'ADD1'
text = text1.
CALL METHOD e_object->add_function
EXPORTING fcode = 'ADD2'
text = text2.
ENDIF.
ENDMETHOD.
The choices (function codes from your menu) are still handled in the ON_USER_COMMAND.
Cheers
Jimbo -
ALV Grid default values for new rows added with Add/Insert buttons
Hi!
Help, please, to find a way how to set default values for new rows added with Add/Insert buttons in
ALV Grid.I have found salution:
ALV Grid u2013 Insert row function
Sometimes we need to assign some default values when we create a new row in a grid using standard ALV Append row button. In our scenario we will see how to assign default values to Airline Code (CARRID), Flight Connection Number (CONNID) and Flight date (FLDATE) when a new row is created. To do that we need to handle DATA_CHANGED event in the program like mentioned below.
Definition of a class:
Code:
CLASS lcl_event_receiver DEFINITION
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed
e_ucomm.
ENDCLASS. "lcl_event_receiver DEFINITION
Implementation of a class:
Code:
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_DATA_CHANGED.
DATA: dl_ins_row TYPE lvc_s_moce. " Insert Row
FIELD-SYMBOLS: <fs> TYPE table. " Output table
Loop at the inserted rows table and assign default values
LOOP AT er_data_changed->mt_inserted_rows INTO dl_ins_row.
ASSIGN er_data_changed->mp_mod_rows->* TO <fs>.
loop at <fs> into ls_outtab.
ls_outtab-carrid = 'LH'.
ls_outtab-connid = '400'.
ls_outtab-fldate = sy-datum.
MODIFY <fs> FROM ls_outtab INDEX sy-tabix.
endloop.
endloop.
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
Register the events to trigger DATA_CHANGED event when a new row is created.
Code:
CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED. -
Hi ,
I need to insert a row in ALV output. On click of a Inser Row button a pop up should show with a parameter.Once the value in entered in the parameter enter is hit , the first column of the new row should have value put in that parameter as non editable field.
The Insert row of standard toolbar inserts a blank row . Is there any way to incorporate the above logic in the standard toolbar?
I'm using CL_GUI_ALV_GRID to display the ALV.
It would be helpful if you provide sample coding.
Thanks.
Ajith
Edited by: Ajith Krishna on Oct 28, 2008 8:01 PMHello Ajith
The enhanced version of sample report ZUS_SDN_ALVGRID_EDITABLE_8A demonstrates how to implement your requirement.
*& ZUS_SDN_ALVGRID_EDITABLE_8A
*& Thread: Insert a row in ALV
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1105097"></a>
*& Thread: Blanking values on ALV Grid Row Duplicate
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1057161"></a>
*& Thread: Delete line event in ALV
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="945471"></a>
REPORT zus_sdn_alvgrid_editable_8a.
TYPES: BEGIN OF ty_s_outtab.
INCLUDE TYPE knb1.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab TYPE STANDARD TABLE OF ty_s_outtab
WITH DEFAULT KEY.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
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_outtab TYPE ty_t_outtab.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
mt_sel_rows TYPE lvc_t_row.
CLASS-METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
sender,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING
e_ucomm
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
* define local data
DATA: ls_button TYPE stb_button.
LOOP AT e_object->mt_toolbar INTO ls_button.
CASE ls_button-function.
when cl_gui_alv_grid=>MC_FC_LOC_INSERT_ROW.
ls_button-function = 'INSERT_ROW'.
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
WHEN cl_gui_alv_grid=>mc_fc_loc_delete_row.
ls_button-function = 'DELETE_ROW'.
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
WHEN cl_gui_alv_grid=>mc_fc_loc_copy_row OR
cl_gui_alv_grid=>mc_fc_loc_copy.
ls_button-function = 'COPY_ROW'.
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
WHEN OTHERS.
CONTINUE.
ENDCASE.
ENDLOOP.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
* define local data
DATA: lt_rows TYPE lvc_t_row,
ls_row TYPE lvc_s_row.
REFRESH: mt_sel_rows.
CASE e_ucomm.
when 'INSERT_ROW'.
WHEN 'DELETE_ROW'.
WHEN 'COPY_ROW'.
WHEN OTHERS.
RETURN.
ENDCASE.
" User wants to delete or copy rows => store them in class attribute
" and trigger PAI afterwards where we actually delete /copy the rows
" and do the recalculations (in case of deletion)
CALL METHOD sender->get_selected_rows
IMPORTING
et_index_rows = mt_sel_rows
* et_row_no =
* Trigger PAI
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = e_ucomm
* IMPORTING
* rc =
ENDMETHOD. "user_command
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '2000' OBLIGATORY.
START-OF-SELECTION.
SELECT * FROM knb1 INTO CORRESPONDING FIELDS OF TABLE gt_outtab
UP TO 15 ROWS
WHERE bukrs = p_bukrs.
PERFORM init_controls.
SET HANDLER:
lcl_eventhandler=>handle_toolbar FOR go_grid,
lcl_eventhandler=>handle_user_command FOR go_grid.
" Used to replace standard toolbar function code with custom FC
go_grid->set_toolbar_interactive( ).
* 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.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN 'INSERT_ROW'.
perform INSERT_ROW.
WHEN 'DELETE_ROW'.
PERFORM delete_rows.
WHEN 'COPY_ROW'.
PERFORM copy_rows.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
CALL METHOD go_grid->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. " 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.
* Only non-key fields are editable
ls_fcat-edit = 'X'.
MODIFY gt_fcat FROM ls_fcat
TRANSPORTING edit
WHERE ( key NE 'X' ).
ENDFORM. " BUILD_FIELDCATALOG_KNB1
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* 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.
* 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_outtab
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.
ENDFORM. " INIT_CONTROLS
*& Form delete_rows
* text
* --> p1 text
* <-- p2 text
FORM delete_rows .
* define local data
DATA: ls_row TYPE lvc_s_row.
SORT lcl_eventhandler=>mt_sel_rows BY index DESCENDING. " !!!
LOOP AT lcl_eventhandler=>mt_sel_rows INTO ls_row.
DELETE gt_outtab INDEX ls_row-index.
ENDLOOP.
" After deleting rows do RE-CALCULATION
* perform RECALCULATION.
ENDFORM. " delete_rows
*& Form COPY_ROWS
* text
* --> p1 text
* <-- p2 text
FORM copy_rows .
* define local data
DATA: ld_next TYPE i,
ls_row TYPE lvc_s_row,
ls_outtab TYPE ty_s_outtab.
SORT lcl_eventhandler=>mt_sel_rows BY index DESCENDING. " !!!
LOOP AT lcl_eventhandler=>mt_sel_rows INTO ls_row.
READ TABLE gt_outtab INTO ls_outtab INDEX ls_row-index.
CLEAR: ls_outtab-akont. " In your case: clear GUID
ld_next = ls_row-index + 1.
INSERT ls_outtab INTO gt_outtab INDEX ld_next.
ENDLOOP.
ENDFORM. " COPY_ROWS
*& Form INSERT_ROW
* text
* --> p1 text
* <-- p2 text
form INSERT_ROW .
* define local data
DATA: ld_value1 type SPOP-VARVALUE1,
ls_outtab TYPE ty_s_outtab.
CALL FUNCTION 'POPUP_TO_GET_ONE_VALUE'
EXPORTING
textline1 = 'Enter Value (4 Chars):'
* TEXTLINE2 = ' '
* TEXTLINE3 = ' '
titel = 'Enter Value'
valuelength = 4
IMPORTING
* ANSWER =
VALUE1 = ld_value1
EXCEPTIONS
TITEL_TOO_LONG = 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.
ls_outtab-kunnr = ld_value1.
ls_outtab-bukrs = ld_value1.
append ls_outtab to gt_outtab.
endform. " INSERT_ROW
Regards
Uwe -
Add a button choice on alv toolbar in wda
Hello Experts,
I want add a button choice on alv toolbar. I already insert the choice button indeed I see the button correctly.
Now I want insert the list of action with the following code:
<<
>>
With this code my web-interface retuns this message: "500 SAO INTERNAL SERVER ERROR. ERROR ACCESS via null object reference not possible. (termination rabax_state)". The dump is in "cl_wdr_utilities=>construct_mime_url".
Do you have any ideas? Do you have any examples?
Thanks in advance.
Best Regards,
MarinoHello,
the problem isn't "the line set_image_source". The problem was the order, the correct order is:
<<
CREATE OBJECT lr_button_choice.
lr_button_choice->set_image_source( 'ICON_CHANGE' ). "#EC *
lr_button_choice->set_text( value = 'Modifica' ).
lr_button_choice->set_tooltip( value = 'Modifica Attributi').
CREATE OBJECT lr_menu_action_item
EXPORTING
id = 'MOD_NOTE'." TYPE REF TO cl_salv_wd_menu_action_item.
lr_menu_action_item->set_text( 'Note').
lr_button_choice->add_choice( EXPORTING value = lr_menu_action_item ).
CREATE OBJECT lr_menu_action_item
EXPORTING
id = 'MOD_CONTO'." TYPE REF TO cl_salv_wd_menu_action_item.
lr_menu_action_item->set_text( 'Conto').
lr_button_choice->add_choice( EXPORTING value = lr_menu_action_item ).
lr_function = wd_this->salv_incassi->if_salv_wd_function_settings~create_function( id = 'MOD')."creating the function for alv button
lr_function->set_editor( lr_button_choice ).
>>
Thanks very much.
Best Regards,
Marino -
Requerying a report after an insert button is presses on a form
We have created an On-line Registration system using Portal. A student runs a report displaying courses from which they can register from to add to their profile.
We would like to have the report requeryed after the client has clicked on the insert button on the form (that was called from the report).
Otherwise the student stays at the insert screen and need to use the browser back button. Does any one have a suggestion or example which they wouldn't mind sharing to help us overcome this problem.
Thanks PaulPaul,
You may want to search the Oracle9iAS Portal Applications forum for an answer to your question, but to give you a pointer.
In your form, you have a textbox called "Upon Successfull Submission" .. you would call your report here. Most likely using a redirect procedure or just calling it directly.
You will definitely be able to get more information from the other discussuion forum though.
Sue -
How to insert horizontal lines in alv report?
hi,
i have to insert horizontal lines in alv report.( RM07MLBB )
actually my requirement is:
basis list = RM07MLBB.
first secondary list = another report is called here ( RM07DOCS )
i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
here in this program,
is_layout = alv_layout.
hence i tried to give
alv_layout-no_hline = ' '.
but not effecting.
can some one please tell me , how to insert lines in the alv report.
thanks in advance,
Dastagir.hello,
so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
if same delivery challan number is repeating they should come in the same block,
for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED. -
I cannot send email in hotmail account and insert buttons dissapear after 4 seconds
I am able to receive emails in hot mail account but cannot send.
This has been the case for the last two days.
Have the same problem in IE.
Noticed insert buttons disappear when I click on new
Same in IEEnded up calling my service provider to figure it out. They couldn't but again gave me all the perameters to enter into an account. I had to cancel the account on my phone and set up a new one. I had to enter the information more than once before the phone would actually save it. Lucky me, it did not lose all the emails I had stored on the phone. No help from Apple!
-
Add a button choice on alv toolbar in wd4a
Hy everyone i've to add a button choice on alv toolbar. I create a node 'MY_TOOLBAR_FUNCTIONS' where add node and attributes to bind in external mapping in function_elements of alv interface controller.For button_choice I made a node 'CHOICE' and attribute 'WA_VALUE' type string. But the application dumps when create object lr_choice ; the error is WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set .
May you help me? Thanks in advance.
data: ls_choice TYPE ig_componentcontroller=>element_choice,
nd_choice TYPE REF TO if_wd_context_node,
nd_choice = nd_my_functions->get_child_node( name = wd_this->wdctx_choice ).
el_choice = nd_choice->get_element( ).
ls_choice-wa_value = '01'.
APPEND ls_choice TO lt_choice.
nd_choice->bind_table( lt_choice ).
DATA:lr_button_choice TYPE REF TO cl_salv_wd_fe_button_choice.
DATA:lr_choice TYPE REF TO cl_salv_wd_menu_action_item.
lr_function = l_value->if_salv_wd_function_settings~create_function_right( id = 'MYBUTTONCHOICE' ).
CREATE OBJECT lr_button_choice.
EXPORTING
sel_action_item_elementname = 'CHOICE.WA_VALUE'.
lr_button_choice->set_text( value = 'Filter' ).
lr_button_choice->set_tooltip( value = 'Filter').
lr_button_choice->set_sel_action_itm_elementname( 'CHOICE.WA_VALUE' ).
CREATE OBJECT lr_choice
EXPORTING
id = ls_CHOICE-WA_VALUE.
lr_choice->set_text( 'Esito Positivo' ).
lr_choice->set_image_source( value = 'ICON_GREEN_LIGHT').
lr_button_choice->add_choice( lr_choice ).
lr_function->set_editor( lr_button_choice ).in CREATE OBJECT lr_choice the object id have to refer to name of node.
CREATE OBJECT lr_choice
EXPORTING
id = 'CHOICE'. -
Add button to QA33 ALV output list
Hi, SAP experts:
I need to add a custom button to the ALV output list display in QA33 transaction.
I´ve only found the BAdi ALV_SWITCH_GRID_LIST, but it doesn´t fit my requirements at all.
Any idea?
Thank you very much!Hi,
Please check if this explanation helps you,
Custom Butoon in REUSE_ALV_GRID_DISPLAY_LVC
Regards
Ram -
How to add a new button in an ALV using factory method
im using factory method to creat an ALV
The reason why I'm doing this is because I want the ALV and the selection screen in the same screen like exemplified here http://help-abap.blogspot.com/2008/10/dispaly-alv-report-output-in-same.html
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = if_salv_c_bool_sap=>false
r_container = lo_cont
container_name = 'DOCK_CONT'
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = me->t_data.
The above code already uses every parameter that method as to offer.
Is it possible to add extra buttons to an ALV using that method?Hi Ann,
The reason you are not able to see any of the new columns as a option to select in your web service block is because when you have published that block, they were not present. Add these two new objects in your block and publish it again. You will be prompted for duplication content. Select the highlighted block for duplicate and now you can see the new added objects in the filter option. Update and this will overwrite your published block. Please note, web services do appear to behave weirdly when used with dashboards so I request you to please try it in a separate test report first.
Hope that helps.
Regards,
Tanisha -
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 to send a predefined email after clicking on an Insert button in a Form?
Hi,
I created my form ( three fields) where I enter a three values.
I want an email be sent every time new values are entered and the insert button clicked.
Do you know a way on how to do it please?
Thanks
Khaled.Hi,
I do not know of a way within Portal to automatically send an email, but the database has a utility (utl_smtp) that will allow you to do so very easily. You can use Portal to insert your data and then put a trigger on your table that fires after the data is inserted that calls a procedure that will send the mail.
Here is an example of a procedure that I have used to send mail (you can get all of the info on utl_smtp in the Oracle docs). I have a Portal form that allows the user to input three values and once they click 'insert' and the data goes into the table, I have a trigger that fires 'after insert' and runs this procedure:
PROCEDURE send_register_mail (sender in varchar2,
email varchar2,
date_of_class date)
IS
mailhost VARCHAR2(30) := 'my.mailserver.com';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, email);
utl_smtp.rcpt(mail_conn, '[email protected]');
utl_smtp.open_data(mail_conn);
utl_smtp.write_data(mail_conn, 'Subject: Platform Training registration request'||utl_tcp.crlf||'Content-Type:text/html;'||utl_tcp.crlf||utl_tcp.crlf);
utl_smtp.write_data(mail_conn, sender||' would like to attend the POC training scheduled for '|| date_of_class);
utl_smtp.close_data(mail_conn);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
-- Handle the error
htp.p('There was an error processing your registration. Please contact the site administrator');
END;
Hope this helps.
-melissa -
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 -
How to add a button to an alv standar report
Hi all,
I've got a requiremnt to modify the behaviour of the edit button of the ALV in TX vfx3.
When the edit button pressed, the requiered behaviour is to navigate to a Z TX. Is it possible to edit the ALV without creating a new Z alv? Just changing the standard?
Edited by: Iñaki Nolte Usparicha on Dec 29, 2010 12:18 PMHi Iñaki, you have to copy (using transaction SE41) Status-GUI "standard" from program SAPLSALV, with the same name as our program. Delete all unnecessary components and add your custom button.
In the program you have to add:
Form F_SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD'.
Endform.
Form f_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '%NF'. "NF is the name of the button
PERFORM f_do_something.
ENDCASE.
Endform.
Maybe you are looking for
-
Yosemite and Multiple Displays
I just upgraded a late '12 Mac Mini to Yosemite and am now having some considerable difficulty utilizing TWO Video Output options simultaneously. With 10.8.5 I have been using my Thunderbolt port to adapt to VGA, which goes to a Star-Tech KVM and the
-
Finder hangs on 10.7.4
I installed OS 10.7.4 update. Ater that the finder, safari or any program except for Google Chrome. Before that everything was working perfect. Any clue? Thank you in advance. Nacho.
-
After successfully creating a project with titles upfront (using pull focus) several days ago I now find that when I exit FCPX and get back in lots of my title text is gone. It seems pretty repeatable. Anybody else have this problem ... and discovere
-
Unable to connect to internet using DHCP with WRT54G behind ISA 2004
Hello, For starters, the Linksys WRT54G is located behind the ISA 2004 Sever firewall. The gateway for the LAN and internet segment is set at 192.168.1.1 and 192.168.2.1 for the WLAN segment on the ISA box. All the proper network rules and access rul
-
Macbook Pro 15" 2.4GHz Core i5 8GB RAM - Constant RAM usage?
Hi, I just upgraded my Macbook Pro's RAM to a DDR3 8GB 1067MHz setup that came highly recommended after much research on the topic. My question is, how come in my Activity Monitor I have so much RAM being used at any given time? It doesn't seem to ma