2009 Jan 19 9:54 AM
Hi all,
I would like to add some custom fields into an ALV grid from a FI/CO report.
I have succesfully added the custom field 'VAT' number for example
FORM fieldcat_init
USING rt_fieldcat TYPE slis_t_fieldcat_alv.
...
CLEAR ls_fieldcat.
ls_fieldcat-tabname = g_tabname.
ls_fieldcat-fieldname = 'STCEG'.
* LS_FIELDCAT-KEY = ' '. "sets key field
ls_fieldcat-ref_fieldname = 'STCEG'.
ls_fieldcat-ref_tabname = 'KNA1'.
APPEND ls_fieldcat TO rt_fieldcat.
....
ENDFORM. " FIELDCAT_INITThis works fine. But I have a problem to add another field named 'due days'.
The due days for one record is calculated by a FM that gives back a NUMC datatype. for example : 6
How can I get calculated fields into an ALV ?
Hi all,
I would like to add some custom fields into an ALV grid from a FI/CO report.
I have succesfully added the custom field 'VAT' number for example
FORM fieldcat_init
USING rt_fieldcat TYPE slis_t_fieldcat_alv.
...
CLEAR ls_fieldcat.
ls_fieldcat-tabname = g_tabname.
ls_fieldcat-fieldname = 'STCEG'.
* LS_FIELDCAT-KEY = ' '. "sets key field
ls_fieldcat-ref_fieldname = 'STCEG'.
ls_fieldcat-ref_tabname = 'KNA1'.
APPEND ls_fieldcat TO rt_fieldcat.
....
ENDFORM. " FIELDCAT_INITThis works fine. But I have a problem to add another field named 'due days'.
The due days for one record is calculated by a FM that gives back a NUMC datatype. for example : 6
How can I get calculated fields into an ALV ?
2009 Jan 19 9:58 AM
Hello Abjuh
You could take the data element of the fm parameter which returns the calculated due date as basis for your fieldcatalog entry. Presumably you have to adjust the texts (e.g. LVC_S_FCAT-SCRTEXT_S) as well.
Regards
Uwe
2009 Jan 19 12:32 PM
Thx Uwe, I managed to do it like you said. Don't know what you meant with LVC_S_FCAT-SCRTEXT_S though ... But now it works
2009 Jan 19 2:25 PM
Hello Abjuh
I did not notice that you are using the SLIS-based fieldcatalog. In this case you would need to modify slis_t_fieldcat_alv-scrtext_s in order to change the description of the additional column.
Regards
Uwe
2009 Jan 19 3:53 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |