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

Similar Messages

  • Header net value different in display and change mode in Sales Order.

    Hi All,
    I am facing a strange problem. When I check an order in display mode, I can see the header net value as 120047 Euro.  However, If I open the order in change mode, it shows value as 133099.
    Do not understand why?
    Please help me to solve the issue.
    Regards,
    Neha

    Dear Neha
    Can you please clarify as to whether any header condition type is flowing in the sale order, so that  I will try to give a suitable solution accordingly.
    thanks
    G. Lakshmipathi

  • Infotype Screen control - change field from display to change

    Hello,
    I have a field in a custom infotype, which is showing up as only display. I want to change it so that values can be input. I checked the screen layout in se51 and found that the field is checked as input possible field. There is no entry for this infotype in T588M. I am not sure, where else should I look so that i can change to field to take the input. Please suggest.
    Thank you very much !
    Rush

    Hello Everyone,
    I checked in Module pool Program. The program is written to check the field for some personnel areas. Now, when i did debug, I found that PSYST-werks is not read correctly. Suppose if there are 3 records in infotype 0001, its getting the first record value, not the recent record value. Any suggestions how to change the code, so that the PSYST get the recent record value?
    Sikindar, T588M do not have entry for this table. thank you.
    Jayanthi thank you for your help too.
    Rush
    Edited by: rushi K on May 13, 2008 4:15 PM

  • BADI for BP open (display or change mode) event

    Hi,
    When a user opens a BP (via BP transaction or open method of BOR object) in CRM, I want to do some custom check. Based on the check, I want to decide whether this user is allowed to open this BP or not. If this check fails, I want to display an error message (No authority to display this BP). Only if the check is successful, that BP should open.
    Any idea where can I write this type of code?
    I checked a few BADIs (BUPA_LOCK, HRSYNC_P etc.), but didn't find anything useful.
    Regards,
    Kaushal

    Kaushal,
    For transaction BP in CRM we need to do the following(this won't work in the PCUI).
    1. Create a new class that implements: IF_BUPA_DIALOG_JOEL_EXIT
    2. Create a new function group that has a subroutine called bupa_dialog_joel_exit_create which is coded similar to the subroutine in function group BUPA_DIALOG_JOEL, but calls the class you created in step 1.
    3.  Implement the method IF_BUPA_DIALOG_JOEL_EXIT~CAN_CHANGE_PARTNER in your new class.
    4.  Add Z-entries to the application tables below that will reference the new funciton group created above.
    TBZJ4 -> V_TBZJ4
    TBZJ4C -> V_TBZJ4C
    The class CL_BUPA_DIALOG_JOEL_EXIT is an example of the implemented class.
    This enhancement mechanism should allow you to do want you want to do and at the right timing in the BP transaction.
    Good luck,
    Stephen

  • Issue during Me53N -- switch to change mode

    Hi Experts,
    I use MEREQ001 to add new fields on the customer tab.
    I check during the process the fields and set to required and input a.s.o.
    f.e.
    If sy-tcode eq ME52N or ME51N.
            IF screen-name EQ 'CI_EBANDB-ZZ_ABTL'.
              screen-input = 1.
              screen-required = 1.
            ENDIF.
    Works fine except one issue.
    The user starts tc me53n and click on the pencil to switch from display in change mode.
    The problem now is that sy-tcode is still ME53N and I don´t if there is a field which know that I´m now in change mode.
    Try to find something in SYST but I´m not sure.
    These two field are changing the value during the process.
    sy-modno
    sy-oncom
    what field should I use? Or is there a field I can use instead?
    Any Ideas?
    Thanks
    Alex

    wrong forum - sorry

  • Excise invoice number showing display option in J1IEX change mode.

    Hi CIN Experts,
    We are using E.C.C6.0.
    In Excise transaction T.code: J1IEX Change option, Official Excise invoice number (J_1IEXHEAD-EXNUM) showing the display mode. How can change the Official Excise Document Number is display mode to change mode in T.code: J1IEX change option.
    In 4.7E system showing the change option in T.code: J1IEX change mode.
    Regards,
    Hanuman

    We cannot change this field from display to change. Once the excise invoice is captured the excise invoice number is freezed.
    It is SAP Standard & to break this you would need the access key from SAP.
    If the change in excise invoice number is by user mistake, please cancel the excise invocie and capture the new one.
    Thanks & regards
    Hameed Parvez

  • MIGO : CHANGE FIELD STATUS FROM DISPLAY TO EDIT FOR BATCH

    DEAR GURU
    I HAVE CONFIGURED SHELF LIFE FOR OUR PLANTS. WHEN A PLANT USER CREATING RESERVATION FOR SHELF LIFE ITEM , SYSTEM IS ASKING FOR BATCH NUMBER & THEY ARE SELECTING ANY  BATCH FROM F4 LIST.
    AFTER THAT WHEN STORE USER IS CREATING ISSUE SLIP  AGAINST THAT RESERVATION, BATCH NO IS SHOWING IN DISPLAY MODE . COULD WE CHANGE THIS FIELD FROM DISPLAY TO EDIT MODE, SO THAT IF PLANT USER ENTERED WRONG BATCH ,STORE USER CAN CHANGE IT DURING ISSUE SLIP.
    REGARDS
    RAJ

    hi..
    Please check.
    MSC2N or MSC5N....

  • How to handle "Display/Change" mode in XD0x with CUSTOMER_ADD_DATA_CS

    Hi,
    I've implemented customer fields to the debitor master data screen with BADI CUSTOMER_ADD_DATA_CS,
    using methods SET_DATA and GET_DATA and created a new screen within a Z-function group.
    So I have a new tab with the custom fields. If I do nothing further, the fields are input enabeld also within transaction XD03.
    At the moment, I'm using the value of sy-tcode to check for display (=XD03) or change/create (XD02/XD01) mode to handle
    the enable/disable mode of this fields.
    This is my coding in the PBO of my Z-screen.
      LOOP AT SCREEN.
        IF screen-group1 = 'Z01'.
          IF sy-tcode = 'XD03' OR sy-tcode = 'VD03'.
            IF sy-ucomm = 'ENTR'.
              screen-input = '1'.
             ELSE.
    *.. display mode
              screen-input = '0'.
            ENDIF.
          ENDIF.
       ENDLOOP.
    But if the user change form display to change mode wthin(!) the transaction, the sy-tcode is still XD03 and not XD02.
    If this is done in the screen with the custom fields, I can check for sy-ucomm (='ENTR'), but if an other screen is opened, I could not check for sy-ucomm.
    How can I handle this?
    I've found the following enhancement point:
    ENHANCEMENT-POINT MF02DFD0_01 SPOTS ES_MF02DFD0 INCLUDE BOUND.
    Or can I use the other methods in the BADI like SET_FCODE?
    Thanks in advance!
    Andreas

    Hi Andreas:
      I have to do something similar but for t-code FD02/FD03.
    I've created a program type M to control my new dynpro, and using a PBO module to change the screen depending on display/modify.
    I'm trying to add code to method SET_DATA, but my knowledge on OO programamtion is limited.
    Could you please provide the part of your code to implement the solution described in this post?.
    Best regards,
    Carlos.

  • PLMD_AUDIT - Toggle between Display and Change - Important!!

    Hello all,
    I've a problem when I work on PLMD_AUDIT.
    Pre-requisite for replicating the issue.
    1> Change the settings in PLMD_AUDIT (a face like icon) to Display mode
    When I run PLMD_AUDIT for an Audit with Action, it displays me the "Grouping" field and the "Involved Persons" tab values correctly.
    But when I toggle from Display to Change, the value in "Grouping" and the "Involved Persons" tab vanishes.
    Can you please check in your system and let me know if you also face this issue?
    Thank you in advance,
    Vaishnavi

    Hello Keerthi,
    Thanks for your reply.
    Please follow the below mentioned steps.
    1) Change your time zone to a different time zone other than the created time zone of the action.
    say if action has been created in London time zone, change system zone to some other than London.
    2) Change the Settings in PLMD_AUDIT tcode (face like icon) to Display
    3) Open any audit WITH ACTION.
    4) When you double click on Action inside the audit, the action will be opened in Display mode.
    5) Now toggle between Display and Change.
    6) Kindly check if the values in the "Grouping field" and BUPA roles in "Involved Persons" tab are present now after toggling?
    Please let me know at the earliest.
    Your assistance is highly appreciated in this regard.
    Thanks in advance,
    Vaishnavi

  • Function module change mode?

    Hi,
    I created a new function module in namespace created by colleague, I cant edit the source code in created FM. It is showing only in Grey font display in change mode. I can edit other parameters but not the source code.
    Can anyone help me this out?
    Regards
    Giri

    Dear Giri,
    There must be a Insert Button, through which you can add your codes.
    BTW ... What's the name of the Function Module ????
    Regards,
    Abir
    Don't forget to award Points *

  • How to make the Business Area field from Change Mod to Display Mode in AS02

    Hi Gurus,
    I created a Customized T-code   YAS02   for making the Business Area in Display mode with the help of SHD0.
    But my client wants to do the same in standard T-code of AS02 and they don't like to use the customized T-code.
    Kindly advise to make the Business Area from Change Mode to Display Mode in AS02.
    Thanks in advance...
    regs / Devi Aparna

    Hi Devi,
    check the following customization
    asset accounting -> Integration with the General Ledger> Additional Account Assignment Objects-> Activate Account Assignment Objects---
    Regards,
    Ranjith

  • How to make a field from display mode to change mode for a perticular tcode

    hi all,
    my client want to change one field which is in display mode of a material doc in mb02.
    Restrictions in some fields  in MIGO needs to be changed.
    Uploading point in case of issue: While editing the MIGO latter,  this field needs to be edited.
    Goods recipient in case of receipt: While editing the MIGO latter,    this field needs to be edited.

    hi thanks for quick replay,
    my requirement is, supose i post a material doc through migo in 101 mtype, in item detail, where tab i have given the good reciepitant and unloading point. but while i want to change that material doc in mb02, i saw unloading point is in change mode, but good reciepitant field is in display mode. my client requirement is to change that field. so for change that field, the field should be in change mode, so thats what i want.
    i have checked in configuration side, but i didnt get any setting, i think we have to customize that standard screen.
    any comments?
    regards,
    susanta
    Edited by: susanta bindhani on Jun 19, 2008 2:18 PM

  • ALV Grid - Display/change Problem

    Hi Guys,
    I have a peculiar problem. I have developed a Module pool application containing two screens. In the first screen I have a input field and 2 buttons for display and change. When I enter the value and press Displaythe second screen is called which shows an ALV grid in the respective display mode. But If I come back and press change I could not get the change mode for the ALV grid still it remains in the Display mode. Again if rerun the transaction and press change it shows the ALV grid in change mode but if we press back and choose display then it is not getting changed still remains as such. In all at the first run what ever the mode is chosen it remains stationery. I am using OOALV and i have tried flushing the container, grid and also refreshing the ALV. But could not trace the problem. If you guys have worked or can put some inputs please reply back.
    Jagath.

    Please find the attached code...
    from the first screen 100 i am assigning the flag w_display or w_change based on the okcode. in the second screen 200 PBO i have the following code:
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'STAT200'.
      SET TITLEBAR 'TIT200'.
      if w_display eq 'X'.
      perform grid_display.
      else.
      perform grid_change.
      endif.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    Now in perform display I have the following code:
    form grid_display .
    Set the Fieldcatalog.
      REFRESH t_fieldcat.
      PERFORM get_field_catalog.
    set the Layout.
      CLEAR wa_layout.
      wa_layout-cwidth_opt = 'X'.
    wa_layout-stylefname = 'CELLTAB'.
    set the Variant
      w_variant-report = sy-repid.
    Create the Instance for container
      IF lcl_custom_disp IS INITIAL.
        CREATE OBJECT lcl_custom_disp
          EXPORTING
           PARENT                      =
            container_name              = 'CONTAINER1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    create the object for ALV grid
        CREATE OBJECT lcl_grid_disp
          EXPORTING
            i_parent          = lcl_custom_disp
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Create the object for events
        CREATE OBJECT lcl_events.
        SET HANDLER lcl_events->handle_top_of_list FOR lcl_grid_disp.
    Display the  ALV.
        CALL METHOD lcl_grid_disp->set_table_for_first_display
          EXPORTING
            is_variant                    = w_variant
            i_save                        = ' '
            is_layout                     = wa_layout
          CHANGING
            it_outtab                     = t_final[]
            it_fieldcatalog               = t_fieldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
    Refresh the ALV grid
        CALL METHOD lcl_grid_disp->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.
      ENDIF.
    endform.                    " grid_display
    In the perform change the same code is followed for different object with the fieldcatalog  is changed to edit based on flag.
    Set the Fieldcatalog.
      REFRESH t_fieldcat.
      PERFORM get_field_catalog.
    set the Layout.
      CLEAR wa_layout.
      wa_layout-cwidth_opt = 'X'.
    wa_layout-stylefname = 'CELLTAB'.
    set the Variant
      w_variant-report = sy-repid.
    Create the Instance for container
      IF lcl_custom_chng IS INITIAL.
        CREATE OBJECT lcl_custom_chng
          EXPORTING
           PARENT                      =
            container_name              = 'CONTAINER1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    create the object for ALV grid
        CREATE OBJECT lcl_grid_chng
          EXPORTING
            i_parent          = lcl_custom_chng
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Create the object for events
        CREATE OBJECT lcl_events.
        SET HANDLER lcl_events->handle_top_of_list FOR lcl_grid_chng.
        SET HANDLER lcl_events->handle_data_changed FOR lcl_grid_chng.
        SET HANDLER lcl_events->handle_data_changed_finished FOR lcl_grid_chng.
    Display the  ALV.
        CALL METHOD lcl_grid_chng->set_table_for_first_display
          EXPORTING
            is_variant                    = w_variant
            i_save                        = ' '
            is_layout                     = wa_layout
          CHANGING
            it_outtab                     = t_final[]
            it_fieldcatalog               = t_fieldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
    Refresh the ALV grid
        CALL METHOD lcl_grid_chng->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.
      ENDIF.
    Please let me know if you require some more inputs?
    Jagath

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How to change the selected row color in an alv grid display ?

    Hello ,
    I WANT TO CHANGE THE COLOR OF THE SELECTED RECORDS  IN AN ALV GRID DISPLAY ?
    ITS URGENT..
    WILL BE REWARDED...

    hai   Ssnagh Samala 
    EXicut This report >
    Hope It Will  Meet U r Requirement.
    If Found Helpfull Reward.
    REPORT zcuitest_alv_07.
    Use of colours in ALV grid (cell, line and column) *
    Table
    TABLES : mara.
    Type
    TYPES : BEGIN OF ty_mara,
    matnr LIKE mara-matnr,
    matkl LIKE mara-matkl,
    counter(4) TYPE n,
    free_text(15) TYPE c,
    color_line(4) TYPE c, " Line color
    color_cell TYPE lvc_t_scol, " Cell color
    END OF ty_mara.
    Structures
    DATA : wa_mara TYPE ty_mara,
    wa_fieldcat TYPE lvc_s_fcat,
    is_layout TYPE lvc_s_layo,
    wa_color TYPE lvc_s_scol.
    Internal table
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
    it_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
    it_color TYPE TABLE OF lvc_s_scol.
    Variables
    DATA : okcode LIKE sy-ucomm,
    w_alv_grid TYPE REF TO cl_gui_alv_grid,
    w_docking_container TYPE REF TO cl_gui_docking_container.
    PARAMETERS : p_column AS CHECKBOX,
    p_line AS CHECKBOX,
    p_cell AS CHECKBOX.
    START-OF-SELECTION.
    PERFORM get_data.
    END-OF-SELECTION.
    PERFORM fill_catalog.
    PERFORM fill_layout.
    CALL SCREEN 2000.
    *& Module status_2000 OUTPUT
    text
    MODULE status_2000 OUTPUT.
    SET PF-STATUS '2000'.
    ENDMODULE. " status_2000 OUTPUT
    *& Module user_command_2000 INPUT
    text
    MODULE user_command_2000 INPUT.
    DATA : w_okcode LIKE sy-ucomm.
    MOVE okcode TO w_okcode.
    CLEAR okcode.
    CASE w_okcode.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " user_command_2000 INPUT
    *& Module alv_grid OUTPUT
    text
    MODULE alv_grid OUTPUT.
    IF w_docking_container IS INITIAL.
    PERFORM create_objects.
    PERFORM display_alv_grid.
    ENDIF.
    ENDMODULE. " alv_grid OUTPUT
    *& Form create_objects
    text
    --> p1 text
    <-- p2 text
    FORM create_objects.
    Ratio must be included in http://5..95
    CREATE OBJECT w_docking_container
    EXPORTING
    ratio = 95
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    others = 6.
    CREATE OBJECT w_alv_grid
    EXPORTING
    i_parent = w_docking_container.
    ENDFORM. " create_objects
    *& Form display_alv_grid
    text
    --> p1 text
    <-- p2 text
    FORM display_alv_grid.
    CALL METHOD w_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = is_layout
    CHANGING
    it_outtab = it_mara
    it_fieldcatalog = it_fieldcat
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    ENDFORM. " display_alv_grid
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    FORM get_data.
    SELECT * FROM mara UP TO 5 ROWS.
    CLEAR : wa_mara-color_line, wa_mara-color_cell.
    MOVE-CORRESPONDING mara TO wa_mara.
    ADD 1 TO wa_mara-counter.
    MOVE 'Blabla' TO wa_mara-free_text.
    IF wa_mara-counter = '0002'
    AND p_line = 'X'.
    Color line
    MOVE 'C410' TO wa_mara-color_line.
    ELSEIF wa_mara-counter = '0004'
    AND p_cell = 'X'.
    Color cell
    MOVE 'FREE_TEXT' TO wa_color-fname.
    MOVE '5' TO wa_color-color-col.
    MOVE '1' TO wa_color-color-int.
    MOVE '1' TO wa_color-color-inv.
    APPEND wa_color TO it_color.
    wa_mara-color_cell] = it_color[.
    ENDIF.
    APPEND wa_mara TO it_mara.
    ENDSELECT.
    ENDFORM. " get_data
    *& Form fill_catalog
    text
    --> p1 text
    <-- p2 text
    FORM fill_catalog.
    Colour code : *
    Colour is a 4-char field where : *
    - 1st char = C (color property) *
    - 2nd char = color code (from 0 to 7) *
    0 = background color *
    1 = blue *
    2 = gray *
    3 = yellow *
    4 = blue/gray *
    5 = green *
    6 = red *
    7 = orange *
    - 3rd char = intensified (0=off, 1=on) *
    - 4th char = inverse display (0=off, 1=on) *
    Colour overwriting priority : *
    1. Line *
    2. Cell *
    3. Column *
    DATA : w_position TYPE i VALUE '1'.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'MATNR' TO wa_fieldcat-fieldname.
    MOVE 'MARA' TO wa_fieldcat-ref_table.
    MOVE 'MATNR' TO wa_fieldcat-ref_field.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'MATKL' TO wa_fieldcat-fieldname.
    MOVE 'MARA' TO wa_fieldcat-ref_table.
    MOVE 'MATKL' TO wa_fieldcat-ref_field.
    Color column
    IF p_column = 'X'.
    MOVE 'C610' TO wa_fieldcat-emphasize.
    ENDIF.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'COUNTER' TO wa_fieldcat-fieldname.
    MOVE 'N' TO wa_fieldcat-inttype.
    MOVE '4' TO wa_fieldcat-intlen.
    MOVE 'Counter' TO wa_fieldcat-coltext.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'FREE_TEXT' TO wa_fieldcat-fieldname.
    MOVE 'C' TO wa_fieldcat-inttype.
    MOVE '20' TO wa_fieldcat-intlen.
    MOVE 'Text' TO wa_fieldcat-coltext.
    APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM. " fill_catalog
    *& Form fill_layout
    text
    --> p1 text
    <-- p2 text
    FORM fill_layout.
    Field that identify color line in internal table
    MOVE 'COLOR_LINE' TO is_layout-info_fname.
    Field that identify cell color in inetrnal table
    MOVE 'COLOR_CELL' TO is_layout-ctab_fname.
    ENDFORM. " fill_layout
    Regards.
    Eshwar.

Maybe you are looking for

  • How can I create a new user in jabbheer Cisco

    Hi sir  please can please, canhelp me and explain how ccan I create new end user in jabber Bestregards  

  • Itunes wont sync files to ipod touch

    My friend's wife has been bedbound for years but before she could no longer use her desktop Windows 7 computer, she had gotten hundreds of songs in at least 10 playlists.  She recently bought 3 CD/DVDs that she wanted me to rip with itunes and sync t

  • Messages in smq2

    Hi, when i am checking smq2 t code in xi i am getting approx 5000 messages in queue. and my data is not getting posted at r3. what needs to be done?

  • Error "Trip Country does not exist" in Create Expense Report ESS

    When I try and create an Expense Report after selecting the Trip Schema a critical error appears Trip Country  does not exist in the system (T005). The application was working one day agoa and now it doesn't work giving this error all the time... Can

  • IE8 and Jinitator 1.3.1.21

    Hi, IE8 do not accept Jinitator 1.3.1.21 and prevent it to execute. But EB 11.5.10 need it. Is there any work around ? Thank you.