Making alv deactive

Hi All,
I have one button  and one alv.
Now my requirement is when i press the button on first time the entire table should be in deactive mode
( i got this ) and if i press the same button on second time the entire table should be in edit mode ( i got this also ).But if i press the same button on  third time , am able to get non editable mode ,but here i want in deactive mode .
I want display/Change toggle button.
My code is as follows ...Chech it Once..
  DATA:V_FLAG TYPE C.
  DATA LO_ND_FLAG TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LO_EL_FLAG TYPE REF TO IF_WD_CONTEXT_ELEMENT.
  DATA LS_FLAG TYPE WD_THIS->ELEMENT_FLAG.
navigate from <CONTEXT> to <FLAG> via lead selection
  LO_ND_FLAG = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_FLAG ).
get element via lead selection
  LO_EL_FLAG = LO_ND_FLAG->GET_ELEMENT(  ).
get all declared attributes
  LO_EL_FLAG->GET_STATIC_ATTRIBUTES(
    IMPORTING
      STATIC_ATTRIBUTES = LS_FLAG ).
  IF LS_FLAG-DIS_CHG EQ 'D'.
    CALL METHOD LO_EL_FLAG->SET_ATTRIBUTE
      EXPORTING
        VALUE = 'C'
        NAME  = `DIS_CHG`.
    V_FLAG = 'X'.
  ELSEIF LS_FLAG-DIS_CHG EQ 'C'.
    CALL METHOD LO_EL_FLAG->SET_ATTRIBUTE
      EXPORTING
        VALUE = 'D'
        NAME  = `DIS_CHG`.
    CLEAR V_FLAG.
  ENDIF.
*Instantiate used component
  DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
  LO_CMP_USAGE =   WD_THIS->WD_CPUSE_ALV( ).
  IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
    LO_CMP_USAGE->CREATE_COMPONENT( ).
  ENDIF.
*Get config model
  DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
  LO_INTERFACECONTROLLER =   WD_THIS->WD_CPIFC_ALV( ).
  DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
  LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
  DATA: LR_TABLE_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
  DATA: LR_COLUMN_SETTINGS TYPE REF TO IF_SALV_WD_COLUMN_SETTINGS,
        LR_INPUT_FIELD TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD.
  DATA: LR_COLUMN TYPE REF TO CL_SALV_WD_COLUMN.
  IF V_FLAG = 'X'.
    LO_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_DELETE_ROW_ALLOWED( ABAP_TRUE ).
    LO_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_INSERT_ROW_ALLOWED( ABAP_FALSE ).
    LO_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_CHECK_AVAILABLE( ABAP_FALSE ).
    LO_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_APPEND_ROW_ALLOWED( ABAP_FALSE ).
    LR_TABLE_SETTINGS ?= LO_VALUE.
    LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_FALSE ).
Making the Fields Editable -
    LR_COLUMN_SETTINGS ?= LO_VALUE.
    LR_COLUMN = LR_COLUMN_SETTINGS->GET_COLUMN( 'NAME1' ).
    CREATE OBJECT LR_INPUT_FIELD
      EXPORTING
        VALUE_FIELDNAME = 'NAME1'.
    LR_COLUMN->SET_CELL_EDITOR( LR_INPUT_FIELD ).
    LR_TABLE_SETTINGS ?= LO_VALUE.
    LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_FALSE ).
    LR_COLUMN_SETTINGS ?= LO_VALUE.
    LR_COLUMN = LR_COLUMN_SETTINGS->GET_COLUMN( 'EMAIL_ID' ).
    CREATE OBJECT LR_INPUT_FIELD
      EXPORTING
        VALUE_FIELDNAME = 'EMAIL_ID'.
    LR_COLUMN->SET_CELL_EDITOR( LR_INPUT_FIELD ).
    LR_TABLE_SETTINGS ?= LO_VALUE.
    LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_FALSE ).
  ELSE.
    LR_TABLE_SETTINGS ?= LO_VALUE.
    LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_TRUE ).
  ENDIF.
Could any one help me in this regard.
Thanks in advance.
Regards,
sravan.

Hi Sravan ,
Thats very easy .
Please follow the below steps.
I have seen ur code....plz make following changes in the ELSE PART .
ELSE.
LR_TABLE_SETTINGS ?= LO_VALUE.
LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_TRUE ).------>>>>>>>this is ur code .
now add this .
*make columns   editable
DATA : l_column TYPE REF TO cl_salv_wd_column ,
         l_column1 TYPE REF TO cl_salv_wd_column ,
         lr_input TYPE REF TO cl_salv_wd_uie_input_field ,
         l_input1 TYPE REF TO cl_salv_wd_uie_input_field .
  l_column = lo_value->if_salv_wd_column_settings~get_column( 'NAME1' ).
  CREATE OBJECT lr_input
    EXPORTING
      value_fieldname = 'NAME1'.
*MAKE COLUMN EDIATBLE
  l_column->set_cell_editor( value = lr_input ) .
