cancel
Showing results for 
Search instead for 
Did you mean: 

Variable not visible in debug mode

amine_lamkaissi
Active Contributor
0 Kudos

Hi experts,

i created a variable using a custom exit.

i'v added to my query, but when launch debug mode, i can't see it in I_T_VAR_RANGE table;

but i can see others created previously.

is that normal? do i have to do something else?

Thanks.

Amine

Accepted Solutions (1)

Accepted Solutions (1)

Loed
Active Contributor
0 Kudos

Hi Amine,

How did you launch the debug mode and where did you launch it? What do you want to do? Did you try your customer exit if it's working for your query?

Regards,

Loed

amine_lamkaissi
Active Contributor
0 Kudos

Hi Loed,

i put a stop point at when level.

then i launched debug mode from rsrt, i want to be sure that my variable will contains the last day of month, but i got this error.

Thanks

Amine

amine_lamkaissi
Active Contributor
0 Kudos

Hi Loed,

I will send you the sreen shots.

Amine

amine_lamkaissi
Active Contributor
0 Kudos

Here are the screen shots:

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

put the static dynamic -point at WHEN 'ZLASTDAYMONTH'

activate the code then check it out.

Thanks,

Phani.

Former Member
0 Kudos

Hi Amine,

There are a few points in your code:

1. You are not catching the excetiion when you call the FM.

2. It appears that your value of LOC_VAR_RANGE-LOW is not of type sy-datum. Please check what value you are getting in this value and passing it to FM. Ideally the exception says that day_in_not_valid i.e. your input value is not value. Check the format of LOW_VAR_RANGE-LOW and convert it to sy-datum type by using a conversion exit. Then you should be good.

The Code should be:

-------

DATA: day_in TYPE sy-datum,  "declare this variable for input to FM
      zdate TYPE sy-datum.

day_in = LOW_VAR_RANGE-LOW.          "assign value
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
  EXPORTING
    day_in            = day_in
  IMPORTING
    last_day_of_month = zdate
  EXCEPTIONS
    day_in_not_valid  = 1          "catch exception here
    OTHERS            = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

-------

Please let me know if you face any issues.

Thanks

Amit

amine_lamkaissi
Active Contributor
0 Kudos

thanks a lot Amit.

Amine

Answers (1)

Answers (1)

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

have you saved the query in the query desigenr? if not plesae save it and test it.

then check the I_T_VAR_RANGE internale table you will find the variables.

check the variable - I_STEP 1 or 2 or 3 .- check the step variable.

Thanks,

Phani.

amine_lamkaissi
Active Contributor
0 Kudos

Hi Phani,

Thanks for your answer.

i think that i have an issue in y code, i got the following error:

The function call of SLS_MISC_GET_LAST_DAY_OF_MONTH failed; a field may have been assigned to the parameter DAY_IN whose"


here is my code:


Can you tell me what's wrong please?


DATA: temp_date like sy-datum.

WHEN 'ZLASTDAYMONTH'.                

     if i_step = 2.

       LOOP AT I_T_VAR_RANGE INTO FISC_VAR_RANGE
             WHERE VNAM = 'ZTODAYDATE2'.

         CLEAR L_S_RANGE.

         call function'SLS_MISC_GET_LAST_DAY_OF_MONTH'
       exporting
         day_in = FISC_VAR_RANGE-LOW     "this is the user entry date based on ZTODAYDATE2
         importing
         last_day_of_month = temp_date.

         L_S_RANGE-LOW      = temp_date.
         L_S_RANGE-SIGN        = 'I'.
         L_S_RANGE-OPT         = 'BT'.
         APPEND L_S_RANGE TO E_T_RANGE.
         EXIT.
       ENDLOOP.
     endif.