Access field value in ALV

Hello experts,
I have created an simple ALV Grid report, in that I have implemented double click event n I want to create a new ALV grid with new data to be displayed. So I want to access field value ie using SLIS_SELFIELD or anything. Could anyone please guide me how can I access a field value using slis though SLIS_SELFIELD has methods like SEL_TAB_FIELD... I wan to access something like SEL_FIELD_VALUE but its not available in the class.
Thanks in advance...
Regards,
Viral Patel

Hi Viral,
SLIS_SELFIELD has an attribute named VALUE which holds the value you selected row & TBAINDEX holds the row number.
Refer below code snippet :-
FORM user_command
          USING s_ucomm LIKE sy-ucomm
          s_selfield TYPE slis_selfield.                    "#EC CALLED
  CASE s_ucomm.
    WHEN '&IC1'.
      CLEAR wa_podat2.
      READ TABLE itab_podat2 INTO wa_podat2 INDEX s_selfield-tabindex.
      CHECK sy-subrc = 0.
      IF wa_podat2-ebeln = s_selfield-value.
        SET PARAMETER ID 'BES' FIELD wa_podat2-ebeln.
        IF wa_podat2-ebeln IS NOT INITIAL.
          CALL TRANSACTION c_tcode.
        ENDIF.
For above event to happen, you have to use parameter I_CALLBACK_USER_COMMAND of  REUSE_ALV_GRID_DISPLAY as below :-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program      = l_repid
      i_callback_user_command = 'USER_COMMAND'
      it_fieldcat             = itab_fieldcat
      it_events               = itab_events
    TABLES
      t_outtab                = itab_podat2[].
Regards
Abhii
Edited by: Abhii on Nov 30, 2009 11:25 AM

