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: 

adding a field to field catalog

Former Member
0 Kudos

Hi,

i have a mandatory parameter in my selection screen, for eg: p_date.

how do i add that parameter to the output list, its a list_display alv. how do i do this....

pls help,

thanks,

capc

4 REPLIES 4

Former Member
0 Kudos

Hi,

In the final internal table, have one more field for the date.

loop at itab.

itab-date = p_date.

modify itab.

endloop.

Now generate the fieldcatalog and display the ALV.

Regards

Subramanian

Former Member
0 Kudos

Hi CAPC,

In the output internal table ad one more field of type 'dats'.

Now loop at the internal table and modify the date field to every record.

And now display.

Thank you.

Former Member
0 Kudos

i cant understand whether you want to show it as a field in your list or as a top-of-page?

if you want to display as field in the list then you have to add one field in your itab which you are passing to alv list.

now after fetching all the data fill the date field in your itab.

in fieldcatatlog append that.

data : wfieldcat type slis_fieldcat_alv,

ifieldcat type slis_t_fieldcat_alv.

wfieldcat-fieldname = 'DATE' <which ever your itab date name>.

wfieldcat-col_pos = 1. < which posn you want>.

wfieldcat-outputlen = 10.

wfieldcat-seltext_l = 'Date'.

append wfieldcat to ifieldcat.

now if you want that in top-of-page.

do like this.

data : IEVENTS TYPE SLIS_T_EVENT,

WEVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = ievents

EXCEPTIONS

LIST_TYPE_WRONG = 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.

READ TABLE IEVENTS INTO WEVENT WITH KEY NAME = 'TOP_OF_PAGE'.

IF SY-SUBRC = 0.

WEVENT-FORM = 'TOP_OF_PAGE'.

APPEND WEVENT TO IEVENTS.

MODIFY IEVENTS FROM WEVENT index sy-tabix.

ENDIF.

in reuse list display IT_EVENTS = ievents.

FORM TOP_OF_PAGE.

FORMAT COLOR 3.

WRITE : / 'Date ', p_date.

FORMAT COLOR OFF.

or

data : wlistheader type slis_listheader,

ilistheader type slis_t_listheader,

text(30).

concatenate 'Date' p_date into text separated by space.

wlistheader-info = text.

wlistheader-typ = 'H'.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = ilistheader

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM.

regards

shiba dutta

Former Member
0 Kudos

answered my question