cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a FM for a BEx Variable

Former Member
0 Kudos

Hi,

I have created a BEx Variable of type Customer Exit called 'ZCA8764'

I intend to actually automatically calculate the number of days in the month.

Through some discussions here, I found that I can use a FM NUMBER_OF_DAYS_PER_MONTH_GET

So, I went to CMOD.

But there onwards, I don`t know how to write a code to link the Variable and the FM.

Can someone please advice with a sample code ?

Can someone please assist.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member189638
Active Contributor
0 Kudos

CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'

EXPORTING

(here u need to pass the values to the FM)

IMPORTING

(here u will get the values that the function returns)

e.g.

CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'

EXPORTING

day_in = v_mth_beg

IMPORTING

last_day_of_month = v_mth_end.

Former Member
0 Kudos

Hi rakesh,

How then do I declare?

day_in = v_mth_beg

last_day_of_month = v_mth_end.

Do you mean, that I have to create 2 BEx Variables of type v_mth_beg & v_mth_end

former_member189638
Active Contributor
0 Kudos

No you have to declare these variables in the <b>User exit</b> in the <b>Data</b> section

Former Member
0 Kudos

DATA: L_S_RANGE LIKE RRRANGESID OCCURS 0 WITH HEADER LINE.

data: newdate like sy-datum

NumbofDays type i.

Declare it like this, but are you trying to find the number of dates for what the user enter or for the default system date?

thanks.

Wond

Former Member
0 Kudos

Hi

I need the user to input what is the Month the report should run.

Based on the month given by the user at run time, then the Number of Calendar Days per Month Should be calculated.

Please advice the specific code including the declaration that I need to do.

Cheers mates !

Former Member
0 Kudos

Hi,

In CMOD , Give project name, and enter, call RSR00001 double click on it.

Select ‘EXIT_SAPLRSAP_001’ and open it. It will open the function module screen. Go to Include ‘ZXRSAU01’ double click on it, there write your code or call your function module.

Regards

SR

Former Member
0 Kudos

Hi SR,

Thats precisely my question.

How should I write the code ?

Appreciate your assistance