Function codes ininteractive ALV
Hello all,
In interactive alv we can use function code as &IC1 to indicate double click .
Here my doubt is where we can find all this function codes. Is there any table or ?
Thanks in advance.
Apps.
Hi,
try this .
In the alv display screen,before clicking any button( if u want to know function code ),
press /h on the command box and press enter.This gives u message like debugging on.
Then click on button required,it will goto debugging ,then type sy-ucomm and press F5,u will get function code associated with the button.
Hope this helps u.
Similar Messages
-
ALV-Grid: Is it possible to catch "LOCAL Function Codes" in any Event ??
Hi,
is it possible that i can catch a "Local Function Code" in ALV Grid with an Event??
For example if you click to an Grid Button on the toolbar than it must call an Event!
..........BUTTON: Local APPEND (existing in ALV Toolbar)
Function Code: '&LOCAL&APPEND'
My Idea is:
--- IF i click to the Button "Local APPEND" in the ALV toolbar, than it must after this command give me an Message( "It was Successfull" ).
But the "Local Function Codes" dont called the Event "User_command" OR "After_user_command" is there any other Event for this "Local Function Codes"???
Have anyone an idea?
Thanks in forward.
ErsinHi,
See following thread.
http://scn.sap.com/thread/715996
Thanks
Santosh -
How to find function code for buttons on toolbar in oops alv
Hi experts,
I want to remove some buttons from toolbar in oops alv, i know the procedure like get function code and pass the value in a table and pass that table to IT_TOOLBAR_EXCLUDING of
method set_table_for_first_display but I WANT TO KNOW HOW TO FIND FUNCTION CODE FOR BUTTONS ON TOOLBAR IN OOPS ALVHi Prakash,
-->First you have to set the pf status in your alv program by,
{FORM pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'FIRST'.
ENDFORM. "PF_STATUS}
-->Pass this Subroutine name in the Function module, Reuse_alv_grid_display's parameters i.e,
i_callback_pf_status_set = 'PF_STATUS'}
*-->Then doble click on that pf status,
From the menu bar, select Extras->Adjust Template->List Viewer,
This will give you the existing statndard gui status of the program*
->Then catch that function codes in the User command Parameter of the Function module Reuse.. i.e,
i_callback_user_command = 'COMM'
And make a subroutine of the name 'COMM'i.e,
FORM comm USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
DATA: okcode TYPE sy-ucomm.
okcode = ucomm.
CASE okcode.
WHEN 'REF'.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'MANSI'
txt1 = 'CREATED BY'
txt2 = SY-UNAME
TXT3 = ' '
TXT4 = ' '
endcase.
Hope it helps you
Regrds
Mansi -
Function code for dropdown on OO ALV Grid to trigger user_command
Hi Experts,
I know we can add a dropdown to a column of an OO ALV Grid, set values to the dropdown list and allow the user to select some these values.
However , what I'm not sure is that if we can *assign a function code to the dropdown * which would then trigger the event user_command ( PAI ) of the ALV class so I can handle the changes to when a particular value is selected from a dropdown list, just like we do in normal dialogs.
Now I know that I can register the 'Enter' event and handle the data changes in data_changed event, but that is something I want to avoid the user from doing as far as possible to make the report more user friendly.
Awaiting your valuable inputs and would really appreciate your help.
Thanks & regards,
AdvaitHi Advait,
No problem. Yes, this functionality requires changing the focus to other cell.
I think there is other solution. As the dropdown is kind of F4 activity try this way:
data: it_f4 type lvc_t_f4,
wa_f4 type lvc_s_f4.
wa_f4-FIELDNAME = 'CONNID'.
wa_f4-REGISTER = 'X'.
wa_f4-GETBEFORE = 'X'.
wa_f4-CHNGEAFTER = 'X'.
append wa_f4 to it_f4.
"register F4 event
CALL METHOD g_alv_grid_ref->register_f4_for_fields
EXPORTING
it_f4 = it_f4.
"Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
"Definition
methods:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
"Implementation
METHOD handle_data_changed .
DATA: ls_mod_cells TYPE lvc_s_modi.
IF e_onf4_before = 'X'.
MESSAGE 'Data changed before F4' TYPE 'I'.
ENDIF.
IF e_onf4 = 'X'. "if event triggered by F4
MESSAGE 'Data changed on F4' TYPE 'I'.
ENDIF.
IF e_onf4_after = 'X'.
MESSAGE 'Data changed after F4' TYPE 'I'.
ENDIF.
"here you know which cell was modified
LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
"just example test case, here you can implement your code for modified cells
IF ls_mod_cells-value >=5.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = 'SABAPDOCU'
i_msgty = 'E'
i_msgno = '888'
i_msgv1 = 'Only numbers below 5 are possibe'
i_msgv2 = 'Please correct'
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id
i_value = space.
ENDIF.
ENDLOOP.
ENDMETHOD. "handle_data_changed
This approach works fine for picking value from input help. Never tried it for dropdown list. You have to try it out.
Regards
Marcin -
Please send me some sample codes of ALVS using function modules only
Hi,
i am new to alvs
Please send me some sample codes of alvs using function modules only.
My mail id is [email protected]
Thanks & regards,
hari priyahI
http://www.sapdev.co.uk/reporting/reportinghome.htm SPECIAL FOR ALL ALV PROGRAMS WITH EXAMPLE CODES
Check the below links :
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
http://www.sap-img.com/abap-function.htm
http://www.sap-basis-abap.com/sapab034.htm
http://www.erpgenie.com/abap/example_code.htm
These all are very simple ALV programs ,good luck
<b>Reward if usefull</b> -
Re : function codes that r available in ALV o/pu2019s.
Hi
How or where to find the function codes that r available in ALV o/pu2019s. for ex: for EXIT the fcode is %EX, for Spreadsheet its &XXLu2026. these things we give in menu painter.
And what happens to the deleted sales order data, I mean in the database level ( if it s deleted its not in database table ).
How to solve this.
Thanks
AntoHi,
Go to se80 ->Give standard alv program->Double Click gui status -> You can find the Lists of Fcodes.
Please Find the Below Link
[Help|Re: How to find function code for buttons on toolbar in oops alv]
Hope this will be Helpful
Thanks
kalyan -
Hello Friends,
I had created an ALV using CL_SALV_TABLE. My requirement is to hide some of the satndard functions appearing in ALV. I had tried this using the method REMOVE_FUNCTION from CL_SALV_FUNCTIONS. For example to hide Find function, I tried by giving function code as MC_FC_FIND (function code for Find in normal ALV created using CL_GUI_ALV_GRID). But this lead to dump error. I can't find any function codes in CL_SALV_TABLE class.
Can anyone tell me which is the function code that I have to use and in which class I can find this.
Regards,
AbijithHi ,
You can get Names in debugging using,
DATA: r_functions TYPE REF TO cl_salv_functions,
t_func_list TYPE salv_t_ui_func,
w_fname type string,
wa_func_list LIKE LINE OF t_func_list.
* Get all functions
r_functions = gr_table->get_functions( ).
"gr_table is ref to cl_salv_table
t_func_list = r_functions->get_functions( ).
LOOP AT t_func_list INTO wa_func_list.
w_fname = wa_func_list-r_function->get_name( ).
ENDLOOP.
Note: You can Hide the particular Function code by
wa_func_list-r_function->set_visible( ' ' ).
Hope This Helps You.
Regards,
Raghava Channooru -
Alv status standard function codes
Hello,
I have developed an not OO ALV.
I want to put the sort standard button. Does anybody know the function code i have to put in the status?
ThanksHi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Hope this helps you.
Regards,
Tarun -
Hi ,
For displaying ALV on a modal dialog screen, I am using "CL_GUI_ALV_GRID" and the method is SET_TABLE_FOR_FIRST_DISPLAY.
I want to exclude the complete tool bar that is appearing on the screen. For that I have an exporting parameter of the above mentioned method, i.e., "IT_TOOLBAR_EXCLUDING"
But I dont know the function codes of the tool bar elements, to fill the internal table with. Couls any one please help me how to find them out.In the ALV Layout mark NO_TOOLBAR = 'X'
data: e_layout TYPE LVC_S_LAYO.
MOVE 'X' TO e_layout-no_toolbar.
Pass e_layout to IS_LAYOUT of SET_TABLE_FOR_FIRST_DISPLAY
Edited by: Swastik Bharati on Apr 22, 2009 3:24 PM -
What is the difference b/w ALV Function Module and ALV Methods?
Hello Friends,
Can anybody help me in finding out the difference between ALV Function Modules and ALV methods?
Thanks & Regards
Sathish KumarHi Sathish,
Plz go through this info. It is very useful.
hi,
chk these excellent links.
http://www.geocities.com/mpioud/Abap_programs.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
OOPs:
Check this for basic concepts of OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
Tabstrip
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
Editable ALV
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
Tree
http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
General Tutorial for OOPS
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
Rewords some points if it is helpful.
Rgds,
P.Naganjana Reddy -
User Function in Fullscreen ALV
Hi guys,
i'm using a fullscreen ALV (CL_SALV_TABLE) and want to add a user defined function. On halp.sap.com i found a hint that i have to copy the GUI-STATUS SALV_TABLE_STANDARD and add that copy to ALV by using the method SET_SCREEN_STATUS.
Now the new Button appears, but here is my question. Where do i have to put my coding for that function?
Normally i catch function codes within user_command, but how to do that with fullscreen ALV?
Hope someone can help me?
Regards
Mark-AndréHi,
Chek this article [ALV Object Model u2013 Simple 2D Table u2013 Event Handling|https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01&overridelayout=true]. It explains it well.
Regards
Marcin -
Function Code +CUS1 in GUI AEND for IW37, what is it's purpose?
Hi All,
We have added our own button to the IW37 "List of Order Operations" screen (the ALV grid). In going through our upgrade, I noticed a function code of +CUS1. Should I use this instead of adding our core modification, and if so, how?
Regards,
GregGreg,
Have a look at user-exit ICSV0001 (Display of geographic location data) via TCode SMOD.
PeteA -
Custom Function on OO ALV Grid
I am trying to implement ALV_GRID_XT to enhance the ALV Grid toolbar by adding couple of custom funcitons.As per the SAP documentation I have created 2 methods ON_TOOLBAR - one for adding items on toolbar and the other ON_USER_COMMAND - for processing if the user clicks on the custom function.
I am unable to relate the ALV Grid instance onto the method ON_USER_COMMAND . One of the funciton is to calculate the average of column which represents percentage excluding cells with zero values. Once the user selects column(s) and clicks on the Percent button on the ALV grid my piece of code should trigger ON_USER_COMMAND and then display the average percentage on the Totals row.
Method ON_USER_COMMAND has only one parameter E_UCOMM which i am able to get in the method but I am not able to get the instance of the ALV grid so that I can play around with the data in the Grid.
I could have used a local class and then enhanced the ALV toolbar but this requirement is needed for about 20 reports and hence thought of implementing it globally.
Any ideas would be appreciated.Hi there
You need to set the handlers of course and register the events
I'm using also a Z-class using functionality from the ALV Grid
in the application program
data: z_object type ref to zcl_* "my z_class"
* Instantiate your Z class
create object z_object
exporting
z_object = z_object
cfname = 'CCONTAINER1'.
Now in your Constructor for your Z-Class have a variable
say grid1 which is defined as a type ref to cl_gui_alv_grid.
Code the methods you require --. The trick is to instantiate your OWN Z class and within YOUR CLASS instantiate the GRID1 variable as an instance of cl_gui_alv_grid - then you can use methods etc from that class in your own Z class simple via something like this
method CONSTRUCTOR.
create object grid_container1
exporting
container_name = cfname.
create object grid1
exporting
i_parent = grid_container1.
set handler z_object->on_user_command for grid1.
set handler z_object->on_toolbar for grid1.
set handler z_object->handle_data_changed for grid1.
set handler z_object->handle_data_changed_finished for grid1.
set handler z_object->on_dubbelklik for grid1.
set handler z_object->on_hotspot for grid1.
call method grid1->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
endmethod.
method display_grid .
get reference of g_outtab into g_outtab1.
get reference of g_fldcat into g_fldcat1.
struct_grid_lset-edit = i_edit. "To enable editing in ALV
struct_grid_lset-zebra = i_zebra.
struct_grid_lset-cwidth_opt = i_opt.
struct_grid_lset-grid_title = i_gridtitle.
* struct_grid_lset-ctab_fname = 'T_CELLCOLORS'.
* struct_grid_lset-stylefname = 'CELLTAB'.
struct_grid_lset-ctab_fname = style_fname.
struct_grid_lset-stylefname = style_ctab.
* export gt_outtab from gt_outtab to memory id 'gt_outtab'.
call method grid1->set_table_for_first_display
exporting
is_layout = struct_grid_lset
changing
it_outtab = gt_outtab
it_fieldcatalog = it_fldcat.
endmethod.
You need to add the buttons to the toolbar with your ON TOOLBAR method
for example
method on_toolbar .
type-pools icon.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EXCEL' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move icon_xxl to ls_toolbar-icon.
move 'Excel' to ls_toolbar-quickinfo.
move 'EXCEL' to ls_toolbar-text.
append ls_toolbar to e_object->mt_toolbar.
perform toolbar in program (caller) if found
using e_object.
endmethod.
Now the functionality should work in the ON_USER_COMMAND .
Here's my ON_USER_COMMAND method within the class
method ON_USER_COMMAND.
* FOR EVENT before_user_command OF cl_gui_alv_grid
* IMPORTING
* e_ucomm
* sender
* When defined in SE24 you don't need to code the
* FOR EVENT etc as this is already defined as an event handler
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.
when 'SWITCH'.
call method me->switch.
when 'TEST'.
call method me->get_cell.
endcase.
endmethod.
Add whatever extra functionality you want to the on_user_command so long as you've defined toolbars..
Cheers
jimbo -
Satndard AVL function code in interactive reports
hai
can any one give some frequently used alv function codes for interctie display
thanking u
regards
muraliHi Murali,
please find the attached code. hope it helps you....
report zptest_alv1.
**TABLES DECLN
tables: vbrk,vbrp,t001.
type-pools: slis.
type-pools: icon.
***DATA DECLN.
data: v_vbeln like vbrk-vbeln,
v_matnr like vbrp-matnr.
constants: c_user_command type slis_formname value 'F_USER_COMMAND',
c_pf_status type slis_formname value 'F_SET_PF_STATUS'.
**ALV RELATED TABLES.
*--Field Catalog
data: it_fieldcat type standard table of
slis_fieldcat_alv with header line,
it_fieldcat1 type standard table of
slis_fieldcat_alv with header line ,
wa_fieldcat type slis_fieldcat_alv,
*--Layout
wa_layout type slis_layout_alv,
*--Sort
it_sort type slis_t_sortinfo_alv,
wa_sort type slis_sortinfo_alv ,
**-Structure for excluding function codes
wa_extab type slis_extab,
**-To hold function codes to be excluded in ALV toolbar
it_extab type slis_t_extab.
***INTERNAL TABLE DECLN.
data: begin of it_vbrk occurs 0,
vbeln like vbrk-vbeln,
waerk like vbrk-waerk,
vkorg like vbrk-vkorg,
fkdat like vbrk-fkdat,
bukrs like vbrk-bukrs,
netwr like vbrk-netwr,
end of it_vbrk.
data: begin of itab occurs 0,
vbeln like vbrp-vbeln,
posnr like vbrp-posnr,
fkimg like vbrp-fkimg,
vrkme like vbrp-vrkme,
netwr like vbrp-netwr,
matnr like vbrp-matnr,
arktx like vbrp-arktx,
end of itab.
data: it_vbrp like itab occurs 0 with header line.
***selection screen.
selection-screen: begin of block b1 with frame title text-001.
select-options: s_vbeln for vbrk-vbeln,
s_fkdat for vbrk-fkdat obligatory,
s_matnr for vbrp-matnr.
selection-screen: end of block b1.
**INITIALIZATION.
initialization.
s_fkdat-low = sy-datum - 200.
s_fkdat-high = sy-datum.
append s_fkdat.
***AT SELECTION-SCREEN.
at selection-screen.
if not s_vbeln is initial.
select single vbeln from vbrk
into v_vbeln
where vbeln in s_vbeln.
if sy-subrc <> 0.
message e001(zz2).
endif.
endif.
if not s_matnr is initial.
select single matnr from mara
into v_matnr
where matnr in s_matnr.
if sy-subrc <> 0.
message e001(zz2).
endif.
endif.
***START-OF-SELECTION.
start-of-selection.
perform get_data_vbrk.
perform get_data_vbrp.
***END-OF-SELECTION.
end-of-selection.
*--Sort the Output Fields
perform sort_fields.
*--Build Field catalog for the Output fields
perform get_field_catalog.
***MODIFY LAYOUT.
perform modify_layout.
*--Display ALV output
perform list_disp tables it_vbrk
using c_user_command.
*& Form GET_DATA_VBRK
text
--> p1 text
<-- p2 text
form get_data_vbrk.
select vbeln
waerk
vkorg
fkdat
bukrs
netwr
into table it_vbrk
from vbrk
where vbeln in s_vbeln
and fkdat in s_fkdat.
endform. " GET_DATA
*& Form GET_DATA_VBRP
text
--> p1 text
<-- p2 text
form get_data_vbrp .
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO TABLE IT_VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN = IT_VBRK-VBELN.
select vbeln
posnr
fkimg
vrkme
netwr
matnr
arktx
from vbrp
into table itab
for all entries in it_vbrk
where vbeln = it_vbrk-vbeln.
endform. " GET_DATA_VBRP
*& Form GET_FIELD_CATALOG
text
--> p1 text
<-- p2 text
form get_field_catalog .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'IT_VBRK'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat[]
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.
endform. " GET_FIELD_CATALOG
*& Form SORT_FIELDS
text
--> p1 text
<-- p2 text
form sort_fields .
clear wa_sort.
wa_sort-spos = '01'.
wa_sort-fieldname = 'VBELN' .
wa_sort-tabname = 'IT_VBRK'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
clear wa_sort.
wa_sort-spos = '02'.
wa_sort-fieldname = 'POSNR' .
wa_sort-tabname = 'IT_VBRP'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
endform. " SORT_FIELDS
*& Form MODIFY_LAYOUT
text
--> p1 text
<-- p2 text
form modify_layout .
wa_layout-default_item = 'X'.
wa_layout-zebra = 'X'.
wa_layout-expand_fieldname = 'EXPAND'.
wa_layout-colwidth_optimize = 'X'.
endform. " MODIFY_LAYOUT
*& Form LIST_DISP
text
--> p1 text
<-- p2 text
form list_disp tables p_it_vbrk
using p_user_command type slis_formname.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'POPUP'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING = IT_EXTAB[]
TABLES
T_OUTTAB = IT_VBRK
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.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = 'POPUP'
i_callback_user_command = 'HANDLE_USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
tables
t_outtab = p_it_vbrk
exceptions
program_error = 1
others = 2.
endform. " LIST_DISP
*& Form POPUP
text
-->P_EXTAB text
form popup using it_extab type slis_t_extab.
*- Pf status
set pf-status 'POPUP'.
endform. " POPUP
*& Form F_USER_COMMAND
form handle_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
clear it_fieldcat1[].
clear it_vbrp[].
if rs_selfield-fieldname = 'VBELN'.
read table it_vbrk index rs_selfield-tabindex.
loop at itab where vbeln = it_vbrk-vbeln.
move-corresponding itab to it_vbrp.
append it_vbrp.
endloop.
perform interactive_report.
endif.
endcase.
endform. "HANDLE_USER_COMMAND
*& Form INTERACTIVE_REPORT
text
--> p1 text
<-- p2 text
form interactive_report .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT1[]
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.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-seltext_l = 'BILLING DOC'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 1.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'POSNR'.
wa_fieldcat-seltext_l = 'ITEM'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 2.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'FKIMG'.
wa_fieldcat-seltext_m = 'INV QTY'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 3.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'VRKME'.
wa_fieldcat-seltext_m = 'SALES UNIT'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 4.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'NETWR'.
wa_fieldcat-seltext_m = 'NET PRICE'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-col_pos = 5.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 6.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-seltext_m = 'SALES ORDER'.
wa_fieldcat-tabname = 'IT_VBRP'.
wa_fieldcat-col_pos = 7.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT1[]
IT_SORT = IT_SORT
TABLES
T_OUTTAB = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = wa_layout
it_fieldcat = it_fieldcat1[]
tables
t_outtab = it_vbrp
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. " INTERACTIVE_REPORT
Madhavi -
in which table are the function codes stored? how to find the function codes for double click in alv reporting?wht are &IC1 and &ETA function codes?
Hello,
&IC1 can be used to check for a double-click in a "hotspot" field in an ALV grid. It will show up in sy-ucomm and you would check it in a user_command form that was defined as an event in the original ALV call.
For example (using SAP Utilities):
FORM v_user_command USING r_ucomm TYPE sy-ucomm
ls_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'. "hotspot
read table t_error_log index ls_selfield-tabindex.
if ls_selfield-sel_tab_field = 'T_ERROR_LOG-REFOBJTYPE'.
if t_error_log-refobjtype = 'INSTLN'.
set parameter id 'ANL' field t_error_log-refobjkey.
call transaction 'EC85'.
elseif t_error_log-refobjtype = 'DEVICE'.
f_equnr = t_error_log-refobjkey.
perform get_device_number using f_equnr
f_device.
set parameter id 'GER' field f_device.
call transaction 'EC85'.
endif.
elseif ls_selfield-sel_tab_field = 'T_ERROR_LOG-REFOBJKEY'.
if t_error_log-refobjtype = 'INSTLN'.
set parameter id 'ANL' field t_error_log-refobjkey.
call transaction 'EL29'.
elseif t_error_log-refobjtype = 'DEVICE'.
f_equnr = t_error_log-refobjkey.
perform get_device_number using f_equnr
f_device.
set parameter id 'GER' field f_device.
call transaction 'EL29'.
endif.
elseif ls_selfield-sel_tab_field = 'T_ERROR_LOG-DISCNO'.
set parameter id 'EDN' field t_error_log-discno.
call transaction 'EC86' and skip first screen.
endif.
ENDCASE.
endform.
K---
Maybe you are looking for
-
How to invisible perticular row of a table column?
Hi All, I want to set invisible or blank in perticular row of table column. I have a table, contains 2 row in that , one of the column contains button. If i clik on this button(ex: 1st row button ) it add new row with different data, it contains butt
-
Do we really need the install discs?
Hello, we have a Ibook G3, using OS X 10.4.11, that was upgraded from the original and now has more RAM and a higher speed processor. Whomever did this upgrade must have put in the user name and password and for the life of me, cannot figure out what
-
Need to know the standard function module/program in E recruitment
Hi All, I need to know the standard function module/programm that defaults the 'Functional area' field in the posting page from the requisition page. Early responce is greatly appreciated. Thanks and best regards Rajeev
-
Mabook air lemon - how do I resolve it?
I am trying to find out what to do about my recently purchased macbook air. I bought it on march 7, 2010. On march 18, it would no longer turn on. I tried leaving it off for a day. Plugging it into a different location, etc. I spent time online to fi
-
Can The MacBook Pro Retina (2013) daisy chain display?
I have a 2013 MacBook Pro Retina 15" and a Dell U2713H, I would like to use the video-out via Display Port on my monitor to run another monitor. I know that Display port 1.2 supports daisy chain, as does my monitor, but I do not know what versions th