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

create screen when creating OOP ALV

Former Member
0 Likes
2,679

hi everybody

I have created an OOP ALV but I dont know how to attach it to a screen, i know its tcode se51, but i dnt know how to link it to the ALV

can anybody help me?

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,320

Create a Dynpro using SE51, in the dynpro (layout) create a "Custom Control".

In your Abap (or in PBO) create a container object ([cl_gui_custom_container|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_custom_container&adv=false&sortby=cm_rnd_rankvalue]) with container_name equal to the name of your Custom control then create an alv grid object ([cl_gui_alv_grid|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_alv_grid&adv=false&sortby=cm_rnd_rankvalue]), then use the method set_table_for_first_display on your alv grid object.

Look at

- [ALV Grid Control (BC-SRV-ALE)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf]

- [SAP Container|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIDOCK/BCCIDOCK.pdf]

Also don't hesitate to use the SAP demos program, look at transactions

- DEMO_SCREEN_FLOW Demonstration for Screen Sequences

- DEMO_TRANSACTION Demonstration Transaction

- DWDM Development Workbench Demos

- SE83 Reuse Library

Regards

5 REPLIES 5
Read only

former_member745780
Active Participant
0 Likes
1,320

Hello,

I think first you have to check some standard sap program :

BCALV_EDIT_01 Switch on and off the ready-for-input status of the entire grid

BCALV_EDIT_02 Define ready-for-input status at cell level

BCALV_EDIT_03 Verification of modified cells

BCALV_EDIT_04 Delete and append rows

BCALV_EDIT_05 Checkboxes

BCALV_EDIT_06 Dropdown Listbox at Column Level

BCALV_EDIT_07 Dropdown Listbox at Cell Level

BCALV_EDIT_08 Integrate Non-Standard F4 Help

there simple process like you have to add a container on a screen

and in report program

create an instance


data  g_container TYPE scrfname VALUE 'ZGW_CONTAINER',
      grid1  TYPE REF TO cl_gui_alv_grid.

where zgw_container is conatiner name which is asing to screen

then call the method set_table_for_first_display of class cl_gui_alv_grid .

pass the require parameter to that method.


    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
*    I_BUFFER_ACTIVE               =
*    I_BYPASSING_BUFFER            =
*    I_CONSISTENCY_CHECK           =
*    I_STRUCTURE_NAME              =    'ZGW3RE007'
    IS_VARIANT                    =    GS_VARIANT
        I_SAVE                        =    'A'
*    I_DEFAULT                     = 'X'
        IS_LAYOUT                     =     GS_LAYOUT
*    IS_PRINT                      =
*    IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =  lt_exclude
*    IT_HYPERLINK                  =
*    IT_ALV_GRAPHICS               =
*    IT_EXCEPT_QINFO               =
*    IR_SALV_ADAPTER               =
      CHANGING
        IT_OUTTAB                     =    GT_OUTTAB[]
        IT_FIELDCATALOG               =    WA1_FIELDCATALOG
*    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.

or read this pdf document.

http://www.sap-partner.hu/ABAP_HELP_INFO/An%20Easy%20Reference%20for%20ALV%20Grid%20Control.pdf

Thanks

Anirudh Saini

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,321

Create a Dynpro using SE51, in the dynpro (layout) create a "Custom Control".

In your Abap (or in PBO) create a container object ([cl_gui_custom_container|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_custom_container&adv=false&sortby=cm_rnd_rankvalue]) with container_name equal to the name of your Custom control then create an alv grid object ([cl_gui_alv_grid|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=cl_gui_alv_grid&adv=false&sortby=cm_rnd_rankvalue]), then use the method set_table_for_first_display on your alv grid object.

Look at

- [ALV Grid Control (BC-SRV-ALE)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf]

- [SAP Container|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIDOCK/BCCIDOCK.pdf]

Also don't hesitate to use the SAP demos program, look at transactions

- DEMO_SCREEN_FLOW Demonstration for Screen Sequences

- DEMO_TRANSACTION Demonstration Transaction

- DWDM Development Workbench Demos

- SE83 Reuse Library

Regards

Read only

Former Member
0 Likes
1,320

Hi Sia,

I think there is a new ABAP ALV Class .. which doesn't require a screen to be created for display.. check the package.

SALV_OBJECTS.

With Regards,

Ranganathan.

Read only

0 Likes
1,320

That's right, there is. The ALV Object model was introduced in NetWeaver 2004, which is an encapsulation of the existing ALV tools, the REUSE functions, and the CL_GUI_ALV_GRID class. The new Object model is OO based, and still allows to you show your grid in either full screen mode, which does not require you to create a screen, and it also provides container support, which allows to you embed the ALV control into your screens. Here is a document to get your started, and there are example programs which start withe SALV*

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de49...

Regards,

Rich Heilman

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,320

Hello

Please note that if you want to display your ALV list (CL_GUI_ALV_GRID) in fullscreen mode it is not required to have a custom container on the screen. Instead I usually use a docking container as parent for the grid control and simply LINK the docking container to the screen (see sample report ZUS_SDN_TWO_ALV_GRIDS in ).

Advantage of such a solution: you can easily re-link your docking container (including the control) to another screen if required.


* Link the docking container to the target dynpro
  CALL METHOD go_docking->link
    EXPORTING
      repid                       = syst-repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      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.
 
 
* NOTE: dynpro does not contain any elements
  CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*
*PROCESS BEFORE OUTPUT.
*  MODULE STATUS_0100.
**
*PROCESS AFTER INPUT.
*  MODULE USER_COMMAND_0100.

Regards

Uwe