Application Development 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: 

ALV grid output using classes

Former Member
0 Kudos
102

HI

I’m 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

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos
76

Checkout post

I`ll suggest you .pl ..also sreach here before posting a question .. In this way you dont have to ask same question again and again .. but we `ll always love to answer WHY ..points man

Thanks

3 REPLIES 3

former_member181966
Active Contributor
0 Kudos
77

Checkout post

I`ll suggest you .pl ..also sreach here before posting a question .. In this way you dont have to ask same question again and again .. but we `ll always love to answer WHY ..points man

Thanks

Former Member
0 Kudos
76

Look at this where Rich has a good example.

I agree with Saquib that you should first try searching this forum.

Former Member
0 Kudos
76

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