Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Simple ALV (oops)

Former Member
0 Likes
591

hi

I am new to OOPs concept.In this cl_gui_alv_grid,What are all the method used to display the alv grid.

This is my coding ,While executing it is not showing anything ,I dont know exatly wt is the problem

I check with standard program am not able to clear it.

Can any one plz tell me wt are all methods i have to pass

Thanks in Advance

Dharma

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
562

Did you created a screen?

On that screen did u created a Custom Container?

Did you created an instance for Custom Container?

There will be so many other questions also.

Check these things. Search Forum you will get many helpful documents for the same.

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
563

Did you created a screen?

On that screen did u created a Custom Container?

Did you created an instance for Custom Container?

There will be so many other questions also.

Check these things. Search Forum you will get many helpful documents for the same.

Read only

Former Member
0 Likes
562

hi

I am doing without the screen.

without OOPs

I am dong like this way

1.Field catlog pr merge

2.grid alv display

3.events

4.top of page

like i want to know the steps ....

Thanks

Dharma

Read only

Former Member
0 Likes
562

Hi Raj,

We create a screen with a custom control and use that screen for displaying the ALV output.

Please Check the below code, you will understand.

Data Declarations :



DATA : MY_CONTAINER      TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
       GRID              TYPE REF TO CL_GUI_ALV_GRID,
       GT_FCAT           TYPE TABLE OF  LVC_S_FCAT WITH HEADER LINE.
DATA : BEGIN OF GT_VBAK OCCURS 0,
        VBELN   TYPE VBAK-VBELN,
        ERDAT   TYPE VBAK-ERDAT,
       END OF GT_VBAK.

Call the screen



START-OF-SELECTION.

  CALL SCREEN 200.

  • IN PAI of screen 200*


SET PF-STATUS 'ZMMK_OOPS1'.

  SELECT VBELN
         ERDAT FROM VBAK INTO TABLE GT_VBAK
               UP TO 10 ROWS.


  CREATE OBJECT MY_CONTAINER
    EXPORTING
      CONTAINER_NAME              = 'CC1'
     EXCEPTIONS
      CNTL_ERROR                  = 1
      CNTL_SYSTEM_ERROR           = 2
      CREATE_ERROR                = 3
      LIFETIME_ERROR              = 4
      LIFETIME_DYNPRO_DYNPRO_LINK = 5
      OTHERS                      = 6.


  CREATE OBJECT GRID
    EXPORTING
      I_PARENT          = MY_CONTAINER
     EXCEPTIONS
       ERROR_CNTL_CREATE = 1
      ERROR_CNTL_INIT   = 2
      ERROR_CNTL_LINK   = 3
      ERROR_DP_CREATE   = 4
      OTHERS            = 5.

build field cat


  
  GT_FCAT-FIELDNAME = 'VBELN'.
  GT_FCAT-TABNAME   = 'GT_VBAK'.
  APPEND GT_FCAT.


  GT_FCAT-FIELDNAME = 'VBELN'.
  GT_FCAT-TABNAME = 'GT_VBAK'.
  APPEND GT_FCAT.


CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    CHANGING
      IT_OUTTAB                     = GT_VBAK[]
      IT_FIELDCATALOG               = GT_FCAT[]
    EXCEPTIONS
      INVALID_PARAMETER_COMBINATION = 1
      PROGRAM_ERROR                 = 2
      TOO_MANY_LINES                = 3
      OTHERS                        = 4.

*In PBO of Screen 200.


case sy-ucomm.
when 'back'.
leave program.
endcase.

Regards

Kumar M

Read only

0 Likes
562

hi Kumar..

Thanks for reply

It is easy to understand for me..

Thanks

Dharma Raj