Event in ALV For Extra Push Button Added
Hello Guys,
I have created an ALV and with the help of u people I have successfull to add new button (push button) in it with following procdure.
a) New PF-STATUS is required , say 'ABCD'.
b) Handle user_commmand
2. First of all, from Function group SALV,
copy the STANDARD gui status to your program,
from SE80, by right clicking.
3. come to your program.
start-of-selection.
SET PF-STATUS 'ABCD'.
4. Double click ABCD and activate the gui status.
4. In gui status,
add/change your own buttons
Save and activate.
after that, you should be passing the name of the pf-status in the alv grid fm..
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SAT_REPID
I_CALLBACK_PF_STATUS_SET = 'abcd'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = SAT_LAYOUT
IT_FIELDCAT = SAT_FIELDCATALOG[]
IT_EVENTS = SAT_EVENTS[]
TABLES
T_OUTTAB = ITAB_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.
make sure there is a form ABCD in your program...
FORM abcd USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'abcd' EXCLUDING P_EXTAB.
ENDFORM.
Now I have given name of push button as show . My requirement is when users select one row (First I have to identify any row selected or not , if not Error message should be display) and with respect to the selected row I have to show one more ALV contain the billing details of the sales order Row Selected.
My question is ..
1. Is is possible to add a option button with respect to each sales order to identify the which row is selected.
2. How I code to get the event of show push button.
3. At the event I required the Selected Row data, not first column only.
Please do the needful.
Thanks
Swati....
Hello Shiba ,
Really Thanks for Code, Porgram is actviated but after pressing the show button it giving dump.
the message in the dump is <b>Type conflict when calling a FORM.</b>
I have define field catalog like this.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = w_repid
I_CALLBACK_PF_STATUS_SET = 'STANDARD'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'p_header1'(001)
I_CALLBACK_HTML_TOP_OF_PAGE = 'p_header1'(001)
I_GRID_TITLE = 'Outstanding Agewise Customer Report'
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
TABLES
T_OUTTAB = t_fit
and form i have define like this
FORM USER_COMMAND using pucom like sy-ucomm extab type slis_extab.
data : selfield type slis_selfield .
CASE pucom.
WHEN 'SHOW'. "(this is the function code of ur button)
if selfield-fieldname = 'VBELN'.
Perform Show_data using selfield-value.
elseif selfield-fieldname = ' '.
MESSAGE E015(ZMO) WITH 'Please select One Row'.
endif.
ENDCASE.
ENDFORM.
When i have debug the program, I found it will not executing my code , the progrm goes to execute one Stranded code with following name..
form user_command using r_ucomm type sy-ucomm
r_refresh
r_exit
rs_stable type lvc_s_stbl.
data: ls_selfield type slis_selfield.
On this form my program is giving me dump on following line.
>>>>> rs_stable-row = ls_selfield-row_stable.
1103 rs_stable-col = ls_selfield-col_stable.
Please tell me what the problem and how to resolve the same.
Regards
Swati...
Similar Messages
-
I have done coding for G/L interface . This report displays an ALV at the end after performnig validations on each record uploaded from a flat file. Once all records are checked , the ALV requires a PUSH BUTTON that when triggered will post the records.
My query is, how shud i add a push button in the ALV in the title bar.Hi,
You have to copy the standard pf status to a new one.
For this go to the ALV screen and take the menu System -> Status. (I do not access to the system now) then look for the standard pf status. Copy this to Z range and then add your new button.
Even you can do in this method
Create a GUI status.
Go to GUI Status->Application toolbar.
THen add the button by giving
Function text
Icon name
Icon text
Info. text
Fastpath
Then in PBO of the screen,
Just give in a module
set pf_status 'ZSTATUS'.
Here is an example for your question
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 'TEST'.
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.
To Click on the you have to do in the following way
i_callback_user_command = 'USER_COMMAND'
form user_command using i_ucomm like sy-ucomm
is_selfield type slis_selfield.
case i_ucomm.
when 'XXXX'. "XXXX is the function code for new button
endcase.
endform.
For More info please refer the below links
Please refer the following
https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D38170%26messageID%3D368851
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Regards,
Chandru -
I want a push button for line items in my sales order entry screen.
Hi,
I want a push button for line items in my sales order entry screen.
How can I do so?
Thanks.Hi Kumar ,
To have a push buttons you need to first assign a pf-status .
here a sample code for a push button and its handling :
set pf-status 'SELECT' .
at user-command .
describe table t_lpr lines w_lines .
case sy-ucomm .
when 'SELECTALL' .
set pf-status 'SELECT' excluding 'SELECTALL' immediately.
do w_lines times .
read line w_line field value w_check . " INTO W_CHECK .
if w_check = space .
w_check = 'X' .
modify line w_line field value w_check. "INTO W_CHECK .
add 1 to w_line .
endif . " IF W_CHECK = ' '
enddo .
Thus when you say pf-status say 'select' , Double click on that and you find a screen eher you can select icons and assign a function code to it!
Hope it helps!
Much Regards,
Amuktha . -
Push Button Reset - in System Restore's Protection Settings WHAT IS IT FOR?
I just did a REFRESH of my Acer ATC-105-UR10
After it came back to life I went looking the system to see if it set up correctly and I found this under Protection Settings when you go to Configure System Restore.
After Speaking to ACER’s technicial support. I changed the settings for the SYSTEM Protection back to the way it was after the hard drive was REFRESHED.
AFTER I Did the Refresh. I actually set PUSH BUTTON RESET to “ON”, since I thought it should be ON and protecting!
After the Reset of the PC when I Went to Recovery and looked at
CONFIGURE SYSTEM RESTORE it was set like this:
Available Drives Protection
Acer (C) (System) ON
Push Button Reset OFF
I then changed “Push Button Reset” to “ON”.
I thought I better call Acer, and 2 technicians, one a supervisor, told me to set “Push Button Reset” to OFF again, since that is the way the technicians set this up in order to not damage the hard drive.
Since when it was Refreshed it was OFF, they said LEAVE IT AS YOU FOUND IT!
I HOPE THIS IS CORRECT!!
Here is how it looks NOW: (IS THIS CORRECT??? What is PUSH BUTTON RESET for anyway???)
Will my PC still create restore points? Is this correct? Acer said leave it this way!Hi,
For the Push-button reset, we may take a look at the following article:
Push-Button Reset Overview
In a word, the Push-Button Reset is for recovery purpose, to help satisfy the support obligations with faster average resolution times and fewer resources. It is used in Windows Recovery Environment, which should be considered as a recovery partition built
by Acer.
I don't think this would have an effect on the restore points. If we want to figure out what it acturally does, we'd better ask Acer side for detailed information.
Best regards
Michael Shao
TechNet Community Support -
Hi,
I am having a requirement in which, I need to display the report, in the output screen I should have a push button which when pressed the report output should be stored in the Application Layer.
Thanks and Regards,
V.K.HI Vikram,
You can create push button in the output list. You have to use SET PF-STATUS statement.
Just follow these stepts for creation of PUSH BUTTON.
1. write SET PF-STATUS 'TEST'.
2. double click on TEST.
3. It will ask you to create status object. click on YES.
4. give the short description and press enter.
5. next screen you will find three things like... MENU BAR, APPLICATION TOOL BAR and FUNCTION KEYS.
6. click on the down arrow that appears next to APPLICATION TOOL BAR.
7. in the items, in first box write your name and press down the text. one popup box will come. press enter.
8. give the function text and press enter.
9. assign key for your push button. and press enter.
10. press enter and activate.
and run your program. you will get push button on output list.
Adding event for the PUSHBUTTON
For the pushbutton use an sy-ucomm ie SAVE to appln toolbar
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SAVE'.
write your code here to save in the appln server
Edited by: Raj on Jun 26, 2008 7:32 PM -
Hi all,
In my requirement i have a field as push button , now i require to put traffic lights on this push button.I am displaying alv grid through
class cl_gui_alv_grid
please help me with a sample code.
regards,
kushagraHi,
Pass below codes as texts for the push buttons:
@0A@ - Red
@09@ - Orange
@08@ - Green
Below code can help you understanding handling normally without pushbuttons:
DATA: ok_code TYPE syucomm.
TYPES: BEGIN OF ty_data,
num TYPE i,
icon TYPE icon_d,
END OF ty_data.
DATA: wa_data TYPE ty_data,
i_data TYPE TABLE OF ty_data.
DATA: i_fieldcat TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
DATA: g_cust_cont TYPE REF TO cl_gui_custom_container,
g_container TYPE scrfname VALUE 'GRID1',
g_grid TYPE REF TO cl_gui_alv_grid.
START-OF-SELECTION.
DO 10 TIMES.
wa_data-num = sy-index.
IF sy-tabix < 4.
wa_data-icon = '@0A@'.
ELSEIF sy-tabix < 7.
wa_data-icon = '@09@'.
ELSE.
wa_data-icon = '@08@'.
ENDIF.
APPEND wa_data TO i_data.
ENDDO.
END-OF-SELECTION.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAINTITLE'.
IF g_grid IS INITIAL.
PERFORM display_list.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
DATA: l_event TYPE REF TO cl_gui_event.
CASE ok_code.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
PERFORM exit_program.
ENDCASE.
CLEAR: ok_code.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form DISPLAY_LIST
* text
* --> p1 text
* <-- p2 text
FORM display_list .
IF g_cust_cont IS INITIAL.
* Create Custom Container
CREATE OBJECT g_cust_cont
EXPORTING container_name = g_container.
* Create Ojbect for Grid Display
CREATE OBJECT g_grid
EXPORTING i_parent = g_cust_cont.
* Build Field Catalog
PERFORM build_catalog.
* Display Output in Grid Form
CALL METHOD g_grid->set_table_for_first_display
CHANGING
it_fieldcatalog = i_fieldcat
it_outtab = i_data[].
ELSE.
* Refresh Display
CALL METHOD g_grid->refresh_table_display.
ENDIF.
ENDFORM. " DISPLAY_LIST
*& Form BUILD_CATALOG
* text
* --> p1 text
* <-- p2 text
FORM build_catalog .
PERFORM build_fld_catalog USING:
1 'NUM' 'I_DATA' space 'Number' 10,
2 'ICON' 'I_DATA' 'X' 'Icon' 10.
ENDFORM. " BUILD_CATALOG
*& Form BUILD_FLD_CATALOG
* text
* -->P_1 text
* -->P_0182 text
* -->P_0183 text
* -->P_C_X text
* -->P_0185 text
* -->P_12 text
FORM build_fld_catalog USING p_col
p_fld
p_tab
p_icon
p_text
p_len.
CLEAR: wa_fieldcat.
wa_fieldcat-col_pos = p_col.
wa_fieldcat-fieldname = p_fld.
wa_fieldcat-tabname = p_tab.
wa_fieldcat-icon = p_icon.
wa_fieldcat-scrtext_l = p_text.
wa_fieldcat-outputlen = p_len.
APPEND wa_fieldcat TO i_fieldcat.
ENDFORM. " BUILD_FLD_CATALOG
*& Form EXIT_PROGRAM
* text
* --> p1 text
* <-- p2 text
FORM exit_program .
CALL METHOD g_grid->free.
LEAVE TO SCREEN 0.
ENDFORM. " EXIT_PROGRAM -
Issue with Icons display in PUSH BUTTONS in forms 11g
Hello,
This is regarding an issue with the icons background for the push buttons in the forms 11g. When we enable the icons for the buttons (.gif) they are visible on the
top left corner of the buttons and not in the centre. In one of the forums it was written like this is a common problem in Forms 11g. Is there any way by which we can
centralize this icons on the Forms buttons. Also I have heard that image editing tools can be used to centralize the icons. I tried with one of the tools but it seems
like it is not working.
Can somebody suggest a workaround for this?
Thanks in Advance
RamI will assume you are attempting to use the images included in the Forms applet jar. These images are purposely structured so that the subject is off-centered. You should not see that same behavior if you use your own images or edit the ones built-in to Forms. However, keep in mind that the images packaged in the Forms applet jar are intended to be used in a menu toolbar and not custom buttons.
For more information, refer to MyOracleSupport note 1391073.1 where I explain this in detail.
Michael Ferrante
Senior Principal Support Engineer
Forms Global Technical Lead
Oracle Corporation
. -
Hi expert,
In push button i am displaying some ebeln . My requirment is to retrive the value displayed on pushbutton on pressing. I am not able to retrive the value and index ( I have created via step loop) position of the push button. Please tell me how can I do this? I have created one function code for this push button.Duplicate/Cross post of Content of pushbutton in .
Do not post a question more than once in the forum.
Read the [Forum Rules|http://wiki.sdn.sap.com/wiki/x/FgQ] before posting more.
Regards
Karthik D
Moderator message - the other cross post is locked
Edited by: Rob Burbank on Nov 20, 2009 10:42 AM -
hi friends,
kindly help me for this.
how can i implement a multi line label for a push button. i have big label with 5-6 words. i want it to display in multi line format.
can anyone helpme out in this
thanx in advance
chsThe simple answer is you cannot. But you can create an icon or just use tooltip property to put a long description for short item title which will display when the mouse is hold over the button. You can also use prompt for the button.
-
Hi,
Im displaying one text in output and next to that i need to create one push button as shown below. Is it possible in normal list or ALV ?
text PUSH BUTTON.
I dont want to create a push button in application tool bar, or menu bar. I need to create it in output list. Can anyone tell me how to do this?
Thanks,
AmalHi, Amal
In Normal List it is not possible i don't know your goal exactly there are some Ideas which you can use if your requirements are as i am thinking you can Check HOTSPOT with Write Statement. just write hotspot and Press F1 you will get info to use it on other way i am thinking if you want to select multiple record in ALV than Please have a look at the following Thread hope will help you out to take to step to solve your problem,
[Selecting Multiple rows in an ALV |Selecting Multiple rows in an ALV]
[Selecting Multiple Rows from ALV GRID Display|Selecting Multiple Rows from ALV GRID Display]
Sorry, if i didn't understand you.
Kind Regards,
Faisal -
Colored push buttons. It doesn't work on client/server.
I've changed the Background Color property to 'darkyellow' for a push button, but it only shows up colored on the web. Why not in client/server environment ?
BobForms has a separation of UI and the Logic. This is why even in client-server a button will look different on Solaris and Windows. Forms throws the actual drawing of the button(all widgets) off to the underlying operating system. Windows does not allow you to set the background color for a button so the property is ignored.
When Forms runs over the web the UI is rendered as a Java Applet and Windows no longer has control of drawing the widgets.
Hope this helps,
Candace Stover
Forms Product Management -
To add Icon_checked to push button
Moved to correct forum. Please take care to post in the correct forum in future.
Hi,
I have to add Icon_checked icon to a push button on a screen , how can i do this please help!
Thanks ,
Alok
Edited by: Matt on Mar 17, 2009 12:59 PMHi ,
Check the following code snippet.
REPORT ZTESTD1 .
include <icon>.
seLECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON (10) path USER-COMMAND brw.
seLECTION-SCREEN end OF LINE.
INITIALIZATION.
*For the push button
path = ICON_CHECKED.
Regards,
Deepthi -
Displaying a Push button in the application toolbar for an ALV report
Hello everyone,
Query:
Is it possible to display a custom push button in the application tool bar while displaying an ALV report(1st one)?
On pressing this custom push button will I be able to display another ALV report(2nd one) based on the selection made on the current ALV report(1st one)?Yes u can have pushbutton on application toolbar.
You just have to use the new pf status in your report program.
You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.
Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality.
Have a look at below code for using the new status.
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 'TEST'.
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
**Write ur functinality here
endcase.
endform.
Also have a look at below links.
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
ALV report
Best Regards,
Vibha
*Please mark all the helpful answers -
Adding push buttons in standard ALV
Hi ,
Is there any possiblity to add custom push buttons to standard ALV in Webdynpro for ABAP.
If so, please provide me the solution.
Thanks in Advance.
cheers,
sravan.I got the answer .
-
ALV grid control, Adding the push Button in the Toolbar
Hello All,
I am facing a problem when trying to do calculation based on the button added at the toolbar of interactive ALV list.
When I click on the toolbar button Compute, the ALV should calculate the
multiplication of the Qty (manually entered by a user) & price per unit already available in the ALV & show it the Column Total value.
Presently when I try to do this using
Method handle_user_command.
modifying the inetrnal table GT_FINAL_OUTPUT
with the Total price value .
& updating the column Total price (Qty * price) in the Internal table
After doing this I am agin calling the below function
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'GT_FINAL_OUTPUT'
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = GT_FINAL_OUTPUT[].
At above function it gives short dump or sometimes it does not update the ALV screen with the new updated value of Total price .
The short dump comes states the error of unassigned field symbol.
Kindly suggest a program where we can do manipulation at the editable ALV.
Or solution to above issue .
Regards,
AnuragYou should only be calling the SET_TABLE_FOR_FIRST_DISPLAY one time in the PBO of your screen, otherwise you should be using the REFRESH_TABLE_DISPLAY method. IN your PBO, check that the instance of the alv_container is alive, if so, do not call the SET method, rather call the REFRESH method.
if alv_container is initial.
create object......
create object g_grid.....
call method g_grid->set_table_for_first_display......
else.
call method g_grid->refresh_table_display( ).
endif.
Regards,
Rich HEilman
Maybe you are looking for
-
Does Frontrow/Quicktime upscale to 720p on TV?
I have just bought a 42" TV. It has great reviews - but is apparently lacking in it's ability to de-interlace and upscale. So give it a good HD signal, it will provide a good HD picture. As I understand it - my mac will be sending a 720p signal (via
-
Itunes keeps on saying "sync finishing" but nothing is being synced when its done
can someone help
-
SQL Date Issue...
Hi, I am trying to enter values into the db. The data type for the column is "datetime". I have the value in the format "2008-10-03 07:50:10.0" and if i do this, i am just left with the date. Time gets truncated. java.util.Date uploadDate = photo.get
-
JDev10.1.3 EA1 deploy to OC4J 9.0.4.2.0
It appears that "one-click" deployment to a OC4J 9.0.4.2.0 (standalone) instance isn't supported anymore by JDev10.1.3 EA1, is this correct? Customer I'm currently involved in selected JDeveloper because of "nice" features like one-click deployment,
-
Asus USB-N13 is not working on Lion 10.7.2
I purchased this device and used it on Lion 10.7.1, today I updated my MAC to Lion 10.7.2 And now I can not to connect to the Internet on this computer. I can open Asus utility and scan wi-fi networks, but I can not to connect to them. At the Asus we