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

Customer exit code not fetching exact value.

Dear All,

My requirement is as per the user entry date

for that date in one column for that month in one column for that finacial year in one column

fo that date it is coming fine

even for month when i give 14/06/2010 a user entry data has to come up to 14th of that month in year also from financial year starting to 14/o6/2010.

for tha i created three varaibles on calday

as below

zv_sn_dat user entry varaible ready for input

zv_mtd_dat---- customer exit not ready for input

zv_ytd_dat----- customer exit not ready for input

and written the code as below

for fetching the current date data

*

  • WHEN 'ZV_SN_DAT'.

  • IF i_step = 1 .

  • CLEAR l_s_range.

  • l_s_range-low = sy-datum.

  • l_s_range-opt = 'EQ'.

  • l_s_range-sign = 'I'.

  • APPEND l_s_range TO e_t_range.

  • ENDIF.

*

*

*

    • For fetchin month to date ( current date)

    *

    • WHEN 'ZV_MTD_DAT'.

    • DATA : month(2) TYPE n ,

    • year(4) TYPE n .

    • IF i_step = 2.

    • CLEAR : loc_var_range,month,year.

    • LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_SN_DAT'.

    • IF sy-subrc = 0.

    • CLEAR l_s_range.

    • l_s_range-high = loc_var_range-low.

    • year = loc_var_range-low(4).

    • month = loc_var_range-low+4(2).

    • CONCATENATE year month '01' INTO l_s_range-low.

    • l_s_range-sign = 'I'.

    • l_s_range-opt = 'BT'.

    • APPEND l_s_range TO e_t_range.

    • ENDIF.

    • ENDLOOP.

    • ENDIF.

    *

    *(financial year starts from october first)

      • For fetching the Year to Data ( Current Date)

      *

      • WHEN 'ZV_YTD_DT'.

      • IF i_step = 2.

      • CLEAR : loc_var_range,month,year.

      • LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_SN_DAT'.

      • IF sy-subrc = 0.

      • CLEAR l_s_range.

      • year = loc_var_range-low(4).

      • month = loc_var_range-low+4(2).

      • l_s_range-high = loc_var_range-low.

      • IF month NE '01' OR month NE '02' OR month NE '03' OR MONTH NE '04' OR MONTH NE '05' OR MONTH NE '06' OR

      • MONTH NE '07' OR MONTH NE '08' OR MONTH NE '09'.

      • CONCATENATE year '10' '01' INTO l_s_range-low.

      • ELSE.

      • year = year - 1.

      • CONCATENATE year '10' '01' INTO l_s_range-low.

      • ENDIF.

      • l_s_range-sign = 'I'.

      • l_s_range-opt = 'BT'.

      • APPEND l_s_range TO e_t_range.

      *

      • ENDIF.

      • ENDLOOP.

      • ENDIF.

      But the month to date even though iam executing from july 1st but for month to date the data is coming is JUne data

      for year also up to may there is no data , but it is showing June data.

      where the code is wrong ,

      please can anybody suggets where i was gone wrong in code.

      or may be i was gone wrong to create varaibles all te varaibles onot on the calday?

      ?

      Thansk & Regarsd,

      sathish

      *

      *

      *ENDCASE.

      Add a comment
      10|10000 characters needed characters exceeded

      Related questions

      2 Answers

      • Best Answer
        Posted on Jul 03, 2010 at 12:38 PM

        The code looks fine.

        Did you try debugging and verifired whether the low and high values are populated as expected.

        I am sure you can find out the problem then.

        -Neelesh.

        Add a comment
        10|10000 characters needed characters exceeded

        • In debugging you can check what are the values being assigned to low and high.

          Place check points at places where you assing the high and low values.

          Double click on them during debugging, you can then find out where the logic is not fine.

          Try by commenting out the code where you are initializing the system date to variable.

          Also this would be fine for IF MONTH LT 10 instead of

          IF month NE '01' OR month NE '02' OR month NE '03' OR MONTH NE '04' OR MONTH NE '05' OR MONTH NE '06' OR

          • MONTH NE '07' OR MONTH NE '08' OR MONTH NE '09'.

          -Neelesh

          Edited by: Neelesh Jain on Jul 3, 2010 6:57 PM

      • author's profile photo Former Member
        Former Member
        Posted on Jul 04, 2010 at 08:51 AM

        Hi,

        Entry variable zv_sn_dat represents single value or interval.

        Can you confirm this pls.

        Regards,

        Anand

        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.