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

Customer Exist for "From Current Date To Month End"

Hi

I want the variable customer exit for " From Current Date(user enters) to the Month End" . And this 'Month End' is may be 30th or 31st .

I reurn the code for 'Start Of Month To Current Date' in CMOD like below

WHEN 'VAR_MONTHSTART1'.

IF I_STEP = 2. "after the popup

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'VAR_CUST1'.

CONCATENATE LOC_VAR_RANGE-LOW+0(6) '01' into dat.

CLEAR L_S_RANGE.

L_S_RANGE-LOW = dat.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

ENDLOOP.

ENDIF.

So please give the customer exist for ' From Current Date To Month End'.

Regards

Kumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2008 at 01:50 PM

    Hi Ram

    Thanks For your help .

    But my user enters the Input Selection Date .

    And how can i use this function module in the CMOD. So please give me the code for caling the function module in BW-CMOD and to get the last date of month .

    Regards

    Kumar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ravi,

      Here is the code

      in the include ZXRSRU01

      WHEN 'TARGET VARIABLE' .

      DATA : DATE type SY-DATUM .

      DATA : DATE1 type SY-DATUM .

      IF I_STEP = 2 .

      READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'INPUTVARIABLE' .

      DATE = LOC_VAR_RANGE-LOW.

      CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'

      EXPORTING

      DAY_IN = DATE

      IMPORTING

      LAST_DAY_OF_MONTH = DATE1 .

      l_s_range-sign = 'I'.

      l_s_range-opt = 'EQ'.

      l_s_range-low = date1 .

      l_s_range-high = date1 .

      APPEND L_S_RANGE TO E_T_RANGE .

      ENDIF.

      Hope this is of some help to you

      PV

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2008 at 12:50 PM

    Hi

    SLS_MISC_GET_LAST_DAY_OF_MONTH

    use this function module!

    read system date and pass it as in input parameter!

    This function module will give you the last date inthe month!

    The system date and the last day of the month u can get from this

    Regards

    Ram

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI,

      This logic can be used in theexit or call the function module as suggested by Ram.

      Get me month from the month = sy-datum+0(6) .

      month = month + 1 .

      concatenate month '01' into date1 . gives you the first date of next month.

      date1 = date1 - 1 . gives last date of the month.

      Hope this helps

      PV

  • author's profile photo Former Member
    Former Member
    Posted on Jan 03, 2008 at 01:35 PM

    Hi Ram

    Thanks For your help .

    But my user enters the Input Selection Date .

    And how can i use this function module in the CMOD. So please give me the code for caling the function module in BW-CMOD and to get the last date of month .

    Regards

    Kumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:51 AM

    Hai,

    I have posting date field, based on the posting date, I have to get which date is the last day in the period. is there any SAPEXIT variable.

    thanks

    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.