Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Display

Former Member
0 Kudos
179

Hi again,

I am having in displaying the values in my ALV grid. It displays the rows but not the values? How can I solve this?

Thanks,

Atel

1 ACCEPTED SOLUTION

Former Member
0 Kudos
73

hi,

Check the FM <b>REUSE_ALV_GRID_DISPLAY</b>, whether the table <b>t_outtab</b> you have specified is having the values and , check in the debugging. And other two Important parameter in that FM are IS_LAYOUT,IT_FIELDCAT have been specified or not.

cheers.

8 REPLIES 8

Former Member
0 Kudos
74

hi,

Check the FM <b>REUSE_ALV_GRID_DISPLAY</b>, whether the table <b>t_outtab</b> you have specified is having the values and , check in the debugging. And other two Important parameter in that FM are IS_LAYOUT,IT_FIELDCAT have been specified or not.

cheers.

0 Kudos
73

Hi, I have already debugged the FM and my internal table has values too. I already checked if my field catalogues are ok. Anyway, I'll just paste the code here so every one could see. Thanks for all your suggestions. I hope you can all help me with my problem.

Thanks,

Atel

*********************

REPORT zfi_input_tax MESSAGE-ID 00 NO STANDARD PAGE HEADING.

TYPE-POOLS: slis.

DATA: afield TYPE slis_fieldcat_alv, " ALV field

fieldcat LIKE afield OCCURS 0, " ALV field category

alayout TYPE slis_layout_alv, " ALV layout

it_events TYPE slis_t_event, " ALV events

it_header TYPE slis_t_listheader, " ALV header

it_sort TYPE slis_t_sortinfo_alv, " ALV sorting

it_print TYPE slis_print_alv OCCURS 0 WITH HEADER LINE."ALV print

INCLUDE <icon>.

INCLUDE <symbol>.

TABLES: bkpf, " Header Accounting Document

bseg, " Detail Accounting Document

lfa1, " Vendor Master

adrc,

t001. " Company Name

TYPES: BEGIN OF ty_line_items,

name1(40), " BIR Registered Name

lifnr TYPE lifnr, " Vendor Code

addrs(55), " Vendor Address

tin(20), " TIN of Vendor

rmats LIKE bseg-fwbas, " Raw Materials

fwbas LIKE bseg-fwbas, " Tax Base Amount in Doc Currency

waers LIKE bkpf-waers, " Currency

bukrs LIKE bseg-bukrs, " Company Code

gsber LIKE bseg-gsber, " Business Area

budat LIKE bkpf-budat, " Posting Date

mwskz LIKE bseg-mwskz, " Tax Code

wrbtr LIKE bseg-wrbtr, " Amount in Document Currency

dmbtr LIKE bseg-dmbtr, " Amount in Local Currency

gjahr LIKE bseg-gjahr, " Fiscal Year

END OF ty_line_items.

DATA: it_line_items TYPE ty_line_items OCCURS 0 WITH HEADER LINE,

it_bseg TYPE bseg OCCURS 0 WITH HEADER LINE,

it_bkpf TYPE bkpf OCCURS 0 WITH HEADER LINE.

CONSTANTS: ctax_10 TYPE p DECIMALS 2 VALUE '0.10',

ctax_12 TYPE p DECIMALS 2 VALUE '0.12'.

SELECTION-SCREEN BEGIN OF BLOCK blk1.

SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs OBLIGATORY NO INTERVALS

NO-EXTENSION,

s_budat FOR bkpf-budat OBLIGATORY,

s_mwskz FOR bseg-mwskz NO-DISPLAY,

s_gsber FOR bseg-gsber.

SELECT-OPTIONS : s_blart FOR bkpf-blart.

SELECTION-SCREEN END OF BLOCK blk1.

INITIALIZATION.

PERFORM create_events.

PERFORM create_print_params.

AT SELECTION-SCREEN.

START-OF-SELECTION.

SELECT * FROM bkpf

INTO TABLE it_bkpf

WHERE bukrs IN s_bukrs

AND bstat = space

AND budat IN s_budat

AND blart IN s_blart

AND blart IN ('DG','DR','SA','KA','KR','RE','JV','AB','DA').

IF it_bkpf[] IS NOT INITIAL.

LOOP AT it_bkpf.

SELECT * FROM bseg

INTO TABLE it_bseg

WHERE bukrs = it_bkpf-bukrs

AND gjahr = it_bkpf-gjahr

AND belnr = it_bkpf-belnr

AND mwskz IN s_mwskz

AND gsber IN s_gsber

AND lifnr <> space.

IF it_bseg[] IS NOT INITIAL.

