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

Customer Exit query

Dear SCN Members,

There is customer exit variable which gives the result of yesterday(Current month) and when we run on 1st day of the month there is no result because of current month. Customer exit variable is based on 0date.

Please see variable and code.

IF i_step = 2.

l_date = sy-datum - 1.

l_range-sign = 'I'.

l_range-opt = 'EQ'.

l_range-low = l_date.

APPEND l_range TO e_t_range.

ENDIF.

Now user would like to have new variable with "variable is ready for input" enabled and I have written the same code as above for new variable & it's giving the same day result and not yesterday's.

Please help me if I have to tweak the code and any changes to variable.

Reg,

Guru.

aaaa.png (116.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 27, 2016 at 01:02 PM

    Hi Manpreet,

    Option 2 already exists and we would like to have "variable ready for input" option checked.

    IF we need to use I_step = 1, please let me know the code.

    Thanks in advance.

    Reg,

    Guru.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Correction to my previous reply:

      I was in an assumption that user will enter a value. Which is incorrect assumption I think.

      So you can follow Eduardo Resano Ladrón de Guevara suggestion and it should work.

      Ideally below:

      l_date = sy-datum -1. " remember sy-datum

      l_range-sign = 'I'.

      l_range-opt = 'EQ'.

      l_range-low = l_date. " No quotes

      * l_range-high = 'l_date.'. "Comment it

      APPEND l_range to e_t_range.

      Thanks

      Amit

  • Posted on Jun 27, 2016 at 11:17 AM

    Hi Guru,

    You need to change the I_STEP varable value. When your variable is "Ready for Input" the system does not go to I_STEP = 2. CHange the value to I_STEP=3 and see if your code will work.

    Regards,

    Manpreet

    Add a comment
    10|10000 characters needed characters exceeded

    • HI Guru,

      I have a correction to make here, it is not possible to update or change variable values in the I_STEP= 3 and I understand your question correctly now,

      1) Either you want to prefill the value of the variable for the user on the variable screen?

      2) Or you want to calculate the previous day based on the date user will enter in the seelction screen?

      OPtion 1 can be acheived using the I_STEP = 1 scenario.

      For option 2: you should create a User entry variable for date field and then use the value that has been entered by the user to calculate "userdate -1 ". This has to be done using another Customer exit type of variable with "inout ready" not checked and using the I_STEP = 2.

      Hope you get my point. 😊

      Let me know in case you have any other question.

      Regards,

      Manpreet

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2016 at 02:01 AM

    Hello Manpreet, Eduardo Resano, Amit,

    Thank you so much for guiding me.

    After removing quotes for I_range-below = I_date it worked.

    Reg,

    Guru.

    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.