‎2010 Feb 01 3:19 PM
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
‎2010 Feb 01 3:28 PM
‎2010 Feb 01 3:29 PM
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
‎2010 Feb 01 3:33 PM
‎2010 Feb 01 4:00 PM
hi,
search on sdn, wiki you got the sample code for creating the ALV through OOPs..........
Regards
Gaurav
‎2010 Feb 01 4:51 PM
http://wiki.sdn.sap.com/wiki/display/ABAP/ObjectModelALV-Interactive
Hope this helps...Thanks to ashish...
Sa
‎2010 Feb 02 4:18 AM
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{}
‎2010 Feb 02 5:25 AM
‎2010 Jun 23 8:30 AM