Skip to Content
author's profile photo Former Member
Former Member

Customer Exit for MTD

Hi,

My requirement is to create Customer exit variable to calculate the Month to date (MTD) value (Quantity) in a query. I created a Customer exit variable for MTD (0CALDAY) in Query & wrote code in CMOD for the same as follows.

DATA: ZYEAR(4) TYPE N,

ZMON(2) TYPE N,

ZDAY(2) TYPE N.

CASE I_VNAM.

WHEN 'ZVCE_MTD'.

IF I_STEP = 2.

REFRESH E_T_RANGE.

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE.

ZYEAR = LOC_VAR_RANGE-LOW+0(4).

ZMON = LOC_VAR_RANGE-LOW+4(2).

ZDAY = LOC_VAR_RANGE-LOW+6(2).

CLEAR L_S_RANGE.

CONCATENATE ZYEAR ZMON '01' INTO L_S_RANGE-LOW.

CONCATENATE ZYEAR ZMON ZDAY INTO L_S_RANGE-HIGH.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDLOOP.

ENDIF.

ENDCASE.

I debugged this code by putting a break point & running the query in RSRT, the code is getting executed & i am getting the From & To dates in E_T_RANGE output.

But when I execute the Query, I am getting the output Quantity for FTD only, not MTD.

For example, if i give 05-12-2009 as variable input for 0CALDAY when i execute the query, i should get the summed up quantity for 01 Dec to 05 Dec in a single cell. But now, i am getting the summed up quantity for 05 Dec only.

Help me in resolving this.

Regards,

Murali

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2011 at 12:54 PM

    Dear Murali,

    If your report is displaying the data only for the date entered,

    Check if the Variable has been created with Interval,it might have been selected as Single Value

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.