F4 help for a field in alv grid
hello friends,
i want to make one of the fields of my alv grid as editable and i want f4 help option also available for it, can v do it, if yes how??? pls explain through code
thanks
check this example
REPORT ztest440.
TABLES : mara.
TYPES: BEGIN OF t_mara,
matnr TYPE mara-matnr,
lvorm TYPE mara-lvorm,
mtart TYPE mara-mtart,
mbrsh TYPE mara-mbrsh,
matkl TYPE mara-matkl,
meins TYPE mara-meins,
brgew TYPE mara-brgew,
ntgew TYPE mara-ntgew,
gewei TYPE mara-gewei,
END OF t_mara.
TYPES: BEGIN OF t_equk,
matnr TYPE equk-matnr,
werks TYPE equk-werks,
bdatu TYPE equk-bdatu,
vdatu TYPE equk-vdatu,
qunum TYPE equk-qunum,
END OF t_equk.
CLASS : lcl_alv_grid DEFINITION DEFERRED.
DATA : gi_mara TYPE STANDARD TABLE OF t_mara,
gi_equk TYPE STANDARD TABLE OF t_equk,
gs_mara TYPE t_mara,
gs_equk TYPE t_equk.
*-- Global data definitions for ALV
*--- ALV Grid instance reference
DATA : gw_alvgrid TYPE REF TO cl_gui_alv_grid,
gw_alvgrid1 TYPE REF TO cl_gui_alv_grid .
*--- Custom container instance reference
DATA gw_container TYPE REF TO cl_gui_custom_container.
DATA gw_event_handler TYPE REF TO lcl_alv_grid.
DATA gw_event_handler1 TYPE REF TO lcl_alv_grid.
DATA gw_container1 TYPE REF TO cl_gui_custom_container.
*--- Field catalog table
DATA : gi_fieldcat TYPE lvc_t_fcat,
gi_fieldcat1 TYPE lvc_t_fcat,
gs_fieldcat TYPE lvc_s_fcat,
gs_fieldcat1 TYPE lvc_s_fcat.
*--- Layout structure
DATA : gs_layout TYPE lvc_s_layo,
gs_layout1 TYPE lvc_s_layo.
CLASS lcl_alv_grid DEFINITION
CLASS lcl_alv_grid DEFINITION.
PUBLIC SECTION.
METHODS :
Handle_double_click
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column,
Handle_double_click
handle_onf4
FOR EVENT onf4 OF cl_gui_alv_grid
IMPORTING e_fieldname,
Handle_double_click
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id.
PRIVATE SECTION.
ENDCLASS. " lcl_alv_grid DEFINITION
CLASS LCL_ALV_GRID IMPLEMENTATION *
CLASS lcl_alv_grid IMPLEMENTATION.
METHOD handle_double_click *
METHOD handle_double_click.
READ TABLE gi_mara INTO gs_mara INDEX e_row.
IF sy-subrc = 0.
SELECT matnr
werks
bdatu
vdatu
qunum
FROM equk
INTO TABLE gi_equk
WHERE matnr = gs_mara-matnr.
IF sy-dbcnt NE 0.
SORT gi_equk BY matnr werks bdatu.
ENDIF.
CALL SCREEN 0002.
ENDIF.
ENDMETHOD. "handle_double_click
METHOD handle_onf4 *
METHOD handle_onf4.
PERFORM f4_help USING e_fieldname.
ENDMETHOD. "handle_double_click
METHOD handle_double_click *
METHOD handle_hotspot_click.
READ TABLE gi_mara INTO gs_mara INDEX e_row_id.
IF sy-subrc = 0.
SELECT matnr
werks
bdatu
vdatu
qunum
FROM equk
INTO TABLE gi_equk
WHERE matnr = gs_mara-matnr.
IF sy-dbcnt NE 0.
SORT gi_equk BY matnr werks bdatu.
ENDIF.
CALL SCREEN 0002.
ENDIF.
ENDMETHOD. "handle_hotspot_click
ENDCLASS. " lcl_alv_grid IMPLEMENTATION
SELECTION SCREEN DEFINITION *
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS,
s_mtart FOR mara-mtart NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION *
START-OF-SELECTION.
SELECT matnr
lvorm
mtart
mbrsh
matkl
meins
brgew
ntgew
gewei
FROM mara
INTO TABLE gi_mara
WHERE matnr IN s_matnr
AND mtart IN s_mtart.
IF sy-dbcnt NE 0.
SORT gi_mara BY matnr.
ENDIF.
CALL SCREEN 0001.
*& Module STATUS_0001 OUTPUT
text
MODULE status_0001 OUTPUT.
SET PF-STATUS '0001'.
SET TITLEBAR '001'.
PERFORM build_alv_display.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
text
MODULE user_command_0001 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'SAVE'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
*& Form build_alv_display
text
--> p1 text
<-- p2 text
FORM build_alv_display .
PERFORM build_fieldcat.
PERFORM build_layout.
PERFORM create_alv_grid.
PERFORM display_alv_grid.
ENDFORM. " build_alv_display
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
FORM build_fieldcat .
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material Number'.
gs_fieldcat-outputlen = '18'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '1'.
gs_fieldcat-hotspot = 'X'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'LVORM'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Deletion'.
gs_fieldcat-outputlen = '8'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '2'.
gs_fieldcat-checkbox = 'X'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MTART'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material Type'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '3'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MBRSH'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Industry sector'.
gs_fieldcat-outputlen = '15'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '4'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATKL'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material group'.
gs_fieldcat-outputlen = '14'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '5'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MEINS'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Base Unit of Measure'.
gs_fieldcat-outputlen = '20'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '6'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'BRGEW'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Gross weight'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '7'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'NTGEW'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Net weight'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '8'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'GEWEI'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Weight Unit'.
gs_fieldcat-outputlen = '11'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '9'.
APPEND gs_fieldcat TO gi_fieldcat.
ENDFORM. " build_fieldcat
*& Form build_layout
text
--> p1 text
<-- p2 text
FORM build_layout .
gs_layout-sel_mode = 'A'.
gs_layout-edit = ' '.
gs_layout-no_toolbar = ' '.
gs_layout-grid_title = 'Material Data'.
gs_layout-no_headers = ' '.
gs_layout-weblook = 'X'.
ENDFORM. " build_layout
*& Form create_alv_grid
text
--> p1 text
<-- p2 text
FORM create_alv_grid .
IF gw_container IS INITIAL.
CREATE OBJECT gw_container
EXPORTING
container_name = 'CC_ALV'.
Display ALV grid
IF gw_alvgrid IS INITIAL.
CREATE OBJECT gw_alvgrid
EXPORTING
i_parent = gw_container.
ENDIF.
ENDIF.
IF gw_event_handler IS INITIAL.
CREATE OBJECT gw_event_handler.
SET HANDLER gw_event_handler->handle_double_click
FOR gw_alvgrid.
SET HANDLER gw_event_handler->handle_onf4
FOR gw_alvgrid.
SET HANDLER gw_event_handler->handle_hotspot_click
FOR gw_alvgrid.
ENDIF.
ENDFORM. " create_alv_grid
*& Form display_alv_grid
text
--> p1 text
<-- p2 text
FORM display_alv_grid .
CALL METHOD gw_alvgrid->set_table_for_first_display
EXPORTING
i_buffer_active = ' '
i_bypassing_buffer = ' '
i_structure_name = 'T_MARA'
is_layout = gs_layout
CHANGING
it_outtab = gi_mara[]
it_fieldcatalog = gi_fieldcat[]
EXCEPTIONS
OTHERS = 0.
ENDFORM. " display_alv_grid
*& Module STATUS_0002 OUTPUT
text
MODULE status_0002 OUTPUT.
SET PF-STATUS '0002'.
SET TITLEBAR '002'.
PERFORM build_alv_display1.
ENDMODULE. " STATUS_0002 OUTPUT
*& Module USER_COMMAND_0002 INPUT
text
MODULE user_command_0002 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0002 INPUT
*& Form build_alv_display1
text
--> p1 text
<-- p2 text
FORM build_alv_display1 .
PERFORM build_fieldcat1.
PERFORM build_layout1.
PERFORM create_alv_grid1.
PERFORM display_alv_grid1.
ENDFORM. " build_alv_display1
*& Form build_fieldcat2
text
--> p1 text
<-- p2 text
FORM build_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Material Number'.
gs_fieldcat-outputlen = '18'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '1'.
gs_fieldcat-f4availabl = 'X'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'WERKS'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Plant'.
gs_fieldcat-outputlen = '4'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '2'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'BDATU'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Valid Untill'.
gs_fieldcat-outputlen = '12'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '3'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'VDATU'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Valid From'.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '4'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'QUNUM'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Quota'.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '5'.
APPEND gs_fieldcat TO gi_fieldcat1.
ENDFORM. " build_fieldcat2
*& Form build_layout2
text
--> p1 text
<-- p2 text
FORM build_layout1.
gs_layout1-sel_mode = 'A'.
gs_layout1-edit = ' '.
gs_layout1-no_toolbar = ' '.
gs_layout1-grid_title = 'Quota Header Data'.
gs_layout1-no_headers = ' '.
ENDFORM. " build_layout1
*& Form create_alv_grid2
text
--> p1 text
<-- p2 text
FORM create_alv_grid1.
IF gw_container1 IS INITIAL.
CREATE OBJECT gw_container1
EXPORTING
container_name = 'CC_ALV1'.
Display ALV grid
IF gw_alvgrid1 IS INITIAL.
CREATE OBJECT gw_alvgrid1
EXPORTING
i_parent = gw_container1.
ENDIF.
ENDIF.
IF gw_event_handler1 IS INITIAL.
CREATE OBJECT gw_event_handler1.
SET HANDLER gw_event_handler1->handle_onf4
FOR gw_alvgrid1.
ENDIF.
ENDFORM. " create_alv_grid1
*& Form display_alv_grid2
text
--> p1 text
<-- p2 text
FORM display_alv_grid1 .
DATA : li_f4 TYPE lvc_t_f4,
ls_f4 TYPE lvc_s_f4.
CALL METHOD gw_alvgrid1->set_table_for_first_display
EXPORTING
i_buffer_active = ' '
i_bypassing_buffer = ' '
i_structure_name = 'T_EQUK'
is_layout = gs_layout1
CHANGING
it_outtab = gi_equk[]
it_fieldcatalog = gi_fieldcat1[]
EXCEPTIONS
OTHERS = 0.
IF li_f4[] IS INITIAL.
MOVE 'MATNR' TO ls_f4-fieldname.
MOVE 'X' TO ls_f4-register.
MOVE 'X' TO ls_f4-getbefore.
APPEND ls_f4 TO li_f4.
CLEAR ls_f4.
CALL METHOD gw_alvgrid1->register_f4_for_fields
EXPORTING
it_f4 = li_f4.
ENDIF.
ENDFORM. " display_alv_grid1
*& Form f4_help
text
-->P_FIELDNAME text
FORM f4_help USING p_fieldname.
TYPES : BEGIN OF t_values,
matnr TYPE mara-matnr,
END OF t_values.
DATA : li_fields TYPE TABLE OF dfies,
li_select_values TYPE TABLE OF ddshretval,
li_values TYPE TABLE OF t_values,
ls_fields TYPE dfies,
ls_values TYPE t_values.
REFRESH : li_fields,
li_select_values.
SELECT matnr
FROM equk
INTO TABLE li_values.
CASE p_fieldname.
WHEN 'MATNR'.
ls_fields-tabname = 'EQUK'.
ls_fields-fieldname = 'MATNR'.
APPEND ls_fields TO li_fields.
CLEAR ls_fields.
SORT li_values BY matnr.
DELETE ADJACENT DUPLICATES FROM li_values COMPARING matnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
TABLES
value_tab = li_values
field_tab = li_fields
return_tab = li_select_values.
IF sy-subrc = 0.
LOOP AT li_select_values WHERE fieldname = 'MATNR'.
clear gs_mara.
gs_mara in
ENDIF.
ENDCASE.
ENDFORM. " f4_help
Similar Messages
-
How to add F1 help for a field on ALV grid
Hi All,
When we execute a program, the output is displayed using ALV grid.
on the ALV grid, if we press F1 on a field, it should popup the help document.
How to add F1 help for a field on ALV grid.
Thank you all in advance.fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
A. -
Add List box for one field in ALV GRID
Hi All,
I need to add drop down list box for one field in ALV Grid.
If any body knows, please help.
Thanks in advance.
Regards
MangleshHi,
Here is the ex where i have used for date parameter in the sel screen
type-pools: vrm.
data: name type vrm_id,
list type vrm_values,
value like line of list.
parameters : p_date like p_date2
as listbox visible length 15.
at selection-screen output.
name = 'P_DATE'.
value-key = '1'.
value-text = 'Today'.
append value to list.
value-key = '2'.
value-text = 'Last 7 days'.
append value to list.
value-key = '3'.
value-text = 'Last 30 days'.
append value to list.
value-key = '4'.
value-text = 'Last 90 days'.
append value to list.
value-key = '5'.
value-text = 'Last year'.
append value to list.
Call the ''VRM_SET_VALUES' to display the values in Listbox
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
at selection-screen.
if sy-ucomm = 'CLI1'.
sscrfields-ucomm = 'ONLI'(001).
endif.
if p_date = '1'.
p_date11 = sy-datum .
elseif p_date = '2'.
p_date11 = ( sy-datum - 7 ).
elseif p_date = '3'.
p_date11 = ( sy-datum - 30 ).
elseif p_date = '4'.
p_date11 = ( sy-datum - 90 ).
elseif p_date = '5'.
p_date11 = ( sy-datum - 365 ).
endif.
Hope this helps u..
Please reward points if useful.
Regards,
Sreenivas -
How to pass custom search help(F4 help) for a field in ALV output?
Hi,
I want to activate the F4 help in ALV output for a field for which we do not have search help assigned at table ,data element and domain level.
In field catalog i have enabled it by below line.
ls_fcat-F4AVAILABL = 'X'.
but because there are no standard input help available it is giving message as "No input help is available".
so how to pass our custom search help (g_search) for any field in ALV output.
I am using object oriented ALV grid display.
Thanks!!!
Rajesh Gupta.hi,
check this out:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/acdefb13-0701-0010-f1a2-8eeefa7d3780
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d?quicklink=index&overridelayout=true -
Reg : F4 help for custom fields in ALV report
hi friends..
in my internal table i have fields including 1 custom field..
DATA : BEGIN OF i_final OCCURS 0,
pernr LIKE p0000-pernr,
begda LIKE p0000-begda,
plans LIKE ZPOSITION-plans, (custom)
werks LIKE pspar-werks,
end of i_final.
i want to display this i_final table in alv. for that i genetrate one fieldcatalog
PERFORM fcat USING:
'I_FINAL' 'PERNR' 'P0000' 'PERNR' '15' 'X' '',
'I_FINAL' 'BEGDA' 'P0000' 'BEGDA' '10' 'X' '',
'I_FINAL' 'PLANS' 'ZPOSITION' 'PLANS' '8' 'X' '',
'I_FINAL' 'WERKS' 'PSPAR' 'WERKS' '14' 'X' ''.
in custom table zposition, i maintain serch help for custom field "PLANS".
then i used reuse_alv_grid_display.. for all the std fields along wit custom fields
i got f4 all std fields but for my custom i am not getting the f4 help
how can i get the F$ help for this custom fields Zposition-plans..
plz give some ideaHi
In that Ztable against the field
PLANS give the check table name as <b>T528B</b>
then it will automatically give the search help
or you can create your own search help(elementary) and add to that field
Reward if useful
regards
Anji -
How to add a search help for a field in alv?
HI!Everyone ,
i want to add a search help created by myself for one field in alv,
and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
can anyone help me ?
thanks!HI,Vijay.
My code like this :
PERFORM build_fcat.
PERFORM build_objects.
PERFORM layo_build.
PERFORM set_drdn_table .
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'STU_S'
is_layout = s_layo
CHANGING
it_outtab = itab_out
it_fieldcatalog = i_fcat
."Period
IF sy-subrc <> 0.
EXIT.
ENDIF.
for example, there is a field 'UNAME' IN Structure 'STU_S',
i want to add a search help for 'UNAME'.
the 'UNAME' is not users in SAP R/3 , i want to add some data by myself or from a table . -
Suppress Decimals for CURR field in ALV Grid based on condition
Hello All,
I am displaying records in ALV Grid. For a Company Code, I get the Currency Code from table T001.
If the Currency is JPY, I want to display the value of CURR field without decimals.
For example: if the value is 200.00, I want to display only 200
But if the Currency is other than JPY, I want to display value with decimals.
For example: if the value is 200.00, I want to display only 200.00
Also I want the summation function to work on this column, so can't take the field as char field.
Waiting for useful pointers.
Thanks in advance,
Regards,
Tarun GambhirHi Keshav,
Thanks for the reply.
I have only one CompCode on the selection screen and for that CoCd I will have only one Currency.
So either all records will be displayed with decimals or all records will be displayed without decimals.
Can DECIMALS_OUT property of field catalog be helpful in this case.
For reference you can check: http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm
I am confused over the use of DECIMALS_OUT.
Please suggest.
Regards,
Tarun -
Custom F4 for a field in ALV GRID
I am want to provide a custom f4 fro a field in alv gird
similiar to the functionality of process on value request
on a normal screenHi Kaushik
You can find some information at page 37 of the document:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
*--Serdar -
How to enable F4 help for a field in ALV?
Hi,
I want to activate the F4 help in ALV output for a field for which we do not have search help assigned at table ,data element and domain level.
In field catalog i have enabled it by below line.
ls_fcat-F4AVAILABL = 'X'.
but because there are no standard input help available it is giving message as "No input help is available".
Can you please help?
Best Regards,
Rajesh GuptaThanks.
But i have my own custom search help which i want to assign for the ALV field as the standard field does not have the search help associated with it.
and because its a standard dataelement we can not even assign the search help at dataelement level.
do we have any way that we can pass our own custom search help from field catalog or any other way to implement the same.
Thanks again!!
Rajesh
Edited by: Rajesh Gupta on Nov 18, 2010 4:12 PM -
How can we sum for the field on alv grid
Dear Freinds,
I am having the field count .....in the ouput (iam using alv grid) .......which dispalys the id's which are identical .
i have scneario similar to the below in my ALV Output
ID count total
4000 3 100
100
200 Can i get count 3 also along with 200 in alv?
i am using the code as follows for count can any one please let me know.
my earlier question which i put was confusing.........so i am givin the qustion again
clear ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'ORGUNIT'.
ls_fieldcat-seltext_l = text-015. "'Orgunit'.
ls_fieldcat-key = 'X'.
ls_fieldcat-key_sel = 'X'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'COUNT'.
ls_fieldcat-seltext_l = 'H.Count'.
ls_fieldcat-outputlen = 4.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'NUMC'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'TOTAL'.
ls_fieldcat-seltext_m = 'total'.
ls_fieldcat-col_pos = 3.
ls_fieldcat-outputlen = 17.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'CURR'.
append ls_fieldcat to fp_i_fieldcat.
Please let me know how can do if so what is the parameter i have to change for COUNT
regards
syamalHi Shamala Kiran.
My name is also kiran.I have a develop a code for u.Actually i cant understand your code.But i know ur problem .Plz check that code.In that code i develop a subtotals and grandttotal.Plz observe the FORM "FIELD CATALOG" in that observe the NETWR FIELD and observe the FORM SORTCATALOG then ur problem will be solved.
Copy the the below code and execute that code and the result.
If u r Satisfied with the answer plz give the REWARD POINTS.
CODE:
Type Pools
TYPE-POOLS:slis.
Tables
TABLES: vbak,vbap.
Global Variable
data: w_var type i.
Global Data
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
it_sortcat TYPE slis_t_sortinfo_alv,
wa_sortcat LIKE LINE OF it_sortcat.
Internal Table
data: BEGIN OF it_salesorder OCCURS 0,
vbeln LIKE vbak-vbeln, " Sales Document Number
posnr like vbap-posnr, " Sales Doc Item
netwr like vbap-netwr, " Net Value
END OF it_salesorder.
SELECT OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. " Sales Document Number.
SELECTION-SCREEN END OF BLOCK b1.
Initialization
INITIALIZATION.
PERFORM initialization.
*& Form initialization
text
--> p1 text
<-- p2 text
form initialization .
s_vbeln-sign = 'I'.
s_vbeln-option = 'BT'.
s_vbeln-low = '4969'.
s_vbeln-high = '5000'.
APPEND s_vbeln.
endform. " initialization
Start Of Selection
START-OF-SELECTION.
PERFORM field_catalog. "For Structure Creation
PERFORM fetch_data. "Get the Data From DB Table
PERFORM sorting USING it_sortcat.
End Of Selection
END-OF-SELECTION.
perform display_data.
*& Form field_catalog
text
--> p1 text
<-- p2 text
form field_catalog .
wa_fieldcat-col_pos = w_var. " Column Position Variable
wa_fieldcat-tabname = 'IT_SALESORDER'. " Internal Table Name
wa_fieldcat-fieldname = 'VBELN'. " Field Name
wa_fieldcat-key = 'X'. " Blue Color
wa_fieldcat-ref_tabname = 'VBAK'. " Table Name
wa_fieldcat-ref_fieldname = 'VBELN'. " Field Name
wa_fieldcat-seltext_m = 'Sales Doc No'. " Display Text In Screen
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ADD 1 TO w_var.
wa_fieldcat-col_pos = w_var. " Column Position Variable
wa_fieldcat-tabname = 'IT_SALESORDER'. " Internal Table Name
wa_fieldcat-fieldname = 'POSNR'. " Field Name
wa_fieldcat-ref_tabname = 'VBAP'. " Table Name
wa_fieldcat-ref_fieldname = 'POSNR'. " Field Name
wa_fieldcat-seltext_m = 'Sales Doc Item'. " Display Text In Screen
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ADD 1 TO w_var.
wa_fieldcat-col_pos = w_var. " Column Position Variable
wa_fieldcat-tabname = 'IT_SALESORDER'. " Internal Table Name
wa_fieldcat-fieldname = 'NETWR'. " Field Name
wa_fieldcat-ref_tabname = 'VBAP'. " Table Name
wa_fieldcat-ref_fieldname = 'NETWR'. " Field Name
wa_fieldcat-do_sum = 'X'. " Sum
wa_fieldcat-seltext_m = 'Net Value'. " Display Text In Screen
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ADD 1 TO w_var.
endform. " field_catalog
*& Form sorting
text
-->P_IT_SORTCAT text
form sorting using p_it_sortcat TYPE slis_t_sortinfo_alv.
wa_sortcat-fieldname = 'VBELN'.
wa_sortcat-up ='X'.
wa_sortcat-subtot = 'X'.
APPEND wa_sortcat TO p_it_sortcat.
endform. " sorting
*& Form display_data
text
--> p1 text
<-- p2 text
form display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = it_sortcat
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_salesorder
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " display_data
*& Form fetch_data
text
--> p1 text
<-- p2 text
form fetch_data .
select a~vbeln
posnr
b~netwr
from vbak as a
inner join vbap as b on avbeln = bvbeln
into table it_salesorder
where a~vbeln in s_vbeln.
endform. " fetch_data -
Help values for a field in ALV GRID
Hi !
i have a field in a structure, whose field have a table of values in its domain. How does this table values can apear in the ALV, when i click the corresponding field?
Best regards,
RuiHi,
Use the Field Catalogue Properties
Ref_fieldname
Ref_Tablename
and assign the corresponding field & Table/Strucutre Name to the above fields.... -
Disable F4 Help for disabled field in ALV?
I have an ALV table in which I display a field, which has an automatic F4 help defined in DDIC.
Via a button ("Display/Edit"), i set the input field to enabled and disabled.
This works, but the F4 help is visible in both modes.
How can I disable the F4 help when I am in display mode?Hi ,
U can deactivated the value help by calling the method ..SET_ATTRIBUTE_VALUE_HELP of class IF_WD_CONTEXT_NODE_INFO for the attribute and passing the parameter VALUE_HELP_MODE = C_VALUE_HELP_mode-deactivated .
Regards
Yash -
Negative sign display for CURR field in ALV grid report
I have a field BETRG defined as CURR field of length 15, decimal places 2. The value may be negative or positive. In case of negative values I am using EDIT_MSK option in the field catalog to bring the negative sign to the left of the value as shown below.
Quote
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'LT_FINAL'
i_inclname = sy-repid
CHANGING
ct_fieldcat = fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
LOOP AT fieldcat.
CASE fieldcat-fieldname.
WHEN 'BETRG'.
fieldcat-ctabname = ' '.
fieldcat-cfieldname = ' '.
fieldcat-edit_mask = 'RRV_______________.__'.
ENDCASE.
MODIFY fieldcat.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
i_grid_title = 'ABCD'
is_layout = gs_layout
it_fieldcat = fieldcat[]
i_save = 'A'
is_variant = gs_save
it_events = gs_events
TABLES
t_outtab = lt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Unquote
On displaying the report using 'REUSE_ALV_GRID_DISPLAY' as shown above, when the value of BETRG is a smaller number like say 624, then the ALV output appears as '- 624.00' instead of '-624.00'.
Is there any way that I can remove the space in between the negative sign and the number before displaying the ALV output using 'REUSE_ALV_GRID_DISPLAY'?Hi Deepak,
I tried this and found that this doesn't work in case of currency field. Once you move back the char field (with negative sign to the left and condensed) to the currency field, the negative sign again moves back to the right.
I think that the only way a negative sign can be brought to the left of the currenct field is by using edit_mask of field catalog as I have shown above.
Regards,
Shayeree. -
F4 - Help for field in ALV Grid Output
Hi,
I generated a report which gives output in ALV Grid output.
In the output, 1 of the field is editable.Here, for this field I need to have my own F4-Help.
I think the procedure to be followed is:--
Create a Search Help in SE11.
Link the Search Help to the editable field.
Please let me know if its the correct procedure.
I f yes, how can I link user defined Search Help to the editable field?
Thanks,
Shivaa........Hi siva,
you can also do that way.
while filling the fieldcatalog use the parameter F4AVAILABL
for more info check
F4 help in ALV Grid...
f4 help for a field in alv grid
hope it helps you
Thanks!
Edited by: Prasanth on Mar 6, 2009 3:59 PM -
F4 help for field in ALV grid control (using ABAP objects)
Hi All,
I have created a z table ZTAB which is a master table( with single column X). field X should be a input field in ALV Grid through F4 key. I have created searchelp and assigned it to data element of X feild, and in domain level I have assigned ZTAB as value table.
And in ALV field catalog wrote ls_fcat-ref_tab = 'ZTAB'. But still I'm not getting list of values when I press F4.
Can anyone help me to understand what is missing here? How to call standardard F4 help?
This is very urgent..
Regards
Jaker.u can refer to this standard program :BCALV_EDIT_08
also u wont get the list of values automatically..
declare a class :
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS :
handle_on_f4 for event onf4 of cl_gui_alv_grid
importing e_fieldname es_row_no er_event_data,
ENDCLASS. "LCL_EVENT_HANDLER
implementation of class
here u pass ur internal table what u want to display as pop up for f4 help.
*& Class (Implementation) LCL_EVENT_HANDLER
Text
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Method to handle F4 click.
Method handle_on_f4.
Function to create a popup and passing the values of internal table in it.
CALL FUNCTION 'POPUP_WITH_TABLE'
EXPORTING
ENDPOS_COL = 60
ENDPOS_ROW = 60
STARTPOS_COL = 5
STARTPOS_ROW = 5
TITLETEXT = 'pop up'
IMPORTING
CHOICE = wa_grid-zfield
TABLES
VALUETAB = ITAB
EXCEPTIONS
BREAK_OFF = 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.
RETURN.
ENDIF.
endmethod. "handle_on_f4
ENDCLASS. "LCL_EVENT_HANDLER
hope this gives u some idea.
Maybe you are looking for
-
Unable to release billing document to accounting
Dear All, I am cancelling billing document.The document created in July and cancelling today. Following error is coming in vf02 SD billing document cannot be cancelled. Error message F5A 005 occurs during release to accounting. the foreign currency
-
Language change in Dreamweaver cs6 from Dutch to English.
I have accidentally selected Dutch to be my Language during set up. How do I change the language from this point? Its all in Dutch and is very confusing. I'm not on it through Creative cloud. Please Help!
-
Safari is working for YouTube, but on other websites that have video content it gets choppy and very slow. I tested my down load connection. It averages 2.3 Mbps. I'm using a 1 GHz G4 Powerbook with 768 MB Ram. Firefox does the same thing as Safari.
-
I need to update from version 4.3.5. And i cant seem to find a link on app store or on apple website ....do i need a computer to do so or can i do so wirelessly from my ipad2 if so how?
-
Running Java program outside Jdeveloper -- issue with dependent libaries
Hello, I am using Jdeveloper 11.1.1.7 and have built a java application that imports XML Files into Oracle, then exports an XML file for others to pick up. I use jaxb, java persistance, and javax.mail etc.... when I run the application in Jdeveloper