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

ALV report using CLASS method

former_member1125862
Participant
0 Likes
2,554

Hi experts,

I am working on interactive ALV.

I know how to write this using FUNCTIONS.

But my requirement is how to writ using class method.

Can any one give me a sample program r notes how to write ALV using class method.

Waiting for your replay.

Thanks,

Kruthik

8 REPLIES 8
Read only

Former Member
0 Likes
1,165

By example SALV_DEMO_HIERSEQ_COLUMN or SALV_DEMO*

Read only

former_member182010
Active Participant
0 Likes
1,165

Hello,

Go to SE38 and search for all programs with parameter SALVDEM0. You will see all the SAP demo problems using the class methododolgy for ALV.

You can paste the link below in your browser to read about coding ALV using the class methodology on help.sap.com.

http://help.sap.com/erp2005_ehp_04/helpdata/EN/5e/88d440e14f8431e10000000a1550b0/frameset.htm

Regards,

Rae Ellen Woytowiez

Read only

Former Member
0 Likes
1,165

Chk the program BCALV_GRID_03 for interactive alv report using OO

also chk this thread.

Read only

Former Member
0 Likes
1,165

hi,

search on sdn, wiki you got the sample code for creating the ALV through OOPs..........

Regards

Gaurav

Read only

Former Member
0 Likes
1,165

http://wiki.sdn.sap.com/wiki/display/ABAP/ObjectModelALV-Interactive

Hope this helps...Thanks to ashish...

Sa

Read only

Former Member
0 Likes
1,165

Hi,

thise code is helpfil for you...this is an example code...just create a custum container with name CONTAINER1 with screen number 9000. create a transaction for it and run the program....

CODE{}

DATA: itab type TABLE OF sflight,

CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

GRID TYPE REF TO CL_GUI_ALV_GRID,

L_LAYOUT TYPE DISVARIANT,

G_LAYOUT TYPE LVC_S_LAYO.

&----


*& Module STATUS_9000 OUTPUT

&----


  • text

----


MODULE STATUS_9000 OUTPUT.

SET PF-STATUS 'ALV'.

SET TITLEBAR 'TITTLE'.

PERFORM ALV_CONTAINER.

ENDMODULE. " STATUS_9000 OUTPUT

&----


*& Form ALV_CONTAINER

&----


----


FORM ALV_CONTAINER .

IF CUSTOM_CONTAINER1 IS INITIAL.

CREATE OBJECT CUSTOM_CONTAINER1

EXPORTING

CONTAINER_NAME = 'CONTAINER1'.

----


CREATE OBJECT GRID

EXPORTING

I_PARENT = CUSTOM_CONTAINER1.

L_LAYOUT-REPORT = SY-REPID.

SELECT * from sflight into TABLE itab.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

I_STRUCTURE_NAME = 'SFLIGHT'

IS_VARIANT = L_LAYOUT

I_SAVE = 'A'

IS_LAYOUT = G_LAYOUT

CHANGING

IT_OUTTAB = ITAB.

  • IT_FIELDCATALOG = FIELDCAT.

ENDIF.

ENDFORM. " ALV_CONTAINER

&----


*& Module USER_COMMAND_9000 INPUT

&----


MODULE USER_COMMAND_9000 INPUT.

CASE SY-UCOMM.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

CODE{}

Read only

Former Member
0 Likes
1,165

Check the programs starting with BCALV_GRID..

Read only

former_member1125862
Participant
0 Likes
1,165

Got the solution by myself.