Skip to Content
author's profile photo Former Member
Former Member

Editable Column of ALV Grid, Without Using The Field Symbols

Hi Friends,

In coding i have make use of the Static Internal Table and not making use of the Field Symbols, As i had to Develop a ALV LIst which is having a Column ( Comment ) editable. Ii develop the same with making use of Field Symbol as well as Static Internal Table, so want to share with u all...

The Coding As Follows

PERFORM build_fieldcatalog  USING:
      '1' 'VBELN' 'LIKP' text-b01 'X' '',
      '2' 'LFDAT' 'LIKP' text-b02 '' '',
      '3' 'WADAT_IST' 'LIKP' text-b03 '' '',
      '4' 'VKORG' 'LIKP' text-b04 '' '',
      '5' 'KUNNR' 'LIKP' text-b06 '' '',
      '6' 'KUNAG' 'LIKP' text-b07 '' '',
      '7' 'COMMENT1' 'zsd_delivery_not' text-b08 '' 'X' .
FORM build_fieldcatalog  USING    col_pos TYPE i
                                 fieldname TYPE c
                                 tabname TYPE c
                                 seltext_l TYPE c
                                 key TYPE c
                                 edit TYPE c.
  wa_fc1-col_pos       = col_pos.
  wa_fc1-fieldname     = fieldname .
  wa_fc1-tabname       = tabname.
  wa_fc1-seltext_m     = seltext_l.
  wa_fc1-key           = key.
  wa_fc1-edit          = edit.

  APPEND wa_fc1 TO it_fieldcat.   "Appending each column to
  "table
  "it_fldcat_basic for basic list
  CLEAR wa_fc1.

ENDFORM.  

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'SET_PF_STATUS'
      i_callback_user_command  = 'USER_COMMAND'
*      i_structure_name         = c_table
      it_fieldcat              = it_fieldcat[]
    TABLES
      t_outtab                 = it_basic
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.

  IF sy-subrc = 0.


     ENDIF.

FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
    WHEN 'CNG'.
        gv_ucomm = 'CNG'.
        gv_select = rs_selfield.
      CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
        EXPORTING
          functioncode           = '&REFRESH'
        EXCEPTIONS
          function_not_supported = 1
          OTHERS                 = 2.
      IF sy-subrc NE 0.
        MESSAGE 'Refersh Not performed' TYPE 'S'.
        STOP.
      ENDIF.
      READ TABLE it_basic INTO wa_basic INDEX
    rs_selfield-tabindex .
************************************************************************
*  locking the customize table(zsd_delivery_not)
************************************************************************
      CALL FUNCTION 'ENQUEUE_E_TABLE'
        EXPORTING
          mode_rstable   = 'E'
          tabname        = c_table
        EXCEPTIONS
          foreign_lock   = 1
          system_failure = 2
          OTHERS         = 3.
      IF sy-subrc = 0.
        "populating the zsd_delivery_not from workarea <dyn_ztable_wa>

        MODIFY zsd_delivery_not FROM TABLE it_basic.
        IF sy-subrc EQ 0.
          MESSAGE 'DataBase Updated' TYPE 'S'.
        ELSE.
          MESSAGE 'DataBase Updatation Fail' TYPE 'E'.
        ENDIF.
      ENDIF.


************************************************************************
*  release the lock from the customize table
************************************************************************
      CALL FUNCTION 'DEQUEUE_E_TABLE'
        EXPORTING
          mode_rstable = 'E'
          tabname      = c_table.

Edited by: RameezSheikh-LnT on Jul 11, 2011 12:26 PM

Moderator Message: Please post the relevant portions of you code only! If possible try to elaborate the business/technical requirement you're trying to achieve.

Edited by: Suhas Saha on Jul 11, 2011 3:57 PM

Edited by: RameezSheikh-LnT on Jul 11, 2011 2:00 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jul 11, 2011 at 12:44 PM

    Hi, Is this a question or you want to share some information with community ? If the purpose is sharing of information, go through the link [How to Contrinbute|ABAP Frequently Asked Questions].

    Regards, Vinod

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2011 at 01:04 PM

    Marvelous...from the stone age of ALV (function modules), and not a field symbol in sight...don't understand your post.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi DaveL,

      I just want to share coding with others, so the post will help them . when i am searching for the "Edittable Alv", every where "Editable Alv" is Achieve by making use of "Field Symbols" and i Didn't want to make use of "Field Symbol". Is Something worng with the coding?

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2014 at 04:53 AM

    hi rameez...

    Thnax a lot for this information...it helped me a lot....!!!!!!!!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.