Hi, i have doubt in alv field cat log
1)In alv field cat preparation (i dont want to display for one particular field in output screen) can u pls send me the code.
2)in field cat for a particular field i want to display in different color for that can u send me code.
3)code for (DOUBLE CLICK) event.
for the can u send me a code
Regards,
Nagesh
Hi Nagesh,
I think you have posted your question in the wrong forum, this forum is for education related topics only. Please review the existing forums and re-post it to the appropriate one.
Regards,
Simon
Similar Messages
-
Getting dump when using do_sum in alv field cat in the output of the report
Dear Freinds,
Iam getting the alv report when i click on the segma field (Sum) on my salary
field iam getting dump. and also if i try to print my alv output iam getting dump , only
happening to my custom report.
i have used the following code pleae correct me .
This perform is used for Layout settings
perform st_layout_build using gs_layout.
form st_layout_build using st_ls_layout type slis_layout_alv.
st_ls_layout-no_input = 'X'.
st_ls_layout-colwidth_optimize = 'X'.
st_ls_layout-zebra = 'X'.
st_ls_layout-detail_popup = 'X'.
endform. " st_layout_build
Field Catalog details
perform st_fieldcat_init changing gt_fieldcat.
form st_fieldcat_init changing fp_i_fieldcat type slis_t_fieldcat_alv.
clear ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'ORGUNIT'.
ls_fieldcat-seltext_l = 'Orgunit'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'ORGTEXT'.
ls_fieldcat-seltext_l = 'Orgdesc'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'SALARY'.
ls_fieldcat-seltext_l = 'Salary'.
ls_fieldcat-col_pos = 3.
ls_fieldcat-outputlen = 15.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'CURR'. "CURR
append ls_fieldcat to fp_i_fieldcat.
endform.
Variant
perform st_variant_init using gs_variant g_repid.
form st_variant_init using st_gs_variant type disvariant
st_repid like sy-repid.
clear st_gs_variant.
st_gs_variant-report = st_repid.
endform. " st_variant_init
g_repid = sy-repid.
perform st_comment_build using gt_list_top_of_page[].
form st_comment_build using st_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
Listenüberschrift: Typ H
clear ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = text-000.
append ls_line to st_lt_top_of_page.
endform. " st_comment_build
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = 'X'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_structure_name = 'i_final' "c_i_final "'objec'
i_save = g_save
is_variant = gs_variant
tables
t_outtab = fp_i_pyrol_final
exceptions
program_error = 1
others = 2.
if sy-subrc ne 0.
message e018. " Displaying the ALV GRID has failed
endif.
Please could any one let me know why iam getting dump when iam clicking for total
on my salary field.
Regards
lathaDear Chandu,
my code iam giving in details
types : begin of ty_output_data,
staffno type pernr_d,
staffname type emnam,
grade type stell,
orgunit type orgeh,
orgtext type hr_mcstext,
psgroup type trfgr, " Pay Scale Group
salary type maxbt, "PAD_AMT7S,
rrefunded type pad_amt7s,
leavepay type pad_amt7s,
mshortfal type pad_amt7s, " Medical Shortfall
echkshfal type pad_amt7s, " Execute checkup shortfall
ofindeduc type pad_amt7s, " Other Finance Deduction
mtyprem type pad_amt7s, " maternity premium
vpbonus type pad_amt7s, " VP/Bonus
gratuity type pad_amt7s, " Gratuity
vpay type pad_amt7s, " Variable pay
mallowance type pad_amt7s, " Meal Allowance
overtime type pad_amt7s, " overtime
other type pad_amt7s, " OTHER
pfundeecon type pad_amt7s, " PFund Employee's Contribution
banktrnsfer type pad_amt7s, " Bank Transfer
count type i,
end of ty_output_data.
data : i_final type standard table of ty_output_data.
iam getting all my data in the internal table I_FINAL.
perform get_final_alv using i_final.
form get_final_alv using fp_i_pyrol_final type ty_t_output_data.
*local variable declarations
data : l_v_idx type sy-tabix.
*local work areas
data : l_wa_final type ty_output_data.
g_save = 'A'.
This perform is used for Layout settings
perform st_layout_build using gs_layout.
Field Catalog details
perform st_fieldcat_init changing gt_fieldcat.
Variant
perform st_variant_init using gs_variant g_repid.
g_repid = sy-repid.
perform st_comment_build using gt_list_top_of_page[].
if not fp_i_pyrol_final is initial.
delete adjacent duplicates from fp_i_pyrol_final comparing all fields.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = 'X'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_structure_name = 'i_final' "c_i_final "'objec'
i_save = g_save
is_variant = gs_variant
tables
t_outtab = fp_i_pyrol_final
exceptions
program_error = 1
others = 2.
if sy-subrc ne 0.
message e018. " Displaying the ALV GRID has failed
endif.
endif.
endform. " get_final_alv
form st_layout_build using st_ls_layout type slis_layout_alv.
st_ls_layout-no_input = 'X'.
st_ls_layout-colwidth_optimize = 'X'.
st_ls_layout-zebra = 'X'.
st_ls_layout-detail_popup = 'X'.
endform. " st_layout_build
form st_fieldcat_init changing fp_i_fieldcat type slis_t_fieldcat_alv.
data: ls_fieldcat type slis_fieldcat_alv.
clear ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'ORGUNIT'.
ls_fieldcat-seltext_l = 'Orgunit'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'ORGTEXT'.
ls_fieldcat-seltext_l = 'Orgdesc'.
ls_fieldcat-no_out = 'X'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 5.
ls_fieldcat-fieldname = 'STAFFNAME'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-seltext_l = 'StaffName'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 4.
ls_fieldcat-fieldname = 'STAFFNO'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-seltext_l = 'StaffNo.'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 6.
ls_fieldcat-fieldname = 'GRADE'.
ls_fieldcat-seltext_l = 'Grade'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 3.
ls_fieldcat-fieldname = 'COUNT'.
ls_fieldcat-seltext_l = 'Headcount'.
append ls_fieldcat to fp_i_fieldcat.
if the field name is 'Salary' then do a sum on this field.
IF fp_fname = c_betrg.
l_wa_fieldcat-do_sum = c_x.
ENDIF.
NOTE : IAM GETTING PROBLEM IN THE BELOW SALARY.
IAM JUST CHECKING ITSELF NOT ALLOWING ME TO EXECUTE
clear ls_fieldcat.
ls_fieldcat-fieldname = 'SALARY'.
ls_fieldcat-seltext_l = 'Salary'.
ls_fieldcat-col_pos = 7.
ls_fieldcat-outputlen = 20.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-datatype = 'CURR'. "CURR
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 9.
ls_fieldcat-fieldname = 'LEAVEPAY'.
ls_fieldcat-seltext_l = 'Leave Pay'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 10.
ls_fieldcat-fieldname = 'MSHORTFAL'.
ls_fieldcat-seltext_l = 'Med.Sfall'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 11.
ls_fieldcat-fieldname = 'ECHKSHFAL'.
ls_fieldcat-seltext_l = 'EX.Chckup.Sfall'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 12.
ls_fieldcat-fieldname = 'OFINDEDUC'.
ls_fieldcat-seltext_l = 'Oth.Fin.Deduction'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 13.
ls_fieldcat-fieldname = 'MTYPREM'.
ls_fieldcat-seltext_l = 'Mat.Premium'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 14.
ls_fieldcat-fieldname = 'VPBONUS'.
ls_fieldcat-seltext_l = 'VP/Bonus'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 15.
ls_fieldcat-fieldname = 'GRATUITY'.
ls_fieldcat-seltext_l = 'Gratuity'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 16.
ls_fieldcat-fieldname = 'VPAY'.
ls_fieldcat-seltext_l = 'Variable Pay'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 17.
ls_fieldcat-fieldname = 'MALLOWANCE'.
ls_fieldcat-seltext_l = 'Meal.Allowance'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 18.
ls_fieldcat-fieldname = 'OVERTIME'.
ls_fieldcat-seltext_l = 'Overtime'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 19.
ls_fieldcat-fieldname = 'OTHER'.
ls_fieldcat-seltext_l = 'Other'.
append ls_fieldcat to fp_i_fieldcat.
pfundeecon
clear ls_fieldcat.
ls_fieldcat-col_pos = 20.
ls_fieldcat-fieldname = 'P FUND EMPLOYEES CONTRIBUTION'.
ls_fieldcat-seltext_l = 'P.Fund.Emp.Contrib'.
append ls_fieldcat to fp_i_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = 21.
ls_fieldcat-fieldname = 'BANKTRNSFER'.
ls_fieldcat-seltext_l = 'Payment'.
append ls_fieldcat to fp_i_fieldcat.
endform. " st_fieldcat_init
form st_variant_init using st_gs_variant type disvariant
st_repid like sy-repid.
clear st_gs_variant.
st_gs_variant-report = st_repid.
endform. " st_variant_init
form st_comment_build using st_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
Listenüberschrift: Typ H
clear ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = text-000.
append ls_line to st_lt_top_of_page.
endform. " st_comment_build
FORM TOP_OF_PAGE *
form top_of_page.
data: l_i_detailheader type slis_t_listheader.
To get the header for ALV
perform detail_header changing l_i_detailheader.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = l_i_detailheader.
endform. "top_of_page
form detail_header changing fp_i_detailheader type slis_t_listheader.
data: l_wa_header type slis_listheader,
l_v_time type slis_edit_mask,
l_v_date type slis_edit_mask,
l_v_abkrs type char5,
l_v_pabrj type char8,
l_v_pagno type char10.
Local Constants
constants: l_c_h type char1 value 'H',
l_c_1 type i value '1',
l_c_edit type char10 value '__.__.____',
l_c_slash type c value '/'. " constant for slash
To display the report Header
l_wa_header-typ = l_c_h.
WRITE sy-repid TO l_wa_header-info LEFT-JUSTIFIED.
write text-014 to l_wa_header-info left-justified.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To display the Page no
l_v_pagno = sy-pagno + l_c_1.
l_wa_header-typ = c_s.
l_wa_header-key = text-008. " Page No:
l_wa_header-info = l_v_pagno.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To Display the User ID
l_wa_header-typ = c_s.
l_wa_header-key = text-009. " User ID
l_wa_header-info = sy-uname.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
To Display the Date/Time
l_wa_header-typ = c_s.
l_wa_header-key = text-010. " Date/Time:
l_v_time = sy-uzeit.
l_v_date = sy-datum.
write: sy-uzeit to l_v_time.
write sy-datum to l_v_date using edit mask l_c_edit.
concatenate l_v_date
l_c_slash
l_v_time into l_wa_header-info+0(25) separated by space.
append l_wa_header to fp_i_detailheader.
clear: l_wa_header, l_v_date.
To Display the Report Description
l_wa_header-typ = c_s.
l_wa_header-key = text-011. " Report Description
l_wa_header-info = text-012.
append l_wa_header to fp_i_detailheader.
clear l_wa_header.
append l_wa_header to fp_i_detailheader.
endform. " detail_header
I will be greatful if any one can please help me in removing me the dump.
REGARDS
LATHA. -
HI,
I use that function for alv and fieldcat and its working o.k. but i wont to add
field name to colman and its not working ,and optimaize colman for text , and title how i do that?
Regards
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
ls_fieldcat-fix_column = &3. "this is not working
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DATA l_rnd_value TYPE integer2.
FIELD-SYMBOLS : <itab> LIKE LINE OF itab .
LOOP AT itab ASSIGNING <itab>.
CASE <itab>-object.
WHEN 'Badi'.
<itab>-line_color = 'C510'. " Blue.
WHEN 'User Exit'.
<itab>-line_color = 'C611'. " Red.
ENDCASE.
ENDLOOP.
ENDFORM.
FORM f_display_data.
DATA:
ls_layout TYPE slis_layout_alv,
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'OBJECT' 'ITAB' 'X'.
m_fieldcat 'OBJECT_NAME' 'ITAB' 'X' .
* m_fieldcat 'VBELN' 'VBAK'.
* m_fieldcat 'NETWR' 'VBAK'.
* Fill Layout - Name of the field with color
ls_layout-info_fieldname = 'LINE_COLOR'.
* Display the list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
TABLES
t_outtab = itab.
ENDFORM. "f_display_dataYou will have to use this:
1. Change the macro following way:
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
ls_fieldcat-fix_column = &3.
ls_fieldcat-reptext_ddic = &4. " << will repalce from the macro's argument
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
2. Call the macro like this.
m_fieldcat 'OBJECT' 'ITAB' 'X' 'Object'
m_fieldcat 'OBJECT_NAME' 'ITAB' 'X' 'Oject Name'.
Regards,
Naimesh Patel -
hi all,
in my itab i have a field naming sum_invoice its value is sum of records of a field , now when i pass this value to field cat its not coming correctly , it takes the value of the next field
ADD 1 TO g_field_count.
ls_fieldcat-fieldname = 'sum_invoice'.
ls_fieldcat-cfieldname = 'WAERS'.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-seltext_l = text-f02.
ls_fieldcat-col_pos = g_field_count.
ls_fieldcat-ref_fieldname = 'NETWR'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
This is the code i am doing.
can anybody help me with it?hi,
ADD 1 TO g_field_count.
ls_fieldcat-fieldname = 'sum_invoice'. <-------- use capital letters 'SUM_INVOICE'
ls_fieldcat-cfieldname = 'WAERS'.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-seltext_l = text-f02.
ls_fieldcat-col_pos = g_field_count.
ls_fieldcat-ref_fieldname = 'NETWR'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat. -
HI EXPERTS,
CAN ANY BODY EXPLAIN ME ABT THE USAGE OF FIELD CAT IN ALV.
PLEASE DESCRIBE ME ABOUT FIELDCAT USAGE AND FUNCTIONS OF FIELDCAT IN ALV.
THANKS,
SAKTHI
*VALUABLE POSTS WILL BE REWARDED--*Field cataloge is to create columna heading. In this you need to fill an internal table which contains the heading of all the fields which needs to be displayed. e.g.: customer no, Customer name etc.
Field_catalog:
Field catalog with field descriptions
2.7.1. Description
Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output.
The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module
See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE.
The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default.
A field catalog need not be built-up and passed explicitly only under the following conditions:
The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.
all fields in this structure are to be output
the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.
See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME.
Positioning
row_pos (row position)
value set: 0, 1 - 3
Only relevant if the list output is to be multi-line (two or three lines) by default.
A multi-line list can also be defined by the user interactively if the default list is one-line.
The parameter specifies the relative output line of the column in a multi-line list.
col_pos (column position)
value set: 0, 1 - 60
only relevant when the default relative column positions differ from the field catalog field sequence. The parameter specifies the relative column position of the field in the list output. The column order can be changed interactively by the user. If this parameter is initial for all field catalog entries, columns appear in the field catalog field sequence.
Identification
fieldname (field name)
value set: internal output table field name (required parameter)
Name of the internal output table field which is described by this field catalog entry
tabname (internal output table)
value set: SPACE, internal output table name
This parameter is used in 'manual' field catalog build-up only for hierarchical-sequential lists.
Name of the internal output table which contains the field FIELDCAT-FIELDNAME.
Data Dictionary reference
ref_fieldname (reference field name)
value set: SPACE, Data Dictionary field name
Name of the Data Dictionary field referred to.
This parameter is only used when the internal output table field described by the current field catalog entry has a reference to the Data Dictionary (not a program field), and the field name in the internal output table is different from the name of the field in the Data Dictionary. If the field names are identical, naming the Data Dictionary structure or table in the FIELDCAT-REF_TABNAME parameter is sufficient.
ref_tabname (reference table/structure field name)
value set: SPACE, name of a Data Dictionary structure or table
Structure or table name of the referred Data Dictionary field.
This parameter is only used when the internal output table field described by the current field catalog entry has a Data Dictionary reference (not a program field).
Reference to fields with currency/measurement unit
Each internal output table sum or quantity field whose decimal places are to be formatted appropriately for the unit in the list must follow the convention:
the field is of data type QUAN or CURR (internal type P) (the field must really have this physical data type. Overwriting the physical data type with the parameter FIELDCAT-DATATYPE has no effect)
There is a field in the internal output table which contains the associated unit.
There is also an entry in the field catalog for the unit field.
(If the unit is not to appear as a column in the list, and cannot be interactively displayed as a column, e.g. because it is always unambiguous and is therefore explicitly output by the caller in the list header, the field catalog units field entry can take the parameter FIELDCAT-TECH = 'X'.
The association of a value field to a unit affects the output as follows:
appropriate decimal places display for the unit
an initialized field with a link to a non-initial unit is output as '0' for the unit (if FIELDCAT-NO_ZERO is initial). When this field is summed, this unit affects whether the units are homogeneous.
an initialized field with a link to an initial unit is output as SPACE. When this field is summed, the unit SPACE does not affect the homogeneity of the units.
When non-initial fields with an initial unit are summed, the unit SPACE is considered to be a unit.
Link to currency unit
cfieldname (currency unit field name)
value set: SPACE, output table field name
Only relevant for amount columns with associated unit.
Name of the internal output table field containing the currency unit associated with the amount field FIELDCAT-FIELDNAME. The field in FIELDCAT-CFIELDNAME must have its own field catalog entry.
ctabname (internal currency unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-CFIELDNAME field.
Link to measurement unit
qfieldname (measurement unit field name)
value set: SPACE, output table field name
only relevant for quantity columns with unit link.
Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME.
The field in FIELDCAT-QFIELDNAME must have its own field catalog entry.
qtabname (internal measurement unit field output table)
value set: SPACE, output table field name
only relevant for hierarchical-sequential lists
Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
Column output options
outputlen (column width)
value set: 0 (initial), n
For fields with a Data Dictionary link this parameter can be left initial.
For fields without a Data Dictionary link (program field) the parameter must be given the value of the desired field list output length (column width).
initial = column width is the output length of the referred Data Dictionary field (domain).
n = column width is n characters
key (key column)
value set: SPACE, 'X' 'X' = kex field (key field output in color)
Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial.
For exceptions see the documentation of the FIELDCAT-KEY_SEL parameter.
key_sel (hideable key column)
value set: SPACE, 'X'
only relevant when FIELDCAT-KEY = 'X'
Key field which can be hidden interactively.
The key column sequence cannot be changed interactively by the user.
The output is controlled by the FIELDCAT-NO_OUT parameter analogously to non-key fields.
no_out (field in field list)
value set: SPACE, 'X' 'X' = field is not displayed in the current list.
The user can interactively choose the field for output from the field list.
The user can display the contents of these fields at line level using the 'Detail' function.
See also the 'Detail screen' documentation of the parameter IS_LAYOUT.
tech (technical field)
value set: SPACE, 'X' 'X' = technical field
Field cannot be output in the list and cannot be displayed interactively.
Field can only be used in the field catalog (not in IT_SORT, ...).
emphasize (highlight columns in color)
value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
'X' = column is colored with the default column highlight color.
'Cxyz' = column is colored with a coded color:
C: Color (coding must begin with C)
x: color number
y: bold
z: inverse
hotspot (column as hotspot)
value set: SPACE, 'X'
'X' = column cells are output as hotspots
fix_column (fix column)
value set: SPACE, 'X'
Not relevant for block lists (output of several lists consecutively)
'X' = column fixed (does not scroll horizontally)
All columns to be fixed must have this flag, starting from the left. If a column without this flag is output, only the columns to the left of this column are fixed. The user can change the column fixing interactively. See also the documentation of the Layout parameter
IS_LAYOUT-NO_KEYFIX of the IMPORTING paramter IS_LAYOUT.
do_sum (sum over column)
value set: SPACE, 'X' 'X' = a sum is to be calculated over this internal output table field.
This function can also be called by the user interactively.
no_sum (sums forbidden)
value set: SPACE, 'X' 'X' = no sum can be calculated over this field, although the data type of the field would allow summing.
input (column ready for input)
Function not available
Format column contents
icon
value set: SPACE, 'X' 'X' = column contents to be output as an icon.
The caller must consider the printability of icons.
symbol
value set: SPACE, 'X' 'X' = column contents are to be output as a symbol.
The internal output table column must be a valid symbol character.
The caller must consider the printability of symbols.
Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.
just (justification)
value set: SPACE, 'R', 'L', 'C'
Only relevant for fields of data type CHAR or NUMC
' ' = default justification for this data type
'R' = right-justified output
'L' = left-justified output
'C' = centered output
The justification of the column header always follows the justification of the columns. Independent justification of the column neader is not possible.
lzero (leading zeros)
value set: SPACE, 'X'
Only relevant for fields of data type NUMC
ALV outputs NUMC fields right-justified without leading zeros by default.
'X' = output with leading zeros
Note: If a NUMC field is output left-justified or centered by FIELDCAT-JUST, leading zeros are output. If the output of leading zeros is suppressed by a Data Dictionary reference ALPHA conversion exit, the output is always left-justified.
no_sign (no +/- sign) Only relevant for value fields
value set: SPACE, 'X' 'X' = value output without +/ sign
no_zero (suppress zeros) Only relevant for value fields
value set: SPACE, 'X' 'X' = suppress zeros
edit_mask (field formatting)
value set: SPACE, template
template = see documentation of WRITE formatting option USING EDIT MASK template
The output conversion conv can be made by template = '== conv'.
Texts
The following text parameters should be specified for program fields without a Data Dictionary reference. The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. If the user changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes account of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header.
The 'long field label' is also used in display variant definition, sort, etc. popups.
seltext_l (long field label)
seltext_m (medium field label)
seltext_s (short field label)
reptext_ddic (header)
analogous to the Data element maintenance 'Header'
The specified text is not necessarily output in the list, an optimum among all texts is sought.
ddictxt (specify text)
value set: SPACE, 'L', 'M', 'S'
You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.
Parameters for program fields without Data Dictionary reference
see also 'Text' parameters
datatype (data type)
value set: SPACE, Data Dictionary data type (CHAR, NUMC,...)
Only relevant for fields without Data Dictionary reference
Program field data type
ddic_outputlen (external output length)
value set: 0 (initial), n
Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
Prerequisites:
FIELDCAT-EDIT_MASK = '==conv'
see also the documentation of the parameter FIELDCAT-EDIT_MASK
FIELDCAT-INTLEN = n
see also the documentation of the parameter FIELDCAT-INTLEN
n = external format field output length
The column width FIELDCAT-OUTPUTLEN need not be the same as the external format output length (FIELDCAT-DDIC_OUTPUTLEN).
intlen (internal output length)
value set: 0 (initial), n
Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
Prerequisites:
FIELDCAT-EDIT_MASK = '==conv'
see also the documentation of the parameter FIELDCAT-EDIT_MASK
FIELDCAT-DDIC_OUTPUTLEN = n
see also the documentation of the parameter FIELDCAT-DDIC_OUTPUTLEN
n = internal format field output length
rollname (data element)
value set: SPACE, Data Dictionary data element name
F1 help can be provided for a program field without a Data Dictionary reference, or F1 help which differs from the Data Dictionary help can be provided for a field with a Data Dictionary reference, using this parameter.
When F1 help is called for this field, the documentation of the specified data element is displayed.
If the FIELDCAT-ROLLNAME is initial for fields with a Data Dictionary reference, the documentation of the data element of the referred Data Dictionary field is output.
Others
sp_group (field group key)
value set: SPACE, CHAR(1)
Field group key.
Keys are assigned to group names in the IT_SPECIAL_GROUPS parameter (see also the documentation of the parameter IT_SPECIAL_GROUPS).
When such an assignment is made in the field catalog and in IT_SPECIAL_GROUPS, the fields are grouped correspondingly in the display variant popup.
reprep (Report/Report interface selection criterion)
value set: SPACE, 'X'
Prerequisites:
The system contains the Report/Report interface (function group RSTI, table TRSTI)
Parameter LAYOUT-REPREP = 'X'
(see also the documentation of the parameter LAYOUT-REPREP of the IMPORTING parameter IS_LAYOUT )
'X' = When the Report/Report interface is called, the value of this field is passed in the selected interface start record as a selection criterion.
2.7.2. Default
The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary :
fieldname
ref_tabname
Notes:
ALV gets the remaining information from the Data Dictionary.
If no relative column position (COL_POS) is specified, the fields are output in the list in the order in which they were added to the field catalog.
REF_FIELDNAME need only be specifid when the name of the internal table field differs from the name of the referred Data Dictionary field.
Information which is explicitly entered in the field catalog is not overwritten by information from the Data Dictionary.
Priority rule:
Entries in the field catalog have priority over differing entries in the Data Dictionary.
The following entries are usually sufficient for internal table fields without a reference to the Data Dictionary (program fields):
fieldname
outputlen
datatype
seltext_s
seltext_m
seltext_l
Notes:
F1 help can be provided for program fields by assigning a data element to the parameter ROLLNAME.
If the parameters SELTEXT_S, SELTEXT_M, SELTEXT_L, and REPTEXT_DDIC contain appropriate field labels, the program field column headers are also adjusted appropriately when the column width changes. -
Error in updating ALV field catalog in selection tool for Planning Book
Hi ,
I am Implementing BADI '/SAPAPO/SDP_SELECTOR' to upload Custom Fields Data in Planning Book Selection Window under APO Location Product. These Custom Fields are maintained in Custom Table.So from Table whatever Custom Fields are availabe all the fields needs to be available in for selection. Once selection is done the same data to be uploaded into Planning Book.
This BADI is working Fine upto 4 fields but if any extra fields are added in the table 'Error in updating ALV field catalog in selection tool' error Pop Up is coming. Here i am using Folloowing Methods
1). INIT_OBJECT_LIST
2). F4
3). LOC_PROD_VALUE_LIST
Please help on the same if u have any idea or clue.
Thanks.Hi Srinivas!
Where did you get your implementation from?
It would be nice if you could debug your code!
For the F4 method, have you seen this note?
Note 544904 - Sample source code f.BAdI /SAPAPO/SDP_SELECTOR ('F4'method)
Also check this note. It contains selection modifications in the BAdI:
Note 376902 - SDP selector: Basis corrections for BADI
I do not know your release and support package in your SCM, but you can find a lot of notes related to this BAdI.
Thank you!
Will
SCM Support Consultant -
Error in updating ALV field catalog in selection
Dear all,
I'm trying to use the standard transaction /SAPAPO/TSKEYFMAIN in order to check the TS values.
After filling the selection variant, the system shows the following error:
'Error in updating ALV field catalog in selection'
Could you please provide me with further details about the error? What could be the possible solution to avoid it?
Many thanks,
SMHi Marius,
thanks for your answer.
I would like to use the /SAPAPO/TSKEYFMAIN transaction to check massively the values in the time series KFs and not just the consistency of them.
So do you know any other transaction to do it or do you have an idea about the error of /SAPAPO/TSKEYFMAIN?
Thanks for your help!
SM -
New ALV field is not displaying
Hi
I have added the currency field in the existing ALV report.
The final internal table having the currency field and it has value. Curreny field is not displaying in output. Pls help
Below is my ALV code for currency.
PERFORM FILL_FIELDCAT USING
'WAERS' SPACE SPACE 'CURRENCY' 'CURRENCY' 'CURRENCY'.
READ TABLE GIT_FIELDCAT INTO LX_FIELDCAT
WITH KEY FIELDNAME = 'WAERS' .
LX_FIELDCAT-OUTPUTLEN = 5.
LX_FIELDCAT-JUST = 'L'.
MODIFY GIT_FIELDCAT FROM LX_FIELDCAT INDEX SY-TABIX.
FORM FILL_FIELDCAT USING P_FIELDNAME
P_NO_OUT
P_DO_SUM
P_SELTEXT_S
P_SELTEXT_M
P_SELTEXT_L. "#EC *
DATA: LX_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LX_FIELDCAT.
LX_FIELDCAT-TABNAME = 'GIT_LIST'.
LX_FIELDCAT-FIELDNAME = P_FIELDNAME.
LX_FIELDCAT-NO_OUT = P_NO_OUT.
LX_FIELDCAT-DO_SUM = P_DO_SUM.
LX_FIELDCAT-SELTEXT_S = P_SELTEXT_S.
LX_FIELDCAT-SELTEXT_M = P_SELTEXT_M.
LX_FIELDCAT-SELTEXT_L = P_SELTEXT_L.
APPEND LX_FIELDCAT TO GIT_FIELDCAT.
ENDFORM. " FILL_FIELDCATYou have to [maintain maintenance dialog|http://help.sap.com/SAPHELP_NWPI71/helpdata/EN/a7/513484407a11d1893b0000e8323c4f/frameset.htm] as described in the link.
Regards,
Raymond -
Doubts in alv interactive report
Hello Gurus
i am new to abap i have doubt regarding interactive alv . i wrote one but it gives runtime error . i taken reference to a sample program availiable please explain this code so i can write interactive alv effectively.
FORM POPULATE_EVENT.
READ TABLE ITAB_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY ITAB_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
IF ITAB_EMPLOY-EMPID NE ''.
READ TABLE ITAB_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'. MODIFY ITAB_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
ENDIF.
ENDIF.
ENDFORM.Hi,
Event form names are appended to an internal table and passed to the ALV. And whatever you write inside that form
can be called through the function module.
What you are trying to do is modify the internal table with the form name, which does not exsist. Instead of this append it.
There are lot of example of this ALV list events.
DATA: T_EVENT TYPE SLIS_T_EVENT,
W_EVENT TYPE SLIS_ALV_EVENT.
CLEAR W_EVENT.
W_EVENT-FORM = SLIS_EV_AFTER_LINE_OUTPUT.
W_EVENT-NAME = SLIS_EV_AFTER_LINE_OUTPUT."AFTER_LINE_OUTPUT event
APPEND W_EVENT TO T_EVENT.
Thanks & Regards,
Tapodipta Khan -
Error in ALV : Field Does not exists in Output table .
Hi All,
In my ALV report, program get dumped and showing error when i tried to put a col named Distribution channel ion the alv.
I have put the Distribution cannel field in the IT_FInal table , but still getting folwong errors :
Error : Field Symbol is not been assigned.
As Instructed i have passed I_INTERFACE_CHECK = 'X'.
By this i am getting detail error that :
Field Distribution channel does not exists in Output table & Heading for List is missing .
But i have maintained the distribition channel in IT_Final table
Please suggest wheather we have to define dis channel in any other place.
Thanks in advance.
Can any one help me regrarding this.
Thanks in advance.Hello,
You have to populate the same in the fieldcatalog as well, i think you have not maintained this field there.
BR,
Suhas
PS: Also make it a point to follow-up on your previous post: [Error in ALV : Field Symbol not been assigned.|Error in ALV : Field Symbol not been assigned.] -
1000 CHARACTER TEXT IN ALV FIELD
Hi Experts,
I have a String type variable containing 1000 character text that I am passing in a field on ALV. But ALV field can display on 132 characters. So now my requirement is that when a user double clicks on that field... then a popup or a screen appears where the user can read the entire text of that field.
I have tried some FMs (like POPUP_TO_CONFIRM, POPUP_TO_INFORM, POPUP_DISPLAY_TEXT etc...), but all have length restriction.
Please suggest if there is any FM to get the entire 1000 character text on a popup.... OR if there is any other way to do this...
Thanks in advance
Regards,
Ashish GoyalI am using this code provided by you, facing error : Field "OB_GUI_DIALOGBOX_CONTAINER" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
Please take a look and suggest.
Using REUSE ALV GRID to display ALV.
TYPES: BEGIN OF tp_text_x .
TYPES: tdname TYPE thead-tdname ,
tdobject TYPE thead-tdobject ,
tdid TYPE thead-tdid ,
tdspras TYPE thead-tdspras ,
tdtxtlines TYPE thead-tdtxtlines .
TYPES: tdline TYPE tline-tdline ,
it_tline TYPE tline_tab .
TYPES: END OF tp_text_x .
CLASS cl_event_reciever DEFINITION DEFERRED.
DATA v_event_reciever TYPE REF TO cl_event_reciever.
CLASS cl_event_receiver DEFINITION .
PRIVATE SECTION.
METHODS: close
FOR EVENT close OF cl_gui_dialogbox_container
IMPORTING sender.
METHODS: init_container .
METHODS: display_textedit
IMPORTING value(st_text_x) TYPE tp_text_x .
ENDCLASS . "cl_event_receiver DEFINITION
CLASS cl_event_receiver IMPLEMENTATION.
METHOD close .
CALL METHOD sender->set_visible
EXPORTING
visible = abap_false.
ENDMETHOD . "handle_close
METHOD init_container .
* DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
IF ob_gui_dialogbox_container IS NOT INITIAL .
* IF EDITOR_CONTAINER IS NOT INITIAL .
me->close( EXPORTING sender = ob_gui_dialogbox_container ) . " EDITOR_CONTAINER ).
ENDIF .
CREATE OBJECT ob_gui_dialogbox_container
EXPORTING
parent = cl_gui_container=>screen0
top = 40
left = 200
lifetime = cntl_lifetime_dynpro
width = 600
height = 100.
ENDMETHOD. "init_container
METHOD display_textedit .
me->init_container( ) .
DATA: ob_gui_textedit TYPE REF TO cl_gui_textedit .
* DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
CREATE OBJECT ob_gui_textedit
EXPORTING
parent = ob_gui_dialogbox_container.
CALL METHOD ob_gui_textedit->set_readonly_mode
EXPORTING
readonly_mode = cl_gui_textedit=>true.
DATA: it_tdline TYPE TABLE OF tdline .
DATA: st_tdline LIKE LINE OF it_tdline .
FIELD-SYMBOLS: <st_tline> LIKE LINE OF st_text_x-it_tline .
LOOP AT st_text_x-it_tline ASSIGNING <st_tline> .
APPEND <st_tline>-tdline TO it_tdline .
ENDLOOP .
CALL METHOD ob_gui_textedit->set_text_as_stream
EXPORTING
text = it_tdline.
ENDMETHOD. "display_textedit
ENDCLASS . "cl_event_receiver IMPLEMENTATION
INITIALIZATION.
CREATE OBJECT v_event_reciever.
DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
CREATE OBJECT ob_gui_dialogbox_container.
START-OF-SELECTION.
v_event_reciever->display_textedit( EXPORTING st_text_x = <st_alv_data_1>-text_1 ) . -
Hi All,
I am displaying a list using alv hierarchy report and I dont want the fields at the item level to diplay. I am using the fieldcat-tech = 'X' for this. Its working butthe allignment of the fields is getting disturbed. How can it be displayed properly. One more issue is how can i display a value in the list as a delete icon if the value of the field is 'X'. I know there is a icon field in field cat ..I dont know how to get that particular icon in place. Could somebody please help.
Thanks,
Kiran.HI.
Pls use ALV grid if you dont want item level.
alv hierarchy report for when we need header and line item .
refer this porg
BCALV_TEST_HIERSEQ_LIST
BCALV_TEST_HIERSEQ_LIST_EVENTS
Reward all helpfull answers.
Regards.
Jay -
hi,
I HAVE A TABLE IN WHICH ONE FIELD SAY F1 IS OF TYPE STRING
I HAVE CREATED AN ALV REPORT IN WHICH THIS FIELD F1 IS editable
when i press save button it ads the new row in the database
the Problem lies here is that the output length is viewed only to lenght of 15 infact outlen of fieldcatalog is set to 30
and i could only ad 30 character at max infact of being a type string
how can i add data in the table through alv with lenght more than 256 characters(1) How do you build the transparent table with type string field. This type is not allowed in transparent table.
Do you mean CHAR (til 255) or LCHR type (<a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf">BC - ABAP Dictionary</a>)
<i><b>STRING</b>: Character string with variable length This type can only be used in types (data
elements, structures, table types) and domains. It cannot be used in database tables. In ABAP, this type is implemented as a reference to a storage area of variable size.
<b>CHAR</b>: Character string. Fields of type CHAR may have a maximum length of only 255 in tables. If longer character fields are to be used in tables, you must choose data type LCHR. There are no restrictions on the length of such fields in structures.
<b>LCHR</b>: Character string of any length, but with a minimum of 256 characters. Fields of this type must be located at the end of transparent tables and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. A fields of this type cannot be used in the WHERE condition of a SELECT statement.</i>
(2) Use of long text (in fact that's your need ?) in ALV
<i>1. Declare the internal and the external length of the field to the ALV Grid Control.
For fields with DDIC reference, the ALV Grid Control automatically uses the internal and the external length.
For fields without DDIC reference, you must specify the internal length using field INTLEN and the external length using field DD_OUTLEN of the field catalog (see Parameters for Fields Without DDIC Reference).
2. Specify the conversion exit using field EDIT_MASK of the field catalog (see Formatting Column Contents).
3. Pass the field catalog with method</i>
If you really need long text, you may declare an output length of say 80 in the ALV grid, and provide an icon to edit a very-long text (via a popup screen with a container and a use of class cl_gui_textedit for example)
Regards -
ALV field catalogue update problem
Dear Friends;
I have a problem with field catalog update of ALV grid. I have designed an initial screen for selections and there are two pushbuttons here. According to the pushbutton selection the field catalogue values change, ie. some fields are hidden etc. After the first selection this works but if i exit the second screen and go to the selection screen to change my selection the fieldcatalogue is not updated accordingly altough i call the relevant fm. i fill in fieldcat with fm LVC_FIELDCATALOG_MERGE.
Can someone suggest a solution pls?
Thx
AliHi Ali,
chk this excellent Link.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
compare your code with the code there.
Regards
anver -
Problem Modifying ALV Field Catalog
Hi,
One grid of my ALV report displays material numbers as 0100.2000. But when I use method FILE_SAVE_DIALOG to save ALV report to Excel, the material number changes to 100.2.
I have tried modifying my field catalog as shown at end of this message, but it doesn't change the output in Excel.
Does anyone have a fix for this problem? I will award points! - Beth
FORM build_fieldcatalog.
DATA: ls_fieldcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZBOM_ALV'
CHANGING
ct_fieldcat = gt_fieldcat.
LOOP AT gt_fieldcat INTO ls_fieldcat where fieldname eq 'COLUMN3'.
ls_fieldcat-DATATYPE = 'NUMC'.
ls_fieldcat-LZERO = 'X'.
ls_fieldcat-REF_TABLE = ''.
ls_fieldcat-DECIMALS_O = '4'.
ls_fieldcat-INTTYPE = 'N'.
ls_fieldcat-OUTPUTLEN = '20'.
MODIFY gt_fieldcat FROM ls_fieldcat.
ENDLOOP.
ENDFORM. " build_fieldcatalogHi,
If you want to save any data like 0100.2000 in the excel, you need to write it as Number with decimal places 4, so it will take 4 decimal places . coming to your ALV, you need to pass the same structure to the Excel i mean the passing variable should be lilke Number with 4 decimal places ..
Regards
Sudheer
Maybe you are looking for
-
Java concurrent program doesn't use template
Hi all, I have a report which executable is of type: Java Concurrent Program. I copied the original one and i created the same data definition and template with different names, set the Onsite Settings to my template but when submitting the report it
-
How to copy paste a new page with thumbnails view in Pages 5?
How to copy paste a new page with thumbnails view in Pages 5?
-
I know that this problem may have been asked before but I searched and could not find a similar situation. I have a spreadsheet that will not sort the contents of a cell correctly. As an example, the table has two columns, the first is formatted as a
-
I have a seperate OS 100GB Sata III SSD drive along with another a 240GB Sata III SSD and then a RAID 0 configuration of two 500GB 7200 regular HDD totalling about 950GB of space. I want to install Lightroom, Photoshop and Premiere. Where shoud I p
-
I CAN'T OPEN THE "CONTACTS" APP
Hello, Since I bought my iPad2 I can't open the "Contacts" app, when I try to open it just closes. And because of that I'm having problems to send emails. I just updated the software for the iOS 5.1, but the problem continues. Could you help me? Than