07-18-2007 3:07 PM
HI FRIENDS,
I HAVE A TROUBLE IN DISPLAYNG TWO TABLES TOGETHER IN THE GRID DISPLAY, BUT I CAN DISPLAY USING BLOCKS. I DONT WANT TO USE JOIN STATEMENT IN THE SELECT QUERY.
HELP WITH BY DISPLAYING THE RESPECTIVE CODES FOR THAT.
THANK U IN ADVANCE
07-18-2007 3:12 PM
If you want to use the Block list
then you need 3 Function modules.
1. Block list initialization
(This will be called once)
REUSE_ALV_BLOCK_LIST_INIT
2. Block List Append
REUSE_ALV_BLOCK_LIST_APPEND
(This will be called n times, if you have n tables)
3. Block list Display
(this will be called once)
REUSE_ALV_BLOCK_LIST_DISPLAY
Check BALVBT01 program
Regards
Vijay
07-18-2007 3:13 PM
Hi,
Append the data of 2nd table into 1st table & then pass the 1st table to ALV Grid FM.
Else.
Use two containers on a screen & pass table to each container.
Best regards,
Prashant
07-18-2007 3:39 PM
hi,
type-pools : slis,icon.
data : gd_repid like sy-repid.
data : d_fieldcat type slis_t_fieldcat_alv,
d_fieldcat_wa type slis_fieldcat_alv.
data : begin of itab_mara occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
end of itab_mara.
data : begin of itab_marc occurs 0,
matnr like marc-matnr,
werks like marc-werks,
end of itab_marc.
data : begin of itab_final occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
werks like marc-werks,
end of itab_final.
gd_repid = sy-repid.
loop at itab_emp.
itab_final-matnr = itab_emp-matnr.
itab_final-ernam = itab_emp-ernam.
append itab_emp.
clear itab_emp.
endloop.
d_fieldcat_wa-fieldname = 'MATNR'.
d_fieldcat_wa-seltext_l = 'material number'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'ERNAM'.
d_fieldcat_wa-seltext_l = 'created by'.
d_fieldcat_wa-col_pos = 2.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'WERKS'.
d_fieldcat_wa-seltext_l = 'plant number'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
call function module 'REUSE_ALV_GRID_DISPLAY'.
Reward with points if helpful.
08-22-2007 3:25 PM