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

Re: URGENT: REGARDING ALV REPORT

Hi,

I had made report of sales order and i want it to convert it into alv report and i want to use same internal table as i don't i want it convert into types first and den work area.

Plz provide d solution of it maybe example of it. he or she will be definitely rewarded.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:46 AM

    hi,

    u can use the same internal table for the alv display... no need to go for types declarations... build a fieldcatalog with the same structure and use it.

    thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:49 AM

    here is the example

    &----


    *& Report YKTEST *

    *& *

    &----


    REPORT yktest.

    &----


    *& TABLES DECLARATION *

    &----


    TABLES : ekko, ekpo, t001w, t161t, lfa1.

    &----


    *& INTERNAL TABLE DECLARATION *

    &----


    TYPES : BEGIN OF tp_itab1,

    bukrs TYPE ekko-bukrs,

    lifnr TYPE ekko-lifnr,

    ebeln TYPE ekko-ebeln,

    waers TYPE ekko-waers,

    bsart TYPE ekko-bsart,

    ekorg TYPE ekko-ekorg,

    ekgrp TYPE ekko-ekgrp,

    ebelp TYPE ekpo-ebelp,

    txz01 TYPE ekpo-txz01,

    matnr TYPE ekpo-matnr,

    werks TYPE ekpo-werks,

    menge TYPE ekpo-menge,

    meins TYPE ekpo-meins,

    netpr TYPE ekpo-netpr,

    netwr TYPE ekpo-netwr,

    name1 TYPE t001w-name1,

    header_text(132),

    chk TYPE c,

    END OF tp_itab1.

    DATA : t_itab1 TYPE STANDARD TABLE OF tp_itab1,

    wa_itab1 TYPE tp_itab1,

    ws_name1 TYPE t001w-name1.

    DATA : f_itab1 TYPE STANDARD TABLE OF tp_itab1,

    wa_fitab1 TYPE tp_itab1.

    DATA : f_itab2 TYPE STANDARD TABLE OF tp_itab1,

    wa_fitab2 TYPE tp_itab1.

    TYPES : BEGIN OF tp_name1,

    werks TYPE t001w-werks,

    name1 TYPE t001w-name1,

    END OF tp_name1.

    DATA : t_name1 TYPE STANDARD TABLE OF tp_name1,

    wa_name1 TYPE tp_name1.

    DATA : t_lfa1 TYPE STANDARD TABLE OF lfa1,

    wa_lfa1 TYPE lfa1.

    DATA: hold_tabix TYPE sy-tabix.

    DATA : t_tlinetab TYPE STANDARD TABLE OF tline,

    wa_tlinetab TYPE tline.

    DATA: ws_name TYPE thead-tdname,

    ws_repid TYPE sy-repid VALUE 'YKTEST'.

    DATA : repid TYPE sy-repid.

    DATA : total TYPE p DECIMALS 2,

    quantity TYPE p DECIMALS 3.

    CONSTANTS : ws_id TYPE thead-tdid VALUE 'F01',

    ws_object TYPE thead-tdobject VALUE 'EKKO',

    lc_view(1) TYPE c VALUE 'F',

    lc_form(10) TYPE c VALUE 'YK_FORM'.

    &----


    *& ALV DECLARATION *

    &----


    TYPE-POOLS : slis.

    DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,

    lf_fieldcat TYPE slis_fieldcat_alv.

    DATA: lh_index LIKE lf_fieldcat-col_pos.

    DATA: l_layout TYPE slis_layout_alv.

    DATA : l_sort TYPE slis_t_sortinfo_alv,

    w_sort TYPE slis_sortinfo_alv.

    &----


    *& SELECTION-SCREEN *

    &----


    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.

    SELECTION-SCREEN SKIP 2.

    SELECT-OPTIONS: s_bukrs FOR ekko-bukrs OBLIGATORY.

    SELECT-OPTIONS: s_lifnr FOR ekko-lifnr OBLIGATORY.

    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.

    PARAMETERS: p_bsart TYPE ekko-bsart.

    SELECT-OPTIONS: s_matnr FOR ekpo-matnr.

    SELECT-OPTIONS: s_ekorg FOR ekko-ekorg.

    SELECT-OPTIONS: s_ekgrp FOR ekko-ekgrp.

    SELECTION-SCREEN SKIP 2.

    SELECTION-SCREEN END OF BLOCK a1.

    &----


    *& START-OF-SELECTION *

    &----


    START-OF-SELECTION.

    • FETCHING DATA

    PERFORM fetch_data.

    • BUILD FIELD CATALOG

    PERFORM build_fieldcatalog.

    • BUILD LAYOUT

    PERFORM build_layout.

    • SORT LAYOUT

    PERFORM sort_layout.

    &----


    *& END-OF-SELECTION. *

    &----


    END-OF-SELECTION.

    *DISPLAY GRID

    PERFORM display_grid.

    &----


    *& Form fetch_data *

    &----


    FORM fetch_data.

    IF p_bsart IS INITIAL.

    SELECT ekko~bukrs

    ekko~lifnr

    ekko~ebeln

    ekko~waers

    ekko~bsart

    ekko~ekorg

    ekko~ekgrp

    ekpo~ebelp

    ekpo~txz01

    ekpo~matnr

    ekpo~werks

    ekpo~menge

    ekpo~meins

    ekpo~netpr

    ekpo~netwr

    INTO TABLE t_itab1 FROM

    ekko INNER JOIN ekpo ON ekkoebeln = ekpoebeln

    WHERE ekko~ebeln IN s_ebeln AND

    ekko~bukrs IN s_bukrs AND

    ekko~lifnr IN s_lifnr AND

    ekko~ekorg IN s_ekorg AND

    ekko~ekgrp IN s_ekgrp AND

    ekpo~matnr IN s_matnr.

    ELSE.

    SELECT ekko~bukrs

    ekko~lifnr

    ekko~ebeln

    ekko~waers

    ekko~bsart

    ekko~ekorg

    ekko~ekgrp

    ekpo~ebelp

    ekpo~txz01

    ekpo~matnr

    ekpo~werks

    ekpo~menge

    ekpo~meins

    ekpo~netpr

    ekpo~netwr

    INTO TABLE t_itab1 FROM

    ekko INNER JOIN ekpo ON ekkoebeln = ekpoebeln

    WHERE ekko~ebeln IN s_ebeln AND

    ekko~bukrs IN s_bukrs AND

    ekko~lifnr IN s_lifnr AND

    ekko~ekorg IN s_ekorg AND

    ekko~ekgrp IN s_ekgrp AND

    ekpo~matnr IN s_matnr AND

    ekko~bsart = p_bsart.

    ENDIF.

    IF NOT t_itab1[] IS INITIAL.

    • FETCHING NAME1

    SELECT werks

    name1

    FROM t001w

    INTO TABLE t_name1

    FOR ALL ENTRIES IN t_itab1

    WHERE werks = t_itab1-werks.

    SORT t_itab1 BY werks.

    SORT t_name1 BY werks.

    IF sy-subrc = 0.

    LOOP AT t_itab1 INTO wa_itab1.

    hold_tabix = sy-tabix.

    READ TABLE t_name1 INTO wa_name1 WITH KEY werks = wa_itab1-werks

    BINARY SEARCH.

    IF sy-subrc = 0.

    wa_itab1-name1 = wa_name1-name1.

    MODIFY t_itab1 INDEX hold_tabix FROM wa_itab1.

    ENDIF.

    • FETCHING HEADER TEXT

    MOVE wa_itab1-ebeln TO ws_name.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = ws_id

    language = sy-langu

    name = ws_name

    object = ws_object

    TABLES

    lines = t_tlinetab

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    not_found = 4

    object = 5

    reference_check = 6

    wrong_access_to_archive = 7

    OTHERS = 8.

    IF sy-subrc = 0.

    LOOP AT t_tlinetab INTO wa_tlinetab.

    wa_itab1-header_text = wa_tlinetab-tdline.

    MODIFY t_itab1 FROM wa_itab1.

    ENDLOOP.

    ENDIF. " IF sy-subrc = 0.

    CLEAR : wa_itab1,

    hold_tabix,

    wa_name1.

    ENDLOOP.

    ENDIF.

    ENDIF. " IF NOT t_itab1[] IS INITIAL.

    IF t_itab1[] IS INITIAL.

    MESSAGE i000(zg) WITH text-008.

    ENDIF.

    SORT : t_itab1 BY bukrs lifnr ebeln ebelp.

    ENDFORM. " fetch_data

    &----


    *& Form build_fieldcatalog *

    &----


    FORM build_fieldcatalog .

    • COMPANY CODE

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'BUKRS'.

    lf_fieldcat-ref_tabname = 'EKKO'.

    lf_fieldcat-ref_fieldname = 'BUKRS'.

    lf_fieldcat-fix_column = 'X'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • VENDOR

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'LIFNR'.

    lf_fieldcat-ref_tabname = 'EKKO'.

    lf_fieldcat-ref_fieldname = 'LIFNR'.

    lf_fieldcat-fix_column = 'X'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • PURCHASING DOCUMENT NUMBER

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'EBELN'.

    lf_fieldcat-ref_tabname = 'EKKO'.

    lf_fieldcat-ref_fieldname = 'EBELN'.

    • lf_fieldcat-key = 'X'.

    lf_fieldcat-do_sum = 'X'.

    lf_fieldcat-fix_column = 'X'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • ITEM NUMBER OF PURCHASING DOCUMENT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'EBELP'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'EBELP'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • SHORT TEXT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'TXZ01'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'TXZ01'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • MATERIAL NUMBER

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'MATNR'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'MATNR'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • PLANT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'WERKS'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'WERKS'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • NAME

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'NAME1'.

    lf_fieldcat-ref_tabname = 'T001W'.

    lf_fieldcat-ref_fieldname = 'NAME1'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • PURCHASE ORDER QUANTITY

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'MENGE'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'MENGE'.

    lf_fieldcat-do_sum = 'X'.

    lf_fieldcat-qfieldname = 'MEINS'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • UNIT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'MEINS'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'MEINS'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • NET PRICE IN PURCHASING DOCUMENT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'NETPR'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'NETPR'.

    lf_fieldcat-cfieldname = 'WAERS'.

    lf_fieldcat-do_sum = 'X'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • NET ORDER VALUE IN PO CURRENCY

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'NETWR'.

    lf_fieldcat-ref_tabname = 'EKPO'.

    lf_fieldcat-ref_fieldname = 'NETWR'.

    lf_fieldcat-cfieldname = 'WAERS'.

    lf_fieldcat-do_sum = 'X'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • CURRENCY

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'WAERS'.

    lf_fieldcat-ref_tabname = 'EKKO'.

    lf_fieldcat-ref_fieldname = 'WAERS'.

    APPEND lf_fieldcat TO lt_fieldcat.

    • HEADER TEXT

    CLEAR lf_fieldcat.

    lf_fieldcat-fieldname = 'HEADER_TEXT'.

    lf_fieldcat-seltext_m = 'Header Text'.

    APPEND lf_fieldcat TO lt_fieldcat.

    ENDFORM. " build_fieldcatalog

    &----


    *& Form display_grid *

    &----


    FORM display_grid.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = ws_repid

    i_callback_pf_status_set = 'PF_STATUS'

    i_callback_user_command = 'USER_COMMAND'

    is_layout = l_layout

    it_fieldcat = lt_fieldcat

    it_sort = l_sort

    i_save = 'X'

    • IMPORTING

    TABLES

    t_outtab = t_itab1

    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.

    ENDFORM. " display_grid

    &----


    *& Form build_layout *

    &----


    FORM build_layout .

    l_layout-colwidth_optimize = 'X'.

    l_layout-zebra = 'X'.

    l_layout-box_fieldname = 'CHK'.

    l_layout-box_tabname = 'T_ITAB1' .

    ENDFORM. " build_layout

    &----


    *& Form sort_layout *

    &----


    FORM sort_layout .

    CLEAR w_sort.

    w_sort-fieldname = 'BUKRS'.

    w_sort-tabname = 'T_ITAB1'.

    w_sort-spos = 1.

    w_sort-up = 'X'.

    w_sort-subtot = 'X'.

    APPEND w_sort TO l_sort.

    CLEAR w_sort.

    w_sort-fieldname = 'EBELN'.

    w_sort-tabname = 'T_ITAB1'.

    w_sort-spos = 1.

    w_sort-up = 'X'.

    w_sort-subtot = 'X'.

    APPEND w_sort TO l_sort.

    ENDFORM. " sort_layout

    &----


    *& Form PF_STATUS

    &----


    FORM pf_status USING rt_extab TYPE slis_t_extab.

    SET PF-STATUS 'STANDARD1' EXCLUDING rt_extab.

    ENDFORM. " PF_STATUS

    &----


    *& Form user_command

    &----


    FORM user_command USING s_ucomm TYPE sy-ucomm

    rs_selfield TYPE slis_selfield.

    CLEAR wa_itab1.

    READ TABLE t_itab1 INTO wa_itab1 INDEX rs_selfield-tabindex.

    CASE s_ucomm.

    WHEN 'POD'.

    SET PARAMETER ID 'BES' FIELD wa_itab1-ebeln.

    CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

    CLEAR wa_itab1.

    WHEN 'MAT'.

    SET PARAMETER ID 'MAT' FIELD wa_itab1-matnr.

    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

    WHEN '&IC1'.

    IF rs_selfield-fieldname = 'MATNR'.

    SET PARAMETER ID 'MAT' FIELD wa_itab1-matnr.

    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

    ELSEIF rs_selfield-fieldname = 'EBELN'.

    SET PARAMETER ID 'BES' FIELD wa_itab1-ebeln.

    CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:49 AM

    Check all standard reports BCALV* in SE38 you will let list of all ALV OOPS reports.

    If you want to study grid reports then press BCALVGRID you will get all examples

    Note: you need to crete a screen for program in Std program it is 100 but when you copy it to Z create screen with 9000 and create custom container

    Rewards if useful.........................

    Minal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:52 AM

    Hello,

    U can use the same internal table for ALV display.

    For ALV Creation u can use 2 methods.

    <b>1. using Function module reuse_alv_grid_display

    2. using object oriented method.</b>

    Reward if helpful,

    Regards,

    LIJO

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:52 AM

    Hi ric,

    you can use the same internal table for ALV report also.

    No need to convert it into types and then work are.

    still if you couldnt find the exact solution.

    explain your problem more in clear.

    Regards,

    phani.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      i want to display d contents of calculations also stored in variables.

      i had made d report of alv and it is giving runtime error :-

      d report as follows: -

      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 declaration.

      *DATA BEGIN OF IT_SORT OCCURS 5.

      • INCLUDE TYPE SLIS_SORTINFO_ALV.

      *DATA END OF IT_SORT.

      • 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.

      REFRESH ITSO.CLEAR ITSO.

      DATA : V_ITEM LIKE MAKT-MAKTX,

      V_ADDR LIKE KNA1-NAME1,

      B_QTY TYPE P LENGTH 7 DECIMALS 3,

      B_GR_W TYPE P LENGTH 5 DECIMALS 3,

      B_NT_W TYPE P LENGTH 5 DECIMALS 3,

      ITEM_NTW TYPE P LENGTH 5 DECIMALS 3,

      ITEM_GRW TYPE P LENGTH 5 DECIMALS 3,

      ITEM_DISP TYPE P LENGTH 5 DECIMALS 3,

      CNT(5) TYPE N.

      • 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.

      • Field Catalog

      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.

      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 LSORT

      &----


      *FORM LSORT USING P_FIELD P_TABLE P_UP.

      • ADD 1 TO L_POS.

      • IT_SORT-SPOS = L_POS.

      • IT_SORT-FIELDNAME = P_FIELD.

      • IT_SORT-TABNAME = P_TABLE.

      • IT_SORT-UP = P_UP.

      • APPEND IT_SORT.

      *ENDFORM. " LSORT

      *----


      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_REPORT_HEADER_ALV.

      **CALL FUNCTION 'Z_YHEAD_PRINT'

      • EXPORTING

      • TITLE1 = 'XYZ Limited'

      • TITLE2 = 'Sales Order Report'

      • TITLE3 = 'Created on '

      • COLOR = 'X'

      .

      **ENDFORM.

      &----


      *& 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.

      more over i want to diplay d variables which use to perform calculations in it...

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:57 AM

    Hi Ric S,

    You just need to pass the internal table which you are using for output now.

    And one more thing is that you need to declare the things which are required for ALV.

    Reward If Helpful.

    Regards

    --

    Sasidhar Reddy Matli.

    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.