Alv + menge field + decimals

Hi,
in my ALV (4.6C)i´ve got a field "quanti" with the following characteristics:
data element...menge_d
domain...........meng13
data type........quan
length.............13
and when i define the field catalog i add:
w_fcat-decimals_o = '0'.
The problem is that i´m
not able to supress the decimals when i display the data.Why is this happening?, what can i do to solve this problem?
Best regards.

With your field catalog defined like that,  I'm not sure why your program is working at all.  Type your field catalog like this.
type-pools: slis.
data: ifieldcat  type slis_t_fieldcat_alv.
data: wfieldcat  type slis_fieldcat_alv.
The fields of these structures is not the same as the other field catalog types.  You will have to adjust accordinglly.
Here is a sample program.
report zrich_0003 .
* Tables.
tables: mara.
* Global ALV Data Declarations
type-pools: slis.
* Internal Tables
data: begin of itab occurs 0,
      matnr type mara-matnr,
      maktx type makt-maktx,
      menge type mseg-menge,
      end of itab.
data: ifieldcat  type slis_t_fieldcat_alv.
data: wfieldcat  type slis_fieldcat_alv.
start-of-selection.
  perform get_data.
  perform call_alv.
*      Form  GET_DATA
form get_data.
  select mara~matnr makt~maktx up to 100 rows
          into corresponding fields of table itab
               from mara
                 inner join makt
                  on mara~matnr = makt~matnr
                   where makt~spras = sy-langu.
  loop at itab.
    itab-menge = 1.
    modify itab.
  endloop.
endform.
*  CALL_ALV
form call_alv.
  data: variant type  disvariant.
  variant-report = sy-repid.
  variant-username = sy-uname.
  perform build_field_catalog.
* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            it_fieldcat =  ifieldcat
            is_variant  = variant
            i_save      = 'U'
       tables
            t_outtab    = itab.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
  clear: ifieldcat. refresh: ifieldcat.
  perform update_catalog using 'Material Number'
                            'ITAB'
                            'MATNR'
                            '18'
                            space
                            space
                            'L'.
  perform update_catalog using 'Material Description'
                            'ITAB'
                            'MAKTX'
                            '40'
                            space
                            space
                            'L'.
  perform update_catalog using 'Quantity'
                            'ITAB'
                            'MENGE'
                            '13'
                            space
                            space
                            'R'.
endform.
* UPDATE_CATALOG
form update_catalog using col_head
                          table
                          field
                          outputlen
                          do_sum
                          no_out
                          just.
  wfieldcat-REPTEXT_DDIC = COL_HEAD.
  wfieldcat-FIELDNAME    = FIELD.
  wfieldcat-TABNAME      = TABLE.
  wfieldcat-OUTPUTLEN    = OUTPUTLEN.
  wfieldcat-JUST         = JUST.
  wfieldcat-DECIMALS_OUT = '0'.
  wfieldcat-DO_SUM      = DO_SUM.
  wfieldcat-NO_OUT      = NO_OUT.
  APPEND wfieldcat TO ifieldcat.
endform.
Regards,
Rich Heilman

