Skip to Content

Scenario:

The are some case when creating a customer exit variable we need to consider other variable value at run time.

Requirement:

Create a FI-AR or FI-AP aging report . In which we need to create aging buckets . We consider Posting Date , Document Date  and Cleared Dates to calculate

Balances.Our requirement to consider Document date value which calculating clearing date and posting date.

step 1 :

Create a variable for Document date calculation.

code :

data: v_date      type sydatum,
         v_qtr(2)    type c,
         wa          like LINE OF i_t_var_range,
         l_s_range   like line of e_t_range,
         v_day    type n length 2,
         v_year    type n length 4,
         p_year    type n length 4,
         l_vnam    TYPE rszglobvvnam.

   constants: c_varname type rszvnam value ‘ZVAR_DOC_DATET’,
              c_iobjnm  type rsiobjnm value ‘0DOC_DATE’.

   if i_step = 0 or i_step = 1.

l_vnam = i_vnam.

   IF l_vnam = ‘ZVAR_DOC_DATET’.
*Read System Date
     l_s_rangelow = sydatum.
     l_s_rangesign     = ‘I’.
     l_s_rangeopt      = ‘EQ’.
     APPEND l_s_range TO e_t_range.
endif.
endif.

*}   INSERT
ENDFUNCTION.

step 2 :

: Call the Document date variable value into clearing date calculation ( The FM also created exactly in same manner).

              user the same parameters like ‘Z_*_ZVAR_DOC_DATET’.

           code :

data: wa          like LINE OF i_t_var_range,
         l_s_range   like line of e_t_range,
         l_vnam    TYPE rszglobvvnam.

   constants: c_varname type rszvnam value ‘ZVAR_DOC_DATET’,
              c_iobjnm  type rsiobjnm value ‘0DOC_DATE’.

   if i_step = 1.
     clear: l_s_range.
      l_vnam = i_vnam.

   IF l_vnam = ‘ZVAR_CLEAR_DATE3’.
* Read the variable ZVAR_DOC_DATET value.
     loop at i_t_var_range into wa
           where vnam = c_varname
             and iobjnm = c_iobjnm.
     endloop.

         if sysubrc = 0.
              l_s_rangelow = walow.
              l_s_rangesign     = ‘I’.
              l_s_rangeopt      = ‘EQ’.
              APPEND l_s_range TO e_t_range.
         endif.
    endif.

elseif  i_step = 0.

              l_s_rangelow = sydatum.
              l_s_rangesign     = ‘I’.
              l_s_rangeopt      = ‘EQ’.
              APPEND l_s_range TO e_t_range.
ENDIF.

*}   INSERT
ENDFUNCTION.

In this we call the value of variable ‘ZVAR_DOC_DATET’  into a loop over.And used that value into our required variable .

Note : Make sure   ‘RSR00001 BI: Enhancements for Global Variables in Reporting’ is developed in a way to support variable call as Function module.

we can  also use the same approach  in our traditional variable calculation also.

Hope this Helps!

Anjaneyulu Kanta


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply