01-21-2008 7:33 AM
Hi,
I want to display BSIK-DMBTR field contents using ALV also
I want to display total = bsik-dmbtr + 1 using alv..
my final output list should contain
DMBTR TOTAL
______ ___________
100 101
200 201
. .
. .
. .
. .
pls let me know how to display the above...
the following is the same program without logic..
________________________________________
report zalv.
tables : bsik.
type-pools : slis.
DATA: it_fldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fldcat TYPE slis_fieldcat_alv.
DATA : it_sort TYPE slis_t_sortinfo_alv.
DATA : wa_sort TYPE slis_sortinfo_alv.
data : begin of itab occurs 0,
dmbtr like bsik-dmbtr.
total type i,
end of itab.
bld_fcat 1 'DMBTR' 13 'Amt Document Curr' 'L'.
bld_fcat 2 'TOTAL' 20 'Total amount' 'L'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "Displaying data in grid format
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fldcat "fieldcatalog
it_sort = it_sort[] "Sort
it_events = it_events
TABLES
t_outtab = itab "internal table to output
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.
01-21-2008 7:35 AM
hi,
before the ALV call:
LOOP AT itab.
itab-total = itab-dmbtr + 1.
MODIFY itab.
ENDLOOP.
hope this helps
ec
01-21-2008 7:35 AM
hi,
before the ALV call:
LOOP AT itab.
itab-total = itab-dmbtr + 1.
MODIFY itab.
ENDLOOP.
hope this helps
ec
01-21-2008 7:38 AM
Hi,
You can do as below :
Once everything is done and before passing the internal table to ALV.
loop at gt_final.
gt_final-total = gt_final-dmbtr + 1.
modify gt_final.
clear gt_final.
endloop.
Thanks,
Sriram Ponna.
01-21-2008 7:38 AM
Hi Malika,
Before populating in to the final internal table just add 1 to the total field.
ie + 1 to your total field.
Regards,
DVNS
01-21-2008 7:43 AM
Hi,
U can add an extra field in the internal table.increment tht value and store it in tht internal table.
Thn in the fieldcatalog u can arraange this field and u can display it.
example:
data :begin of itab.
inculde structure dbtablename.
data : incr type i.
data : end of itab.
reward if useful
01-21-2008 7:47 AM
Why can't you have an additonal field "TOTAL" in your output table.
when you calculate DMBTR then in that piece of code , next line you can derive TOTAL as :
....
itab-DMBTR = gw_dmbtr.
itab-TOTAL = gw_dmbtr + 1.
...
append itab.
else you will have to unnecessarily make an additional loop on table itab and calculate DMBTR as suggested by other guys ont he forum.
.