Similar Messages

  • Tool Tip Text for field values in ALV report

    Hi,
    How to get the tool tip text for the field values in ALV report.
    Thanks & Regards,
    Pallavi.

    Hi,
    In fieldcatalog specify the TOOLTIP.
    <b>
    LVC_S_FCAT-TOOLTIP
    </b>
    In this speicfyteh tooltip you want.
    Then append this to the fieldcatalog.
    Hope this solves ur problem.

  • Can JVM security policy be modified to access field values of private field

    Can JVM security policy be modified to access field values of "private" field in a Class?

    See http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html#ReflectPermission.
    Note that you will have to use reflection to access the fields once the security policy allows you to supress the access controls.
    Chuck

  • FIELD VALUE IN ALV HEADER

    Hi friends,
    I make one header alv ok I want and take one variable count in my program so I want to display its value in ALV HEADER
    Total Target Qty:
    Total EMP. Efficiency 
    Total Machine Effi. 
    I take may header like this and pass thre text here.ok Now I want to display value of this three.
    Total Trget Qty: 2.23 like that.
    CLEAR st_line.
      st_line-typ = 'S'.
      CONCATENATE 'Total Target Qty: '  count     ' ' INTO st_line-info.
      APPEND st_line TO t_list_top_of_page.
    So I took like this in header count is my variable in which I take value.
    So how can we pass the value in ALV Header please tell me.
    its urgent so.
    Thnaks in Advance.
    Prashant.

    HI DHWANI,
    *& Report  ZPP_RE_EMP_DETAILS
    *& This Report is used to check the Employee Performance And Used Machine Quantity
    *& Rqueirement By Santhosh
    *& Developed By Prashant On Date 01.02.2008
    *&  Created By: Prashant Brahmbhatt
    *&  Creation Date: 20080201
    *&  Module: PP (Production & Plannig)
    *&  Changed By         Changed Date        Reason
    REPORT  zpp_re_emp_details.
    TABLES:zpplan.
    TYPE-POOLS:slis.
    DATA:BEGIN OF itab OCCURS 0,
         zdate LIKE zpplan-zdate,
         werks LIKE zpplan-werks,
         mname LIKE zpplan-mname,
         shftin LIKE zpplan-shftin,
         iserh LIKE zpplan-iserh,
         quaty LIKE zpplan-quaty,
         plan_qty LIKE zpplan-plan_qty,
         act_prod LIKE zpplan-act_prod,
         temp TYPE c,
         tar_qty(10) TYPE c,
         ach_qty(10) TYPE c,
         mch_eff(10) TYPE c,
        a(10) TYPE c,
         END OF itab.
    DATA:BEGIN OF temp OCCURS 0,
         zdate LIKE zpplan-zdate,
         werks LIKE zpplan-werks,
         mname LIKE zpplan-mname,
         shftin LIKE zpplan-shftin,
         iserh LIKE zpplan-iserh,
         quaty LIKE zpplan-quaty,
         plan_qty LIKE zpplan-plan_qty,
         act_prod LIKE zpplan-act_prod,
         temp TYPE c,
         tar_qty(10) TYPE c,
         ach_qty(10) TYPE c,
         mch_eff(10) TYPE c,
        a(10) TYPE c,
         END OF temp.
    DATA:BEGIN OF itab_t OCCURS 0,
         zdate LIKE zpplan-zdate,
         werks LIKE zpplan-werks,
         mname LIKE zpplan-mname,
         shftin LIKE zpplan-shftin,
         iserh LIKE zpplan-iserh,
         quaty LIKE zpplan-quaty,
         plan_qty LIKE zpplan-plan_qty,
         act_prod LIKE zpplan-act_prod,
         temp TYPE c,
         tar_qty(10) TYPE c,
         ach_qty(10) TYPE c,
         mch_eff(10) TYPE c,
        a(10) TYPE c,
         END OF itab_t.
    DATA:BEGIN OF itab1 OCCURS 0,
         zdate LIKE zpplan-zdate,
         werks LIKE zpplan-werks,
         mname LIKE zpplan-mname,
         shftin LIKE zpplan-shftin,
         act_prod LIKE zpplan-act_prod,
         quaty LIKE zpplan-quaty,
         planned LIKE zpplan-planned,
         iserh LIKE zpplan-iserh,
         temp TYPE c,
         tar_qty TYPE p DECIMALS 2,
         ach_qty TYPE p DECIMALS 2,
         mch_eff TYPE p DECIMALS 2,
         END OF itab1.
    DATA: wa LIKE  itab1.
    DATA:BEGIN OF itab2 OCCURS 0,
         zdate LIKE zpplan-zdate,
         werks LIKE zpplan-werks,
         mname LIKE zpplan-mname,
         shftin LIKE zpplan-shftin,
         act_prod LIKE zpplan-act_prod,
         quaty LIKE zpplan-quaty,
         planned LIKE zpplan-planned,
         iserh LIKE zpplan-iserh,
         temp TYPE c,
         tar_qty(10) TYPE p DECIMALS 2,
         ach_qty(10) TYPE p DECIMALS 2,
         mch_eff(10) TYPE p DECIMALS 2,
         count(10) TYPE c,
         END OF itab2.
    DATA: a(10) TYPE c,
          b(10) TYPE c,
          count(10) TYPE c,
          count1(10) TYPE c.
         c(2) TYPE p DECIMALS 2.
    DATA:t_fcat TYPE slis_t_fieldcat_alv,
         t_events TYPE slis_t_event,
         t_list_top_of_page TYPE slis_t_listheader,
         t_list_end_of_page TYPE slis_t_listheader.
    CONSTANTS:c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    CONSTANTS:c_formname_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
    DATA: st_line TYPE slis_listheader.
                  SELECTION-SCREEN
    SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    *PARAMETERS:shftin LIKE zpplan-shftin.
    SELECT-OPTIONS:date FOR zpplan-zdate,
                   shftin FOR zpplan-shftin,
                   werks FOR zpplan-werks.
    SELECTION-SCREEN:END OF BLOCK blk1.
                   ALV CALL
    INITIALIZATION.
      PERFORM build_fieldcatalog USING t_fcat .
      PERFORM event_call.
      PERFORM head_built USING t_events.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM display_alv.
    *&      Form  build_fieldcatalog
          text
         -->P_T_FCAT  text
    FORM build_fieldcatalog  USING temp_fcat TYPE slis_t_fieldcat_alv.
      DATA:w_fcat TYPE slis_fieldcat_alv.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'MNAME'.
      w_fcat-seltext_m = 'Machine Name'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'SHFTIN'.
      w_fcat-seltext_m = 'Emp No'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'ZDATE'.
      w_fcat-seltext_m = 'Pos Date'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
    w_fcat-tabname = 'ITAB2'.
    w_fcat-fieldname = 'QUATY'.
    w_fcat-seltext_m = 'Quantity'.
    APPEND w_fcat TO temp_fcat.
    CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'ACT_PROD'.
      w_fcat-seltext_m = 'Actual Quantity'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'ISERH'.
      w_fcat-seltext_m = 'Down Time'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'TAR_QTY'.
      w_fcat-seltext_m = 'Target Qty.'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'ACH_QTY'.
      w_fcat-seltext_m = 'EMP Effec.'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
      w_fcat-tabname = 'ITAB2'.
      w_fcat-fieldname = 'MCH_EFF'.
      w_fcat-seltext_m = 'Machine Effec.'.
      APPEND w_fcat TO temp_fcat.
      CLEAR w_fcat.
    w_fcat-tabname = 'ITAB2'.
    w_fcat-fieldname = 'COUNT'.
    w_fcat-seltext_m = 'Machine Effec.'.
    APPEND w_fcat TO temp_fcat.
    CLEAR w_fcat.
    ENDFORM.                    " build_fieldcatalog
    *&      Form  event_call
          text
    -->  p1        text
    <--  p2        text
    FORM event_call .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type           = 0
       IMPORTING
         et_events             = t_events
      EXCEPTIONS
        LIST_TYPE_WRONG       = 1
        OTHERS                = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " event_call
    *&      Form  data_retrieval
          text
    -->  p1        text
    <--  p2        text
    FORM data_retrieval .
      IF shftin <> ''.
        SELECT zdate werks mname shftin  INTO CORRESPONDING FIELDS OF TABLE
         temp FROM zpplan
         WHERE shftin IN shftin
         AND zdate IN date
         AND werks IN werks.
      ELSE.
        SELECT zdate werks mname INTO CORRESPONDING FIELDS OF TABLE
           temp FROM zpplan
           WHERE  zdate IN date
           AND werks IN werks.
      ENDIF.
      SORT temp BY mname zdate shftin.
      DELETE ADJACENT DUPLICATES FROM temp.
      SORT temp BY mname shftin zdate.
      DELETE ADJACENT DUPLICATES FROM temp.
      APPEND temp.
      LOOP AT temp.
        SELECT zdate werks mname shftin act_prod quaty iserh   FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab_t
        WHERE mname = temp-mname
        AND zdate = temp-zdate
        AND werks = temp-werks.
        LOOP AT itab_t.
          MOVE-CORRESPONDING itab_t TO itab.
          APPEND itab.
        ENDLOOP.
      ENDLOOP.
      *******************************************8
    SELECT zdate werks mname shftin act_prod quaty iserh   FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
         FOR ALL ENTRIES IN temp
         WHERE zdate = temp-zdate AND
               werks = temp-werks
              AND mname = temp-mname.
    SELECT zdate werks mname shftin act_prod quaty iserh   FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
       WHERE zdate IN date AND
             werks IN werks AND
    shftin = shftin.
      SORT itab BY mname zdate.
    DELETE ADJACENT DUPLICATES FROM itab.
      LOOP AT itab.
        MOVE-CORRESPONDING itab TO itab1.
        COLLECT itab1.
      ENDLOOP.
      LOOP AT itab1.
        itab1-tar_qty = itab1-tar_qty + ( itab1-quaty / 3 ).
        IF  ( itab1-tar_qty NE 0 ).
          itab1-ach_qty = ( itab1-ach_qty +  itab1-act_prod / itab1-tar_qty ) * 100.
        ELSE.
          itab1-ach_qty = 0 * 100.
        ENDIF.
        itab1-mch_eff = ( ( 8 - itab1-iserh ) / 8 ) * 100.
        MODIFY itab1 TRANSPORTING tar_qty ach_qty mch_eff.
      ENDLOOP.
      LOOP AT itab1.
        READ TABLE itab1 INDEX 1 INTO wa.
        IF itab1-mname = wa-mname.
          itab1-zdate = wa-zdate.
          itab2-shftin = itab1-shftin.
          itab2-mname = itab1-mname.
          itab2-zdate = itab1-zdate.
               itab2-quaty = itab2-quaty + itab1-quaty.     
               itab2-act_prod = itab2-act_prod + itab1-act_prod.
               itab2-iserh = itab2-iserh + itab1-iserh.
               itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
               itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
          itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
        ELSE.
               APPEND itab2.
               CLEAR itab2.
               MOVE-CORRESPONDING itab1 TO wa.
          itab2-shftin = itab1-shftin.
          itab2-mname = itab1-mname.
          itab2-zdate = itab1-zdate.
          itab2-quaty = itab2-quaty + itab1-quaty.     
          itab2-act_prod = itab2-act_prod + itab1-act_prod.
               itab2-iserh = itab2-iserh + itab1-iserh.
               itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
               itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
               itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
        ENDIF.
      ENDLOOP.
      APPEND itab2.
      LOOP AT itab2.
        IF  ( itab2-tar_qty NE 0 ).
          itab2-ach_qty = ( itab2-ach_qty +  itab2-act_prod / itab2-tar_qty(10) ) * 100.
        ELSE.
          itab2-ach_qty = 0 * 100.
        ENDIF.
        itab2-mch_eff = ( ( 8 - itab2-iserh ) / 8 ) * 100.
        MODIFY itab2 TRANSPORTING tar_qty ach_qty mch_eff.
      ENDLOOP.
    APPEND itab2.
      LOOP AT itab2.
       count = sy-tfill.
        a = a + itab2-tar_qty.
        b = b + itab2-ach_qty.
      ENDLOOP.
      CLEAR itab2.
      itab2-tar_qty = a.
      itab2-ach_qty = b.
      APPEND itab2.
      CLEAR itab2.
      count = a / sy-tfill.
      count1 = b / sy-tfill.
      itab2-tar_qty = count.
      itab2-ach_qty = count1.
    itab2-tar_qty = count.
      APPEND itab2.
    ENDFORM.                    " data_retrieval
    *&      Form  head_built
          text
         -->P_T_EVE  text
    FORM head_built  USING    p_t_eve TYPE slis_t_event.
    count = a / sy-tfill.
      DATA: ls_event TYPE slis_alv_event.
      REFRESH t_list_top_of_page.
      READ TABLE p_t_eve WITH KEY name = slis_ev_top_of_page INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO ls_event-form.
        MODIFY p_t_eve FROM ls_event   INDEX sy-tabix.
      ENDIF.
       CLEAR st_line.
        st_line-typ = 'S'.
        st_line-key = 'Total Target Qty: '.
        st_line-info = count.
        APPEND st_line TO t_list_top_of_page.
    CLEAR st_line.
    st_line-typ = 'S'.
    st_line-info = count.
    CONCATENATE 'Avg Target Qty.'  count  ' ' INTO st_line-info.
    APPEND st_line TO t_list_top_of_page.
      CLEAR st_line.
        st_line-typ = 'S'.
        st_line-key = 'Avg.EMP Efficiency: '.
        st_line-info = count1.
        APPEND st_line TO t_list_top_of_page.
      CLEAR st_line.
        st_line-typ = 'S'.
        st_line-key = 'Avg. Machine Efficincy: '.
       st_line-info = count.
        APPEND st_line TO t_list_top_of_page.
    REFRESH t_list_end_of_page.
    READ TABLE p_t_eve WITH KEY name =  slis_ev_end_of_list INTO ls_event.
    IF sy-subrc = 0.
       MOVE c_formname_end_of_page TO ls_event-form.
       MODIFY p_t_eve FROM ls_event INDEX sy-tabix.
    ENDIF.
    CLEAR st_line.
    st_line-typ = 'S'.
    CONCATENATE 'END OF PAGE' ' ' INTO st_line-info.
    APPEND st_line TO t_list_end_of_page.
    ENDFORM.                    " head_built
    *&      Form  top-of-page
          text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_list_top_of_page
        I_LOGO                   =
        I_END_OF_LIST_GRID       =
        I_ALV_FORM               =
    ENDFORM.                    "top-of-page
    *&      Form  display_alv
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = 'ZPP_RE_EMP_DETAILS'
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
       i_background_id                   = 'ALV_BACKGROUND'
       i_grid_title                      = 'EMP Information'
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
         it_fieldcat                       = t_fcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         it_events                         = t_events
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = itab2
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " display_alv

  • Arrow mark with kunnr field values in alv output.

    Hi ,
    I  need to increase the column field length. I am using Function Module REUSE_ALV_LIST_DISPLAY because alv_grid display fm is not available in 4.0b version. I have used column optimization in layout. The column kunnr is coming with a small arrow though there is no data loss. Is there any way I can remove the arrow mark with kunnr field values.

    Hi,
    You can increase your column lenght in fieldcat by using Fcat-columnwidth = "SIZE OF KUNNR ".
    Set the size of kunnr field in fieldcat and get the appropiate output.
    Regards
    Abdul

  • Accessing field values using property names

    Hi all,
    I have the following problem:
    I have several hundred simple beans which act as value holders:
    public class MyBean1 {
    private String field1;
    private String field2;
    Getters
    Setters etc.
    Now I have a class which receives the MyBean1 class encapsulated in an Object. I also have access to a list of propertynames i.e. field1, field2 etc.
    Having that info is it possible for me to retrieve the values from the bean without actually instantiating it in my implemantation class.
    I was thinking in the direction of something like a Factory helper class or so but wasn't quite able to figure out how to go about it.
    Any help would be appreciated.
    Regards
    Michael

    >
    Having that info is it possible for me to retrieve the
    values from the bean without actually instantiating it
    in my implemantation class.
    This does not make sense to me. If an object is not instantiated, then it does not exist nor do any of its fields. The operation of obtaining values that do not exist is undefined.
    I think you must mean something else but you need to explain it better.

  • How to show fixed values instead of field values in ALV cell.

    Hi colleagues,
    I have a ALV object of type CL_GUI_ALV_GRID.
    I have associted a table with it which has a field called refresh type which is of type char1.
    My program works fine.
    But the problem is,
    The refresh_type field has fixed values in its value range.
    On display of ALV i want to show the associated fixed value instead of actual value in table content.
    I donno the way to do it.
    Please help me.
    -Trupti

    Another way to do this would be to define a conversion exit function for use in the report.
    You can copy a SAP-provided function group like ALFA as a template, but you may need untyped importing/exporting parameters. Name the new functions as CONVERSION_EXIT_Zxxx_OUTPUT and CONVERSION_EXIT_Zxxx_INPUT where Zxxx is some string you choose.
    In this case the input to the ...OUTPUT function will be the code value from the database and the output value will be the corresponding text. So the code of the function CONVERSION_EXIT_Zxxx_OUTPUT will do the conversion suggested in steps 2 & 3 of Marcin's response above.
    Here is an example based on the SFLIGHT model to enhance example report BCALV_GRID_DEMO.
    First the conversion function:  (I used 'zalv' as my identifying string for the conversion.)
    function conversion_exit_zalv_output.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(INPUT)
    *"  EXPORTING
    *"     VALUE(OUTPUT)
      field-symbols:
        <output> type c,
        <carrid> type c.
      assign input  to <carrid> casting.
      assign output to <output> casting.
      select single carrname from  scarr into <output>  " convert code to text
             where  carrid  = <carrid>.
    endfunction.
    In a copy of program BCALV_GRID_DEMO, make changes in the module pbo.
    module pbo output.
      set pf-status 'MAIN100'.
      if g_custom_container is initial.
        create object g_custom_container
          exporting
            container_name = g_container.
        create object grid1
          exporting
            i_parent = g_custom_container.
    * " changes start here
        data: gs_fcat type lvc_s_fcat,
              gt_fcat type lvc_t_fcat.
        tables: dd03l.
        select * from dd03l where tabname = 'SFLIGHT'. " fill field catalog
          if dd03l-fieldname = 'CARRID'.
            gs_fcat-inttype = dd03l-inttype.
            gs_fcat-outputlen = 20.
            gs_fcat-coltext = 'Carrier'.
            gs_fcat-seltext = 'Carrier'.
            gs_fcat-edit_mask = '==ZALV'. " == with the string you used to name the functions
          else.
            clear gs_fcat.
            gs_fcat-ref_table = dd03l-tabname.
          endif.
          gs_fcat-fieldname = dd03l-fieldname.
          append gs_fcat to gt_fcat.
        endselect.
    * " changes end here
        call method grid1->set_table_for_first_display
          exporting
            i_structure_name = 'SFLIGHT'
          changing
            it_fieldcatalog  = gt_fcat
            it_outtab        = gt_sflight.
      endif.
    endmodule.                    "PBO OUTPUT
    If you run this amended program, you see appropriate carrier texts in the ALV grid, where the original program had the IATA codes.
    This approach makes sense if, for example, the same translation is also required elsewhere, as the function can easily be reused.
    best wishes
    Ed

  • How to get field values in ALV based on user provided input

    Hi,
    In my ALV grid, I have 2 fields:
    1. Material ID
    2. Material Description
    When user provides input to Material ID field, the material Description field should get populated immediately.
    Note: Curretly I am able to do it based on the sy-ucomm = 'Enter', i.e. when the user presses "Enter" outside the ALV grid, I retrieve Description from Mat Table and populate this in Mat_Desc in ALV grid.
    I want to do the same operation whenever tab is pressed (not when user presses enter outside the ALV grid).
    Please provide your inputs for this.
    Thanks & regards,
    Ravish

    Hi Ravish,
    Check <b>BCALV_TEST_GRID_F4_HELP</b> program for F4 help on ALV Grid.
    Thanks
    Venkat.O

  • Upload interactive form and access field values in WD component

    Hi Experts,
    I want to upload a prefilled  interactive adobe form in my webdynpro component and then I want to read the values filled in the form in my webdynpro component.
    I don't want to display the interactive form in the WD component. Just need to read the values.
    Please let me know how can I do it.
    Warm regards,
    Sushant Singh

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • Subtotal in alv report based on the particular field value

    Hi,
    As per my requirement, i need to do subtotal of quntity field based on the material number field value in alv report.
    Ex:  if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    <removed_by_moderator>
    Regards
    Nagendra

    Hi,
    Ex: if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    What you can do is in your output table, you will have to create an auxilary field, lets call it as material group (groupid). Now you can do a subtotal on the material group. However the logic to determine what materials belong to which group should be coded. I guess you might be having some logic for that.
    So lets say that material 1 to 10 as G1 ( group 1 ) and material 11 to 20 as G2 ( group 2 )
    The output of the internal table would be
    Groupid  matnr ...
    1  1
    1  2
    1  3.....and so on
    2  11
    2  12
    2  13....upto 20.
    Now in the fieldcatalog assign an 'X' to the 'dosum' parameter to the field Groupid
    In the sort info do the following :
    gs_sort-fieldname = 'GROUPID'.
    gs_sort-spos = 1.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
    append gs_sort to gt_sort.
    Now pass all this data to the alv grid function. And you are done.
    regards,
    Advait

  • Field value is not coming in my customize ALV report

    Hi All,
    Good day.
    I have added two fields in a customized ALV report. But the customized report was not developed by me. Therefore I am unable to understand the whole report. As per my requirement I have added 2 fields more like* quantity* & unit field in that ALV. But not understanding why values are not coming in my report though values are there in DB. Plz help me regarding this. The portion of the code is given below.
    SORT t_ekbe by belnr.
      loop at t_ekbe INTO w_ekbe where vgabe = '1'.
        on CHANGE OF w_ekbe-belnr.
          SELECT  MBLNR
            BWART
            SMBLN
            ERFMG   " This is the new added field
            erfme     " This is the new added field
          INTO CORRESPONDING FIELDS OF TABLE t_mseg
          from mseg
          where mblnr = t_ekbe-belnr
          AND   bwart = '101'.
        endon.
      ENDLOOP.
    Thanks,
    Tripod.

    hi ,
    Do according to this
    SORT t_ekbe by belnr.
      if  t_ekbe[] is not initial  .
          SELECT  MBLNR
            BWART
            SMBLN
            ERFMG   " This is the new added field
            erfme     " This is the new added field
          INTO CORRESPONDING FIELDS OF TABLE t_mseg
        for all entries in t_ekbe
          from mseg
          where mblnr = t_ekbe-belnr
          AND   bwart = '101'.
      endif.
    after this
    loop at t_ekbe .
    loop at t_mseg  where mblnr  = t_ekbe-belnr .
      t_ekbe-ERFMG = t_mseg-ERFMG .
    t_ekbe-erfme =   t_mseg-erfme  .
    modify t_ekbe transporting ERFMG  erfme .
    clear t_mseg .
    endloop.
    clear t_ekbe .
    endloop.
    Regards
    Deepak .

  • How to access the value of a field of a field symbol.

    Hello All,
    i need to access the value of a field in a field symbol. But when i am trying to get the value like <FS>-POSNR, it's showing that that the <FS> has no structure.
    In my program, the field itself that i need to check should be dynamic. ie i'll get the field in a variable and i need to find the value of that field.
    Am pasting my code below, please tell me what needs to be done.
    here in my sample code i am moving the entry of the <FS> into a work area structure. But in my actual program, i gets the structure as a parameter. So is there any way i can declare a work area dynamically...
    FUNCTION z_39181_dyn_fs_60758.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(PARAMETER) TYPE  VBELN
    *"  TABLES
    *"      DATA_TAB
      BREAK-POINT.
      FIELD-SYMBOLS <fs> TYPE ANY.
      FIELD-SYMBOLS <fs1> TYPE ANY.
      FIELD-SYMBOLS <fstab> TYPE ANY TABLE.
      DATA name(5) VALUE 'POSNR'.
      FIELD-SYMBOLS <f> TYPE ANY.
      DATA: dref TYPE REF TO data,
            dref1 TYPE REF TO data,
            dref2 TYPE REF TO data.
      DATA: lv_lips TYPE string.
      DATA: lv_lipsfld TYPE string,
                lv_fld TYPE string,
                lw_lips TYPE lips.
                lv_lips = 'LIPS'.
                lv_fld = 'LW_lips-POSNR'.
      CREATE DATA dref1 TYPE (lv_lips).
      CREATE DATA dref TYPE STANDARD TABLE OF (lv_lips).
      CREATE DATA dref2 LIKE LINE OF data_tab.
      ASSIGN dref->* TO <fstab>.
      ASSIGN dref1->* TO <fs>.
    assign dref2->* to <fs
      <fstab> = data_tab[].
      LOOP AT <fstab> INTO <fs>.
        lw_lips = <fs>.
        WRITE lw_lips-vbeln.
        ASSIGN (lv_fld) TO <fs1>.
       write <fs>
      ENDLOOP.
    Helpful answers will be rewarded...

    Use syntax
    ASSIGN COMPONENT name OF STRUCTURE struc TO <fs>.

  • Accessing the field values in different fields for calculation

    Hi,
    I am creating a report in which I have used breaks for grouping the  customers by their category. I have used summary on the amount field to calculate the sum in the individual category and also for total amount.
    Now, I also want to add an column which could display the percentages of individual contributions.
    So, its like I have to write a query accessing the total percentage, categorized percentage and individual amount.
    My question: How can I access the various fields values in the query of some other field specifically sum and total sum( because it shows the sum([Amount]) for category sum and total sum both)
    -BOBJuser

    Hmmm, I assume you are talking about WebIntelligence here...
    Ok, so let's go: you can access every "object" in the report simply by it's name. Every cell contains either a constant value (e.g. some text) or a formula, the simplest one can be just the value of an "object" from the query.
    There is a formula bar on top which you can activate, where you can easily see the content of a specific cell and also copy/paste the formula from the cell, as well as access all the built-in functions.
    WebI has a built-in calculator which works very similar to a "micro" olap engine, so you can access every sort of aggregate (of a measure) via a correspondig formula, irrelevant in which cell you are using it.
    Nevertheless, there is a "computation context" which depends on the place where you put the formula, e.g. summary row, detail row, etc.
    for more info: see the manual )
    hth, Walter

  • How to access screen field value in a module pool programming?

    Hi Experts,
       I have create a module pool program SAPMYDLG. It contains two screens 100 and 200.
       The first screen contains Employee_ID field. This field is not a dictionary field.
       In the second screen 200, I want to access the value of Employee_ID field from first screen.
       For this I created a global variable v_empid in TOP include.
       Then in the PAI of the screen 100 I have assigned the screen field value to global variable.
       v_empid = Employee_ID.
       But this gives an error saying " Field  Employee_ID not defined".
       What am I doing wrong? How can I access the screen field value?
    Thanks
    Gopal

    Hi,
    Employee_ID field also must u define in the top include when u define that 100 screen and 200 screen will access.
    regards,
    muralii

  • Accessing recordset field values using labview Active X

    dear friends,
    i have opened recordset using labview active X Refenum opening dbengine,workspace ,opendatabase,openrecordset
    i need to access the field value from the record
    but labview doesnot show any propery or methods that r related to fields ,except count.
    in short i am looking for a code statemant in labview which is equivalent to VB
    Recordset.Fields("Name").Value or Recordset.Fields(Index).Value
    can anybody help
    thanks in advance
    regards
    shridhar joshi

    try something like this .
    "shridharjosh" wrote in message
    news:[email protected]..
    > dear Ben Schulte
    > i am using MS Access Database and i opened
    > Acitve X class and necessary database connection parameters
    >
    > thing is Fields is a collection in VB and
    > has a two default properties 1-Count 2-Index
    >
    > I am Able to get count property but un succesfull in accessing index
    > this is important inorder to acces the value of a individual field in
    > a recordset
    > i am attaching data vi with this please ahve a look at it
    >
    > thanks in advance
    [Attachment Fields.PDF, see below]
    Attachments:
    Fields.PDF ‏175 KB

Maybe you are looking for

  • Issue with field symbol not assigned in SMQ2

    We are facing an issue with an error in SMQ2. The error is "field symbol not assigned". There is also short dump in ST22. I have read the previous forum threads and it talks about going into the debugger mode. However, which is the program to be debu

  • "Using" and SPRequest object was not disposed

    Just trying to understand what is happening here. I have an event receiver that currently is not working (yet to find the bug). The code is incredibly simple and uses 2 "using" statements as per best practise in order to ensure the the objects are di

  • BPC 7.5 Clarification on Installation Document

    In Page number 23 in SBOP_PC_75_NW_SP03_Install.pdf under step 10 It says. Define the .NET service user that is needed to log on to ApShell and run Server Manager by doing the following: Stop the IIS and SAP Planning and Consolidation instances using

  • TS1538 This is useless - it all started happening after I updated to the latest version of iTunes

    Device not recognized in iTunes for Windows I wasted about 1.5 hours with Apple on this issue. It all started happening after I updated to the latest version of iTunes. I haven't been able to sync my iPhone 4 in 1 month and am freaking out about poss

  • Converting files to QT

    I have a couple of files that won't play in QT. They are MPEG-2, MPEG Layer files. I downloaded MPEG Streamclip but when I try to conver them to a QT file, it says I don't have the playback component to do this. I downloaded the files on a pc. I need