ALV Display on the Custom Control

Hi Friends,
Iam developing a Module Pool program where I call a ALV grid on a custom control.
I have only one screen in which i have a input field and a custom control.
when I enter a material number in the input field and press ENTER the custom control should be populated with some of the material details. I have written all the logic. But the problem is when i press enter the custom control is not filled but after I press the REFRESH button present by default on the grid, the details are displayed.
What is the problem??
Regards,
Raju...

HI,
Use the method <b>REFRESH_TABLE_DISPLAY</b> after filling the new values into <b>it_outtab</b> table. in the PBO flow logic of your Module pool program.
<b>CALL METHOD grid1->refresh_table_display.</b>
Regards,

Similar Messages

  • Hide the custom control while changing the tab

    Hello Experts,
    I am using many screens & subscreens in my application. In a tabstrip control, I am calling one subscreen which has Custom Control to display the text editor.
    When I change the tab say for ex from TAB1 to TAB2, the custom control with text editor remains at the same place. In TAB2 I dont want custom control of TAB1.
    Thank you to go through my query.
    Regards,
    Bhavina
    Edited by: Rob Burbank on Aug 23, 2010 5:12 PM

    Hello Alej,
    I have created one subscreen which i need in a tabstrip control. Now this subscreen has one Editor Control (CL_GUI_TEXTEDIT->TEXT_EDITOR)  which I put on Custom Control. Custom Control is placed in the subscreen with SE51.
    to put the editor control  of CL_GUI_TEXTEDIT, I need Custom Control on screen. And I didnt find any property using which we can hide custom control.
    Is there any way using classes or methods, can we put Editor Control without using the custom control of screen.
    I think in your prob, you had ALV, that we can put on another subscreen, but in my prob how can we remove custom control Please Explain.
    Thanks & Regards,
    Bhavina

  • How to use the custom control ?

    Hi Friends,
    plz help to use of  custom control in screen painter ?
    and how to use the custom control ?
    Thanking you.
    Regards,
    Subash.

    HI,
    Screen Elements
    A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). You use the Screen Painter to arrange elements on the screen.
    You can use the following elements:
    ·        Text fields
    Display elements, which cannot be changed either by the user or by the ABAP program.
    ·        Input/output fields and templates
    Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.
    ·        Dropdown list boxes
    Special input/output fields that allow users to choose one entry from a fixed list of possible entries.
    ·        Checkbox elements
    Special input/output fields that the user can either select (value ‘X’) or deselect (value SPACE). Checkbox elements can be linked with function codes.
    ·        Radio button elements
    Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.
    ·        Pushbuttons
    Elements on the screen that trigger the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.
    ·        Frame
    Pure display elements that group together elements on the screen, such as radio button groups.
    ·        Subscreens
    Area on the screen in which you can place another screen.
    ·        Table controls
    Tabular input/output fields.
    ·        Tabstrip controls
    Areas on the screen in which you can switch between various pages.
    ·        Custom Controls
    Areas on the screen in which you can display controls. Controls are software components of the presentation server.
    ·        Status icons
    Display elements, indicating the status of the application program.
    ·        OK field
    Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.
    All screen elements have a set of attributes, some of which are set automatically, others of which have to be specified in the Screen Painter. They determine things such as the layout of the screen elements on the screen. You can set the attributes of screen elements in the Screen Painter - either for a single element, or using the element list, which lists all of the elements belonging to the current screen. Some of the attributes that you set statically in the Screen Painter can be overwritten dynamically in the ABAP program.
    with regards,
    sowjanyagosala

  • BDC on transaction CV02N handling the Custom Control

    Hi Guru's,
           I am developing a BDC program for the transaction CV02N. This transaction is for Changing the document link. Here I need to delete the existing Document links and create the new ones.
         I am facing the issue for Deleting the document links. The custom control has the links for each document. I need to select each document link in the custom control then delete it. But  the BDC recording is not showing this selection of document links in the custom control, If I write the program using the recording, it is stopping me at the time of pressing the delete button, and giving the message make the selection.
    I dont know how to handle this custom control's in BDC program. Please help me.
    Thanks
    Ravi.

    Use the [search tool for CV02NBDC|http://www.sdn.sap.com/irj/scn/advancedsearch?query=cv02nBDC] and then [for CV02NBAPI|http://www.sdn.sap.com/irj/scn/advancedsearch?query=cv02nBAPI] (look for BAPI_DOCUMENT*)
    Basically, transaction ending with "N" are Enjoy, and not fully suitable for BDC, so look for BAPI, or sometimes for older version of the transaction, without the trailing "N" (til they become obsolete)
    Regards,
    Raymond

  • Date not being displayed in the custom format

    Hi ,
      I have a problem wherein i am unable to change the format of the date.
    I need the date to be in the format 'January 10,2010.' however the date is being displayed as '1/10/10'. I have tried all options for the date formatting. I specified the custom format as 'MMMM D,YYYY' as mentioned in the SAP Library. I am trying to use the std custom options like YYYY-MM-DD, the date is not being dispalyed in the custom format provided by SAP either.
    I have binded date from the context, used the Current Date field provided by SAP.  Nothing works.
    Its not working on the new form. However the old forms have the same kind of formatting and are being displayed as desired.
    Please suggest as to what the issue could be.
    Thanks,
    Soumya.

    Hi All,
    Even I'm encountering the same issue. I'm trying to control the outputted date format programmatically.Please have a look.
    data: v_int_date like sy-datum,
            v_ext_date(10).
    v_int_date = '20110201'
    write v_int_date to v_ext_date MM/DD/YYYY.
    Here I've tried to convert the date to external format using a fixed format(MM/DD/YYYY). But still it's getting outputted in the format DD/MM/YYYY only as that's the way its defined in the User Master!
    Is there any solution for this? How can I 'override' defaults in the SAP User Master?
    Thanks,
    Mahesh

  • How to display text in custom control?

    Im doing a module pool program. There I have a Input field ,if user input there, some text I have to show in custom control. I have created custom control . But how to display some text there? what method I have to use?
    I have use this code for creating custom control.
    CREATE OBJECT EDITOR_CONTAINER
          EXPORTING
            CONTAINER_NAME              = 'TEXTEDITOR'
          EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5.
        CREATE OBJECT TEXT_EDITOR
          EXPORTING
            PARENT           = EDITOR_CONTAINER
            WORDWRAP_MODE    = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
            WORDWRAP_POSITION          = LINE_LENGTH
            WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.

    Hi,
    You will have to use the method 'set_text_as_r3table' to display your text in the object.
    The text will have to be passed as an internal table to the method.
    Regards,
    Ankur Parab

  • Component level display of the Custom Error Message in 11g

    Iam using custom error handler that extends the default DCErrorHandlerImpl class to handle the Custom exceptions thrown from the service layer, and able to see the exception displayed in the ADF UI in a popup window.
    How can we do Customization in order to display the Custom error message inline with a component (i.e. associated with a specific UI component with the arrow mark look and feel ) instead of the global level message displayed as a pop up window on the ADF UI page? Please suggest.
    Thanks,
    Kayal.
    Edited by: user11217416 on Feb 15, 2012 6:07 AM
    Edited by: user11217416 on Feb 15, 2012 6:14 AM

    Hi,
    Try as follows
      final static int MSG_FATAL = 1;
      final static int MSG_ERROR = 2;
      final static int MSG_WARN = 3;
      final static int MSG_INFO = 4;
          public static void showMsgForRelevantComponentAll(int iSeverity, String sMsg, UIComponent uIComponent) {
              FacesMessage msg = null;
              switch (iSeverity) {
              case MSG_FATAL:
                  msg = new FacesMessage(FacesMessage.SEVERITY_FATAL, null, sMsg);
                  break;
              case MSG_ERROR:
                  msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, sMsg);
                  break;
              case MSG_WARN:
                  msg = new FacesMessage(FacesMessage.SEVERITY_WARN, null, sMsg);
                  break;
              case MSG_INFO:
              default:
                  msg = new FacesMessage(FacesMessage.SEVERITY_INFO, null, sMsg);
              FacesContext facesContext = FacesContext.getCurrentInstance();
              facesContext.addMessage(uIComponent.getClientId(facesContext), msg);
          }

  • How to limit the number of rows in the Custom Control box

    Hi All,
    In my Module pool screen I have a Custom Control box for providing some free text as input. Now, there is no limit in the number of rows allowed for this box.
    But, the requirement is, it should have the maximum number of rows = 99. and each row should have maximum length = 60 characters.
    User should not be allowed to enter more than 60 characters per row and more than 99 rows.
    Could you please let me know how to do this..? Are there any methods available which controls the maximum number of rows and maximum length per row..?
    Please help me in resolving the issue. Thanks in advance.
    Thanks & Regards,
    Paddu.

    By "Custom Control Box", do you mean a Custom Container or a Table Control?
    Anyway, I suggest you to use a table control (not a custom container as your requirement seems to be very precise on that point, maybe ask your client twice to make sure). Look at the examples of table controls in ABAPDOCU transaction.

  • Data Display in the Table Control

    Hi All,
             Please help me know how to fetch the data from the internal table in to the Table Control.  I have defined the internal table with some fields and wrote the select query to fetch the records from database. But Iam unable to get the idea of how to pass the internal table records into the table control.
    Your suggestion will be appreciated.
    Thanks and Regards,
    Murali Krishna Tatoju

    HI
    if your select query is first operation before the screen is displayed.
    then write the select query in PBO.
    in PBO
    module select
    loop at itab with control tc.
    module transfer_itab_to_tc
    endloop
    in program.
    module select
    select query here and get the data.
    endmodule
    module transfer_itab_to_screen.
    move-corresponding itab to t_tab " here t_tab is strucutre from where the fields on Table control has been taken
    endmodule
    Cheerz
    Ram

  • How to open a Excel file and display on the custom screen

    Guys, I am new to screen programming. In my first screen (SCREEN #9000) I want to put a field, where I must be able to select a file from my desktop and when I click the DISPLAY button, it should suck all the data from the spread sheet in to an internal table, and should display the next screen  (SCREEN #9001), displaying the data from the internal table along with a button called LOAD. Now when I click the LOAD button after reviewing the data, it must load the data to my custom table in R/3. I know how to load an Excel spreadsheet to R/3 without the custom screens. But my requirement now is to do from custom screens like I mentioned above. Any ideas how to do this? Thanks.
    Dan

    Hi Dan,
    In my first screen (SCREEN #9000) I want to put a field, where I must be able to select a file from my desktop and when I click the DISPLAY button, it should suck all the data from the spread sheet in to an internal table, and should display the next screen (SCREEN #9001)
    For  this create a MPP program and create a Push button. Write the code for this to open a file like use f4_filename.From here you are able to select a file.
    + displaying the data from the internal table along with a button called LOAD. Now when I click the LOAD button after reviewing the data, it must load the data to my custom table in R/3.+
    With the above you are able to open a file and now you have to load that data into internal table. Select the file from the desktop.
    Totally you have to create 1) Screen 2) Push button( Open File) 3) Load data ( From file) .
    [Create Push Buttons|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba9a635c111d1829f0000e829fbfe/content.htm]
    Check this if there is any please post.
    Regards,
    Madhu.

  • 2002 G3 600 mhz iMac display stays dim with an unidentified sign displayed.  The contrast control does not work.

    My display screen is dim and the contrast control does not work.  There is a sign on the screen that I have been unable to identify.  It is a white circle outline with a half moon solid circle within it.  Does anyone know what's wrong?

    There is a sign on the screen that I have been unable to identify.  It is a white circle outline with a half moon solid circle within it
    That would be a screen contrast symbol     
    My display screen is dim and the contrast control does not work.
    Did you reset the PRAM? http://support.apple.com/kb/ht1379 And the pram battery may need to be replaced if it is over 3 years old it is under the iMac under the ram cover and there is a little button in there to reset the pmu as well. you have to have it pluged in when you do a pmu reset. there is a lot more stuff to try before the worst case scenario that is a bad PAV board the Pav is what runs the monitor and if it is going bad That may be a syptom that it is haveing and they can not be fixed (Well not for under $250 and that is useing old parts because they do not make them any more) but that wood be worst case scenario. Lets just hope it just needs to be reset Try that and Keep us posted

  • Alv display for the 2nd time.

    Hi everybody
    I have created a interactive alv report. when i am going for   first display it is giving correct result whne i go for 2nd time it is not initilizing the grids the records are displayed twice or same record is displayed. i have check BCALV_GRID_03 but i could not understand it properly so i am giving my code please help.
    *& Report  ZVTEST1                                                     *
    REPORT  ZVTEST1 .
    class lcl_event_receiver definition deferred.
    class cl_event_receiver definition deferred.
    TYPE-POOLS : SLIS.
    tables : ekko,ekpo,lfa1.
    data : begin of itab occurs 0,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
          end of itab.
    data : begin of inv_det occurs 0,
             ebeln like ekko-ebeln,
             bedat like ekko-bedat,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
           end of inv_det.
    data : begin of mat_det occurs 0,
             ebeln like ekko-ebeln,
             lifnr like ekko-lifnr,
             bedat like ekko-bedat,
             matnr like ekpo-matnr,
             menge like ekpo-menge,
             netpr like ekpo-netpr,
             NETWR LIKE EKPO-NETWR,
             maktx like makt-maktx,
           end of mat_det.
    DATA :TEST_GRID TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT TYPE SCRFNAME VALUE 'TESTING_ALV',
          TEST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT TYPE LVC_S_LAYO,
          TEST_FIELDCAT TYPE LVC_T_FCAT,
          ok_code like sy-ucomm,
          event_receiver type ref to lcl_event_receiver,
          event_receiver1 type ref to cl_event_receiver,
          TEST_GRID1 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT1 TYPE SCRFNAME VALUE 'PARTYWISE_DETAILS',
          TEST_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          ls_layout TYPE lvc_s_layo,
          TEST_LAYOUT1 TYPE LVC_S_LAYO,
          TEST_FIELDCAT1 TYPE LVC_T_FCAT,
          TEST_GRID2 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT2 TYPE SCRFNAME VALUE 'INVOICE',
          TEST_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT2 TYPE LVC_S_LAYO,
          TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    select-options: s_bedat for ekko-bedat.
    CALL SCREEN 100.
    class LCL_EVENT_RECEIVER definition.
      public section.
          methods:
          handle_double_click
            for event double_click of cl_gui_alv_grid
                importing e_row e_column.
      private section.
    endclass.
    class LCL_EVENT_RECEIVER implementation.
    method handle_double_click.
        data: itab1 like line of itab.
        read table itab index e_row-index into itab1.
        perform select_table_invdet using itab1
                                   changing inv_det.
        call screen 200 starting at 10 5.
    endmethod.
    endclass.
    class CL_EVENT_RECEIVER definition.
      public section.
          methods:
           handle_hotspot_click
            for event hotspot_click of cl_gui_alv_grid
                importing e_row_id e_column_id es_row_no.
      private section.
    endclass.
    class CL_EVENT_RECEIVER implementation.
    method handle_hotspot_click.
        data: itab2 like line of inv_det.
        read table inv_det index e_row_id-index into itab2.
        perform select_matdet using itab2
                                   changing mat_det.
        call screen 300 starting at 15 5.
    endmethod.
    endclass.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'TEST'.
    PERFORM SELECT-DATA.  " FOR THE INITIAL LIST.
    PERFORM ALV_DISPLAY.   "TO DISPLAY INITIAL SCREEN.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
       WHEN 'BACK'.
         LEAVE TO SCREEN 0.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  SELECT-DATA
          text
    -->  p1        text  DATA SELECTION FOR THE 1ST LIST
    <--  p2        text
    FORM SELECT-DATA .
    select alifnr sum( bnetwr ) as netwr
        into corresponding fields of itab
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where abedat in s_bedat group by alifnr.
        select single name1 from lfa1 into itab-name1
           where lifnr = itab-lifnr.
    append itab.
    endselect.
    ENDFORM.                    " SELECT-DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text  DISPLAY THE LIST FIRST TIME.
    <--  p2        text
    FORM ALV_DISPLAY .
    IF TEST_GRID IS INITIAL.
         CREATE OBJECT TEST_CONTAINER
           EXPORTING
             CONTAINER_NAME              = 'TESTING_ALV'.
          CREATE OBJECT TEST_GRID
            EXPORTING
              I_PARENT          =  TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           IS_LAYOUT                     =  TEST_LAYOUT
         CHANGING
           IT_OUTTAB                     =  ITAB[]
           IT_FIELDCATALOG               =  TEST_FIELDCAT[].
    create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click for TEST_GRID.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = TEST_CONTAINER.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  PROC_CATALOG
          text
         <--P_TEST_FIELDCAT  text
    FORM PROC_CATALOG  CHANGING P_TEST_FIELDCAT type lvc_t_fcat.
    data: TEST_fieldcat type lvc_s_fcat.
    TEST_FIELDCAT-fieldname = 'LIFNR'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '12'.
    TEST_FIELDCAT-coltext   = 'VENDOR CODE'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR CODE'.
    *TEST_FIELDCAT-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NAME1'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '25'.
    TEST_FIELDCAT-coltext   = 'VENDOR NAME'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR NAME'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NETWR'.
    TEST_FIELDCAT-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT-OUTPUTLEN = '20'.
    TEST_FIELDCAT-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    ENDFORM.                    " PROC_CATALOG
    *&      Form  PROC_LAYOUT
          text
         <--P_TEST_LAYOUT  text
    FORM PROC_LAYOUT  CHANGING P_TEST_LAYOUT type lvc_s_layo.
    p_TEST_layout-zebra = 'X'.
    p_TEST_layouT-grid_title = 'TEST INTERACTIVE ALV'.
    p_TEST_layout-smalltitle = 'X'.
    p_TEST_layout-no_hgridln    = 'X'.
    p_TEST_layout-excp_conds  = 'X'.
    p_TEST_layout-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT
    *&      Form  select_table_invdet
          text
         -->P_ITAB1  DATA SELECTION FOR THE 2ND LIST
         <--P_INV_DET  text
    FORM select_table_invdet  USING    P_ITAB1 like line of itab
                              CHANGING P_INV_DET.
    clear inv_det.
    select alifnr aebeln abedat sum( bnetwr ) as netwr
        into corresponding fields of inv_det
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where  alifnr = p_itab1-lifnr and abedat in s_bedat group by
         alifnr  aebeln a~bedat.
        select single name1 from lfa1 into inv_det-name1
           where lifnr = inv_det-lifnr.
    append INV_DET.
    endselect.
    ENDFORM.                    " select_table_invdet
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
    IF TEST_GRID1 IS INITIAL.
        CREATE OBJECT TEST_CONTAINER1
           EXPORTING
             CONTAINER_NAME              = 'NEXT_CONT'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
      ENDIF.
         CREATE OBJECT TEST_GRID1
           EXPORTING
             I_PARENT          = TEST_CONTAINER1.
       PERFORM PROC_CATALOG1 CHANGING TEST_FIELDCAT1.
       PERFORM PROC_LAYOUT1 CHANGING TEST_LAYOUT1.
        CALL METHOD TEST_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
            IS_LAYOUT                     =  test_layout1
          CHANGING
            IT_OUTTAB                     =  inv_det[]
            IT_FIELDCATALOG               =  TEST_FIELDCAT1[].
    create object EVENT_RECEIVER1.
        set handler EVENT_RECEIVER1->handle_hotspot_click for TEST_GRID1.
    ELSE.
       CALL METHOD TEST_GRID1->REFRESH_TABLE_DISPLAY.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           =  TEST_container1.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
          text
    MODULE USER_COMMAND_0200 INPUT.
      case ok_code.
        when 'EXIT'.
    leave to screen 0.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Form  PROC_CATALOG1
          text
         <--P_TEST_FIELDCAT1  text
    FORM PROC_CATALOG1  CHANGING P_TEST_FIELDCAT1 type lvc_t_fcat.
    data: TEST_fieldcat1 type lvc_s_fcat.
    TEST_FIELDCAT1-fieldname = 'EBELN'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '12'.
    TEST_FIELDCAT1-coltext   = 'P.O NUMBER'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O NUMBAR'.
    TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'BEDAT'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '10'.
    TEST_FIELDCAT1-coltext   = 'P.O.DATE'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O.DATE'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'NETWR'.
    TEST_FIELDCAT1-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT1-OUTPUTLEN = '20'.
    TEST_FIELDCAT1-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    ENDFORM.                    " PROC_CATALOG1
    *&      Form  PROC_LAYOUT1
          text
         <--P_TEST_LAYOUT1  text
    FORM PROC_LAYOUT1  CHANGING P_TEST_LAYOUT1  type lvc_s_layo.
    p_TEST_layout1-zebra = 'X'.
    p_TEST_layouT1-grid_title = 'DATE WISE PURCHASE ORDERS'.
    p_TEST_layout1-smalltitle = 'X'.
    p_TEST_layout1-no_hgridln    = 'X'.
    p_TEST_layout1-excp_conds  = 'X'.
    p_TEST_layout1-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT1
    *&      Form  select_matdet
          text
         -->P_ITAB2  text
         <--P_MAT_DET  text
    FORM select_matdet  USING    P_ITAB2 like line of inv_det
                        CHANGING P_MAT_DET.
    select ebeln bedat lifnr from ekko into corresponding fields of mat_det
        where ebeln = p_itab2-ebeln and bedat = p_itab2-bedat
          and lifnr = p_itab2-lifnr..
    select matnr menge netpr NETWR from ekpo
       into corresponding fields of mat_det
         where ebeln = mat_det-ebeln.
    select single maktx from makt into corresponding fields of mat_det
         where matnr = mat_det-matnr.
    append mat_DET.
    endselect.
    endselect.
    ENDFORM.                    " select_matdet
    *&      Module  STATUS_0300  OUTPUT
          text
    MODULE STATUS_0300 OUTPUT.
    set pf-status 'TEST1'.
    IF TEST_GRID2 IS INITIAL.
       CREATE OBJECT TEST_CONTAINER2
         EXPORTING
           CONTAINER_NAME              = 'INVOICE_DETAILS'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
        ENDIF.
        CREATE OBJECT TEST_GRID2
          EXPORTING
            I_PARENT          = TEST_CONTAINER2.
         PERFORM PROC_CATALOG2 CHANGING TEST_FIELDCAT2.
         PERFORM PROC_LAYOUT2 CHANGING TEST_LAYOUT2.
         CALL METHOD TEST_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
           EXPORTING
             IS_LAYOUT                     = test_layout2
           CHANGING
             IT_OUTTAB                     = mat_det[]
             IT_FIELDCATALOG               = test_fieldcat2[].
    else.
    CALL METHOD TEST_GRID2->GET_FRONTEND_LAYOUT
      IMPORTING
        ES_LAYOUT = ls_layout.
    CALL METHOD TEST_GRID2->SET_FRONTEND_LAYOUT
      EXPORTING
        IS_LAYOUT = ls_layout.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = test_container2.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        TITEL         = SY-REPID
        TXT1          = SY-SUBRC
        TXT2          = 'ERROR IN FLUSH'.
    ENDIF.
    ENDMODULE.                 " STATUS_0300  OUTPUT
    *&      Module  USER_COMMAND_0300  INPUT
          text
    MODULE USER_COMMAND_0300 INPUT.
    case ok_code.
        when 'BACK'.
            leave to screen 0.
        WHEN 'CANCLE'.
          LEAVE PROGRAM.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0300  INPUT
    *&      Form  PROC_CATALOG2
          text
         <--P_TEST_FIELDCAT2  text
    FORM PROC_CATALOG2  CHANGING P_TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    data: TEST_fieldcat2 type lvc_s_fcat.
    TEST_FIELDCAT2-fieldname = 'MATNR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '12'.
    TEST_FIELDCAT2-coltext   = 'MATERIAL NO'.
    TEST_FIELDCAT2-SELTEXT   = 'MATERIAL NO'.
    *TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MAKTX'.
    TEST_FIELDCAT2-REF_TABLE = 'MAKT'.
    TEST_FIELDCAT2-OUTPUTLEN = '30'.
    TEST_FIELDCAT2-coltext   = 'DESCRIPTION'.
    TEST_FIELDCAT2-SELTEXT   = 'DESCRIPTION'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MENGE'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '10'.
    TEST_FIELDCAT2-coltext   = 'QUANTITY'.
    TEST_FIELDCAT2-SELTEXT   = 'QUANTITY'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETPR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETWR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    ENDFORM.                    " PROC_CATALOG2
    *&      Form  PROC_LAYOUT2
          text
         <--P_TEST_LAYOUT2  text
    FORM PROC_LAYOUT2  CHANGING P_TEST_LAYOUT2  type lvc_s_layo.
    p_TEST_layout2-zebra = 'X'.
    p_TEST_layouT2-grid_title = 'PURCHASE ORDERS MATERIAL WISE DETAILS'.
    p_TEST_layout2-smalltitle = 'X'.
    p_TEST_layout2-no_hgridln    = 'X'.
    p_TEST_layout2-excp_conds  = 'X'.
    p_TEST_layout2-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT2
    thanks
    Vinayak.

    Vinayak,
    Add the Code(ELSE part) into the Form ALV_DISPLAY.
    IF TEST_GRID IS INITIAL.
      CREATE OBJECT TEST_CONTAINER
        EXPORTING
          CONTAINER_NAME = 'TESTING_ALV'.
      CREATE OBJECT TEST_GRID
        EXPORTING
         I_PARENT = TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_LAYOUT = TEST_LAYOUT
          CHANGING
               IT_OUTTAB = ITAB[]
               IT_FIELDCATALOG = TEST_FIELDCAT[].
        create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click
           for   TEST_GRID.
    <b>ELSE.
       CALL METHOD TEST_GRID->REFRESH_TABLE_DISPLAY(
                 "EXPORTING
                 "IS_STABLE =
                 "I_SOFT_REFRESH=
                            ).</b>
    ENDIF.
    Thanks
    Kam
    Note: Allot points for all worthful postings

  • How to exclude certain rows in the ALV display from the total?

    Hi,
    May I know is there a way to exclude certain rows that are shown in the ALV control from the calculation of grand total?
    Thanks much.

    See, if
    function module REUSE_ALV_TRANSFER_DATA 's
    IT_EXCLUDING   .... param
    works for you.

  • ALV display using the fieldcatalog created programatically

    Hi,
    I have created a field catalog to be passed to the FM REUSE_ALV_GRID_DISPLAY, without calling the FM REUSE_ALV_FIELDCATALOG_MERGE.
    The result is being displayed properly. But the problem is that, when I try to export the alv into a spreadsheet by clicking on the button 'Local File..', the data is saved in random manner in the excel file.(data is being placed in saome other column).
    How to rectify this.
    Please help.
    Regards
    s.a.k

    Hi,
    data:
    l_tbl_fieldcat    TYPE          slis_t_fieldcat_alv,
    lv_fcat           LIKE LINE OF   l_tbl_fieldcat.
    *********************Prepare field catalog***********************
    *Column: Role Name
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'AGR_NAME'.
      lv_fcat-ref_fieldname   =   'AGR_NAME'.
      lv_fcat-tabname         =   'AGR_1251'.
      lv_fcat-col_pos         =   1.
      lv_fcat-seltext_s       =   text-003.
      lv_fcat-seltext_m       =   text-003.
      lv_fcat-seltext_l       =   text-003.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    *Column: Role Description
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'TEXT'.
      lv_fcat-ref_fieldname   =   'AGR_TITLE'.
      lv_fcat-tabname         =   'AGR_TEXTS'.
      lv_fcat-col_pos         =   2.
      lv_fcat-seltext_s       =   text-004.
      lv_fcat-seltext_m       =   text-004.
      lv_fcat-seltext_l       =   text-004.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    *Column: Transaction Code
      CLEAR lv_fcat.
      lv_fcat-fieldname       =   'LOW'.
      lv_fcat-ref_fieldname   =   'TCODE'.
      lv_fcat-tabname         =   'TSTCT'.
      lv_fcat-col_pos         =   3.
      lv_fcat-seltext_s       =   text-005.
      lv_fcat-seltext_m       =   text-005.
      lv_fcat-seltext_l       =   text-005.
      INSERT lv_fcat INTO TABLE l_tbl_fieldcat.
    Display ALV****
    CLEAR l_wa_layout.
      l_wa_layout-colwidth_optimize = lc_true.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat   = l_tbl_fieldcat
          is_layout     = l_wa_layout
        TABLES
          t_outtab      = l_tbl_role_res
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    Regards
    s.a.k

  • Module pool-Custom controls

    Hi,
         Cany any one tell me with example how we will use the customccontrols in module pool program..Why it is used

    I got answer, i am using same editor for displaying all the custom controls.
    i.e. was the problem.
    anyway Thanks for looking into this issue.

Maybe you are looking for

  • Someone else's picture on my Photostream

    First time posting on here so be gently I've just been looking through my photos on my AppleTV device and found that there is a photo on there that I didn't take (i.e. - Someone elses photo !!). How is it possible that I have an image from someone el

  • Ratings loss after editing in Photoshop

    I have my LR3 RAW images rated a "1" star.  When I select one to edit in PHotoshop and save it, it shows back up in LR3 with no rating. This is costing me a lot of time to change my ratings to find the image and then put the rating back on.  This nev

  • I have to reinstall OSX upon every restart

    I have the oddest problem. Two weeks ago I restarted my computer and got stuck on the grey apple startup screen. At first I thought my HD was the issue. All of the data was accessable, and no signs of an issue (disk utility confirmed) Even knowing th

  • Need help working with audio channels in Premiere cs4

    Hello, I recorded audio with an analog mic, now the audio plays only on one audio channel( one speaker only) how do I fix this problem? Thank you

  • SCOM - How internally classes and properties, discovered and monitored

    I am trying to understand how internally classes created instances, and how it runs in the agent, discovered and monitored in the state view.  Need to understand this for Create my own design and develop complete management pack, to display some hard