How to add push buttons in out put screen of ALV
Hai,
How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
Thanks in advance .
kiran
Hi Kiran,
Here is the sample code.If you are using reuse_alv_grid_display, no need to write code in PBO.
Just double click the 'TEST' which is written in code.Then create a GUI Status.In Application toolbar,type the name of the button you want(say BUTTON).Then double click that name.Then enter the ICON name and function text.Activate it.This itself will work.If you want all the functionalities,then try to do as Vinod told.
TYPE-POOLS: slis.
DATA: i_qmel LIKE qmel OCCURS 0.
data v_repid type repid.
SELECT * FROM qmel INTO TABLE i_qmel.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_structure_name = 'QMEL'
TABLES
t_outtab = i_qmel
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status '<b>TEST</b>'.
endform.
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data lv_ucomm type sy-ucomm.
lv_ucomm
= sy-ucomm.
CASE lv_ucomm.
WHEN 'BUTTON'. "Double Click line Item
call transaction 'MM01'.
endcase.
endform.
Similar Messages
-
How to add push button in alv display with out class or method
Hai,
How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
Thanks in advance .
kiranYou should post your question in the ABAP forum.
ABAP Development -
How to Add Push Button On Selection Screen
Hi Experts,
How to add Push button on Selection Screen.
Points will b rewarded for useful help.
Bohra.Hi,
To create a pushbutton on the selection screen, you use:
SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>
USER-COMMAND <ucom> [MODIF ID <key>].
The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.
<push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.
For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREENevent.
Ex.
REPORT DEMO.
TABLES SSCRFIELDS.
DATA FLAG.
SELECTION-SCREEN:
BEGIN OF SCREEN 500 AS WINDOW TITLE TIT,
BEGIN OF LINE,
PUSHBUTTON 2(10) BUT1 USER-COMMAND CLI1,
PUSHBUTTON 12(10) TEXT-020 USER-COMMAND CLI2,
END OF LINE,
BEGIN OF LINE,
PUSHBUTTON 2(10) BUT3 USER-COMMAND CLI3,
PUSHBUTTON 12(10) TEXT-040 USER-COMMAND CLI4,
END OF LINE,
END OF SCREEN 500.
AT SELECTION-SCREEN.
CASE SSCRFIELDS.
WHEN 'CLI1'.
FLAG = '1'.
WHEN 'CLI2'.
FLAG = '2'.
WHEN 'CLI3'.
FLAG = '3'.
WHEN 'CLI4'.
FLAG = '4'.
ENDCASE.
START-OF-SELECTION.
TIT = 'Four Buttons'.
BUT1 = 'Button 1'.
BUT3 = 'Button 3'.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
CASE FLAG.
WHEN '1'.
WRITE / 'Button 1 was clicked'.
WHEN '2'.
WRITE / 'Button 2 was clicked'.
WHEN '3'.
WRITE / 'Button 3 was clicked'.
WHEN '4'.
WRITE / 'Button 4 was clicked'.
WHEN OTHERS.
WRITE / 'No Button was clicked'.
ENDCASE.
This example defines four pushbuttons on a selection screen that is displayed as a
dialog box. The selection screen is defined in a statement chain for keyword
SELECTION-SCREEN.
If the text symbols TEXT-020 and TEXT-040 are defined as 'Button 2' and 'Button 4',
the four pushbuttons appear as follows on the selection screen displayed as a dialog box.
Regards,
Bhaskar -
How to add push button in application tool bar in SAP transaction VA01
How to add push button in application tool bar in SAP standard transaction VA01 and how to implement the code for that function code.
There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.
-
How to give F4 Help for out put screen
Hi ,
I have out put grid display which is editable , in that i want to give F4 help for one of the eidtable field. if any body know about this please me .
My problem is i need to add F4 for my out put screen.
Thanks ,
saleem.Check the following code it may hel u.
REPORT ABC.
DATA : BEGIN OF ITAB OCCURS 0,
UNAME LIKE USR01-BNAME,
END OF ITAB.
data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .
data : RETURN_wa LIKE DDSHRETVAL .
PARAMETERS : A(12) TYPE C.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.
ITAB-UNAME = 'U01'. APPEND ITAB.
ITAB-UNAME = 'U02'. APPEND ITAB.
ITAB-UNAME = 'U03'. APPEND ITAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ITAB-UNAME'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'A'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = ITAB
FIELD_TAB = FTAB
RETURN_TAB = return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
Regards -
How to add push button in function module
I want to add Push button( yes/no) in same screen. I used POPUP_TO_CONFIRM,
but this popup is coming on next screen when I click on cancel button.There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.
-
How to add push button in report.
Hi,
how to add a push button in the standard list report and on clicking which the line-size of the screen should reduce from 300 to 100.
how to proceed.
Can anyone help me.
Regards
GuhapriyanHii Guhapriyam,
You can ceate PUSHBUTTON in selection-screen like Below
SELECTION-SCREEN PUSHBUTTON 2(10) text-004 USER-COMMAND CL1.
Create a variable to hold the processed PUSHBUTTON value like
DATA v_flag TYPE flag.
The PUSHBUTTON will be processed at the event AT SELECTION-SCREEN. So write your code like below
AT SELECTION-SCREEN.
IF sy-ucomm EQ 'CL1'.
v_flag = 1. "Buttob clicked
ENDIF.
START-OF-SELECTION.
IF v_flag EQ 1.
NEW-PAGE LINE-SIZE 100.
ENDIF.
OR
The best way of doing this by setting PF-STATUS like
START-OF-SELCTION.
SET PF-STATUS 'ZSTATUS'. "Double click on this and set the pushButton in standard toolbar option and in function key specify the BACK, EXIT and CANCEL button .
Then write your logic at the event AT USER-COMMAND.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'RED'.
NEW-PAGE LINE-SIZE 100.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
regards
Syed -
How to add push button on UI?
Hi,
I would like to add a push button 'PROCESS' on one assignment block. When user selects the pushbutton I would like to execute some custom functionality. How do I achieve this?
Regards,
AkashHi,
Please add the below code in the htm page of your view
<thtmlb: button id = Search
on Click = Search
text = Search
tooltip = Search />
Regards,
Lakshmi.Y
Edited by: Lakshmi Soujanya on Jun 7, 2011 11:09 AM
Edited by: Lakshmi Soujanya on Jun 7, 2011 11:11 AM -
How to add a button in Sales Order screen?
Hi,
Basically I want to add a new button "Show My lookup" in sales order screen and when clicking the button I want to show a form.
Please anyone tell me how to do this?.
thanks in advance
MinaHere is a sample ItemEvent that adds a custom button to Sales Order Entry, and loads a form from XML when it is clicked. Make sure you give the forms unique identifiers when you create them - the sample just uses a hardcoded value.
Hope it helps,
John
Private Sub sboApp_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
On Error GoTo ErrorHandler
Dim sboForm As SAPbouiCOM.Form
Dim sboItem As SAPbouiCOM.Item
Dim sboBtn As SAPbouiCOM.Button
Dim objXMLDoc As MSXML2.DOMDocument
Dim objXMLErr As IXMLDOMParseError
Dim objXMLElem As MSXML2.IXMLDOMElement
Dim strIdentifier As String
If pVal.EventType = et_FORM_LOAD And pVal.Before_Action = False And pVal.FormType = 139 Then
'Add Custom Button
Set sboForm = sboApp.Forms(FormUID)
Set sboItem = sboForm.Items.Add("AZU_BTN", it_BUTTON)
sboItem.Top = sboForm.Items("1").Top
sboItem.Width = "80"
sboItem.Left = sboForm.Width - 105
Set sboBtn = sboItem.Specific
sboBtn.Caption = "Custom Button"
End If
If pVal.EventType = et_ITEM_PRESSED And pVal.Before_Action = False And pVal.ItemUID = "AZU_BTN" And pVal.FormType = 139 Then
strIdentifier = "AZU_XXX" 'You should set this to a unique value each time
Set objXMLDoc = New MSXML2.DOMDocument
objXMLDoc.async = False
objXMLDoc.validateOnParse = True
objXMLDoc.Load (App.Path & "\Config\AZU_CUSTOM.srf")
Set objXMLErr = objXMLDoc.parseError
If (objXMLErr <> 0) Then
MsgBox "Failed to load XML screen definition."
Exit Sub
Else
For Each objXMLElem In objXMLDoc.getElementsByTagName("form")
objXMLElem.setAttribute "uid", strIdentifier
Next
sboApp.LoadBatchActions objXMLDoc.xml
End If
End If
Exit Sub
ErrorHandler:
MsgBox Err.Number & " " & Err.Description
End Sub -
How to add a button to the Standard Toolbar in ALV ?
Hi All,
If i add a button it should be displayed along with
the standard icons of the toolbar.
Plz guide me.
Thx in advance.Hi Albert.
You need to do a few things for that :
- Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
- Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
- define a subroutine to handle the user commands.
Sample implementation :
FORM pf_status USING extab TYPE slis_t_extab.
extab = pf_exclude.
SET PF-STATUS 'STANDARD' EXCLUDING extab.
ENDFORM. "PF_STATUS
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PF_STATUS'
is_layout = layout
it_fieldcat = fieldcat
it_excluding = pf_exclude
TABLES
t_outtab = itab
EXCEPTIONS
OTHERS = 0.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
ENDFORM.
Please reward points if found helpful. -
How to add push button in alv list
Dear all,
I am doing ALV report, in that i have some requirements as mentioned below
6. In the main report screen, each row should have a selection button at the left end. The entire row should be selectable by clicking on this button. By clicking on the button a second time the row gets deselected. The user should be able to select only one row at a time (i.e. he should not be able to select multiple rows simultaneously).
7. All Report screens should have standard SAP Navigation buttons.
8. The main Report Screen should have a Refresh Button. When the user clicks on this Refresh button the program should remember and re-execute (i.e. refresh) the last selection of the user in the Selection Screen above and the Main Report Screen should be re-displayed accordingly.
pleae help on me,
Regards ,
Sudhakar.hi
good
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
http://www.sap-img.com/abap/what-are-the-events-in-alv.htm
reward point if helpful.
thanks
mrutyun^ -
Help: how to add a button to print the screen
Hi,
I am working on a set of forms. One of the feature user ask is to place a "Print Screen" button on the form so that user will be about to simply print the form screen.
Any help will be greatly appreciated.
Thank you in advance.
JimmyThanks Rosario. I did that but it seems not working. In fact, I added a form level trigger key-PRINT and put "print;"
Anyway, what does it really do? I think that it should not be identical to Print-Scrn on the key board.
Jimmy
Message was edited by:
WJH -
Need to add push botton in my selection screen
Hi
I am doing a report program . I need to add PUSH BUTTON in my selection screen can u give me any code or suggestions for this.
IF i press this push button i should get the basic list.
Regards
Rasheed.Hi Here is a another example.
U can place a Push button on selection screen by using the satatement..
SELECTION-SCREEN PUSHBUTTON 2(10) butt USER-COMMAND cli3.
The push button will start from second character position on Selection screen and of length 10 characters !!
check this program...
TABLES sscrfields.
DATA flag(1) TYPE c.
SELECTION-SCREEN:
BEGIN OF SCREEN 500 AS WINDOW TITLE tit,
BEGIN OF LINE,
PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,
END OF LINE,
BEGIN OF LINE,
PUSHBUTTON 2(10) but3 USER-COMMAND cli3,
PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,
END OF LINE,
END OF SCREEN 500.
AT SELECTION-SCREEN.
MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm.
CASE sscrfields-ucomm.
WHEN 'CLI1'.
flag = '1'.
WHEN 'CLI2'.
flag = '2'.
WHEN 'CLI3'.
flag = '3'.
WHEN 'CLI4'.
flag = '4'.
ENDCASE.
START-OF-SELECTION.
TIT = 'Four Buttons'.
BUT1 = 'Button 1'.
BUT3 = 'Button 3'.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
CASE FLAG.
WHEN '1'.
WRITE / 'Button 1 was clicked'.
WHEN '2'.
WRITE / 'Button 2 was clicked'.
WHEN '3'.
WRITE / 'Button 3 was clicked'.
WHEN '4'.
WRITE / 'Button 4 was clicked'.
WHEN OTHERS.
WRITE / 'No Button was clicked'.
ENDCASE.
Reward me if its helpful.
Regards
Ravi -
How to add a button to the grouped data in an AdvancedDataGrid?
Hi,
Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
For the leaf node the itemRenderer property works just fine.
Please help!HI ,
I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list but still I am unable to get any additional button on the output ALV popup.
Please help.
Regards,
Kavya. -
Hello...
This is my code. How to add REFRESH button in this code
package sample.view;
import javax.faces.event.ActionEvent;
public class Student {
public Student() {
super();
private String name;
private String id;
private String course;
public void setName(String name) {
this.name = name;
public String getName() {
return name;
public void setId(String id) {
this.id = id;
public String getId() {
return id;
public void setCourse(String course) {
this.course = course;
public String getCourse() {
return course;
public void dosubmittoActionisterner() {
// Add event code here...
System.out.println(getName() + " " + getId() + " " + getCourse());
public void dorefershActionlistener(ActionEvent actionEvent) {
// Add event code here...Hi,
is this a home work you are working on? Even as a student you should be able to express questions more clearly.
Frank
Maybe you are looking for
-
Export to text removes trailing spaces in XI R2
I've found an article that talks about the problem of the export to text removing trailing spaces, but the article mentions that this is fixed in Crystal Reports XI with a newer version of u2ftext.dll to version 11.0.0.941. [1218375 - Trailing spaces
-
Product costing Cycle run for first time to complete backlog
Dear sir, In my Company we went live in April 2011 and since then we never did settlement of Product costing as process was not stream line , but now (in Aug-2011) it is stream-line and we wanted to do Proper costing Cycle run & settlement too. Can y
-
Error while doing EHP4 upgrade
Hello Colleagues, While doing EHP4 upgrade on windows 2008 server in extraction phase, i am getting following error message: Unable to execute the SDT request ABAP operation extract on hostname inmumeucpi instance 00 Extraction of the ABAP upgrade re
-
Yahoomail the text and everything is so large it doesn't fit on the screen. I always have to scroll left and right to read my mail. It's really annoying. I don't know how to adjust that . I tried Google Chrome and it was more normal. Everything fit.
-
Where to put jar files reachable for ejb:s?
Hello! I have a ejb that use some jar files. But I can not figure out where to put the jar files that I use from my ejb in Weblogic 8.1.3. Until now I have extracted all jar files and put them inside my ejb with my own class files. But this seems odd