Skip to Content
author's profile photo Former Member
Former Member

how to convert classical report to alv report

how to convert classical report to alv report,so that i can get all the functionalities in the final output of my report.

Iam using types,and seperate work areas.

Moderator message: please use a meaningful title for your questions. I have edited it for you this time.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 31, 2008 at 08:42 AM

    Hi,

    You will have to create a new report program wherein you can output your report as an ALV, which will have some built in functionality such as sorting, totalling etc. For this you'll have to call the function module REUSE_ALV_GRID_DISPLAY.

    If you want to create a simple ALV grid, here is a sample code where you are displaying the vendor number,vendor name and city from lfa1 table.

    type-pools slis.

    data: wa_fcat type slis_fieldcat_alv,

    i_fcat type slis_t_fieldcat_alv,

    begin of itab occurs 0,

    lifnr type lfa1-lifnr,

    name1 type lfa1-name1,

    ort01 type lfa1-ort01,

    end of itab.

    select lifnr name1 ort01 from lfa1 into table itab.

    perform create_fieldcatalog.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER = ' '

    • I_BUFFER_ACTIVE = ' '

    • I_CALLBACK_PROGRAM = ' '

    • I_CALLBACK_PF_STATUS_SET = ' '

    • I_CALLBACK_USER_COMMAND = ' '

    • I_CALLBACK_TOP_OF_PAGE = ' '

    • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

    • I_CALLBACK_HTML_END_OF_LIST = ' '

    • I_STRUCTURE_NAME =

    • I_BACKGROUND_ID = ' '

    • I_GRID_TITLE =

    • I_GRID_SETTINGS =

    • IS_LAYOUT =

    IT_FIELDCAT = i_fcat

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    • IT_SORT =

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    • IT_EVENTS =

    • IT_EVENT_EXIT =

    • IS_PRINT =

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • I_HTML_HEIGHT_TOP = 0

    • I_HTML_HEIGHT_END = 0

    • IT_ALV_GRAPHICS =

    • IT_HYPERLINK =

    • IT_ADD_FIELDCAT =

    • IT_EXCEPT_QINFO =

    • IR_SALV_FULLSCREEN_ADAPTER =

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    T_OUTTAB = itab[]

    • EXCEPTIONS

    • PROGRAM_ERROR = 1

    • OTHERS = 2

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    &----


    *& Form CREATE_FIELDCATALOG

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM CREATE_FIELDCATALOG .

    wa_fcat-tabname = 'LFA1'.

    wa_fcat-fieldname = 'LIFNR'.

    wa_fcat-reptext_ddic = 'Vendor'.

    append wa_fcat to i_fcat.

    clear wa_fcat.

    wa_fcat-tabname = 'LFA1'.

    wa_fcat-fieldname = 'NAME1'.

    wa_fcat-reptext_ddic = 'Name'.

    append wa_fcat to i_fcat.

    clear wa_fcat.

    wa_fcat-tabname = 'LFA1'.

    wa_fcat-fieldname = 'ORT01'.

    wa_fcat-reptext_ddic = 'City'.

    append wa_fcat to i_fcat.

    clear wa_fcat.

    ENDFORM. " CREATE_FIELDCATALOG

    SLIS is a type group whose types can be viewed via se11. Just enetr slis in the type group and display. This is the most basic grid display. you can further make it interactive and change the layouts by studying the different types in the type-group. Fieldcatalog is created as only 3 fields from lfa1 (ie lifnr,name1 and ort01 are only required) If more fields are required just add the code as in the create_fieldcatalog subroutine.

    Hope this helps you in solving your issue.

    Regards,

    Sachin.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 31, 2008 at 08:13 AM

    Hi,

    You will have to use F.M. 'REUSE_ALV_GRID_DISPLAY' to display output in ALV format.

    For this, you will have to create a fieldcatalog that will contain the columns that will appear when you execute the report.

    Also chk the following links for example:

    ALV output using classes

    http://saplab.blogspot.com/2007/10/sample-abap-program-of-alv-grid-control.html

    ALV output without using OO methods

    http://saplab.blogspot.com/2007/10/sample-abap-program-of-alv-grid.html

    Regards,

    Saba

    Edited by: Saba Sayed on Oct 31, 2008 9:13 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 31, 2008 at 08:25 AM

    Hi Siva,

    Check out the Link:

    http://saptechnical.com/Tutorials/ALV/ALVMainPage.htm

    Thanks,

    Chidanand

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 31, 2008 at 08:34 AM

    Hi,

    Hope the following Threads will help you regarding your problem.

    regarding-converting-classical-report-into-alv-gri

    Thanks.

    Nitesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.