2006 Apr 07 10:47 PM
HI
Im writing a report in hr and I have been asked to display the employee # their positions and their basic pay.
Well I can handle this part.. by reading PA0001 and PA0008 .I have to write out put as ALV grid display . Using classes how can I write out put in ALV grid .
Waiting for your answers
Cheers
Usman
2006 Apr 07 10:52 PM
2006 Apr 07 10:52 PM
2006 Apr 07 10:59 PM
2006 Apr 08 5:27 PM
Hi Usman,
check the following links.
<a href="http://help.sap.com/saphelp_webas630/helpdata/en/99/49b844d61911d2b469006094192fe3/frameset.htm">ALV Grid Control</a>
Also check this <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=/library/abap/anEasyReferenceforALVGridControl.pdf">Easy reference to ALV grid</a>
here is the sample code
data : g_alv type ref to cl_gui_alv_grid,
gref_docking_container TYPE REF TO cl_gui_custom_container,
gs_layout TYPE lvc_s_layo,
gt_fieldcat type lvc_t_fcat,
gs_fieldcat type lvc_s_fcat.
DATA : gt_outtab type table of <table>.
data : gs_outtab like line of gt_outtab.
call screen 100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STAT'.
* SET TITLEBAR 'xxx'.
create object gref_docking_container
exporting
container_name = 'CCAREA_ALV'.
create object g_alv
exporting i_parent = GREF_DOCKING_CONTAINER.
select * from <table> into table GT_OUTTAB.
gs_fieldcat-fieldname = 'F1'.
gs_fieldcat-ref_table = 'table'.
gs_fieldcat-edit = 'X'.
gs_fieldcat-key = 'X'.
append gs_fieldcat to gt_fieldcat.
... and other fields.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_user_command FOR g_alv.
CALL METHOD g_alv->set_toolbar_interactive.
ENDMODULE. " STATUS_0100 OUTPUT
I hope you find this useful.
regards,
kinshuk
PS reward points if you find the post helpful