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

Simple Report using oops

Hi Experts,

Am trying to display simple reprt using report, actually i dnt want to displayy using oops through module pool programming.

please look my below code. am not able to dispaly the report.

plz correct.

tables: vbak.

types: begin of ty_data,
vbeln type vbeln,
auart type AUART, " Sales Document Type
vkorg type VKORG, "Sales Organization
* VTWEG type VTWEG, "Distribution Channel
* SPART type SPART, "Ditvision
end of ty_data.
data: it_data type table of ty_data,
wa_data like line of it_data,
it_fcat type LVC_T_FCAT,
wa_fcat type LVC_S_FCAT.
* gv_repid TYPE sy-repid,
* gv_dynnr TYPE sy-dynnr.
data: oref_cc type ref to cl_gui_container,
* oref_dc type ref to cl_gui_docking_container,
oref_grid type ref to cl_gui_alv_grid.
select-options s_vbeln for vbak-vbeln obligatory.
start-of-selection.
perform preapre_data.
*perform prepare_layout.
perform prepare_fieldcatalog.
perform display_alv.
*&---------------------------------------------------------------------*
*& Form PREAPRE_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PREAPRE_DATA .
select vbeln auart vkorg from vbak
into table it_data
where vbeln in s_vbeln.
if it_data[] is initial.
leave to list-processing.
endif.
ENDFORM. " PREAPRE_DATA
*&---------------------------------------------------------------------*
*& Form PREPARE_LAYOUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PREPARE_LAYOUT .

ENDFORM. " PREPARE_LAYOUT
*&---------------------------------------------------------------------*
*& Form DISPLAY_ALV
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_ALV .

CREATE OBJECT OREF_GRID
EXPORTING
I_PARENT = CL_GUI_CUSTOM_CONTAINER=>DEFAULT_SCREEN.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD OREF_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE = 'X'
I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = it_data
IT_FIELDCATALOG = it_fcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

oref_grid->refresh_table_display( ).

ENDFORM. " DISPLAY_ALV
*&---------------------------------------------------------------------*
*& Form PREPARE_FIELDCATALOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM PREPARE_FIELDCATALOG .
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-fieldname = 'VBELN' .
wa_fcat-outputlen = '6' .
wa_fcat-coltext = 'Sales Order'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-fieldname = 'AUART' .
wa_fcat-outputlen = '12' .
wa_fcat-coltext = 'Sales Doc Type'.
append wa_fcat to it_fcat.
clear wa_fcat.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-fieldname = 'VKORG' .
wa_fcat-outputlen = '12' .
wa_fcat-coltext = 'Sales Orga'.
append wa_fcat to it_fcat.
clear wa_fcat.
ENDFORM. " PREPARE_FIELDCATALOG

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2012 at 09:08 AM

    Srinath,

    Your getting any error can you please debug the program then you can find the issue..

    Then you can post the issue what you faced...

    Thanks,

    Raj

    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.