jump to navigation

SM37 September 5, 2008

Posted by Ajay in Uncategorized.
trackback

1. try the below function module to read data from the infoproviders.

RSDRI_INFOPROV_READ_CONTEXT

RSDRI_INFOPROV_READ_RFC 

RSDRI_INFOPROV_READ_DEMO

2. You can use these function modules 

FIMA_DAYS_BETWEEN_TWO_DATES 

FIMA_DAYS_BETWEEN_TWO_DATES_2 

to get the number of days between two dates. Pass the lower and upper value of the input variable as parameter to this function and you can get the number of days between those dates.

Requirment:

Data :

Emp_ID——Start_Date(DATS)—–End_Date(DATS)

I had a user entry (intreval) VARIABLE created on Start_Date

User will enter the date intreval he want to analyze…

Ex: 01.01.2008 to 01.02.2008

Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigureIn the above example it is 31 days So i created a Formula Variable of Customer Exit now i need a code that will

Code: 

your code should look like

DATA: low_date2 TYPE d,

high_date2 TYPE d,

num_days TYPE N,

new_low_date2 TYPE d.

 

Case i_vnam.

 

WHEN ‘ZND_EXIT’.

 

IF i_step = 2.

LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = ‘ZST_VAR’.

CLEAR l_s_range.

l_s_range-sign = ‘I’.

l_s_range-opt = ‘BT’.

low_date2 = ls_varrange-low.

high_date2 = ls_varrange-high.

 

CALL FUNCTION ‘FIMA_DAYS_AND_MONTHS_AND_YEARS’

EXPORTING

I_DATE_FROM = low_date2

I_DATE_TO = high_date2

 

I_FLG_SEPARATE = ‘ ‘

IMPORTING

E_DAYS = NUM_DAYS

 

l_s_range-low = NUM_DAYS.

 

APPEND l_s_range TO e_t_range.

 

EXIT.

ENDLOOP.

 

endcase.

Advertisements

Comments»

1. Raghavendra - January 27, 2011

Useful one.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: