Application Development and Automation 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: 
Read only

to get the values from func. module

Former Member
0 Likes
613

c i have used a func. module to calculate the values of date , i wrote a subroutine i want the values of this to be dispalyed on the list...

now how do i get them to the list output, i mean how do i assign to the fieldcatalog?????

thanks,

CAPC

5 REPLIES 5
Read only

anversha_s
Active Contributor
Read only

Former Member
0 Likes
592

Hi

its unclear if u want to display the values on a normal list or alv..

however if its an alv use any of the following fms

reuse_alv_list_display

REUSE_ALV_FIELDCATALOG_MERGE

hope this helps,

all the best,

sampath

*mark helpful answers

Read only

Former Member
0 Likes
592

hi

if you want to display a value calculated for date in every record then add a new field to the internal table which you are tying to give as output. populate this field with your vales and then use it for display.

if you are trying to get the values from the selection screen then make the parameter GET_SELINFOS in the layot structure as 'X'.

-

Santosh

Read only

Former Member
0 Likes
592

Hi CAPC,

Plese find below a sample program which will solve u r broblem.

report abc.

TYPE-POOLS : slis.

*----


Data

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE t001.

DATA : flag tyPE c,

END OF itab.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvly TYPE slis_layout_alv.

*----


Select Data

SELECT * FROM t001 INTO TABLE itab.

*------- Field Catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Display

alvly-box_fieldname = 'FLAG'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid "<-------Important

i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important

is_layout = alvly

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

*----


  • CALL BACK FORM

*----


FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

data : msg(100) type c.

LOOP AT itab.

if itab-flag = 'X'.

msg = sy-tabix.

condense msg.

concatenate 'Row Number ' msg ' ' into msg

separated by space.

message msg type 'I'.

endif.

ENDLOOP.

ENDFORM. "ITAB_user_command

Regards,

Sunil

Read only

Former Member
0 Likes
592

done