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

Re: URGENT: REGARDING ALV REPORT OUTLOOK

HI,

I am making alv report in which d simple format is used and its output is used to be appear to be simple and now i want to make its output more gud,can anybody tell me d solution of dis problem,reply useful will be definately rewarded....

REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.

TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.

*Varriable declaration.

TYPE-POOLS SLIS.

DATA : POS TYPE I.

DATA REPID LIKE SY-REPID.

DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,

F2 TYPE SLIS_FIELDCAT_ALV,

L_LAYOUT TYPE SLIS_LAYOUT_ALV.

DATA L_POS TYPE I VALUE 1. "position of the column

DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

**DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.

DATA: GT_EVENTS TYPE SLIS_T_EVENT,

FS_EVENTCAT LIKE LINE OF GT_EVENTs.

  • INTERNAL TABLE FOR SALES ORDER *****************

DATA : BEGIN OF ITSO OCCURS 0,

VBELN LIKE VBAK-VBELN,

ERDAT LIKE VBAK-ERDAT,

BSTNK LIKE VBAK-BSTNK,

KUNNR LIKE VBAK-KUNNR,

MATNR LIKE VBAP-MATNR,

POSNR LIKE VBAP-POSNR,

WMENG LIKE VBEP-WMENG,

NTGEW LIKE MARA-NTGEW,

BRGEW LIKE MARA-BRGEW,

GEWEI LIKE MARA-GEWEI,

SPART LIKE VBAK-SPART,

BMENG LIKE VBEP-BMENG,

EDATU LIKE VBEP-EDATU,

BSTKD LIKE VBKD-BSTKD,

WERKS LIKE VBAP-WERKS,

MEINS LIKE MARA-MEINS,

KWMENG LIKE VBAP-KWMENG,

KLMENG LIKE VBAP-KLMENG,

END OF ITSO.

  • Heading of the report.

data: t_heading type slis_t_listheader.

***********PARAMETERS***************

PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.

*********SELECTION SCREEN OPTIONS*********

SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,

SO_PARTY FOR VBAK-KUNNR,

IT_M FOR MARA-MATNR,

DIV FOR VBAK-SPART,

SO_DATE FOR VBAK-ERDAT,

S_DATE FOR VBEP-EDATU. .

START-OF-SELECTION.

SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR BSPART BMATNR BPOSNR BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG DEDATU D~VBELN

FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN

INNER JOIN MARA AS C ON CMATNR = BMATNR

INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR = B~POSNR

INTO CORRESPONDING FIELDS OF TABLE ITSO

WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND BSPART IN DIV AND AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND B~WERKS = PLANT.

IF SY-SUBRC <> 0.

MESSAGE E899(M3) WITH 'No records'.

ENDIF.

perform f_build_eventcat.

PERFORM LAYOUT.

END-OF-SELECTION.

FORM LAYOUT.

PERFORM FCAT USING 'VBELN' 'ITSO' '' 'S.O.NO. ' 'VBELN' 'VBAK' ''.

PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.

PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.

PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.

PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.

PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.

PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' ''.

REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPID

IT_FIELDCAT = F1

  • IT_SORT = GT_SORT

I_SAVE = 'X'

IT_EVENTS = GT_EVENTS[]

TABLES

T_OUTTAB = ITSO.

IF SY-SUBRC <> 0.

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

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

ENDIF.

  • Top of page heading

  • perform set_top_page_heading using t_heading t_event.

  • Events

  • perform set_events using t_event.

  • GUI Status

  • w_status = ''.

  • w_repid = sy-repid.

  • Title

  • w_title = <<If you want to set a title for

  • the ALV, please, uncomment and edit this line>>.

  • User commands

  • w_comm = 'USER_COMMAND'.

ENDFORM. " LAYOUT

&----


*& Form FCAT

&----


FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.

ADD 1 TO POS.

F2-COL_POS = POS.

F2-FIELDNAME = P_FIELD.

F2-TABNAME = P_TABLE.

F2-SELTEXT_L = P_TEXT.

F2-REF_FIELDNAME = P_RFIELD.

F2-REF_TABNAME = P_RTABLE.

F2-DO_SUM = P_SUM.

F2-NO_OUT = P_DISP.

APPEND F2 TO F1.

CLEAR F2.

ENDFORM. " FCAT

FORM F_BUILD_EVENTCAT .

CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.

CLEAR: FS_EVENTCAT.

FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.

FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.

APPEND FS_EVENTCAT TO GT_EVENTS.

CLEAR: FS_EVENTCAT.

FS_EVENTCAT-NAME = 'END_OF_LIST'.

FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.

APPEND FS_EVENTCAT TO GT_EVENTS.

ENDFORM. " F_BUILD_EVENTCAT

&----


*& Form F_WRITE_SUMMARY

&----


  • Write summary before exit

----


FORM F_WRITE_SUMMARY .

write:/ 'Welcome to XYZ Limited'.

write:/ 'This is a test program to display Report in ALV Format'.

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 12:59 PM

    Hi,

    Good look in which way can u specify some of them so that i can help u.

    You can give top-of-page to heading and stuff like by using grid alv.

    Regards,

    Pria.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 01:08 PM

    Change it to ALV_GRID - by using REUSE_ALV_GRID_DISPLAY.

    You can inherit the standard captions of the DDIC by passting the REF_FIELD and REF_TABLE to ur field catalog. In that way u ll be able to remove the hardcoding.

    Put a Title of the grid , u can pass the Title in the LAYOUT , saying so and so number of records getting displayed.

    Put HOTSPOT = 'X" , where clicking on the column will take u to the corresponding Sales Order.

    Have a look at VA05.

    Cheers SKC.

    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.