FIELD CAT USAGE?

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.

Similar Messages

  • Field cat in alv

    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, 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

  • SD Standard Report for Field VKAUS (Usage)

    Hi Gurus,
    Good Day!
    This is just a simple query. Just need to know if there are any available standard reports that shows the sales order and the value of its usage field? Usage field can be found in table VBAP-VKAUS.
    Thank you very much!
    Regards,
    Jv Nunez

    Dear,
    There is no standard report in SAP for VBAP-VKAUS usage field.
    Regards,
    R.Brahmankar

  • CProjects - Set-up field control - Usage of conditions

    Hello
    In cProjects, in set-up field control it is possible to adjust behavior (display, updatable, mandatory, u2026) field by field.
    My questions are:
    - Where to find the complete list of conditions available?
    - Is any condition is usable everywhere, for example C001 Object is released on a DAG Document (means the object link to this document is released)?
    - Is there a condition with a meaning like u201CThe object is in creationu201D (to have for example a phase description not updatable after creation)?
    - How to create its own conditions?
    Thanks for your help.
    Rémy
    Here you can find a list of conditions for the main objects.
    CTO (Checklist)      C001 Object is released
    ITO (Checklist Item)      C001 Object is released
    MTG (Project Participant)      C001 Object is released
    PPO (Phase)      C001 Object is released
    TTO (Task)      C001 Object is released
    MTG (Project Participant)      C002 CATS is active
    TTO (Task)      C002 CATS is active
    TTO (Task)      C004 Confirmation for task
    MTG (Project Participant)      C005 Role start and finish are specified
    ITO (Checklist Item)      C006 Object has a superior phase
    TTO (Task)      C006 Object has a superior phase
    TTO (Task)      C007 Phase without approval
    TTO (Task)      C008 Appr. is in process, granted, rejected
    CTO (Checklist)      C009 Ind. 'Changeability' to 'Cannot Be Chgd'
    ITO (Checklist Item)      C009 Ind. 'Changeability' to 'Cannot Be Chgd'
    CTO (Checklist)      C010 Ind.'Changeability' to 'Partlly Chngble'
    ITO (Checklist Item)      C010 Ind.'Changeability' to 'Partlly Chngble'
    PPO (Phase)      C011 Project Type 'Initiative'
    PPO (Phase)      C015 Constraint: As soon as possible
    TTO (Task)      C015 Constraint: As soon as possible
    ITO (Checklist Item)      C016 Constraint: As late as possible
    PPO (Phase)      C016 Constraint: As late as possible
    TTO (Task)      C016 Constraint: As late as possible
    ITO (Checklist Item)      C017 Constraint (Finish Date): None
    PPO (Phase)      C017 Constraint (Finish Date): None
    TTO (Task)      C017 Constraint (Finish Date): None
    TTO (Task)      C018 Task is a summary task
    TTO (Task)      C019 'Remaining Work Man.'indicator is active
    TTO (Task)      C020 Object is part of a project version
    ITO (Checklist Item)      C030 Access to Forecasted Dates
    PPO (Phase)      C030 Access to Forecasted Dates
    TTO (Task)      C030 Access to Forecasted Dates
    OAG (Object Link)      C100 Object has not been specified yet
    RAG (Checklist Reference)      C200 Checklist reference was created
    ATO (Approval)      C300 Approval has the status: Created
    EAG (Project Element Link to Role)      C400 Status: Staffing in Process/Complete
    MTG (Project Participant)      C500 Status: Staffing in Process/Complete
    MTG (Project Participant)      C501 Confirmation for project role
    BAG (Link to Business Partner)      C502 Distribution is active
    MTG (Project Participant)      C502 Distribution is active
    MTG (Project Participant)      C503 Status: Staffing in Process
    MTG (Project Participant)      C504 Cost/revenue rate is initial
    TTO (Task)      C504 Cost/revenue rate is initial
    MTG (Project Participant)      C505 Org. Unit (Staff. Manager) is changeable
    MTG (Project Participant)      C506 Org. Unit (Cand. Manager) is changeable
    MTG (Project Participant)      C507 Staffing Manager is changeable
    MTG (Project Participant)      C508 Candidate Manager is changeable
    SAO (Individual Approval)      C600 Approval allows decision maker change
    DAG (Document)      C700 cProjects file is checked out
    DAG (Document)      C701 Plug-in for documents is used
    DAG (Document)      C702 Document has status 'Not in Process'
    DAG (Document)      C703 Document is changeable
    DAG (Document)      C704 Link to document template
    DAG (Document)      C705 Document in projekt-/checklist template
    DAG (Document)      C706 cProj. file is checked by current user

    Hi Matthias
    I am trying to setup field control to make a bespoke field in a bespoke tab toggle between READ only and Editable. 
    I have gone through number of posts and the SAP note you mentioned. I have setup the entire configuration required and it is still not working.
    What confuses me is that, to setup a field control dynamically, is it all done via configuration?. Is some coding still required in the VIEW methods?. I am setting up a debug breakpoint in the class method that is created for the condition I created, but the program is not stopping there so I think the condition method is not being called.
    Please can you give some more details.
    Thanks
    Raj

  • Definitions of time-related fields of usage tracking data

    Hi all,
    After reading the related documentations on usage tracking, I'm still confused about the true meaning of the following fields:
    COMPILE_TIME_SEC The time in seconds required to compile the query.
    C UM_DB_TIME_SEC The total amount of time in seconds that the Oracle BI Server waited for back-end physical databases on behalf of a logical query.
    TOTAL_TIME_SEC The time in seconds that the Oracle BI Server spent working on the query while the client waited for responses to its query requests.
    START_TS The date and time the logical query was submitted.
    END_TS The date and time the logical query finished. The start and end timestamps also reflect any time the query spent waiting for resources to become available.
    My questions are:
    1. Is TOTAL_TIME_SEC = C U M_DB_TIME_SEC + COMPILE_TIME_SEC? Why are there cases where C U M_DB_TIME_SEC > TOTAL_TIME_SEC ?
    2. I've logged cases where (END_TS - START_TS) > TOTAL_TIME_SEC. Why would this happen?
    Could someone clarify the meaning of these fields for me please? Thanks very much!!
    =================
    I have logged the following data with usage tracking, posting here as examples:
    1.
    compile_time_sec = 0
    c um_db_time_sec = 23
    total_time_sec = 12
    start_ts = 18-AUG-09 (14:15:47)
    end_ts = 18-AUG-09 (14:16:00)
    end_ts - start_ts (in sec) = 13
    cache_ind_flg = N
    num_cache_hits = 0
    num_cache_inserted = 1
    2.
    compile_time_sec = 0
    c um_db_time_sec = 125
    total_time_sec = 110
    start_ts = 21-AUG-09 (15:45:37)
    end_ts = 21-AUG-09 (16:47:35)
    end_ts - start_ts (in sec) = 3718
    cache_ind_flg = N
    num_cache_hits = 0
    num_cache_inserted = 0
    3.
    compile_time_sec = 0
    c um_db_time_sec = 1252
    total_time_sec = 932
    start_ts = 24-AUG-09 (17:23:40)
    end_ts = 24-AUG-09 (17:49:27)
    end_ts - start_ts (in sec) = 1547
    cache_ind_flg = N
    num_cache_hits = 0
    num_cache_inserted = 0

    Check out DOC ID 973090.1 in metalink.

  • 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
    latha

    Dear 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.

  • Problem with field-symbols usage

    Hi guys,
    I am trying to read a record of table gi_outtab as follows:
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    And now i want the value of a field of wa_outtab and this field is contained in a field-symbol <field> .
    I thought wa_outtab-<field> would give the value for that field. But it gives syntax error saying component doesn't exist.How do I fix it ? Any help or sample code to fix this error is greatly appreciated.The code is below.
    Thanks,
    SHK
    I have fieldname info and row index info in wa_ir2_data_changed.I assign field-name info to a field-symbol.wa_outtab-<field> gives error saying no component like that exists. <field> dynamically changes for ever iteration of the loop below.How do I fix it ?
    data : wa_ir2_data_changed like line of ir2_data_changed->mt_good_cells.
    field-symbols : <field> type ANY .
    loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
    assign wa_ir2_data_changed-fieldname to <field> .
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    call method ir2_data_changed->modify_cell
       exporting i_row_id  = wa_ir2_data_changed-row_id
               i_fieldname = wa_ir2_data_changed-fieldname
               i_value     = wa_outtab-<field>.
    endloop.
    wa_ir2_data_changed has 3 components.
    a) row_id
    b) fieldname
    c) value

    The following code fixed it.Thanks Suresh for the tip.
    loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    ASSIGN COMPONENT wa_ir2_data_changed-fieldname of structure wa_outtab to
    <field>.
    call method ir2_data_changed->modify_cell
       exporting i_row_id  = wa_ir2_data_changed-row_id
               i_fieldname = wa_ir2_data_changed-fieldname
               i_value     = <field>.
    endloop.

  • Field-Symbols usage

    I have this internal table with more than 8 lacs of records. This table is looped inside to fetch some other data from a database table.
    I am losing the performance because of all this looping. Can anyone tell me how to use field-symbols in this case. I have gone through some documentation on field-symbols. Can anyone tell if the below one is correct.
    data: begin of struct,
          field1,
          field2,
          field3,
          end of struct.
    field-symbols <itab> like struct.
    assign struct to <itab>.
    loop at <itab>.
    <itab>-field1=....
    <itab>-field2=....
    further processing using <itab>....
    endloop.
    If this is not true, whats the way one use the field-symbols when we want to loop?
    thanks

    Hi,
    As others have said, you can use field-symbols as your header in your itab. This will give you improved performance because the data that you are currently looping will not be moved from itab to the header/work area. It will point directly to that record in your itab so lesser memeory is required. Also, using field-symbols is needed when creating programs using ABAP OO. Below is an example:
    data: it_spfli type table of spfli.
    field-symbols: <fs_spfli> like line of it_spfli.
    select * from spfli into table it_spfli.
    loop at it_spfli assigning <fs_spfli>.
    endloop.
    Hope this helps...
    P.S. Please award points for useful answers.

  • HELP IN ALV FIELD CAT

    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_data

    You 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

  • Field cat. & Text pools

    Hi Experts,
    What r Text pools?
    What r field catalogues in defination(I know, they r used in ALVs to display the fields in ALV with many attributes edit, save etc.)?
    ThanQ.

    <i>What r field catalogues in defination(I know, they r used in ALVs to display the fields in ALV with many attributes edit, save etc.)?</i>
    You answered your own question here,  FCs are used to define the columns in the output of the ALV grid.
    Regards,
    Rich Heilman

  • Error with the FIELD CAT function module.

    Hi folks,
    This was the error message i had got from the FIELDCAT function module.
    An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_READ_SRC_LINE_TOO_LONG', was
         not caught in
        procedure "K_KKB_FIELDCAT_MERGE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        There was an attempt to read program "/A1SSPC/ITP_SCH_REP" from the database.
        The READ REPORT statement allows you to copy a program text into an
        internal table. The occupied line length in the program text must not
        exceed the width of the internal table.
        The internal table "\FUNCTION=K_KKB_FIELDCAT_MERGE\DATA=???" is 72 characters
         wide. The program line is
        204 characters wide.
    Reg,
    Hariharan

    You can do this
    TYPE-POOLS:slis.
    DATA: it_vabp TYPE STANDARD TABLE OF vbap WITH HEADER LINE.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       i_program_name               = sy-repid
       i_internal_tabname           = 'IT_VBAP'
       i_inclname                   = sy-repid
      CHANGING
        ct_fieldcat                  = it_fieldcat
    * EXCEPTIONS
    *   INCONSISTENT_INTERFACE       = 1
    *   PROGRAM_ERROR                = 2

  • Technical Field name for Usage

    Hi,
    Could anyone please tell me whether there is any SAP standard field (technical) name & Segment structure for u201CUsageu201D  for the automatic determination of Item Category.
    More details:
    User wants to send sales order through a non SAP application. So when the order comes to SAP through IDoc, I want the item category to be determined automatically. As you all knew, the rule for automatic determination of item category is Sales order type + Item cat. Group + Usage + HLevItCa. So I just need technical field name for Usage for XI mapping.
    Is there SAP standard field for Usage just like we have field name (PSTYV) & segment structure (E1EDP01)for item category? Or it should only be achieved through any user exit? Could anyone ever done such setting? Could you please give me some inputs.
    Thank you.
    Regards, Sats.

    HI
    VWPOS - Item Category usage
    Check using path
    SPRO --> Sales and Distribution --> Sales --> Sales Document --> Define item Category Usage
    Thanks & Regards
    Edited by: WISH on May 17, 2010 12:13 PM

  • BOM  usage field in BOM Copy

    Gurus,
    Am creating production (usage 1) BOM by copy from engineering (usage 2) BOM alternative 1. Once the first alternative production BOM has been created, is it possible to create the second alternative of this production BOM by copy of the engineering BOM ?
    In CS01, once the first alternative of a BOM usage exists, (for instance production) the system only lets you create the following alternatives of the production BOM usage by copy of production BOMs. Engineering BOMs cannot be refered to anymore as field BOM usage is deactivated (and value "1" corresponding to production bom usage is set), only alternative field can be populated, in "Copy From..." screen.
    What is the functional reason for the standard R3 to be like this ? Are there any work around ?
    Thanks for answers,
    Olivier

    Dear Olivier,
    is it possible to create the second alternative of this production BOM by copy of the engineering BOM
    in my understanding Copying  Alt 2 is not possible
    i exactly don't know the functional reson behind this
    May be experts can throw some light on this
    Regards
    Madhu

  • Where do we assign ITEM CATEGORY USAGE to a material?

    Hi all,
      I have understood the calculation of ITEM CATEGORY based upon ITEM CATEGORY USAGE and three values.
    Can someody tell me where do we link this ITEM CATEGORY USAGE and the Material?
    Where do we assign this ITEM CATEGORY USAGE to a Material?
    Thanks and Regards,
    Max

    hi
    item cat usage is basically one of the factors that determines the item category.
    this is assigned in item cat determinmation VOV4,
    as you can see there USAGE field  basically suggessts, the nature of the item.
    for example if the item is normal item,the usage field is left blank,
    if it is a free item, then usage will reflect 'free".
    like wise for text item "text"and so on.
    from this you can understand what is the charecter of the item.
    hope it is useful to u.
    suresh

Maybe you are looking for