How to make ALV editable?

Hi all,
i wonder if there is a way to make cells of the new ALV CL_SALV_TABLE editable. I know that there is a way for the older version CL_GUI_ALV_GRID as you can see in SAP Demos BCALV_EDIT_*.
Do i have to use the older one for editing fields or is there a way to achieve that with CL_SALV_TABLE ?
Regards
Mark-André

Hi Mark,
          if you are using cl_gui_alv_grid class you can make fields of the grid editable by setting field catalog of structure type lvc_s_fcat field edit as 'X'.
Regards
Naveen

Similar Messages

  • How to make field editable in ALV tree in OOPs?

    Hi Gems,
    Again I need help from you all.
    I am writing a program using OOPs and the uotput will be in ALV tree. I need to make a field editable in a perticular row.
    I am doing it using layout but the program is giving error during
    CALL METHOD CL_GUI_CFW=>FLUSH
          EXCEPTIONS
            CNTL_SYSTEM_ERROR = 1
            CNTL_ERROR        = 2.
    This method is returning sy-subrc = 2 and I am unable to get the output.
    I am using below code to make the field editable:
    DATA: LT_LAYOUT_ITEM TYPE LVC_T_LAYI,
                LS_LAYOUT_ITEM TYPE LVC_S_LAYI.
      LS_LAYOUT_ITEM-FIELDNAME = 'ACPCKTWRT'.     "ACPCKTWRT is the field name in the Internal table
      LS_LAYOUT_ITEM-EDITABLE = 'X'.
      APPEND LS_LAYOUT_ITEM TO LT_LAYOUT_ITEM.
    CALL METHOD G_ALV_TREE->ADD_NODE
        EXPORTING
          I_RELAT_NODE_KEY     = FP_RELAT_KEY
          I_RELATIONSHIP       = CL_GUI_COLUMN_TREE=>RELAT_LAST_CHILD
          IS_OUTTAB_LINE       = LS_TMP_FINFCNO                                                "structure of the internal table
         IS_NODE_LAYOUT       =
          IT_ITEM_LAYOUT       = LT_LAYOUT_ITEM                                                "Added layout to make the field editable
          I_NODE_TEXT          = LV_NODE_TEXT                                                      "Node text
        IMPORTING
          E_NEW_NODE_KEY       = FP_NODE_KEY
        EXCEPTIONS
          RELAT_NODE_NOT_FOUND = 1
          NODE_NOT_FOUND       = 2
          OTHERS               = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Please help me and let me know how to get the solution.

    Hello
    The ALV tree control is not intended for making values editable (e.g. see
    [How to make ALV tree columns editable|http://sap.ittoolbox.com/groups/technical-functional/sap-abap/how-to-make-alv-tree-columns-editable-2052414])
    However, if you need an editable tree control then you have to use a different class (e.g. CL_ITEM_TREE_MODEL or CL_COLUMN_TREE_MODEL) but you will not have the ALV functionality of the ALV tree control.
    Regards
      Uwe

  • How to make cell editable alv in WebDynpro for ABAP?

    I make Column editable ALV.(See under source code)
    But I can't make Cell editable ALV.
    How to make Cell editable ALV in WebDynpro for ABAP?
    and..how to get changed data?
    DATA: l_value TYPE REF TO cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model( ).
    * { EDITABLE
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_input_field     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_column          TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'TOTAL_COUNT' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'TOTAL_COUNT'.
      lr_column->set_cell_editor( lr_input_field ).
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= l_value.
      lr_table_settings->set_read_only( abap_false ).

    the code seems to be correct....but where are you writing it?
    put the code in the wddoinit method and it should work.
    have a look at this article..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1

  • How to make ALV output Colorless

    Hi All,
    How to make ALV output Colorless at all....
    I have Sum field which after all the rows it iwll do sum and it is showing in ALV .it is showing in Yellow color. Client dont want that.
    Currently I am using ALV_LIST_DISPLAY Fm to see this report output via Mss.
    So the client want a plane paper color which 2 things are strukcing me up.
    1) How to make Sum row(Final Sum up row) as colorless
    2) How to make header as colorless.(Header column like emp no , emp name ,e.t.c)
    Regards
    sas
    Can any body any Idea is this possible or not..
    Edited by: saslove sap on Apr 13, 2011 11:26 AM

    Hi sap.,
    I don't think decolor header is possible.,  but u can show totals color less by calculating manually.,
    as., in field catalog  donot use do_sum = 'X'.  so it will not calculate totals and yellow color will not appear., now u calculate total and append at last row., 
    ex: loop at itab into wa.
    wa_alv-f1  = wa-f1.
    wa_alv-f2 = wa-f2.
    temp_total = temp_total + wa-f2.
    append wa_alv to itab_alv.
    endloop.
    wa_alv-f1 = 'Total'.
    wa_alv-f2 = temp_total.
    append wa_alv to itab_alv.
    now itab_alv contains all records along with total..
    hope this helps u.,
    reply if u need some more clarifications.,
    Thanks & Regards
    Kiran

  • How to make subforms editable in ADOBE forms

    Hello All,
       The 'Pagination' for few of the subforms are editable, and for few of the subforms are not editable.
    Actaully i have to set the 'overflow' for one subform, but the whole pagination is dispaly mode.
    (i can edit pagination for other subforms).
    can someone help how to make it editable.
    Thanks in advance
    Best Regards,
    Amarender Reddy B

    Hello Amar,
    Can please explain the problem you are facing with more clearer words. I am unable to make out any thing from this post.
    You might have some problem with Pages. We have two type of pages body and master. If a perticular subform is there in master page you can not edit it on the body page.
    Regards,
    Vikash

  • How to make separately editable blocks in one widget?

    How to make separately editable blocks (Width, Height, BGColor,...) in one widget?

    There's an example widget for a 5x5 table which allows you set the color of different areas differently.
    Download the sample files at the bottom of the MUCOW documentation page:
    MuCow Documentation
    The sample named 'Table5x5.mucow' sets different parts of the widgets to different colors.

  • How to make field editable in Tcode WPED

    Hi,
    Its about upgrade of IS Retail from ECC5.0 to ECC6.0.
    For Inbound IDOCS coming from POS to SAP System, IDOCs which are in unprocessed category in WPER Tcode.
    Now problem is in Tcode WPED there is a transaction date field which is now non editable in ECC6.0
    I want to make it modifiable.
    Earlier in ECC5.0 It was editable.
    So how to make that field modifiable.
    Regards,
    Divya

    Thanks Chenna
    But that field is sometimes coming editable and sometimes not.....may be it depends on some condition.....but I want to make it editable always whenever an Inbound IDOC is in "To be processed" status in WPER tcode.
    Iam going in that screen where field is coming uneditable is:
    Tcode WPER -
    > Inbound IDOC processing---> to be processed idocs---> double clicking on Idoc Number (comes on WPED screen with non-editable fields in overview table).
    If I'm double clicking on that transaction date field it goes to the screen whcih shows Sales Audit Editor: Item list of aggregate sales.
    Suggest me how to make it editable.
    bye
    Divya

  • How to make lookup editable

    Hi All,
    In my instance MTL_RELATIONSHIP_TYPES lookup is disabled for editing , how to make it editable?
    Any profile options?
    Please help
    Thanks,

    Verify you are not in read only responsiblity.

  • How to make fields editable in an alv tree

    hi
    there is an alv grid for which tree view shud also be made. The cells that are editable in the grid should also be editable in the tree.
    please let me know how to make the specific cells of the tree editable

    after setting the edit field in the field catalogue its bot working.
    i am posting the code snippet.
    please let me know what else should be done and how to add  INPUT field to the fieldcat.
      field-symbols: <fs_fieldcat> type lvc_s_fcat.
      data: l_tabix type sy-tabix.
      data: g_fieldcatalog type lvc_t_fcat,
            wa_fcat like line of g_fieldcatalog.
      data : hide type c value 'X'.
      call function 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'RSTHIE_M'
          i_client_never_display = 'X'
          i_bypassing_buffer     = 'X'
        CHANGING
          ct_fieldcat            = g_fieldcatalog.
    ***-set table header on middle width
      LOOP AT g_fieldcatalog ASSIGNING <fs_fieldcat>.
        <fs_fieldcat>-FIX_COLUMN = 'X'.
        <fs_fieldcat>-edit = 'X'.
      ENDLOOP.

  • How to make the editable col. in alv grid scrollable?

    friends,
        i have made the last col. in my alv grid editable..even though i have declared it as char of length 255, it's showing only 50 characters in the grid..but when i try to type beyond 50 characters, it's not allowing...how to make it scrollable so that it extends beyond 50 char. and capture all the characters typed in that col.? pl suggest..thanks all..
    Sathish. R

    Hi, u can extend the length of your last field.
    LOOP AT t_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN text-001.
            ls_fcat-outputlen = c_10.                    "10
          WHEN text-002.
            ls_fcat-outputlen = c_20.                    "20
          WHEN text-003.                                  "your lastfield
            ls_fcat-outputlen = c_255.                  "255
                "do nothing
        ENDCASE.
    *fixed column
        ls_fcat-fix_column = c_x.
    *changes to take effect
        MODIFY t_fieldcat FROM ls_fcat.
        IF sy-subrc = 0.
          "do nothing
        ENDIF.
        CLEAR ls_fcat.
      ENDLOOP.

  • How to make Rows editable in ALV

    Hello,
    I show some Records in my ALV and Column PersonalNumber is noneditable.
    and I have created Append Row Button. If I click on this Button, then new added PersonalNumber should
    be editable and old PersonalNumbers should be noneditable. How can we realize that?
    otherwise; How can we make some editable and some noneditable in ALV?
    Thanks!
    with my Best Regards
    Beserithan Malabakan

    Hi,
    Try this code for Editable ALV.
    DATA: LR_COLUMN_SETTINGS TYPE REF TO IF_SALV_WD_COLUMN_SETTINGS,
           LR_INPUT_FIELD TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD.
      LR_COLUMN_SETTINGS ?= L_VALUE.
      LR_COLUMN = LR_COLUMN_SETTINGS->GET_COLUMN( 'Your Field' ).
      CREATE OBJECT LR_INPUT_FIELD EXPORTING VALUE_FIELDNAME = 'Your Field'.
      LR_COLUMN->SET_CELL_EDITOR( LR_INPUT_FIELD ).
    If any doubts let me know.
    Thanks.
    Edited by: Viji on Feb 28, 2008 12:14 PM

  • How to make column editable in Normal ALV report

    Hi experts,
                       I Have one push button In ALV tool bar like Fields to be change..when i click this..i need to get one pop up with all fields which is having in Filedcatalog..so i need to doule click on any field which i want to be midified..then in ALV that particular entire  column should be editable.Can anybody please help me what is procedure to get pop up with fields..
    Thanks & regards,
    Veena..

    here is the required code
    type-pools: slis.
    types: BEGIN OF TY_MKPF,
            MBLNR TYPE MKPF-MBLNR,
            MJAHR TYPE MKPF-MJAHR,
            VGART TYPE MKPF-VGART,
            BLART TYPE MKPF-BLART,
            BLAUM TYPE MKPF-BLAUM,
          END OF TY_MKPF.
    TYPES:         BEGIN OF TY_WA, "STRUCTURE FOR POP UP ALV
                   CHECK TYPE C,
                   FIELDNAME TYPE DFIES-FIELDNAME,
                   FIELDTEXT TYPE DFIES-FIELDTEXT,
    END OF TY_WA.
    data: lt_mkpf type table of ty_mkpf,
          ls_mkpf type mkpf,
          IT TYPE TABLE OF TY_WA,  "INTERNAL TABLE FOR POP UP ALV
          WA TYPE TY_WA,           "WA FOR POP UP ALV
          IT_FCATP TYPE SLIS_T_FIELDCAT_ALV, "FCAT FOR POP UP ALV
          WA_FCATP LIKE LINE OF IT_FCATP, "WA FOR POP UP ALV
          ok_code type sy-ucomm,
          lt_fcat type lvc_t_fcat,
          ls_fcat type lvc_s_fcat.
    data: o_alv type ref to cl_gui_alv_grid,
          o_doc type ref to cl_gui_docking_container.
    start-of-selection.
    select  MBLNR
            MJAHR
            VGART
            BLART
            BLAUM
    into corresponding fields of table lt_mkpf from mkpf up to 100 rows.
    *---create fieldcatalog
    clear ls_fcat.
    ls_FCAT-FIELDNAME = 'MBLNR'.
    *WA_FCAT-TABNAME = WA-TABNAME.
    ls_FCAT-REF_TABLE = 'MPKPF'.
    ls_FCAT-REF_FIELD = 'MBLNR'.
    APPEND ls_FCAT TO lT_FCAT.
    clear ls_fcat.
    ls_FCAT-FIELDNAME = 'MJAHR'.
    *WA_FCAT-TABNAME = WA-TABNAME.
    ls_FCAT-REF_TABLE = 'MPKPF'.
    ls_FCAT-REF_FIELD = 'MJAHR'.
    APPEND ls_FCAT TO lT_FCAT.
    clear ls_fcat.
    ls_FCAT-FIELDNAME = 'VGART'.
    *WA_FCAT-TABNAME = WA-TABNAME.
    ls_FCAT-REF_TABLE = 'MPKPF'.
    ls_FCAT-REF_FIELD = 'VGART'.
    APPEND ls_FCAT TO lT_FCAT.
    clear ls_fcat.
    ls_FCAT-FIELDNAME = 'BLART'.
    *WA_FCAT-TABNAME = WA-TABNAME.
    ls_FCAT-REF_TABLE = 'MPKPF'.
    ls_FCAT-REF_FIELD = 'BLART'.
    APPEND ls_FCAT TO lT_FCAT.
    clear ls_fcat.
    ls_FCAT-FIELDNAME = 'BLAUM'.
    *WA_FCAT-TABNAME = WA-TABNAME.
    ls_FCAT-REF_TABLE = 'MPKPF'.
    ls_FCAT-REF_FIELD = 'BLAUM'.
    APPEND ls_FCAT TO lT_FCAT.
    *---collect the field names of alv in a itab
    clear wa.
    WA-FIELDNAME = 'MBLNR'.
    WA-FIELDTEXT = 'Number of Material Document'.
    APPEND WA TO IT.
    clear wa.
    WA-FIELDNAME = 'MJAHR'.
    WA-FIELDTEXT = 'fiscical year'.
    APPEND WA TO IT.
    clear wa.
    WA-FIELDNAME = 'VGART'.
    WA-FIELDTEXT = 'Transaction/Event Type'.
    APPEND WA TO IT.
    clear wa.
    WA-FIELDNAME = 'BLART'.
    WA-FIELDTEXT = 'Document Type'.
    APPEND WA TO IT.
    clear wa.
    WA-FIELDNAME = 'BLAUM'.
    WA-FIELDTEXT = 'Document type of revaluation document'.
    APPEND WA TO IT.
    *----------create field catalog
    CLEAR WA_FCATP.
    WA_FCATP-FIELDNAME = 'CHECK'.
    WA_FCATP-SELTEXT_M = 'Selection Field'.
    WA_FCATP-TABNAME = 'IT'.
    APPEND WA_FCATP TO IT_FCATP.
    CLEAR WA_FCATP.
    WA_FCATP-FIELDNAME = 'FIELDNAME'.
    WA_FCATP-TABNAME = 'IT'.
    WA_FCATP-REF_TABNAME = 'DFIES'.   "CHECK IN SE11 TYPE GROUP SLIS
    WA_FCATP-REF_FIELDNAME = 'FIELDNAME'. "CHECK IN SE11 TYPE GROUPB u201CSLIS
    APPEND WA_FCATP TO IT_FCATP.
    CLEAR WA_FCATP.
    WA_FCATP-FIELDNAME = 'FIELDTEXT'.
    WA_FCATP-TABNAME = 'IT'.
    WA_FCATP-REF_TABNAME = 'DFIES'.   "CHECK IN SE11 TYPE GROUP SLIS
    WA_FCATP-REF_FIELDNAME = 'FIELDNAME'.  "CHECK IN SE11 TYPE GROUPB SLIS
    APPEND WA_FCATP TO IT_FCATP.
    CLEAR WA_FCATP.
    call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '100'.
    *  SET TITLEBAR 'xxx'.
      if o_doc is not bound.
    CREATE OBJECT O_DOC
      EXPORTING
        RATIO                       = 95.
    CREATE OBJECT O_ALV
      EXPORTING
        I_PARENT          = o_doc.
      endif.
    CALL METHOD O_ALV->SET_TABLE_FOR_FIRST_DISPLAY
      CHANGING
        IT_OUTTAB                     = lt_mkpf
        IT_FIELDCATALOG               = lt_fcat.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'BACK'.
    CLEAR :O_ALV,
           O_DOC.
    LEAVE TO SCREEN 0.
    when 'CHNG'.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
       I_TITLE                       = 'select fields to make it editable'
       I_ZEBRA                       = 'X'
       I_CHECKBOX_FIELDNAME          = 'CHECK'
        I_TABNAME                     = 'IT'
       IT_FIELDCAT                   = IT_FCATP
      TABLES
        T_OUTTAB                      = it.
    loop at it into wa where check = 'X'.
    *---change fieldcatalog dynamacally
    case wa-fieldname.
    when 'MBLNR'.
    read table lt_fcat into ls_fcat with key fieldname = wa-fieldname.
    if sy-subrc = 0.
    ls_fcat-edit = 'X'.
    endif.
    when 'MJAHR'.
    read table lt_fcat into ls_fcat with key fieldname = wa-fieldname.
    if sy-subrc = 0.
    ls_fcat-edit = 'X'.
    endif.
    when 'VGART'.
    read table lt_fcat into ls_fcat with key fieldname = wa-fieldname.
    if sy-subrc = 0.
    ls_fcat-edit = 'X'.
    endif.
    when 'BLART'.
    read table lt_fcat into ls_fcat with key fieldname = wa-fieldname.
    if sy-subrc = 0.
    ls_fcat-edit = 'X'.
    endif.
    when 'BLAUM'.
    read table lt_fcat into ls_fcat with key fieldname = wa-fieldname.
    if sy-subrc = 0.
    ls_fcat-edit = 'X'.
    endif.
    endcase.
    modify lt_fcat from ls_fcat index sy-tabix transporting edit.
    clear ls_fcat.
    endloop.
    *---change fieldcatalog dynamically
    CALL METHOD O_ALV->SET_FRONTEND_FIELDCATALOG
      EXPORTING
        IT_FIELDCATALOG = lt_fcat
    *CALL METHOD O_ALV->REFRESH_TABLE_DISPLAY
    **  EXPORTING
    **    IS_STABLE      =
    **    I_SOFT_REFRESH =
    **  EXCEPTIONS
    **    FINISHED       = 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.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Edited by: zjason on Dec 29, 2010 7:47 AM
    Edited by: zjason on Dec 29, 2010 7:52 AM
    Edited by: zjason on Dec 29, 2010 7:54 AM

  • How to make ALV cell editable

    Hi ,
    I am using cl_gui_alv_grid .
    please let me know how to make a particular cell is editable
    eg:  cell corresponding to first row second column should be editabel but remaining all are non editable

    Hi,
    Loop at your internal table.
    Eg: i have total 5 fields in my internal table itab_zqmeinz. in that 3 fields are editable as below.
    declare DATA: lt_celltab TYPE lvc_t_styl.
    internal table with celltab as one of the column
    DATA: BEGIN OF itab_zqmeinz OCCURS 0. "TYPE STANDARD TABLE OF zqmseqkopf
            INCLUDE STRUCTURE zqmseqeinz.
    DATA: celltab TYPE lvc_t_styl.
    DATA: END OF itab_zqmeinz.
    LOOP AT itab_zqmeinz INTO wa_zqmeinz.
          l_index = sy-tabix.
          REFRESH lt_celltab.
          CLEAR wa_zqmeinz-celltab.
          PERFORM fill_celltab1 USING 'RW'
                                  CHANGING lt_celltab.
          INSERT LINES OF lt_celltab INTO TABLE wa_zqmeinz-celltab.
          MODIFY  itab_zqmeinz FROM wa_zqmeinz INDEX l_index.
        ENDLOOP.
    FORM fill_celltab1 USING value(p_mode)
                      CHANGING pt_celltab TYPE lvc_t_styl.
    Refresh pt_celltab.
      clear ls_celltab.
      IF p_mode EQ 'RW'.
        l_mode = cl_gui_alv_grid=>mc_style_enabled.    "to enable the required fields
      ELSE.                                "p_mode eq 'RO'
        l_mode = cl_gui_alv_grid=>mc_style_disabled.
      ENDIF.
      ls_celltab-fieldname = 'NEBENSEQUEN'.   " field1
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
      ls_celltab-fieldname = 'BEZEICHNUNG'.     "field2
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
      ls_celltab-fieldname = 'SORTIERUNG'.         "field3
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
    Endform.
    It works. I have done it in my program.
    Thanks,

  • How to make create, edit, display form in a page fragment ?

    Hello everyone,
    I have a problem when I want to make create, edit,display in a page.
    Ok let's say we have created two pages,
    In page A we have 3 buttons, CreateEmp, EditEmp and DisplayEmp button and one text field as a parameter field to edit and display (let say employeeId).
    In page B we have form employee to create new employee, edit employee and display and a button AddMoreEmp (to add more employee without back to page A)
    in this case if button EditEmp is pressed in page A, so button AddMoreEmp in page B will be enabled
    if button DisplayEmp in page A is pressed , so button AddMoreEmp in page B will be disabled.
    Thanks in advance,
    samantha

    I think what you are looking for is a comb field. It acts like a regular field but puts the vertical lines in between each character. You can turn the comb on in the object palette and indicate how many chars will appear in the field (so that it knows how many lines to draw).
    Paul

  • How to make fields editable in an custom enhancement

    Hi Experts,
    My requirement is to perform some custom validations against a field FKONT(BSEG) at the line item level of FB60 and display appropriate message and make the incorrect field editable.
    I have implemented an implicit enhancement point in include MF05AFGENJ.
    The error messages are coming but I am unable to make the GL account, cost center and profit center fields editable.
    Please let me know how to make the above fields editable after displaying the error message.
    For reference, I have done the coding like this:
    IF sy-tcode = 'FB60' .
    CHECK GL_ITEMS IS NOT INITIAL.
    DATA: L_COUNT TYPE I,
          L_STRING TYPE STRING,
          L_FKONT TYPE FIPLS,
          L_TABIX TYPE SY-TABIX,
          G_FLAG TYPE C.
    DATA: WA_ZZFSTP LIKE ZZFSTP.          "Work area for ZZFSTP table
    CONSTANTS:C_MK TYPE TXJCD VALUE 'MK0000000'.
    *-- Validating the Financial budget item field
    IF GL_ITEMS-FKONT IS NOT INITIAL.
    SELECT SINGLE FKONT
                        INTO L_FKONT
                        FROM ZFSTP
                        WHERE FKONT = GL_ITEMS-FKONT.  "cost center
    IF SY-SUBRC NE 0.
       CLEAR: G_FLAG.
       G_FLAG = 'X'.
       MESSAGE W003(ZZFI) WITH 'Please enter 'Financial' 'Budget Item Field' DISPLAY LIKE 'E'.
       EXIT.
    ENDIF.
    *-- Copying the first line item financial budget item field to all the line items in the internal table
    DESCRIBE TABLE GL_ITEMS LINES L_COUNT.
    IF L_COUNT > 1.
      READ TABLE GL_ITEMS INDEX 1.
      IF SY-SUBRC = 0.
            CLEAR: L_FKONT.
            L_FKONT = GL_ITEMS-FKONT.
    *-- Assign the tax jurisdiction codes in all the line items
             LOOP AT GL_ITEMS.
               CLEAR: L_TABIX.
               L_TABIX = SY-TABIX.
               GL_ITEMS-FKONT = L_FKONT.
               GL_ITEMS-TXJCD = C_MK.
    *-- Copy the first financial budget item number and tax jurisdiction code MK0000000 in all line items
               MODIFY GL_ITEMS INDEX L_TABIX TRANSPORTING FKONT TXJCD.
    *-- Populate tax jurisdiction and FKONT financial budget item number in XBSEG table
               L_TABIX = L_TABIX + 1.  "top record in XBSEG is for header
               READ TABLE XBSEG INDEX L_TABIX.
               IF SY-SUBRC = 0.
                 XBSEG-FKONT = L_FKONT.
                 XBSEG-TXJCD = C_MK.
                 MODIFY XBSEG INDEX L_TABIX.
               ENDIF.
             ENDLOOP.
      ENDIF.
    ENDIF. "describe statement
    CLEAR: WA_ZZSTP.
    *-- Validate the amount and GL account against the FKONT(financial budget item) number
    SELECT SINGLE FKONT
                  ZZWRBTR
                  ZZHKONT
                  ZZKOSTL
                  ZZPRCTR
           INTO CORRESPONDING FIELDS OF WA_ZZFSTP
           FROM ZFSTP
           WHERE FKONT EQ GL_ITEMS-FKONT.
    IF sy-subrc EQ 0.
    IF BSEG-WRBTR > WA_ZZFSTP-ZWRBTR.
           CLEAR: G_FLAG.
           G_FLAG = 'X'.
           MESSAGE W003(ZZFI) WITH 'Amount entered' 'cannot be' 'greater than ' WA_ZFSTP-ZZWRBTR DISPLAY LIKE 'E'.
           EXIT.
    ELSE.
             CLEAR: G_FLAG.
            G_FLAG = 'X'.
            SET CURSOR FIELD 'GL_ITEMS-HKONT'.
            MESSAGE W003(ZZFI) WITH 'Incorrect GL account' 'number entered for' 'given financial' 'budget item number'.
            EXIT.
           ELSE.
    *-- Check for cost center and profit center at line item level
             LOOP AT GL_ITEMS.
    *-- Both cost center and profit center is initial.
                IF GL_ITEMS-KOSTL IS INITIAL AND GL_ITEMS-PRCTR IS INITIAL.
                    CLEAR: G_FLAG.
                    G_FLAG = 'X'.
                    SET CURSOR FIELD 'GL_ITEMS-PRCTR' LINE SY-STEPL.
                    SET CURSOR FIELD 'GL_ITEMS-KOSTL' LINE SY-STEPL.
                    MESSAGE W003(ZZFI) WITH 'Please enter' 'cost center' 'or' 'profit center'.
                    EXIT.
    *-- Either cost center or profit center is initial
                ELSEIF GL_ITEMS-KOSTL IS INITIAL AND GL_ITEMS-PRCTR IS NOT INITIAL.
                    CHECK GL_ITEMS-PRCTR NE WA_ZZFSTP-ZPRCTR.
                      CLEAR: G_FLAG.
                      G_FLAG = 'X'.
                      SET CURSOR FIELD 'GL_ITEMS-PRCTR' LINE SY-STEPL.
                      MESSAGE W003(ZZFI) WITH 'Incorrect profit' 'center entered' 'for given' 'financial budget item' DISPLAY LIKE 'E'.
                      EXIT.
                ELSEIF GL_ITEMS-KOSTL IS NOT INITIAL AND GL_ITEMS-PRCTR IS INITIAL.
                   CHECK GL_ITEMS-KOSTL NE WA_ZFSTP-ZKOSTL.
                      CLEAR: G_FLAG.
                      G_FLAG = 'X'.
                      SET CURSOR FIELD 'GL_ITEMS-KOSTL' LINE SY-STEPL.
                      MESSAGE W003(ZZFI) WITH 'Incorrect cost' 'center entered' 'for given' 'financial budget item' DISPLAY LIKE 'E'.
                      EXIT.
                ENDIF.
             ENDLOOP.
           ENDIF. "GL Account
    ENDIF. "Amount check
    ENDIF. "SY-SUBRC check
    ENDIF.
    EXPORT G_FLAG FROM G_FLAG TO MEMORY ID 'ZER'.
    Please let me know how to make GLaccount,cost center and profit center fields editable.
    Regards,
    Sangeeta.

    Hi.. chaek the below links. may be useful to u.
    Making Table control records Editable / Non-editable
    Table control with both Editable and non Editable fields
    Regards,
    KP.

Maybe you are looking for

  • Is there a way to add a password to a certain folder?

    Is there a way to add a password to a certain folder on a mac?

  • Cs4 color management?

    Does Fireworks CS4 support color management? IE, does it assume all colors are sRGB and use the monitor profile to correctly show sRBG colors? I'm hoping it has the same Color Settings as other adobe products or at least will use the monitor ICC prof

  • PROBLEM WITH OUTLOOK

    GUYS FIX THIS OUTLOOK , IT DRIVERS ME CRAZY, I CANT SEND EMAIL.

  • Connection refused at localhost

    Hi, I got a problem binding a Socket(just try a few like 3090 or 22222) with ip = localhost... What can be the error? new Socket("127.0.0.1", 3090); java.net.ConnectException: Connection refused: connect      at java.net.PlainSocketImpl.socketConnect

  • What is the main purpose of ichat server what is it good for?

    i've been looking at ichat server, but can't figure what advantages is has opposed to just using ichat on bonjour on my network? what is it good about it?