LOOP AT it_bseg.

CLEAR it_line_items.

IF it_bseg-shkzg = 'H'.

it_bseg-wrbtr = it_bseg-wrbtr * '-1'.

it_bseg-fwbas = it_bseg-fwbas * '-1'.

ENDIF.

it_line_items-fwbas = it_bseg-fwbas.

it_line_items-wrbtr = it_bseg-wrbtr.

it_line_items-dmbtr = it_bseg-dmbtr.

it_line_items-mwskz = it_bseg-mwskz.

it_line_items-gjahr = it_bseg-gjahr.

it_line_items-budat = it_bkpf-budat.

it_line_items-bukrs = it_bseg-bukrs.

IF it_bseg-mwskz EQ 'I2'.

it_line_items-rmats = it_line_items-wrbtr * ctax_12.

ELSE.

it_line_items-rmats = it_line_items-wrbtr * ctax_10.

ENDIF.

it_line_items-lifnr = it_bseg-lifnr.

CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_00'

EXPORTING

i_lfa1_lifnr = it_bseg-lifnr

IMPORTING

a_lfa1 = lfa1.

IF sy-subrc = 0.

CONCATENATE lfa1-stras lfa1-ort01 INTO it_line_items-addrs

SEPARATED BY space.

it_line_items-name1 = lfa1-name1.

it_line_items-tin = lfa1-stceg.

ENDIF.

APPEND it_line_items.

ENDLOOP.

ENDIF.

ENDLOOP.

ENDIF.

END-OF-SELECTION.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = 20

text = 'Formatting report...'.

REFRESH fieldcat.

PERFORM create_fieldcat.

PERFORM create_sorting.

PERFORM create_header.

PERFORM output_data.

&----


*& Form create_events

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_events .

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = it_events.

  • TOP_OF_LIST

READ TABLE it_events WITH KEY name = slis_ev_top_of_list

INTO ls_event.

IF sy-subrc EQ 0.

MOVE 'TOP_OF_LIST' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

  • TOP_OF_PAGE

READ TABLE it_events WITH KEY name = slis_ev_top_of_page

INTO ls_event.

IF sy-subrc EQ 0.

MOVE 'TOP_OF_PAGE' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

  • END_OF_LIST

READ TABLE it_events WITH KEY name = slis_ev_end_of_list

INTO ls_event.

IF sy-subrc = 0.

MOVE 'END_OF_LIST' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

ENDFORM. " create_events

&----


*& Form TOP_OF_PAGE

&----


  • Create the top-of-page subroutine to be invoked by ALV

----


FORM top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_header.

FORMAT INTENSIFIED OFF.

WRITE: / 'Page:', sy-pagno LEFT-JUSTIFIED.

SKIP.

ENDFORM. "top_of_page

&----


*& Form top_of_list (ALV)

&----


  • Write the report parameters

----


FORM top_of_list.

DATA: f_title LIKE sy-repid,

f_time(10).

CLEAR: f_title, f_time.

WRITE sy-uzeit TO f_time USING EDIT MASK '__:__:__'.

WRITE: / f_title,

/ 'Program:', 11 sy-repid,

/ 'User:', 11 sy-uname,

/ 'Date:', 11 sy-datum,

/ 'Time:', 11 f_time.

SKIP.

ENDFORM. " top_of_list

&----


*& Form END_OF_LIST

&----


  • Write the end of report text

----


FORM end_of_list.

FORMAT RESET.

DATA f_time(10).

CLEAR f_time.

SKIP.

WRITE sy-uzeit TO f_time USING EDIT MASK '__:__:__'.

WRITE: / 'Program:', 11 sy-repid,

/ 'User:', 11 sy-uname,

/ 'Date:', 11 sy-datum,

/ 'Time:', 11 f_time.

ENDFORM. " end_of_list

&----


*& Form create_print_params

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_print_params .

DATA wa_print TYPE slis_print_alv.

CLEAR wa_print.

wa_print-print = 'X'.

wa_print-no_print_selinfos = ' '.

wa_print-no_coverpage = 'X'.

APPEND wa_print TO it_print.

ENDFORM. " create_print_params

&----


*& Form create_fieldcat

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_fieldcat .

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'name1'.

afield-seltext_l = 'BIR Registered Name'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'lifnr'.

afield-seltext_l = 'Vendor Code'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'addrs'.

afield-seltext_l = 'Vendor Address'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'tin'.

afield-seltext_l = 'TIN of Vendor'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'rmats'.

afield-seltext_l = 'Raw Materials'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'fwbas'.

