10-22-2008 7:13 AM
good day experts...
I just want to ask why is it that when I added another column in an ALV,
the one in bold letter) It does not appear when I execute it? My declarations is herein below:
Please tell me what to do to correct my statements.
Thank you.
CODE:
FORM f_display_aging .
SORT it_aging BY swenr smenr.
REFRESH it_fdcat.
PERFORM f_create_layout USING wa_layout.
PERFORM f_create_fieldcat USING it_fdcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = 'PFSTATUS'
i_grid_title = text-alv
is_layout = wa_layout
it_event_exit = it_event
it_fieldcat = it_fdcat[]
TABLES
t_outtab = it_aging.
ENDFORM. " f_display_aging
&----
*& Form f_create_layout
&----
ALV Layout
----
FORM f_create_layout USING p_wa_layout TYPE slis_layout_alv.
p_wa_layout-zebra = 'X'.
p_wa_layout-colwidth_optimize = 'X'.
ENDFORM. " f_create_layout
&----
*& Form pfstatus
&----
Set PF-Status
----
FORM pfstatus USING ut_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM. " PF_STATUS_SET
FORM f_create_fieldcat USING p_it_fdcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f01.
ls_fieldcat-seltext_l = text-t01.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f02.
ls_fieldcat-seltext_l = text-t02.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f17.
ls_fieldcat-seltext_l = text-t17.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f18.
ls_fieldcat-seltext_l = text-t18.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f19.
ls_fieldcat-seltext_l = text-t19.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f20.
ls_fieldcat-seltext_l = text-t20.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f21.
ls_fieldcat-seltext_l = text-t21.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f22.
ls_fieldcat-seltext_l = text-t22.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f03.
ls_fieldcat-seltext_l = text-t03.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f04.
ls_fieldcat-seltext_l = text-t04.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f05.
ls_fieldcat-seltext_l = text-t05.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f06.
ls_fieldcat-seltext_l = text-t06.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f24.
ls_fieldcat-seltext_l = text-t24.
ls_fieldcat-outputlen = 25.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f07.
ls_fieldcat-seltext_l = text-t07.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f08.
ls_fieldcat-seltext_l = text-t08.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f09.
ls_fieldcat-seltext_l = text-t09.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f10.
ls_fieldcat-seltext_l = text-t10.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f11.
ls_fieldcat-seltext_l = text-t11.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f12.
ls_fieldcat-seltext_l = text-t12.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f13.
ls_fieldcat-seltext_l = text-t13.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f14.
ls_fieldcat-seltext_l = text-t14.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f15.
ls_fieldcat-seltext_l = text-t15.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO p_it_fdcat.
ENDFORM.
10-22-2008 8:13 AM
Adding a record to the fieldcatalog is not enough.
You should add it also to the data table, it_aging in this case.
Regards,
Hans
10-22-2008 8:57 AM
Yes, I did it already. Actually here is my decalaration.
TYPES: BEGIN OF ty_aging,
swenr TYPE swenr,
smenr TYPE smenr,
sell1 TYPE name1,
sell2 TYPE name1,
sell3 TYPE name1,
sell4 TYPE name1,
sell5 TYPE name1,
kunnr TYPE kunnr,
name1 TYPE name1,
zterm TYPE knb1-zterm,
netwr TYPE dmbtr,
paymd TYPE dmbtr,
nydue TYPE dmbtr,
les30 TYPE dmbtr,
due60 TYPE dmbtr,
due90 TYPE dmbtr,
du120 TYPE dmbtr,
du121 TYPE dmbtr,
todue TYPE dmbtr, "total due
lspay TYPE budat, "last pay date
lsamt TYPE dmbtr, "last pay amount
ausdt TYPE ausdt, "dunning level date 1
madat TYPE madat, "dunning level date 2
colle type dmbtr, "percentage of total payments
END OF ty_aging.
DATA: it_aging TYPE TABLE OF ty_aging,
wa_aging TYPE ty_aging.
NOTE:some codes were omitted....I just want to show the declarations I did.
"As I debug, wa_aging-colle will handles 2.66 value
l_total_coll = ( wa_aging-paymd / l_nettcp ) * 100.
wa_aging-colle = l_total_coll.
xxx...
APPEND wa_aging to it_aging.
xxx...
After this statements, I now declare the ALV I wrote above. Also, I have included t24 and f24 on the text symbols.
But unluckily, when I execute my program, this column I added does not appear.
I also change the layout of the ALV, but I noticed too that the additional field I included does not appear
on the column selection.
I dont know now what to do...
Please help me...
10-22-2008 9:09 AM
try this change and see.. may be text element is not active.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'COLLE'. "text-f24.
ls_fieldcat-seltext_l = text-t24.
ls_fieldcat-outputlen = 25.
APPEND ls_fieldcat TO p_it_fdcat.
10-22-2008 9:38 AM
10-22-2008 10:03 AM
give a final try
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'COLLE'. "text-f24.
ls_fieldcat-seltext_l = text-t24.
ls_fieldcat-tabname = 'IT_AGING'. "<-----use this also then it will come
ls_fieldcat-outputlen = 25.
APPEND ls_fieldcat TO p_it_fdcat.
10-22-2008 10:19 AM
Im sorry... but still no output.... Even with the last solution you give...
10-22-2008 8:16 AM
10-22-2008 8:23 AM
levis,
check whether that field is present in it_arging table .
Regards
Hitesh
10-22-2008 9:04 AM
Yes it is included.. Please read the following replies to Vidjay...
Please help what to do..
Thanks a lot.
10-22-2008 8:48 AM
did you add the same field to your internal table, and did you added the logic for selecting the data for that field. all these matters. and make sure the field name you mentioned should be same as that of the field which you added in the internal table.and the fieldname should be CAPS.
10-22-2008 9:06 AM
yes.. I did all the things you mentioned..
But still, it cant be shown when I execute it.
It wonders me a lot.
10-22-2008 9:15 AM
Levis ,
Can you do one favor to me ...
1) Debug your code and check the values in it_fieldcat [] and it_arging
or when instead of this perform
PERFORM f_create_fieldcat USING it_fdcat.
use
PERFORM f_create_fieldcat changing it_fdcat.
Hope it works
Regards
Hitesh
10-22-2008 9:37 AM
Im sorry, but still doesnt work..
I also tried to replaced it manually typing the
fieldname = 'COLLE'
but still no output.
I also tried to comment out all the other columns and maintain this only column
but there is no more output.
I dont know why...
10-22-2008 9:50 AM
Hi levis,
check field is adding the selection statement .
Regrds
Swamy.
10-22-2008 10:39 AM
hi..
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = text-f24.
ls_fieldcat-seltext_l = text-t24.
ls_fieldcat-outputlen = 25.
ls_fieldcat-no_out = ' '.
APPEND ls_fieldcat TO p_it_fdcat.
try this...
use the firld no_out... and put it to blank..
regards
palak
10-22-2008 10:48 AM
10-22-2008 11:29 AM
10-22-2008 11:35 AM
post your entire code,srrounded in .even if it is not so big program.
04-02-2009 2:34 AM