‎2007 Feb 28 4:57 PM
need to write a report that will list customers and vendors using ALV. can someone help me out
‎2007 Feb 28 5:03 PM
Hi,
Check this example to display the customer..For vendor you can use the table LFA1..
TYPE-POOLS: slis.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF wa_kna1,
kunnr like kna1-kunnr,
name1 like kna1-name1,
END OF wa_kna1.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
DATA it_kna1 LIKE STANDARD TABLE OF wa_kna1 WITH HEADER LINE.
SELECT * UP TO 100 ROWS
FROM kna1
INTO CORRESPONDING FIELDS OF TABLE it_kna1.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'WA_KNA1'
i_inclname = v_repid
CHANGING
ct_fieldcat = gt_fieldcat.
Pass the program.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = gt_fieldcat
TABLES
t_outtab = it_kna1.
THanks
Naren
‎2007 Feb 28 5:04 PM