PAI of subscreen: using sy-ucomm

Hi,
I need to write some code in a PAI of a subscreen ( which is actually a screen exit).
I am using : IF sy-ucomm = 'FCOD'.
                      PERFORM GIVE_MESSAGE.
                  ENDIF.
IN MODULE USER_COMMAND_9211. 
I want to know if it is good to use SY-UCOMM directly ?
I read in SAP HELP that I cannot use OK-CODE or FCODE in subscreen directly, so I am using sy-ucomm.
Please advice if this is correct method or is there any better method?
Thanks,
Rupali.

Hi
A subscreen is not a screen: it can "live" in a main screen only and it can be called by several main screens.
It should be better not to manage a USER_COMMAND in a subscreen for the reason above.
Anyway u can check the SY-UCOMM instead of OK-CODE of the main screen, but u make sure the OK-CODE is not changed: sometimes the ok-code can be changed under some situations: so the value of SY-UCOMM wouldn't be equal to OK-CODE.
If you're in a screen-exit it's better not to define an own ok-code becuase it can determine a bad behavior of the standard program.
Max

Similar Messages

  • How to use sy-ucomm in one time in the report

    Hi guru,
    I developed a z report when i am executing the report one screen is didplaying and here and here i have to delect some check boxes (update) and then click the click the toolbar stage (which was created using sy-ucomm) and we are getting some output.
    Now the requirement is when user second time clicking the  botton stage the report shaould not execute it self.How to do it means how to restrict .Please help me .May be it is easy for you but I am facing a severe probleam to achieve this.
    needs yours cooperation and patience.

    Hi subhassikan
    I am not very clear about what you want to say.
    1. you want the sy-ucomm to be executed once right, then you can use a flag in that case.
    one it executed first time
    make flag = 'X'.
    and next time check the value of flag if it is 'X' then the code under sy-ucomm should not be executed.
    2. Secondly is there some buttton or something that you click, check function code for only that button and should not execute for any other button and function codes must be different.

  • PAI of subscreen

    Hi I am enhancing cat2 transaction using screen exit. Now SAP has provided a subscreen for customer use and I am trying to add a few fields in the subscreen, open to user input, and want to populate value into an output field in the PAI.
    But the problem is that at no point is the PAI module of subscreen executed.Has anyone encountered such a problem? IIf yes please do share

    Hi,
    We generally call a screen in PAI.
    MODULE user_command_9001 INPUT.
    CASE g_ok_code .
        WHEN 'SUBM'.
          PERFORM f0601_save.
        WHEN 'SHOW'.
          CLEAR : g_wa_outtab_1,
                  g_wa_outtab_1.
          REFRESH : g_t_outtab_1,
                    g_t_outtab_1[].
          PERFORM f0600_show_selections.
          CALL SCREEN 9002 STARTING AT 1 1 ENDING AT 130 20.
      ENDCASE.
    ENDMODULE.
    Hope this helps you.
    Thanx,
    dhanashri.

  • Set PF-STATUS and use SY-UCOMM in an Exit FM

    Hi,
    I am working on an Exit function, and I am trying to read the screen status and then the user's actions, so that I could code for the SY-UCOMM. For some reason, my program is not working. Is it possible to add the PF-STATUS and SY-UCOMM to the Exit function to process the user's actions? Please advise.
    Thanks,
    RT

    Hi Ravikumar,
    I was able to use the parameters in the Exit provided in the Exit FM to process the necessary data. I have other requirements where I would have to code in the Exit FM to detect the user's actions and process them within the Exit to manipulate the tables. I added some code specified in the previous post, but it doesn't seem to get the OK_CODE; therefore, no processing of the data was happening when I tested by clicking on the yellow arrow to exit. I am able to determine the OK_CODE though.
    Would you have any sample code suggestions when using the Exit for SET PF-STATUS and SY-UCOMM?
    Thanks so much.
    RT

  • Add subscreen using BADI_MATERIAL_REF

    Hi,
    I have been assigned a work to create subscreen on Material create transaction MM01. Add some fields on the subscreen. We are on ECC6. So customer wants to go for BADI only. Any help will be appreciated and points will be rewarded. Please help me.
    Seema

    Hi Seema ,
    Can you Please Explain How did you Solve the Problem Using BADI_MATERIAL_REF.
    Regards,
    Mithun

  • Calling Subscreen using tabstrip control

    Hello all,
    I need to create a tabstrip with 2 tabs.
    when i click on the first tab i need to have 4 fieldnames from EKKO.
    when i click on the second tab i need to have 2 fieldname from EKPO
    I have created a Tabstrip control with 2 tabs.
    Subcreen area is also created in this tabstrip control.
    And i have created 2 subscreens for the 2 tabs.
    but i am not able to call the subcreens.
    Can someone tell me how to do this.
    Thanks
    Harish

    Hi Harish,
    Chekc this
    Calling subscreen in tabstrip
    hope it helps.
    Thanks!

  • Double click on the node,ALV tree, subscreen

    Hi,
    I have a small requirement in ALV Tree
    left side i get a tree and when i double click on one of it , i'm trying to display the subscreen. even though i am setting the paramaters to the screen but i'm unable to get those values in the subscreen.
    example
    Name        Description                                                subscreen 0101
    xyz           xyz desc (double click on this)                  name    = XYZ
    ABC         abs desc                                                      descrip = xyz desc
    This is what the requirement is:
    Please help me out with the solution.
    Bhavana

    Hi Bhavana,
    Register your double click event in the ALV Tree program. Then call the respective subscreen using sy-ucomm value.
    IF NOT r_ucomm IS INITIAL.
        CASE r_ucomm.
          WHEN '&F03'.
            SET SCREEN 100.
            LEAVE SCREEN.
    endif.
    Refer the below code for setting the registering the event.
      CALL METHOD tree->get_registered_events
        IMPORTING
          events = l_events_s.
      l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      APPEND l_event TO l_events_s.
      CALL METHOD tree->set_registered_events
        EXPORTING
          events                    = l_events_s
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      CREATE OBJECT l_events_receiver.
      SET HANDLER l_events_receiver->handle_item_click FOR tree.
    CLASS lcl_events_receiver DEFINITION.                       "#EC *
      PUBLIC SECTION.
        METHODS:
        handle_item_click FOR EVENT item_double_click OF cl_gui_alv_tree
            IMPORTING node_key fieldname.
    ENDCLASS.                    "lcl_handle_events DEFINITION
    CLASS lcl_events_receiver IMPLEMENTATION.
      METHOD handle_item_click.
        PERFORM employee_data USING node_key fieldname.
        CALL SCREEN 300.
      ENDMETHOD.                    "HANDLE_ITEM_DOUBLE_CLICK
    ENDCLASS.                    "lcl_events_receiver IMPLEMENTATION
    Thanks.
    Ganesh R K
    Edited by: Ganesh.rk83 on Jun 23, 2011 11:21 AM

  • Leave subscreen

    hi all
    i had create a subscreen using dialog programming.
    My question is hw to leave the subscreen by clicking the X at the top right cornor of the subscreen. Any code to use?
    Thks

    Hi Gray,
               Place One push button on the subscreen with name as we want for example i will place one push button with name CLOSE.In that CLOSE push button mention fuunciton code as CLOSE.
    LOGIC:write this logic in PAI event ok..
    case sy-ucomm.
    when 'CLOSE'.
    leave program.
    endcase.
    Reward points if helpful.
    Kiran Kumar.G.A
            Have a Nice Day..
    Edited by: KIRAN KUMAR on Jan 16, 2008 7:53 AM

  • How to use cancle button

    hai freinds i have written a module pool and in that i have used an interface which has only one cancel button, when ever i want to come out of transaction without entering mandatory fields, but how to write the code in my module pool and what statements should i use to catch that action , can i use sy-ucomm or use function code or soem thing other if any one can give me the code to come out of the transaction
    bye
    afzal

    Hello,
    Your first PAI module statement should be:
    MODULE exit at exit-command.
    Code:
    Module exit input.
       SET SCREEN 0.
       LEAVE SCREEN.
    endmodule.
    While creating your GUI status, you must give 'E'  as the function type for BACK, CANCEL and EXIT button in the tool bar.
    Thanks and regards,
    S. Chandra Mouli.

  • Difference b/w ok_code and sy-ucomm in module pool ?

    hai abap gurus,
    ok_code and sy-ucomm store the function code of the element.. then y do v use ok-code in the program. y dont v use sy-ucomm... pls clear my doubt...

    hi,
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

  • Regarding sy-ucomm and ok_code

    hi experts,
    gud morning,
    i got something for sy-ucomm and ok_code....
    <b>answer:::</b>
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM <b>receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event.</b> Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTERS). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    cud u plz explain the meaning of the bold part how can we see that the contents are also copied in the pbo side as done in pai.......
    null

    SAP recommends that in dialog program always use OK_Code instead of sy-ucomm. Here is what the help says
    In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:
    In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba99935c111d1829f0000e829fbfe/content.htm
    This is a long standing issue dating back many years. The general answer is that you control the OK_CODE field while SAP controls the SY-UCOMM field. You assign field OK_CODE to the OK code field in the screen painter and SAP copies SY-UCOMM to your OK_CODE field. Now you have control over the value. If you start invoking other code, like SAP utilities that display screens, you can be guaranteed that the value in OK_CODE will still be there, while you have no idea what SAP might be doing with SY-UCOMM.
    This is a design decision that was probably made about 20 years ago when screen processing was introduced. In most cases, you can probably use SY-UCOMM and not have any problems but there are probably cases out there where SAP has done something tricky and you will have a problem.
    Because there are unknowns out there, I always define an OK_CODE and do not use SY-UCOMM for standard screen processing. For me this is a long standing habit.
    OK_Codes are like function code for each button or for any action on the screen.
    When you press SAVE or when you Press some Button on the screen, your every action is recorded by using the OK_COde.
    for example for ENTER button it is '/00'.
    While you record BDC's using SHDB you will come to know all these OK codes.

  • Issue while opening websites from module pool subscreen.

    I have three subscreens which do open while user clicks a radio button on the main screen . Now in two of the subscreens,there are two text fields which contain url of two websites . When i am setting a GUI status when sy-pfkey/sy-ucomm = 'PICK' , they are getting set but inside the PAI of subscreens when I am writing :-
    When sy-ucomm = 'PICK'.
    call fn 'call_browser'.
    The websites don't open  because the PICK fn code is not getting triggered.
    In two of the subscreens ,the website addresses / urls will be fixed whereas in the third subscreen,the website address comes from  field "tline" .
    So I can't handle the scenario through buttons and assigning function codes to them.
    Pls advise.

    Dear Subankar,
    For that  screen filed select option like drill down with key.
    Regards,
    Madhu.

  • How we can use class and methods for the FM of reuse_alv_list_display

    Hi Abapers,
    Please provide the sample code of class and method of REUSE_ALV_LIST_DISPLAY.
    Which Class i can use for this Function module.
    I need to write a code using OOPS concept.
    I was done the GRID display  using this class cl_gui_alv_grid.
    But i want only List Display using the class & methods.
    Plz provide sample code.
    Thanks
    Nani.

    Hi Nani,
    This is the sample code..
    *&amp; Report Z_OO_ALV
    *& We can Use Two containers in OOALV
    REPORT z_oo_alv LINE-COUNT 50.
    *types gt_struct type sflight.
    DATA BEGIN OF gt_struct.
    INCLUDE STRUCTURE sflight.
    DATA rcol(4) TYPE c.
    DATA colors TYPE lvc_t_scol.
    DATA END OF gt_struct.
    *ALV GRIDs
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.
    DATA gr_alvgrid1 TYPE REF TO cl_gui_alv_grid.
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
    DATA gc_custom_control_name1 TYPE scrfname VALUE 'CC_ALV1'.
    *CONTAINERs
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.
    DATA gr_ccontainer1 TYPE REF TO cl_gui_custom_container.
    *FIELDCATALOGs
    DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
    DATA gt_fieldcat1 TYPE lvc_t_fcat WITH HEADER LINE.
    *LAYOUTs
    DATA gs_layout TYPE lvc_s_layo.
    DATA gs_layout1 TYPE lvc_s_layo.
    DATA pt_exclude TYPE ui_functions. "internal table declaration to be passed.
    *DATA pt_cell TYPE lvc_t_cell with header line.
    DATA : gt_list LIKE gt_struct OCCURS 50 WITH HEADER LINE,
    gt_list1 LIKE gt_struct OCCURS 50 WITH HEADER LINE.
    *DATA v_ucomm TYPE sy-ucomm.
    CALL SCREEN 100.
    *& Module display_alv OUTPUT
    text
    MODULE display_alv OUTPUT.
    PERFORM display_alv.
    ENDMODULE. " display_alv OUTPUT
    *& Module PAI INPUT
    text
    MODULE pai INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT'.
    PERFORM exit_program.
    WHEN 'PICK'.
    PERFORM cell_info.
    ENDCASE.
    ENDMODULE. " PAI INPUT
    *& Form display_alv
    text
    FORM display_alv.
    PERFORM prepare_field_catalog CHANGING gt_fieldcat[].
    PERFORM prepare_layout CHANGING gs_layout.
    PERFORM data_retrival.
    IF gr_alvgrid IS INITIAL.
    CREATE OBJECT gr_ccontainer
    EXPORTING
    container_name = gc_custom_control_name
    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.
    ENDIF.
    CREATE OBJECT gr_alvgrid
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    i_parent = gr_ccontainer
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    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.
    PERFORM exclude_tb_functions CHANGING pt_exclude.
    PERFORM set_col.
    CALL METHOD gr_alvgrid->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    it_toolbar_excluding = pt_exclude "excluding toolbar functions
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = gt_list[]
    it_fieldcatalog = gt_fieldcat[]
    IT_SORT =
    IT_FILTER =
    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.
    CALL METHOD gr_alvgrid->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.
    PERFORM prepare_field_catalog1 CHANGING gt_fieldcat1[].
    PERFORM prepare_layout1 CHANGING gs_layout1.
    PERFORM data_retrival1.
    IF gr_alvgrid1 IS INITIAL.
    CREATE OBJECT gr_ccontainer1
    EXPORTING
    container_name = gc_custom_control_name1
    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.
    ENDIF.
    CREATE OBJECT gr_alvgrid1
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    i_parent = gr_ccontainer1
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    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.
    PERFORM set_col1.
    CALL METHOD gr_alvgrid1->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout1
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = gt_list1[]
    it_fieldcatalog = gt_fieldcat1[]
    IT_SORT =
    IT_FILTER =
    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.
    CALL METHOD gr_alvgrid1->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. "display_alv
    *& Form prepare_field_catalog
    text
    -->GT_FIELDCAT text
    FORM prepare_field_catalog CHANGING pgt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-fieldname = 'CARRID'.
    ls_fieldcat-scrtext_m = 'Air line code'.
    ls_fieldcat-col_pos = 0.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-fieldname = 'CONNID'.
    ls_fieldcat-scrtext_m = 'Connection code'.
    ls_fieldcat-emphasize = 'C900'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-fieldname = 'PRICE'.
    ls_fieldcat-scrtext_m = 'PRICE'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ENDFORM. "prepare_field_catalog
    *& Form prepare_layout
    text
    -->GS_LAYOUT text
    FORM prepare_layout CHANGING gs_layout TYPE lvc_s_layo.
    gs_layout-stylefname = 'FIELD_STYLE'.
    gs_layout-zebra = 'X'.
    gs_layout-grid_title = 'FLIGHT'.
    gs_layout-sel_mode = 'A'.
    gs_layout-ctab_fname = 'COLORS'.
    ENDFORM. "prepare_layout
    *& Form data_retrival
    text
    FORM data_retrival.
    SELECT carrid
    connid
    price
    FROM sflight
    INTO CORRESPONDING FIELDS OF TABLE gt_list
    UP TO 50 ROWS.
    ENDFORM. "data_retrival
    FORM EXIT_PROGRAM *
    FORM exit_program.
    CALL METHOD gr_ccontainer->free.
    CALL METHOD gr_ccontainer1->free.
    LEAVE TO SCREEN 0.
    ENDFORM. "exit_program
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'STAT'.
    SET TITLEBAR 'xxx'.
    IF W_CUSTOM_CONTAINER IS INITIAL.
    **sets TITLEBAR
    PERFORM TITLEBAR.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form prepare_field_catalog1
    text
    -->GT_FIELDCAT text
    FORM prepare_field_catalog1 CHANGING pgt_fieldcat1 TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'gt_list1'.
    ls_fieldcat-fieldname = 'SEATSMAX'.
    ls_fieldcat-scrtext_m = 'MAX. SEATS'.
    ls_fieldcat-col_pos = 0.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = ' '.
    APPEND ls_fieldcat TO pgt_fieldcat1.
    ls_fieldcat-tabname = 'gt_list1'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-fieldname = 'SEATSOCC'.
    ls_fieldcat-scrtext_m = 'SEATS OCCUPIED'.
    APPEND ls_fieldcat TO pgt_fieldcat1.
    ENDFORM. "prepare_field_catalog
    *& Form prepare_layout1
    text
    -->GS_LAYOUT text
    FORM prepare_layout1 CHANGING gs_layout1 TYPE lvc_s_layo.
    gs_layout1-stylefname = 'FIELD_STYLE'.
    gs_layout1-zebra = 'X'.
    gs_layout1-grid_title = 'DETAILS'.
    gs_layout-sel_mode = 'C'.
    gs_layout1-info_fname = 'RCOL'.
    gs_layout-no_toolbar = 'X'.
    ENDFORM. "prepare_layout
    *& Form data_retrival1
    text
    FORM data_retrival1.
    SELECT seatsmax
    seatsocc
    FROM sflight
    INTO CORRESPONDING FIELDS OF TABLE gt_list1
    UP TO 50 ROWS.
    ENDFORM. "data_retrival
    *& Form exclude_tb_functions
    &---- subroutine to exclude toolbar options -
    text
    -->PT_EXCLUDE text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    DATA ls_exclude TYPE ui_func.
    ls_exclude = cl_gui_alv_grid=>mc_fc_maximum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_minimum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_sort.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_subtot.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_filter.
    APPEND ls_exclude TO pt_exclude.
    ENDFORM. "data_retrival1
    *& Form cell_info
    text
    FORM cell_info. "CHANGING pt_cell TYPE lvc_t_cell.
    DATA lt_cell TYPE lvc_t_cell WITH HEADER LINE.
    CALL METHOD gr_alvgrid->get_selected_cells
    IMPORTING
    et_cell = lt_cell[].
    LOOP AT lt_cell.
    WRITE : lt_cell-col_id , lt_cell-row_id.
    ENDLOOP.
    MODIFY pt_cell[] from lt_cell[].
    ENDFORM. "cell_info
    *& Form set_col
    text
    FORM set_col .
    DATA ls_cellcolor TYPE lvc_s_scol.
    LOOP AT gt_list.
    IF gt_list-price GT 500.
    ls_cellcolor-fname = 'PRICE'.
    ls_cellcolor-color-col = 5.
    ls_cellcolor-color-int = 1.
    ls_cellcolor-color-inv = 0.
    APPEND ls_cellcolor TO gt_list-colors.
    else.
    ls_cellcolor-fname = 'PRICE'.
    ls_cellcolor-color-col = 3.
    ls_cellcolor-color-int = 1.
    APPEND ls_cellcolor TO gt_list-colors.
    ENDIF.
    MODIFY gt_list.
    ENDLOOP.
    ENDFORM. "set_col
    *& Form set_col1
    text
    FORM set_col1.
    data : ind type sy-tabix,
    indx type sy-tabix.
    loop at gt_list1.
    ind = sy-tabix / 2.
    indx = sy-tabix - ind.
    if indx eq ind.
    gt_list1-rcol = 'C500'.
    endif.
    MODIFY gt_list1.
    endloop.
    ENDFORM. "set_col
    *FORM TITLEBAR.
    *SET TITLEBAR 'TITLE'.
    *ENDFORM.
    *double click on TITLE and write ur title
    Thanks,
    Samantak.
    Rewards points for useful answers.

  • Displaying Data Using Selection-screen in Module Pool

    Hi All,
    Currently I'm working on a module pool program.In that i'm having two screens 9000 and 9001.
    I want to select a bookrefno using a selection screen and display header & table control data in 9001 screen when the bookrefno is validated.
    can anyone help me sending sample code regarding this
    Regards
    Ravi S

    Hi Ravi
    Place "bookrefno." field on screen 9000.
    Use validations on that particular field by using chain-endchain.
    in PAI of 9000
    case sy-ucomm
    when 'display'
    call screen 9001
    write select statment to display data i.e header & table control in 9001 .
    hope this would solve your problem.
    reward points, if its helpful.
    Thanks
    RK Nimma

  • Enhancement for ME21N & ME22N new subscreen

    Hi all,
    I'm looking to ad a new subscreen using definition ME_GUI_PO_CUST. I looked at the example CL_EXM_IM_ME_GUI_PO_CUST to understand how it works. Do you know why in the example the include "LMEVIEWSF01" is used? How the logic in the PBA and PAI works with the new subscreen? And where to put the new logic?
    Thanks.

    DONE THROUGH USER EXIT

Maybe you are looking for

  • How to reduce file size in flash gallery and add description

    How can i reduce physical filesize of my photo's within the flash web gallery. When i generate the flash gallery it takes the original filesizes to publisch, some jpg files are verry large, not mentioning my raw files. How can i reduce the filesize?

  • [solved] "sudo meld" doesn't work

    Hi there, recently I've installed "meld" for merging tasks. The problem: as a user meld works pretty fine but obviously doesn't save any changes to files that require root permission. Now I have tried to start meld with sudo, but this doesn't work: $

  • Despatches to SEZ customer being treated as exports

    Excise invoice generated for sez customer should not sit in ED payable account One of our plant in pondy doing inter plant transfer sales to SEZ customer within India; This is treated as export sales as per Govt of India rules We generate excise invo

  • How do I clear and remove cookies using safari 7.1

    How do I delete cookies.  Using safari 7.1

  • Time-dependency in master-data

    Good mornging BW-community I still have a problem during my query. I have time-dependent master-data (an item infoObject with it's corresponding price as an attribute) and want to show the item prices depending on the date of sale on my bill. I can p