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

Calling a function module and displaying in ALV

Former Member
0 Likes
1,136

Hi There

I am trying to get a month by month alv grid from the data held in function module 'Consumption_Read_For_MM'

I know how to create an ALV grid but how do I get the data from this function module to display it?

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
730

Hi,

1st create an internal table and append all the entries to that internal table which you are getting and finally pass that internal table to that ALV Function Module.

Thanks

Ganesh

Read only

Former Member
0 Likes
730

Create an Internal Table with all the fields u want and use the function module by giving three parameters : matnr =

werks =

perkz =

periv =

Create an internal table like SVERBTABA to get total consumption and use Move-corresponding to get all the info into u r final inetrnal table and display using ALV funcyion modules.

Read only

0 Likes
730

That is a great help!

In the function module do I reference the internal table fields like this?

call function 'CONSUMPTION_READ_FOR_MM'

IMPORTING

MATNR = S_MATNR.

werks = S_MATNR.

perkz = tbl_SVERBTABA-ERTAG

periv = tbl_SVERBTABA-VBWRT.

TABLES

SVERBTABA = tbl_sverbtaba

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.

I would imagine something like this is needed so the fields correspond to my internal table?

Read only

0 Likes
730

Hi,

No. Lopp at your internal table & pass a single value of matnr at a time . Same is applicable for werks as well.

I hope this helps,

Regards

Raju Chitale