afield-seltext_l = 'Tax Base Amount in Doc Currency'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'waers'.

afield-seltext_l = 'Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'bukrs'.

afield-seltext_l = 'Company Code'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'gsber'.

afield-seltext_l = 'Business Area'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'budat'.

afield-seltext_l = 'Posting Date'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'mwskz'.

afield-seltext_l = 'Tax Code'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'wrbtr'.

afield-seltext_l = 'Amount in Document Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'dmbtr'.

afield-seltext_l = 'Amount in Local Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'gjahr'.

afield-seltext_l = 'Fiscal Year'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

ENDFORM. " create_fieldcat

&----


*& Form create_sorting

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_sorting .

DATA wa_sort TYPE slis_sortinfo_alv.

CLEAR wa_sort.

wa_sort-fieldname = 'lifnr'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'name1'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'tin'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

ENDFORM. " create_sorting

&----


*& Form create_header

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form create_header .

DATA: t_line TYPE slis_listheader.

  • Title

CLEAR t_line.

t_line-typ = 'H'.

t_line-info = sy-title.

APPEND t_line TO it_header.

endform. " create_header

&----


*& Form output_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form output_data .

DATA f_report LIKE sy-repid.

f_report = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_background_id = 'ALV_WALLPAPER'

i_callback_program = f_report

it_fieldcat = fieldcat

i_save = 'A'

it_events = it_events

it_sort = it_sort

TABLES

t_outtab = it_line_items.

endform. " output_data

0 Kudos
73

Hi,

Specify all the data that you are entering in the field catalog in UPPER CASE. It will work.

For some reason, the data in the field catalog is CASE SENSITIVE.

Regards,

Ravi

Note : Please mark the helpful answers.

0 Kudos
73

Hi Atel,

you are using the statement

DATA: it_line_items <b>TYPE</b> ty_line_items OCCURS 0 WITH HEADER LINE,

instead of this use,

DATA: it_line_items <b>LIKE</b> ty_line_items OCCURS 0 WITH HEADER LINE,

I have faced this kind of problem with ALV.

When you define the output table or the field of table with <b>TYPE</b>, it won't display the output.

Try to use <b>LIKE</b> and you will get output.

Thanks,

Pal

0 Kudos
73

Hi Mariestel,

I had made small changes in the code bascially the problem was with field catalogue which i had suggested u earlier also.

<b>Problem was with Field Catalog only.</b>

Just copy and paste this report now and will show u output .

REPORT zfi_input_tax MESSAGE-ID 00 NO STANDARD PAGE HEADING.

TYPE-POOLS: slis.

DATA: afield TYPE slis_fieldcat_alv, " ALV field

fieldcat LIKE afield OCCURS 0, " ALV field category

alayout TYPE slis_layout_alv, " ALV layout

it_events TYPE slis_t_event, " ALV events

it_header TYPE slis_t_listheader, " ALV header

it_sort TYPE slis_t_sortinfo_alv, " ALV sorting

it_print TYPE slis_print_alv OCCURS 0 WITH HEADER LINE."ALV print

INCLUDE <icon>.

INCLUDE <symbol>.

TABLES: bkpf, " Header Accounting Document

bseg, " Detail Accounting Document

lfa1, " Vendor Master

adrc,

t001. " Company Name

TYPES: BEGIN OF ty_line_items,

name1(40), " BIR Registered Name

lifnr TYPE lifnr, " Vendor Code

addrs(55), " Vendor Address

tin(20), " TIN of Vendor

rmats LIKE bseg-fwbas, " Raw Materials

fwbas LIKE bseg-fwbas, " Tax Base Amount in Doc Currency

waers LIKE bkpf-waers, " Currency

bukrs LIKE bseg-bukrs, " Company Code

gsber LIKE bseg-gsber, " Business Area

budat LIKE bkpf-budat, " Posting Date

mwskz LIKE bseg-mwskz, " Tax Code

wrbtr LIKE bseg-wrbtr, " Amount in Document Currency

dmbtr LIKE bseg-dmbtr, " Amount in Local Currency

gjahr LIKE bseg-gjahr, " Fiscal Year

END OF ty_line_items.

DATA: it_line_items TYPE ty_line_items OCCURS 0 WITH HEADER LINE,

it_bseg TYPE bseg OCCURS 0 WITH HEADER LINE,

it_bkpf TYPE bkpf OCCURS 0 WITH HEADER LINE.

CONSTANTS: ctax_10 TYPE p DECIMALS 2 VALUE '0.10',

ctax_12 TYPE p DECIMALS 2 VALUE '0.12'.

SELECTION-SCREEN BEGIN OF BLOCK blk1.

SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs OBLIGATORY NO INTERVALS

NO-EXTENSION,

s_budat FOR bkpf-budat OBLIGATORY,

s_mwskz FOR bseg-mwskz NO-DISPLAY,

s_gsber FOR bseg-gsber.

SELECT-OPTIONS : s_blart FOR bkpf-blart.

SELECTION-SCREEN END OF BLOCK blk1.

INITIALIZATION.

PERFORM create_events.

PERFORM create_print_params.

AT SELECTION-SCREEN.

START-OF-SELECTION.

SELECT * FROM bkpf

INTO TABLE it_bkpf

WHERE bukrs IN s_bukrs

AND bstat = space

AND budat IN s_budat

AND blart IN s_blart

AND blart IN ('DG','DR','SA','KA','KR','RE','JV','AB','DA').

IF it_bkpf[] IS NOT INITIAL.

LOOP AT it_bkpf.

SELECT * FROM bseg

INTO TABLE it_bseg

WHERE bukrs = it_bkpf-bukrs

AND gjahr = it_bkpf-gjahr

AND belnr = it_bkpf-belnr

AND mwskz IN s_mwskz

AND gsber IN s_gsber

AND lifnr <> space.

IF it_bseg[] IS NOT INITIAL.

LOOP AT it_bseg.

CLEAR it_line_items.

IF it_bseg-shkzg = 'H'.

it_bseg-wrbtr = it_bseg-wrbtr * '-1'.

it_bseg-fwbas = it_bseg-fwbas * '-1'.

ENDIF.

it_line_items-fwbas = it_bseg-fwbas.

it_line_items-wrbtr = it_bseg-wrbtr.

it_line_items-dmbtr = it_bseg-dmbtr.

it_line_items-mwskz = it_bseg-mwskz.

it_line_items-gjahr = it_bseg-gjahr.

it_line_items-budat = it_bkpf-budat.

it_line_items-bukrs = it_bseg-bukrs.

IF it_bseg-mwskz EQ 'I2'.

it_line_items-rmats = it_line_items-wrbtr * ctax_12.

ELSE.

it_line_items-rmats = it_line_items-wrbtr * ctax_10.

ENDIF.

it_line_items-lifnr = it_bseg-lifnr.

CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_00'

EXPORTING

i_lfa1_lifnr = it_bseg-lifnr

IMPORTING

a_lfa1 = lfa1.

IF sy-subrc = 0.

CONCATENATE lfa1-stras lfa1-ort01 INTO it_line_items-addrs

SEPARATED BY space.

it_line_items-name1 = lfa1-name1.

it_line_items-tin = lfa1-stceg.

ENDIF.

APPEND it_line_items.

ENDLOOP.

ENDIF.

ENDLOOP.

ENDIF.

END-OF-SELECTION.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = 20

text = 'Formatting report...'.

REFRESH fieldcat.

PERFORM create_fieldcat.

PERFORM create_sorting.

PERFORM create_header.

PERFORM output_data.

&----


*& Form create_events

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_events .

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = it_events.

  • TOP_OF_LIST

READ TABLE it_events WITH KEY name = slis_ev_top_of_list

INTO ls_event.

IF sy-subrc EQ 0.

MOVE 'TOP_OF_LIST' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

  • TOP_OF_PAGE

READ TABLE it_events WITH KEY name = slis_ev_top_of_page

INTO ls_event.

IF sy-subrc EQ 0.

MOVE 'TOP_OF_PAGE' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

  • END_OF_LIST

READ TABLE it_events WITH KEY name = slis_ev_end_of_list

INTO ls_event.

IF sy-subrc = 0.

MOVE 'END_OF_LIST' TO ls_event-form.

APPEND ls_event TO it_events.

ENDIF.

ENDFORM. " create_events

&----


*& Form TOP_OF_PAGE

&----


  • Create the top-of-page subroutine to be invoked by ALV

----


FORM top_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_header.

FORMAT INTENSIFIED OFF.

WRITE: / 'Page:', sy-pagno LEFT-JUSTIFIED.

SKIP.

ENDFORM. "top_of_page

&----


*& Form top_of_list (ALV)

&----


  • Write the report parameters

----


FORM top_of_list.

DATA: f_title LIKE sy-repid,

f_time(10).

CLEAR: f_title, f_time.

WRITE sy-uzeit TO f_time USING EDIT MASK '__:__:__'.

WRITE: / f_title,

/ 'Program:', 11 sy-repid,

/ 'User:', 11 sy-uname,

/ 'Date:', 11 sy-datum,

/ 'Time:', 11 f_time.

SKIP.