MAKE   COULNMN  NON EDITABLE i.e. read ony
CALL METHOD LR_INPUT->SET_READ_ONLY
  EXPORTING
    VALUE  = ABAP_TRUE
*repaeat the same step for another field.
  l_column = lo_value->if_salv_wd_column_settings~get_column( 'EMAIL_ID' ).
  CREATE OBJECT lr_input
    EXPORTING
      value_fieldname = 'EMAIL_ID'.
*MAKE COLUMN EDIATBLE
  l_column->set_cell_editor( value = lr_input ) .
MAKE   COULNMN  NON EDITABLE i.e. read ony
CALL METHOD LR_INPUT->SET_READ_ONLY
  EXPORTING
    VALUE  = ABAP_TRUE
    lo_value->IF_SALV_WD_TABLE_SETTINGS~set_read_only( abap_false ).
ENDIF.
hope this will solve ur problem...i have tested  and its working  perfectly
regards
Arjun .

Similar Messages

  • Regarding making ALV Online.

    Dear SAP Gurus,
    I am displaying an ALV Report fetching data from a Z-Table. Now my requirement is,
    once the ALV output comes, it should automatically refresh for every 1 hour. ie, for every one hour data is to be checked from the Z-Table and updated in the list.
    Please help.
    Thanks & Regards
    Pavan.

    Some user(s) will have this report running continuously on their desktop, hour after hour? And, you're going to change the report they're looking at?    I seriously doubt that....  In my case, I added a refresh button to my ALV function buttons, and allow the user to manually choose to refresh, once they have completed working the original list....At that time, I close my SALV screen, clear the underlying data table, then re-execute the data retrieval and SALV startup.
    Edited by: BreakPoint on Mar 14, 2011 12:50 PM

  • How to display the editable fields in output of an ALV report?

    Hi all,
    I have a requirement of displaying values in ALV Grid format and above this grid display i have to put some fields , that are editable.
    I know making ALV grid fields as editable, but here requirement is to display some fields before displaying the ALV grid dispaly and to enable these fields editable to user and when printing this the values entered by user also has tobe printed.
    Please help me on solving this problem? Is it possible to do this with ALV function modules?
    Thanks,
    Vamshi.

    Hi all,
    Thanks for your replies.
    But this is not  my requirement. I mentioned in my question that i too know how to edit the fields in ALV grid report.
    Here my requirement is .
                                             name :_____________
                                             amount:____________
    alv grid display
    Like above i need to display.  after name the user can be enter value and after amount also the user can be enter some value at output . But this is not the header of ALV .
    Is this possible in classical ALV or Classical report? If not please specify alternative?
    Thanks,
    Vamshi.

  • Regarding ALV display

    Hi ,
    I am making ALV Report. I am displaying 4  similar ALV grids in a screen.
    I would like to know how to give them some names so that they can be distinguished from each other by there name.
    Pls help .

    Hi Jaison,
    the easiest way to achive this, is to do the subtotaling with or without detailed lines by changing the ALV variant when in display.
    When you save the ALV layout(variant), in the popup you have a "Save with" tab. There is "Breakdwn to totals lvl:" entry. You ca select the level of sum displayed.
    After saving layout variant, you can pass it depending on  users input in structured parameter IS_VARIANT. Yo need to fill report field with report name and variant with layout name.
    Best is, to have a layout selection parameter. In Initialization, fill it using FM REUSE_ALV_VARIANT_DEFAULT_GET, AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_layout, use REUSE_ALV_VARIANT_F4.
    This makes your report far more flexible.
    Regards,
    Clemens

  • Re: URGENT: REGARDING ALV REPORT OUTLOOK

    HI,
    I am making alv report in which d simple format is used and its output is used to be appear to be simple and  now i want to make its output more gud,can anybody tell me d solution of dis problem,reply useful will be definately rewarded....
    REPORT  ZMFTEST5 no standard page heading LINE-SIZE 310.
    TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
    *Varriable declaration.
    TYPE-POOLS SLIS.
    DATA : POS TYPE I.
    DATA   REPID  LIKE SY-REPID.
    DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
           F2 TYPE SLIS_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA   L_POS TYPE I VALUE 1.               "position of the column
    DATA   GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    **DATA  GT_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA:  GT_EVENTS    TYPE SLIS_T_EVENT,
           FS_EVENTCAT LIKE LINE OF GT_EVENTs.
    INTERNAL TABLE FOR SALES ORDER *****************
    DATA : BEGIN OF ITSO OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           BSTNK LIKE VBAK-BSTNK,
           KUNNR LIKE VBAK-KUNNR,
           MATNR LIKE VBAP-MATNR,
           POSNR LIKE VBAP-POSNR,
           WMENG LIKE VBEP-WMENG,
           NTGEW LIKE MARA-NTGEW,
           BRGEW LIKE MARA-BRGEW,
           GEWEI LIKE MARA-GEWEI,
           SPART LIKE VBAK-SPART,
           BMENG LIKE VBEP-BMENG,
           EDATU LIKE VBEP-EDATU,
           BSTKD LIKE VBKD-BSTKD,
           WERKS LIKE VBAP-WERKS,
           MEINS LIKE MARA-MEINS,
           KWMENG LIKE VBAP-KWMENG,
           KLMENG LIKE VBAP-KLMENG,
           END OF ITSO.
    Heading of the report.
    data: t_heading type slis_t_listheader.
    ***********PARAMETERS***************
      PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
    *********SELECTION SCREEN OPTIONS*********
      SELECT-OPTIONS : SO_ORD  FOR VBAK-VBELN,
                       SO_PARTY FOR VBAK-KUNNR,
                       IT_M FOR MARA-MATNR,
                       DIV FOR VBAK-SPART,
                       SO_DATE FOR VBAK-ERDAT,
                       S_DATE FOR VBEP-EDATU.                   .
    START-OF-SELECTION.
           SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR  BSPART BMATNR BPOSNR BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG DEDATU D~VBELN
              FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN
               INNER JOIN MARA AS C ON CMATNR = BMATNR
                 INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR = B~POSNR
                   INTO CORRESPONDING FIELDS OF TABLE ITSO
                     WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND BSPART IN DIV AND AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND B~WERKS = PLANT.
             IF SY-SUBRC <> 0.
       MESSAGE E899(M3) WITH 'No records'.
    ENDIF.
    perform f_build_eventcat.
    PERFORM LAYOUT.
    END-OF-SELECTION.
    FORM LAYOUT.
      PERFORM FCAT USING 'VBELN'    'ITSO'  '' 'S.O.NO. '  'VBELN'     'VBAK' ''.
      PERFORM FCAT USING 'WERKS'    'ITSO'  '' 'PLANT  '   'WERKS'     'VBAP' ''.
      PERFORM FCAT USING 'ERDAT'    'ITSO'  '' 'S.O.DATE'  'ERDAT'     'VBAK' ''.
      PERFORM FCAT USING 'BSTNK'    'ITSO'  '' 'P.O.N.O.'  'BSTNK'     'VBAK' ''.
      PERFORM FCAT USING 'KUNNR'    'ITSO'  '' 'PARTY   '  'KUNNR'     'VBAP' ''.
      PERFORM FCAT USING 'MATNR'    'ITSO'  '' 'MAT.NO. '  'MATNR'     'MARA' ''.
      PERFORM FCAT USING 'WMENG'    'ITSO'  '' 'S.O.QTY'   'WMENG'     'VBEP' ''.
    REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
             I_CALLBACK_PROGRAM       = REPID
             IT_FIELDCAT              = F1
            IT_SORT                  = GT_SORT
             I_SAVE                   = 'X'
             IT_EVENTS                = GT_EVENTS[]
         TABLES
              T_OUTTAB                 = ITSO.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Top of page heading
    perform set_top_page_heading using t_heading t_event.
    Events
    perform set_events using t_event.
    GUI Status
    w_status = ''.
    w_repid = sy-repid.
    Title
    w_title = <<If you want to set a title for
                the ALV, please, uncomment and edit this line>>.
    User commands
    w_comm   = 'USER_COMMAND'.
    ENDFORM.                    " LAYOUT
    *&      Form  FCAT
    FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
      ADD 1 TO POS.
      F2-COL_POS       = POS.
      F2-FIELDNAME     = P_FIELD.
      F2-TABNAME       = P_TABLE.
      F2-SELTEXT_L     = P_TEXT.
      F2-REF_FIELDNAME = P_RFIELD.
      F2-REF_TABNAME   = P_RTABLE.
      F2-DO_SUM        = P_SUM.
      F2-NO_OUT        = P_DISP.
      APPEND F2 TO F1.
      CLEAR F2.
    ENDFORM.                " FCAT
    FORM F_BUILD_EVENTCAT .
    CLEAR: GT_EVENTS.  REFRESH: GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
      FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'END_OF_LIST'.
      FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
    ENDFORM.                    " F_BUILD_EVENTCAT
    *&      Form  F_WRITE_SUMMARY
          Write summary before exit
    FORM F_WRITE_SUMMARY .
    write:/ 'Welcome to XYZ Limited'.
    write:/ 'This is a test program to display Report in ALV Format'.
    ENDFORM.

    Just check the program :
    REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.
    TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
    *Varriable declaration.
    TYPE-POOLS SLIS.
    DATA : POS TYPE I.
    DATA REPID LIKE SY-REPID.
    DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
    F2 TYPE SLIS_FIELDCAT_ALV,
    L_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA L_POS TYPE I VALUE 1. "position of the column
    DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    **DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
    DATA: GT_EVENTS TYPE SLIS_T_EVENT,
    FS_EVENTCAT LIKE LINE OF GT_EVENTs.
    INTERNAL TABLE FOR SALES ORDER *****************
    DATA : BEGIN OF ITSO OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    ERDAT LIKE VBAK-ERDAT,
    BSTNK LIKE VBAK-BSTNK,
    KUNNR LIKE VBAK-KUNNR,
    MATNR LIKE VBAP-MATNR,
    POSNR LIKE VBAP-POSNR,
    WMENG LIKE VBEP-WMENG,
    NTGEW LIKE MARA-NTGEW,
    BRGEW LIKE MARA-BRGEW,
    GEWEI LIKE MARA-GEWEI,
    SPART LIKE VBAK-SPART,
    BMENG LIKE VBEP-BMENG,
    EDATU LIKE VBEP-EDATU,
    BSTKD LIKE VBKD-BSTKD,
    WERKS LIKE VBAP-WERKS,
    MEINS LIKE MARA-MEINS,
    KWMENG LIKE VBAP-KWMENG,
    KLMENG LIKE VBAP-KLMENG,
    END OF ITSO.
    Heading of the report.
    data: t_heading type slis_t_listheader.
    ***********PARAMETERS***************
    PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
    *********SELECTION SCREEN OPTIONS*********
    SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
    SO_PARTY FOR VBAK-KUNNR,
    IT_M FOR MARA-MATNR,
    DIV FOR VBAK-SPART,
    SO_DATE FOR VBAK-ERDAT,
    S_DATE FOR VBEP-EDATU. .
    START-OF-SELECTION.
    SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR BSPART BMATNR B~POSNR
    BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG
    DEDATU DVBELN
    FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN
    INNER JOIN MARA AS C ON CMATNR = BMATNR
    INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR =
    B~POSNR
    INTO CORRESPONDING FIELDS OF TABLE ITSO
    WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND B~SPART IN DIV AND
    AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND BWERKS
    = PLANT.
    IF SY-SUBRC <> 0.
    MESSAGE E899(M3) WITH 'No records'.
    ENDIF.
    perform f_build_eventcat.
    PERFORM LAYOUT.
    END-OF-SELECTION.
    FORM LAYOUT.
    PERFORM FCAT USING 'VBELN' 'ITSO' '' 'S.O.NO. ' 'VBELN' 'VBAK' ''.
    PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
    PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
    PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.
    PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
    PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.
    PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' ''.
    REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = F1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
       IT_EVENTS                         = GT_EVENTS[]
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_ADD_FIELDCAT                   =
      IT_HYPERLINK                      =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
      IT_EXCEPT_QINFO                   =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = ITSO
    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.
    Top of page heading
    perform set_top_page_heading using t_heading t_event.
    Events
    perform set_events using t_event.
    GUI Status
    w_status = ''.
    w_repid = sy-repid.
    Title
    w_title = <<If you want to set a title for
    the ALV, please, uncomment and edit this line>>.
    User commands
    w_comm = 'USER_COMMAND'.
    ENDFORM. " LAYOUT
    *& Form FCAT
    FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
    ADD 1 TO POS.
    F2-COL_POS = POS.
    F2-FIELDNAME = P_FIELD.
    F2-TABNAME = P_TABLE.
    F2-SELTEXT_L = P_TEXT.
    F2-REF_FIELDNAME = P_RFIELD.
    F2-REF_TABNAME = P_RTABLE.
    F2-DO_SUM = P_SUM.
    F2-NO_OUT = P_DISP.
    APPEND F2 TO F1.
    CLEAR F2.
    ENDFORM. " FCAT
    FORM F_BUILD_EVENTCAT .
    CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
    CLEAR: FS_EVENTCAT.
    FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
    FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
    APPEND FS_EVENTCAT TO GT_EVENTS.
    CLEAR: FS_EVENTCAT.
    FS_EVENTCAT-NAME = 'END_OF_LIST'.
    FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
    APPEND FS_EVENTCAT TO GT_EVENTS.
    ENDFORM. " F_BUILD_EVENTCAT
    *& Form F_WRITE_SUMMARY
    Write summary before exit
    FORM F_WRITE_SUMMARY .
    write:/ 'Welcome to XYZ Limited'.
    write:/ 'This is a test program to display Report in ALV Format'.
    ENDFORM.
    Thanks
    Seshu

  • Urgent: dates calculation in alv

    hi,
    i am making ALV report in alv in whihc i ahve to dispaly the difference between two days i.e. DIFFERRENCE = 7 DAYS.
    CAN anybody provide me the example of it as it is urgent for me.
    points will be definately rewarded for correct awnser.

    use function module
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type  P0001-BEGDA,
           DATE2 type  P0001-BEGDA,
          YEARS type  P0347-SCRYY,
          MONTHS type  P0347-SCRMM,
          DAYS type  P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
      EXPORTING
        DATE1                         = date1
        DATE2                         = date2
       OUTPUT_FORMAT                 = '03'
    IMPORTING
       YEARS                         = years
       MONTHS                        = months
       DAYS                          = days
    EXCEPTIONS
      INVALID_DATES_SPECIFIED       = 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.
    write : days.
    regards,
    sandeep Kaushik

  • Making spool, convert it into PDF and send that PDf throgh EMAIl

    Hi,
    In my making ALV report. In that i want to make the spool  and then convert it into the pdf and send mail to the recepient.
    Atul

    Hi,
    please try the following code. It works for me.
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    DATA : path LIKE pcfile-path.
    DATA : extension(5) TYPE c.
    DATA : name(100) TYPE c.
    DATA:receiver TYPE somlreci1-receiver  ,
         p_file   LIKE rlgrap-filename.
    declarations for PDF convertion
    DATA:  path1       TYPE string ,
           fullpath    TYPE string.
    DATA :textlines LIKE tline OCCURS 100 WITH HEADER LINE.
    DATA otf LIKE itcoo OCCURS 1000 WITH HEADER LINE.
    DATA it_lines LIKE tline OCCURS 100 WITH HEADER LINE.
    DATA options LIKE itcpo.
    DATA header LIKE thead.
    DATA result     LIKE     itcpp.
    DATA: bin_filesize TYPE i.
        fullpath type string.
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    DATA: filesize TYPE i,
          convcount TYPE i,
          cancel(1).
    textlines-tdformat = '*'.
    textlines-tdline    = 'Hello Hao'.
    APPEND textlines.
    options-tdgetotf = 'X'.
    options-tdnoprev = 'X'.
    CALL FUNCTION 'PRINT_TEXT'
      EXPORTING
      APPLICATION                    = 'TX'
      ARCHIVE_INDEX                  = ' '
      ARCHIVE_PARAMS                 = ' '
      DEVICE                         = 'PRINTER'
       dialog                         = ' '
        header                         = header
       OPTIONS                        = options
    IMPORTING
      NEW_ARCHIVE_PARAMS             =
       RESULT                         = RESULT
      tables
        lines                          =  textlines
       otfdata                        = otf
    EXCEPTIONS
      CANCELED                       = 1
      DEVICE                         = 2
      FORM                           = 3
      OPTIONS                        = 4
      UNCLOSED                       = 5
      UNKNOWN                        = 6
      FORMAT                         = 7
      TEXTFORMAT                     = 8
      COMMUNICATION                  = 9
      BAD_PAGEFORMAT_FOR_PRINT       = 10
      OTHERS                         = 11
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
              format            = 'PDF'
         IMPORTING
              bin_filesize      = filesize
         TABLES
              otf               = otf
              lines             = it_lines
         EXCEPTIONS
              err_conv_not_possible = 1
              err_bad_otf           = 2.
    fullpath = 'C:/foldername/test.pdf'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        bin_filesize                  = bin_filesize
        filename                      = fullpath
        filetype                      = 'BIN'
      APPEND                        = ' '
      CODEPAGE                      = ' '
      NO_BYTEORDER_MARK             = ' '
    IMPORTING
       FILELENGTH                    = c
      TABLES
        data_tab                      = it_lines
      FORMAT_TAB                    =
      EXCEPTIONS
        file_write_error              = 1
        no_batch                      = 2
        gui_refuse_filetransfer       = 3
        invalid_type                  = 4
        no_authority                  = 5
        unknown_error                 = 6.
    *filename = fullpath.
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = 'Tst'.
    docdata-obj_descr = 'Testing'.
    reclist-receiver = give the mail id.
    reclist-rec_type = 'U'.
    APPEND reclist.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = fullpath
          filetype                = 'BIN'
        TABLES
          data_tab                = itab
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      path = fullpath.
      CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
      EXPORTING
      complete_filename = path
    CHECK_DOS_FORMAT =
      IMPORTING
    DRIVE =
      extension = extension
      name = name
    NAME_WITH_EXT =
    PATH =
      EXCEPTIONS
      invalid_drive = 1
      invalid_extension = 2
      invalid_name = 3
      invalid_path = 4
      OTHERS = 5
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT itab.
    pos = 255 - len.
    IF pos > 134.                         "length of pdf_table
    pos = 134.
    ENDIF.
    objbin+len = itab(pos).
    len = len + pos.
    IF len = 255.                         "length of out (contents_bin)
    APPEND objbin.
    CLEAR: objbin, len.
    IF pos < 134.
    objbin = itab+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND objbin.
    ENDIF.
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    name = extension.
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = name.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = name.
    APPEND objpack.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    receivers = reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8
    IF sy-subrc <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    Keerthi

  • ALV in ECC 6.0

    Hi Guys..
    I am working on ALV in ECC 6.0. I have given top of page and also using Reuse_alv_commentary_write for logo..I am also giving background wallpaper for header in I_background_id parameter in Grid_display. But only logo is displaying and not the background..Please anyone help me to sortout this problem..
    Thanks..

    IN ALV grid, Logo and BOLD letters are only for display, when try to print the list, system is making ALV List of that. And in ALV List we can not print BOLD fonts or LOGO.
    IT CAN'T PRINT A LOGO.
    You can print a LOGO only in a sapscript and smartform, not in a ABAP LIST.
    The ALV Grid print an abap list.
    for the process look at this :
    Use transaction code OAER to upload your company logo.
    For class name, enter in PICTURES
    For class type, enter in OT
    For object key, enter in name for the object, for instances Z_YOUR_COMPANY_LOGO(obviously using your company name).
    Click execute.
    On the next screen, expand the standard doc types tree and double click on the Screen item.
    Pick your company logo file from your local drive and upload.
    Now use what every name you gave the logo when calling the function module.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    i_logo = 'Z_YOUR_COMPANY_LOGO'
    it_list_commentary = GT_LIST_TOP_OF_PAGE.

  • ALV fields coem dynamicaly in header

    Hi all,
    I desperately need your help in making ALV report.
    TYPE-POOLS: SLIS.
    DATA: ls_fcat TYPE slis_fieldcat_alv,
          ls_layout   TYPE SLIS_LAYOUT_ALV,
          gt_fcat TYPE slis_t_fieldcat_alv.
    data :    gt_fieldcat type slis_t_fieldcat_alv, "catalog for alv
                gt_heading type slis_t_listheader, "list for header1
                gt_sort type slis_t_sortinfo_alv, "Sorting of the
                gt_event type slis_t_event,
                gt_selfield type slis_selfield,
                gv_alv_event type slis_alv_event,
                gv_repname type sy-repid,
                gs_layout type slis_layout_alv,
                gv_save type c.
    constants gc_forname_top_of_page type slis_formname value
    'TOP-OF-PAGE'.
    REFRESH gt_fcat.
    TABLES: vbrk.
    data: begin of it_vbrk occurs 10,
          vbeln type vbeln,
          end of it_vbrk.
    data: begin of it_vbrp occurs 10,
          vbeln type vbeln,
          ntgew type vbrp-ntgew,
          matnr type vbrp-matnr,
          end of it_vbrp.
    data: begin of it_final occurs 10,
          vbeln type vbeln,
          ntgew type vbrp-ntgew,
          matnr type vbrp-matnr,
          end of it_final.
    SELECT-OPTIONS: PERIOD for VBRK-FKDAT  no-extension.
      SELECT VBELN
             FROM VBRK INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
             WHERE FKDAT IN PERIOD.
    SELECT  VBELN
              NTGEW  "Net weight
              MATNR
              FROM VBRP INTO CORRESPONDING FIELDS OF TABLE IT_VBRP
              FOR ALL ENTRIES IN IT_vbrk
              WHERE VBELN = IT_vbrk-VBELN.
    loop at it_vbrp.
    move it_vbrp-vbeln   to   it_final-vbeln  .
    move it_vbrp-matnr   to   it_final-matnr  .
    move it_vbrp-ntgew   to   it_final-ntgew  .
    append it_final.
    endloop.
    ls_fcat-col_pos   = 1.
    ls_fcat-fieldname = 'VBELN'.
    ls_fcat-seltext_l = 'VBELN'.
    ls_fcat-outputlen = 10 .
    APPEND ls_fcat TO gt_fcat.
    DATA: G_REPID TYPE SY-REPID.
    g_repid = sy-repid.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program       = g_repid
            I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
            i_callback_top_of_page   = 'TOP_OF_PAGE'
            IS_LAYOUT                = ls_LAYOUT
            it_fieldcat              = gt_fcat
            I_SAVE                   = 'X'
          TABLES
            t_outtab                 = IT_FINAL.
    My problem is that i want material number in col_pos 2, 3,4... and so on..
    and corresponding weight of that material number comes under that matnr.
    Waiting for ur reply.
    Thanx a ton,
    Puneet

    Try this
    TYPE-POOLS: SLIS.
    DATA: LS_FCAT TYPE SLIS_FIELDCAT_ALV,
    LS_LAYOUT TYPE SLIS_LAYOUT_ALV,
    GT_FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "catalog for alv
    GT_HEADING TYPE SLIS_T_LISTHEADER, "list for header1
    GT_SORT TYPE SLIS_T_SORTINFO_ALV, "Sorting of the
    GT_EVENT TYPE SLIS_T_EVENT,
    GT_SELFIELD TYPE SLIS_SELFIELD,
    GV_ALV_EVENT TYPE SLIS_ALV_EVENT,
    GV_REPNAME TYPE SY-REPID,
    GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
    GV_SAVE TYPE C.
    CONSTANTS GC_FORNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
    'TOP-OF-PAGE'.
    REFRESH GT_FCAT.
    TABLES: VBRK.
    DATA: BEGIN OF IT_VBRK OCCURS 10,
    VBELN TYPE VBELN,
    END OF IT_VBRK.
    DATA: BEGIN OF IT_VBRP OCCURS 10,
    VBELN TYPE VBELN,
    NTGEW TYPE VBRP-NTGEW,
    MATNR TYPE VBRP-MATNR,
    END OF IT_VBRP.
    DATA: BEGIN OF IT_FINAL OCCURS 10,
    VBELN TYPE VBELN,
    NTGEW TYPE VBRP-NTGEW,
    MATNR TYPE VBRP-MATNR,
    END OF IT_FINAL.
    SELECT-OPTIONS: PERIOD FOR VBRK-FKDAT NO-EXTENSION.
    SELECT VBELN
    FROM VBRK INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
    WHERE FKDAT IN PERIOD.
    SELECT VBELN
    NTGEW "Net weight
    MATNR
    FROM VBRP INTO CORRESPONDING FIELDS OF TABLE IT_VBRP
    FOR ALL ENTRIES IN IT_VBRK
    WHERE VBELN = IT_VBRK-VBELN.
    LOOP AT IT_VBRP.
      MOVE IT_VBRP-VBELN TO IT_FINAL-VBELN .
      MOVE IT_VBRP-MATNR TO IT_FINAL-MATNR .
      MOVE IT_VBRP-NTGEW TO IT_FINAL-NTGEW .
      APPEND IT_FINAL.
    ENDLOOP.
    LS_FCAT-COL_POS = 1.
    LS_FCAT-FIELDNAME = 'VBELN'.
    LS_FCAT-SELTEXT_L = 'Billing Document'.
    LS_FCAT-OUTPUTLEN = 10 .
    APPEND LS_FCAT TO GT_FCAT.
    LS_FCAT-COL_POS = 2.
    LS_FCAT-FIELDNAME = 'MATNR'.
    LS_FCAT-SELTEXT_L = 'Material No.'.
    LS_FCAT-OUTPUTLEN = 10 .
    APPEND LS_FCAT TO GT_FCAT.
    LS_FCAT-COL_POS = 3.
    LS_FCAT-FIELDNAME = 'NTGEW'.
    LS_FCAT-SELTEXT_L = 'Weight'.
    LS_FCAT-OUTPUTLEN = 10 .
    APPEND LS_FCAT TO GT_FCAT.
    DATA: G_REPID TYPE SY-REPID.
          G_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = G_REPID
        I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
        I_CALLBACK_TOP_OF_PAGE   = 'TOP_OF_PAGE'
        IS_LAYOUT                = LS_LAYOUT
        IT_FIELDCAT              = GT_FCAT
        I_SAVE                   = 'X'
      TABLES
        T_OUTTAB                 = IT_FINAL.

  • ALV tree without using abap objects---------urgent

    hi
    can anybody send  me code for making alv tree without using ABAP objects.
    thanks in advance
    Aditya

    HI
    goto this link
    you will get all ALV TREE programs
    follow that code you can understand very easily
    http://www.sapdev.co.uk/reporting/alv/alvtree.htm
    <b>Reward if usefull</b>

  • ALV from Display to Change Mode

    Hello,
             I created an application that starts with a selection screen and then the user selects either a Create/Change/Display. Then a call screen is done in which i added an ALV with some editable fields.
    The point is that when the user first selects 'Display' the ALV is all in the display mode. If he makes a BACK then goes to 'Change' the ALV is still displayed in the output mode. and vice-versa.
    Is there a reason for this??
    Please help

    hi emym,
    try this it may be helpful
    Making ALV Grid Editable
    ->To make a column editable, it will be sufficient to set the field “EDIT” in the field catalog. The ALV Grid perceives if there are some editable fields and adds buttons for editing purposes. If you do not need these new buttons, you know how to exclude them.
    ->To make individual cells editable, we will utilize the table we used for making a cell a pushbutton. As you remember, it was of type “LVC_T_STYL”. If you have not added this inner table, add it now. For this procedure; add the name of the field to the field “FIELDNAME”, and pass “cl_gui_alv_grid=>mc_style_enabled” to make a field editable and “cl_gui_alv_grid=>mc_style_disabled” to make a field non-editable, to the field “STYLE”. You can use the one with “disable” when you make an entire column editable and want just a few of cells along it non-editable.
    ps_layout-stylefname = ‘CELLSTYLES’ .
    If we want our column “SEATSMAX” entirely editable except the case “CARRID” is ‘XY’ which is a rare case and we want our cells along the column ‘PLANETYPE’ editable if their respective ‘CONNID’ fields contain the value ‘02’.
    Assume we have added our style table (“CELLSTYLES”) to our list data table and tell the layout structure about it and we adjust the field catalog so that the column “SEATSMAX” has the property “EDIT” set to ‘X’.
    refer this:
    FORM adjust_editables USING pt_list LIKE gt_list[] .
    DATA ls_listrow LIKE LINE OF pt_list .
    DATA ls_stylerow TYPE lvc_s_styl .
    DATA lt_styletab TYPE lvc_t_styl .
    LOOP AT pt_list INTO ls_listrow .
    IF ls_listrow-carrid = 'XY' .
    ls_stylerow-fieldname = 'SEATSMAX' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled .
    APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    IF ls_listrow-connid = '02' .
    ls_stylerow-fieldname = 'PLANETYPE' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled .
    APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles .
    MODIFY pt_list FROM ls_listrow .
    ENDLOOP .
    ENDFORM
    Conditionally setting fields to be editable or non-editable
    ->As usual, cell based settings override entire column settings. You can dynamically switch between cases in any proper part of your execution. Just fill your inner table as required and refresh table display; for entire column settings, set or unset the property “EDIT” of the field catalog for the column and reset the field catalog using “set_frontend_fieldcatalog”.
    ->As the last condition to be met for editability, you must call the method “set_ready_for_input” passing ‘1’ to the parameter “i_ready_for_input”.
    Using this method you can switch between editable and non-editable mode. As you guess, passing ‘0’ to the parameter while calling the method, switches to non-editable mode.
    rewrad if helpful
    regards,
    sravanthi

  • How to get ALV Display with First column alone in sort

    How to get ALV Display with First column alone in sort

    HI,
    You can build Internal Table and send this to the parameter "IT_SORT".
    eg:
    "the sorting Internal Table structure is as whown below.
    DATA:  t_sort_info type slis_t_sortinfo_alv.
    "Build the Sort Internal Table
      t_sort_info-fieldname = 'CARRID'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
      t_sort_info-fieldname = 'FLDATE'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
    Then pass this "IT_SORT_INFO" table to the Function module "Reuse_alv_*". (Note send the body of the Internal table only like "<b>IT_SORT = IT_SORT_INFO[]</b>".
    Here i am making ALV output sorted on CARRID & FLDATE.
    You can specify only the First Column name for sorting.
    Regards,
    Manju
    Message was edited by:
            MANJUNATHA KS

  • Validation of column fields while entering values in editable ALV

    Hi,
    I am currently working on a ALV,I have to validate the editable field of ALV,while entering values.SO if there is a field Item number,the range should be between M01-M99,and user should not take any value other than the F4 help assigned to the field.Can all this calculation be done using a FM & Not OOPs process for making ALV.
    Please advice.
    Thanks.

    >
    p317980 wrote:
    > REF_TABNAME    LIKE DD03P-TABNAME,
    > Will the field just pick values from the F4 & not any random value entered by user?
    >>yes.
    > if these values entered at runtime need to be saved into a Ztable,will I have to use Classes for defining my ALV?
    >>write some code to check if the entry exists.. if not then update the Ztable..
    >>select single field from table. if sy-subrc eq 0. fine else. update ztable.if.

  • Handle "Enter" inside Custom Container

    Hi all,
    I am having 4 to 5 fields in my module pool screen and at the same time i am having a custom container wherein, there is editable ALV.
    Here in editable ALV, i am having an editable field called dealer code.When i enter dealer code in editable ALV and press enter
    my dealer name and dealer address in editable ALV [inside Custom Container] should get populated.
    But when the cursor is inside the custom container [in that editable field] none of my screen events[Module pool events]
    are getting triggered [Hence my values are not getting populated.When the cursor is outside the custom container all my module pool events are working fine, hence values are getting populated....
    Is there anyway to handle this???
    I am using OOPS Editable ALV inside a custom container...
    Waiting for your repiles...

    Hello,
    You have to implement events in order to handle your ALV, take a llok to this PDF:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Take a look on section EVENT BASED ADDITIONAL FUNCTIONALITIES->Making ALV Grid Editable
    Bye!!
    Gabriel P-

  • ALV Colours when making a column editable

    Why do the colours of the entire table change when I make a column editable and how do I change them back to how they were?!

    Hi Ian
    The control itself adjusts the colors if you do not set them explicitly. You can get information on making all those adjustments on the ALV  Grid control from relevant sections of the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    *--Serdar

Maybe you are looking for

  • ACH payment reversals

    Hi Gurus I've the following scenario and I hope someone throws some light on how to handle this scenario. There is a vendor payment which is processed as an ACH payment. Next day, we get the EBS and it clears the banking documents. Now, couple of day

  • Formatting metrics in a pivot table differently based on a unit of measure

    I have a generic metrics table with columns for METRIC NAME, UNIT OF MEASURE, ACTUAL VALUE, BUDGETED VALUE, and PRIOR YEAR VALUE. Each metric has a unit of measure associated to it, and I need to be able to format these metrics differently in the sam

  • Can't make - suddenly - shortcuts anymore. How come?

    I had to reset my pc '(Windows 8.1) after having had the message that entroy pints couldn't be found. Since then it's impossible to make shortcuts in Firefox. After having made a shortcut and put it on the desk, it's the start page (google.be) that a

  • Zen Xtra 60 gig problem, help requi

    hello i have a nomad juxebox zen xtra 60 gig, and it has worked fine for several months. recently, i had a problem that when i was listening to a track, parts of other tracks would interrupt the song, before switching back to the original song. this

  • Every time I open Firefox, It rolls back to 3.0.6.

    It doesn't matter if i just updated to the newest version the last time i used Firefox, the next time i use it, it tells me that my plugins are not compatible & that I should "update to the latest & greatest version." Have you ever heard of this prob