Similar Messages

  • BADI me_process_po_cust, no obtain decimals of menge field

    Hi all !,
    I can´t obtein decimals in menge field when i use get_data method in badi me_process_item.
    it´s my code in process_item method.
            ref              TYPE REF TO if_purchase_order_mm ,
            re_items         TYPE purchase_order_items ,
            line_item        TYPE purchase_order_item ,
            po_item          TYPE mepoitem .
        ref = im_item->get_header( ).
        re_items = ref->get_items( ).
    LOOP AT re_items INTO line_item.
            po_item = line_item-item->get_data( ).      
           po_item-menge without decimals.
    ENDLOOP.
    Can you help me?.
    Thanks all,
    regards!!

    I resolved it. In PO, I got a Warning Message "Order quantity violates rounding rules (See long text)".
    This post was very helpful : Quantity Copied in Purchase Order is not same as Purchase Requisition
    regards.

  • Display MENGE field with no decimals in smartfroms

    Hi Experts,
    I  want to print MSEG-MENGE field with no decimals in smartforms , how do i declare this field,
    I have also declared this field in global defination in quantity/currency field...
    But i am unable to get the output..
    I tried using &mseg-menge(13.0)& but i get an error in my program stating formating is wrong.
    Thanks In Advance.
    Ashwin.

    write a code to display menge value.
    data: l_menge   type i,
          l_menge2  type string.
    move: w_bseg-menge to l_menge.
    move: l_menge to l_menge2.
    condense l_menge2.

  • Change quantity (MENGE) field in G/L posting

    Hi gurus.  I need to be able to change the quantity (BSEG/MENGE) field in a G/L document that has already been posted.  I found the area in config to add the field to be able to change.  So I made the change in config.  Then I pulled up a document that already existed, but the field is still grayed out.  I also created a new entry, then went back in to change mode, and the field is grayed out.  Any ideas?
    Thank you
    Janet

    Not sure about my answer, but I know that you are not allowed to modify any value related fields after a FI document is posted (example, value). So, my guess is by changing the quantity amount will be effected and hence FB02 will not allow you to modify quantity.

  • F4 help for ALV table field

    Hi Experts,
    I need to implement F4 help for ALV table field.
    I my scenario, I am using two views. If we click on any record in fist view then it displays the popup window (second view) with relevant record details.
    Here one of the columns having fieldnames corresponding values (old values), for correcting old values I have created new value editable column, we can enter new value for old value then we can save it. Till this functionality is ok.
    Then I have included OVS help for new value field. Here I need to get f4 help for newvalue field relevant to fieldname.
    For example: user clicks on f4 in cell (new value) then if corresponding fieldname is u2018WERKSu2019 then it shows the plant values
    Here I can get fieldname, domain name  and value table using method set_attribute ().
    Same concept I have implemented in ALV using F4IF_FIELD_VALUE_REQUEST. It is working fine
    Here I have little bit confusion. Please advise me how to implement in OVS.
    Regards,
    BBC

    Hi,
    you'll have to create a method for the OVS search help (define it in the "OVS component usage" field in the context).
    Sample code (should work for WERKS):
    method on_ovs .
    declare data structures for the fields to be displayed and
    for the table columns of the selection list, if necessary
      types:
        begin of lty_stru_input,
      add fields for the display of your search input here
          WERKS TYPE WERKS,
        end of lty_stru_input.
      types:
        begin of lty_stru_list,
      add fields for the selection list here
          WERKS TYPE WERKS_D,
          NAME1 type NAME1,
        end of lty_stru_list.
      data: ls_search_input  type lty_stru_input,
            lt_select_list   type standard table of lty_stru_list,
            ls_text          type wdr_name_value,
            lt_label_texts   type wdr_name_value_list,
            lt_column_texts  type wdr_name_value_list,
            lv_window_title  type string,
            lv_group_header  type string,
            lv_table_header  type string,
            lv_werks type werks_d.
      field-symbols: <ls_query_params> type lty_stru_input,
                     <ls_selection>    type lty_stru_list.
      case ovs_callback_object->phase_indicator.
        when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
      in this phase you have the possibility to define the texts,
      if you do not want to use the defaults (DDIC-texts)
    Set label from Medium Description to something more logical...
          ls_text-name = `NAME1`.  "must match a field in list structure
          ls_text-value = `Plant description`.
          insert ls_text into table lt_label_texts.
    Set col header from Medium Description to something more logical...
          ls_text-name = `NAME1`.  "must match a field in list structure
          ls_text-value = `Plant description`.
          insert ls_text into table lt_column_texts.
         lv_window_title = wd_assist->get_text( `003` ).
         lv_group_header = wd_assist->get_text( `004` ).
         lv_table_header = wd_assist->get_text( `005` ).
          ovs_callback_object->set_configuration(
                    label_texts  = lt_label_texts
                    column_texts = lt_column_texts
                    group_header = lv_group_header
                    window_title = lv_window_title
                    table_header = lv_table_header
                    col_count    = 2
                    row_count    = 20 ).
        when if_wd_ovs=>co_phase_1.  "set search structure and defaults
      In this phase you can set the structure and default values
      of the search structure. If this phase is omitted, the search
      fields will not be displayed, but the selection table is
      displayed directly.
      Read values of the original context (not necessary, but you
      may set these as the defaults). A reference to the context
      element is available in the callback object.
         ovs_callback_object->context_element->get_static_attributes(
             importing static_attributes = ls_search_input ).
        pass the values to the OVS component
         ovs_callback_object->set_input_structure(
             input = ls_search_input ).
        when if_wd_ovs=>co_phase_2.
      If phase 1 is implemented, use the field input for the
      selection of the table.
      If phase 1 is omitted, use values from your own context.
          if ovs_callback_object->query_parameters is not bound.
          endif.
          assign ovs_callback_object->query_parameters->*
                                  to <ls_query_params>.
          if not <ls_query_params> is assigned.
    TODO exception handling
          endif.
            call method ovs_callback_object->context_element->get_attribute
              exporting
                name  = 'WERKS'
              importing
                value = lv_werks.
            data: lv_subcat_text type rstxtmd.
            select werks
                   name1
              into table lt_select_list
              from T001W.
            ovs_callback_object->set_output_table( output = lt_select_list ).
        when if_wd_ovs=>co_phase_3.
      apply result
          if ovs_callback_object->selection is not bound.
          endif.
          assign ovs_callback_object->selection->* to <ls_selection>.
          if <ls_selection> is assigned.
            ovs_callback_object->context_element->set_attribute(
                                   name  = `WERKS`
                                   value = <ls_selection>-werks ).
          endif.
      endcase.
    endmethod.

  • ALV OUTPUT FIELD LEANTH

    HI EXPERTS,
    IN ALV OUTPUT FIELD LENTH IS MAX 128?
    IN MY REQUIRMENT THE FIELD HAS 500 CHARTERS
    Moderator Message: So where is the question? And why type in CAPITAL letters? Do some research before you post a question here. Also, please read the Rules of Engagement of this forum
    Edited by: kishan P on Apr 1, 2011 10:10 AM

    Hi,
    Linking F4 Help to Fields
    For the last section, we will deal with linking F4 help to fields. It is easy. As usual, define, implement and register the event “onf4” at proper places in your code. For F4 help, you must register the fields whose F4 request will trigger the “onf4” event. For this you must prepare a table of type “LVC_T_F4” and register this table using the method “register_f4_for_fields”. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;
    Pass the fieldname to ‘FIELDNAME’
    Set ‘REGISTER’ to make the field registered,
    Set ‘GETBEFORE’ to provide field content transport before F4 in editable mode
    Set ‘CHNGEAFTER’ to make the data changed after F4 in editable mode.
    Preparing table for the fields to be registered to trigger F4 event
    DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .
    lt_f4-fieldname = 'PRICE'.
    lt_f4-register = 'X' .
    lt_f4-getbefore = 'X' .
    APPEND lt_f4 .
    CALL METHOD gr_alvgrid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[] .
    A sample “onf4” method implementation
    METHOD handle_on_f1 .
    PERFORM f4_help USING e_fieldname es_row_no .
    er_event_data->m_event_handled = 'X' .
    Again, we set the attribute “er_event_data->m_event_handled” to prevent further processing of standard F4 help.
    Regards,
    Ranjit Thakur.
    <b>Please Mark The Helpful Answer.</b>
    ENDMETHOD .

  • Updation of the MENGE field in the BSEG table

    SAP 4.6C
    The material is moved from one plant to another. The excise on the same is also moved from one plant to another via STO. The value in the GL accounts is calculated using the quantity in the STO. However when the FI posting is triggered, the quantity does not flow to the BSEG table (MENGE field), but the value is populated.  The posting is triggered via conditions and via OBYC setting
    How can we populate the quantity in the FI document.

    Hello,
    There is a note to help you on to achieve this requirement. CAn you please check the note 608340??
    This note has a detailed description about what should be done to update the field MENGE.
    Regards,
    Renan

  • ALV flter fields where we can get.

    hi friends,
    i created a ALV report i placed upload button on the man bar. when we press it upload data using bdc conditions. it is working fine.
    but if user filter some data on the alv display using filter button, how can i get data which is showing on the alv display. can i get that data or not.
    thanq.
    rajesh.k

    Hi,
    create a field called BOX in your itab of lenght 1 and type c.
    do not display this in the ALV, ( no field cat for this )
    but in the layout - box_fieldname = 'BOX'.
    Now after the filter ask your user to select the rows by clicking the button which is available in the left side.
    so that those filtered and selected rows will be marked as 'X' in the box field in your internal table.
    Now you can get all the filtered as well as selected rows.
    Regards,
    Venkatesh

  • ALV QUANTITY field Geting converted into decimals ?

    Hi All ,
    I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
    Best Regards,
    Sreeram

    Hi Sreeram,
    I am not gettin this issue. See below code :
    If you are gettiing the same issue with the below code then it has something to do with your user settings.
    Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
    Set it to 1,234,567.89 and save. Now try the program again.
    REPORT z_test.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF ty_ekpo,
              ebeln TYPE ebeln,
              ebelp TYPE ebelp,
              ktmng TYPE ktmng,
              menge TYPE bstmg,
            END OF ty_ekpo.
    DATA: it_ekpo TYPE TABLE OF ty_ekpo,
          it_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT ebeln ebelp ktmng menge
      FROM ekpo
      INTO TABLE it_ekpo
      UP TO 20 ROWS.
    PERFORM add_fieldcat USING 'EBELN'.
    PERFORM add_fieldcat USING 'EBELP'.
    PERFORM add_fieldcat USING 'KTMNG'.
    PERFORM add_fieldcat USING 'MENGE'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = sy-repid
       it_fieldcat                       = it_fieldcat
      TABLES
        t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    FORM add_fieldcat  USING  p_fieldname TYPE slis_fieldcat_alv-fieldname.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-tabname = 'IT_EKPO'.
      wa_fieldcat-ref_fieldname = p_fieldname.
      wa_fieldcat-ref_tabname = 'EKPO'.
      IF p_fieldname EQ 'KTMNG'.
        wa_fieldcat-edit = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " ADD_FIELDCAT
    Regards,
    Jovito

  • Alv quanitty field edit mode

    Hi
    I am displaying one quanity field in alv. which is in Editable mode. while running and editing it is behaving strangly. if I enter the value 7,00 it is becoming 0,07 in the internal table .
    Please guide me in this regard.
    jaffer vali shaik

    Jaffer Please check the Below.
    Case#1.
    REPORT  ztest_alv_oo22.
    TYPE-POOLS: slis.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
         wa_cat TYPE slis_fieldcat_alv.
    DATA: BEGIN OF it_data OCCURS 0,
            vbeln TYPE vbeln,
            matnr TYPE matnr,
            menge TYPE p DECIMALS 2,
          END OF it_data.
    DO 10 TIMES.
      it_data-menge = '10.00'.
      APPEND it_data.
    ENDDO.
    wa_cat-fieldname = 'VBELN'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Test'.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'POSNR'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Test'.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'MENGE'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Qty'.
    wa_cat-edit = 'X'.
    wa_cat-decimals_out = 2.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_data
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm selfield TYPE slis_selfield.
      BREAK-POINT.
    ENDFORM.                    "user_command
    Case#2. with out Decimals_out option.
    REPORT  ztest_alv_oo22.
    TYPE-POOLS: slis.
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
         wa_cat TYPE slis_fieldcat_alv.
    DATA: BEGIN OF it_data OCCURS 0,
            vbeln TYPE vbeln,
            matnr TYPE matnr,
            menge TYPE p DECIMALS 2,
          END OF it_data.
    DO 10 TIMES.
      it_data-menge = '10.00'.
      APPEND it_data.
    ENDDO.
    wa_cat-fieldname = 'VBELN'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Test'.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'POSNR'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Test'.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'MENGE'.
    wa_cat-tabname = 'IT_DATA'.
    wa_cat-seltext_l = 'Qty'.
    wa_cat-edit = 'X'.
    APPEND wa_cat TO it_fieldcat.
    CLEAR wa_cat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_data
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm selfield TYPE slis_selfield.
      BREAK-POINT.
    ENDFORM.                    "user_command
    Change the Qty in the output and use refresh .
    and see.

  • Problem with ALV amount field display

    hi friend!!
    i have a editable ALv out put and in that i am displaying Amount and quantity field. In O/p if i enter 100 its taking as 100,00 .Please tell me how to correct the same.
    Plz help me

    Try to fill the Ref_fieldname and Ref_tabname in the fieldcatalog.
    also specify decimals = 0 for the column which you are editing.
    fieldcat-ref_fieldname = 'KWMENG'.
    fieldcat-ref_tabname = 'VBAP'.
    fieldcat-decimals_out = 0.
    "if you want decimals then specify the number how many you want

  • Alv tree - roundoff decimals

    Hi abap king's,
    in <b>alv tree</b> program i want to remove the decimals or to round off the decimals. for ex. 1890.41 to be displayed as 1890.
    thanks,
    Madhu.

    Hi,
    In the internal table , use this logic to populate the field.
    DATA: X TYPE P DECIMALS 2 VALUE '12493.97'.
    WRITE: /X ROUND -2,   "output: 1,249,397.00
           /X ROUND  0,   "output:    12,493.97
           /X ROUND  2,   "output:       124.94
           /X ROUND  5,   "output:         0.12
    Best regards,
    Prashant

  • ALV Grid Field catalog

    Hi,
         I am trying to display data from two different tables, say 3 fields from one table and 3 fields from other table. in alv grid format using classes and using method CALL METHOD go_grid->set_table_for_first_display
    how can we build the field catalog for the internal table which consists of 6 fields from two different tables
    thanks in advance

    Hello,
    Please check,it is similar case.
    FORM set_grid.
      IF g_r_grid IS INITIAL.
        CREATE OBJECT g_r_cont
                     EXPORTING container_name = 'CUST1'.
        CREATE OBJECT g_r_grid
                     EXPORTING i_parent = g_r_cont.
        g_r_variant = sy-repid.
      Build Field Catalog
        PERFORM build_field_catalog.
      Exclude process options from ALV
        PERFORM alv_excl.
      setting ALV Grid layout
        PERFORM alv_layo.
        CALL METHOD g_r_grid->set_table_for_first_display
           EXPORTING
             is_layout                     = g_r_layo
             is_variant                    = g_r_variant
             it_toolbar_excluding          = g_r_excl
             i_save                        = 'X'
           CHANGING
             it_outtab                     = g_t_alv[]
             it_fieldcatalog               = g_t_fieldcat.
      ENDIF.
    ENDFORM.                    " set_grid
    *Form Routine ID    : build_field_catalog
    *Form Routine Name  : TO Build Field Catalog
    *Outline            : Subroutine for building the field catalog
    *Argument           : None
    *Return Value       : None
    FORM build_field_catalog.
      DATA : l_f_n TYPE i.
      REFRESH g_t_fieldcat.
      l_f_n  = 0.
    Add properties values to ALV Catalog
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MATNR' 'CHAR' l_f_n
                                text-001 'X' space ' ' 18 ' '  .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'TXZ01' 'CHAR' l_f_n
                                text-002 'X' space 'X' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MFRPN' 'CHAR' l_f_n
                                text-003 ' ' space ' ' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELN' 'CHAR' l_f_n
                                 text-004 space space ' ' 10 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELP' 'NUMC' l_f_n
                                 text-005 space space ' ' 5 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EINDT' 'DATS' l_f_n
                                 text-006 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE' 'QUAN' l_f_n
                                 text-007 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS' 'UNIT' l_f_n
                                 text-008 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE1' 'QUAN' l_f_n
                                 text-009 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS1' 'UNIT' l_f_n
                                 text-010 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LIFNR' 'CHAR' l_f_n
                                 text-011 space space ' ' 10 'ALPHA'.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'NAME1' 'CHAR' l_f_n
                                 text-012 space space 'X' 35 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSART' 'CHAR' l_f_n
                                 text-013 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BEDAT' 'DATS' l_f_n
                                 text-014 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'AEDAT' 'DATS' l_f_n
                                 text-015 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'INSMK' 'CHAR' l_f_n
                                 text-016 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'WERKS' 'CHAR' l_f_n
                                 text-017 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LGORT' 'CHAR' l_f_n
                                 text-018 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EKGRP' 'CHAR' l_f_n
                                 text-019 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PSTYP' 'CHAR' l_f_n
                                 text-020 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LOEKZ' 'CHAR' l_f_n
                                 text-021 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'DISPO' 'CHAR' l_f_n
                                 text-022 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PO_TEXT' 'CHAR' l_f_n
                                 text-023 space space 'X' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSGRU' 'CHAR' l_f_n
                                 text-024 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA1' 'CHAR' l_f_n
                                 text-025 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT1' 'CHAR' l_f_n
                                 text-026 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA2' 'CHAR' l_f_n
                                 text-027 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT2' 'CHAR' l_f_n
                                 text-028 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA3' 'CHAR' l_f_n
                                 text-029 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT3' 'CHAR' l_f_n
                                 text-030 space space 'X' 40 ' '.
    ENDFORM.                    " build_field_catalog
    *Form Routine ID    : add_catalog
    *Form Routine Name  : To Add the Catalog for the ALV
    *Outline            : Subroutine to add properties values to ALV Catalog
    *Argument           : p_fname        "Field Name
                        p_inttype      "Intenal Type
                        p_col_pos      "Column Position
                        p_coltext      "Column Text
                        p_key          "Key Field
                        p_hotspot      "Hotspot Enabled
                        p_outlen       "Internal Length
                        p_convexit     "conversion exit name
    *Return Value       : g_t_fieldcat   "Field Catalog Table
    FORM add_catalog USING   p_fname
                             p_inttype
                             p_col_pos
                             p_col_text
                             p_key
                             p_hotspot
                             p_lowercase
                             p_outlen
                             p_convexit.
      CLEAR g_r_fieldcat.
      g_r_fieldcat-fieldname = p_fname.
      g_r_fieldcat-inttype   = p_inttype.
      g_r_fieldcat-col_pos   = p_col_pos.
      g_r_fieldcat-coltext   = p_col_text.
      g_r_fieldcat-hotspot   = p_hotspot.
      g_r_fieldcat-lowercase = p_lowercase.
      g_r_fieldcat-outputlen = p_outlen.
      g_r_fieldcat-key       = p_key.
      g_r_fieldcat-convexit  = p_convexit.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    ENDFORM.                    " add_catalog
    *Form Routine ID    : alv_excl
    *Form Routine Name  : ALV Exclude List
    *Outline            : Subroutine to exclude process options from ALV
    *Argument           : None
    *Return Value       : None
    FORM alv_excl.
      APPEND cl_gui_alv_grid=>mc_mb_sum          TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_mb_subtot       TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_graph        TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_info         TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_print_back   TO g_r_excl.
    ENDFORM.                    " alv_excl
    *Form Routine ID    : alv_layo
    *Form Routine Name  : alv_layo
    *Outline            : Subroutine to set alv layout
    *Argument           : None
    *Return Value       : None
    FORM alv_layo.
      g_r_layo-grid_title = text-100.
      g_r_layo-cwidth_opt = g_c_mark.
      g_r_layo-zebra      = g_c_mark.
      g_r_layo-no_rowmark = space.
      g_r_layo-sel_mode   = g_c_selmode.
    ENDFORM.                 
    Regards

  • Search Help in ALV Editable Field

    Hi,
    My requirentment is to get F4 functionality for one  Editable field,
    These F4 values should come from processing of internal table.
    i have searched in SDN but didnt get satisfactory answer for it.
    . I dont want to use ALV control table concept and with OOPs ALV,
    Please let me know.how we can achieve this functionality,
    your suggestions are always welcome.
    Regards
    Vivek

    Hi,
    Use the Function module: F4IF_INT_TABLE_VALUE_REQUEST
    The below code shows how function module F4IF_INT_TABLE_VALUE_REQUEST is used to display a basic ABAP internal table as an SAP search help.  
    parameters: p_ebeln type ekko-ebeln.
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko,
          it_return type STANDARD TABLE OF DDSHRETVAL,
          wa_return like line of it_return.
    *at selection-screen
    at selection-screen on value-request for p_ebeln.
    select *
      up to 10 rows
      from ekko
      into CORRESPONDING FIELDS OF TABLE it_ekko.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = 'EKKO'
        RETFIELD               = 'EBELN'
      PVALKEY                = ' '
       DYNPPROG               = sy-repid
       DYNPNR                 = sy-dynnr
      DYNPROFIELD            = 'EBELN'
      STEPL                  = 0
        WINDOW_TITLE           = 'Ekko Records'
      VALUE                  = ' '
        VALUE_ORG              = 'S'
       MULTIPLE_CHOICE        = 'X'  "allows you select multiple entries from the popup
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             = ld_ret
      TABLES
        VALUE_TAB              = it_ekko
       FIELD_TAB              = lt_field
        RETURN_TAB             = it_return
      DYNPFLD_MAPPING        =
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3.
    READ TABLE it_return into wa_return index 1.
    p_ebeln = wa_return-fieldval.
    Hope it helps you.
    Regards,
    Anju

  • Alv drilldown-fields are hiding in secondary list-when layout option used

    hey guys,
    i displayed alv grid using fms.
    the basic list has default layout option.
    but when user gives a deault layout,and try to see secondary list,the fields appear as hidden.
    one has to unhide them manualy to see.

    Kumar,
      Check the Field catalog Before displaying Secondary list, If NO_OUT is set for Hidden fields.
    Thanks,
    Kishore

Maybe you are looking for