ENDFORM. " top_of_list

&----


*& Form END_OF_LIST

&----


  • Write the end of report text

----


FORM end_of_list.

FORMAT RESET.

DATA f_time(10).

CLEAR f_time.

SKIP.

WRITE sy-uzeit TO f_time USING EDIT MASK '__:__:__'.

WRITE: / 'Program:', 11 sy-repid,

/ 'User:', 11 sy-uname,

/ 'Date:', 11 sy-datum,

/ 'Time:', 11 f_time.

ENDFORM. " end_of_list

&----


*& Form create_print_params

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_print_params .

DATA wa_print TYPE slis_print_alv.

CLEAR wa_print.

wa_print-print = 'X'.

wa_print-no_print_selinfos = ' '.

wa_print-no_coverpage = 'X'.

APPEND wa_print TO it_print.

ENDFORM. " create_print_params

&----


*& Form create_fieldcat

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_fieldcat .

CLEAR afield.

afield-tabname = 'it_line_items'.

<b>*afield-fieldname = 'name1'.</b>

afield-fieldname = 'NAME1'.

afield-seltext_l = 'BIR Registered Name'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

<b>*afield-fieldname = 'lifnr'.</b> " Similarly for others

afield-fieldname = 'LIFNR'.

afield-seltext_l = 'Vendor Code'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'ADDRS'.

afield-seltext_l = 'Vendor Address'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'TIN'.

afield-seltext_l = 'TIN of Vendor'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'RMATS'.

afield-seltext_l = 'Raw Materials'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'FWBAS'.

afield-seltext_l = 'Tax Base Amount in Doc Currency'.

afield-no_out = ' '. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'WAERS'.

afield-seltext_l = 'Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'BUKRS'.

afield-seltext_l = 'Company Code'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'GSBER'.

afield-seltext_l = 'Business Area'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'BUDAT'.

afield-seltext_l = 'Posting Date'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'MWSKZ'.

afield-seltext_l = 'Tax Code'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'WRBTR'.

afield-seltext_l = 'Amount in Document Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'DMBTR'.

afield-seltext_l = 'Amount in Local Currency'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

CLEAR afield.

afield-tabname = 'it_line_items'.

afield-fieldname = 'GJAHR'.

afield-seltext_l = 'Fiscal Year'.

afield-no_out = 'X'. " Do not output

APPEND afield TO fieldcat.

ENDFORM. " create_fieldcat

&----


*& Form create_sorting

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_sorting .

DATA wa_sort TYPE slis_sortinfo_alv.

CLEAR wa_sort.

wa_sort-fieldname = 'LIFNR'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'NAME1'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

APPEND wa_sort TO it_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'TIN'.

wa_sort-spos = 1.

wa_sort-up = 'X'.

APPEND wa_sort TO it_sort.

ENDFORM. " create_sorting

&----


*& Form create_header

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form create_header .

DATA: t_line TYPE slis_listheader.

  • Title

CLEAR t_line.

t_line-typ = 'H'.

t_line-info = sy-title.

APPEND t_line TO it_header.

endform. " create_header

&----


*& Form output_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form output_data .

DATA f_report LIKE sy-repid.

f_report = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_background_id = 'ALV_WALLPAPER'

i_callback_program = f_report

it_fieldcat = fieldcat

i_save = 'A'

it_events = it_events

it_sort = it_sort

TABLES

t_outtab = it_line_items.

endform. " output_data

It works for me , hope it will work for you now.

Cheers

Sunny

Rewrd points, if found helpful by closing this thread

Message was edited by: Sunny

Former Member
0 Kudos
73

Hi mariestel,

R u using the Functin Module.

If yes,

Try debuuging the code and see whether the data is getting passed in the FM or not.

Id ur field catalogue is built correctly.

These are the major areas which may lead to this type of output.

If possible to post the piece of code so that v could help u more approprately.

Cheer

Sunny

Rewrd points , if found helpful

Former Member
0 Kudos
73

Hi

Check out the internal table from which you r passing data or check out with the field catalog.

I hope this will help you to solve your problem.

Thanks and Regards

Mrutyunjaya Tripathy

Former Member
0 Kudos
73

Hi,

Please check the following,

1. Column name that you have given in the fieldcatalog as

same as the internal table field name,

2. Specify all the column name in the fieldcatalog in

capital letters.

3. While passing the fieldcatalog / internal table nameto

the FM REUSE_ALV_GRID_DISPLAY' use [] along with the

table name.

4. Debug whether the internal table has any rows/entries.

Regs,

Venkat Ramanan

Message was edited by: Venkat Ramanan Natarajan