cancel
Showing results for 
Search instead for 
Did you mean: 

Error for variable in customer enhancement

Former Member
0 Kudos

Hi all,

When I am running the query in RSRT I am getting the error "Error for variable  in customer enhancement D_PBACALM12ROLL".

Diagnosis

This internal error is an intended termination resulting from an illegal program status.

The error occurred with variable  in customer enhancement D_PBACALM12ROLL .

I have created customer exit variable to get last 12 month from given user values.

ORM execute_user_exit USING VALUE(u_i_vnam)         TYPE rszvnam

                              VALUE(u_i_vartyp)       TYPE rszvartyp

                              VALUE(u_i_iobjnm)       TYPE rsiobjnm

                              VALUE(u_i_s_cob_pro)    TYPE rsd_s_cob_pro

                              VALUE(u_i_s_rkb1d)      TYPE rsr_s_rkb1d

                              VALUE(u_i_periv)        TYPE periv

                              VALUE(ut_i_t_var_range) TYPE rrs0_t_var_range

                              VALUE(u_i_step)         TYPE i

                     CHANGING ct_e_t_range            TYPE rsr_t_rangesid.

   DATA: l_year     TYPE d,

         l_month    TYPE d,

         l_s_range     LIKE LINE OF ct_e_t_range,

         loc_var_range LIKE rrrangeexit.

   CHECK u_i_step = 2.

* Determine the last 12 month incliuding the given month

   READ TABLE ut_i_t_var_range WITH KEY vnam = 'D_PBACALM' INTO loc_var_range.

   IF sy-subrc EQ 0.

     l_year = loc_var_range-low(4).

     l_month = loc_var_range-low+4(2).

   endif.

   l_s_range-high = loc_var_range-low.

   IF

       l_month = '01'.

     l_year = l_year - 1.

     concatenate l_year'12' into l_s_range-low.

   ELSE.

     l_month = l_month - 1.

     l_year = l_year - 1.

     concatenate l_year l_month into l_s_range-low.

   ENDIF.

   l_s_range-sign = 'I'.

   l_s_range-opt = 'BT'.

   APPEND l_s_range TO ct_e_t_range.

ENDFORM.

When I am checking the the code, it says no Sytax error. Then why it is not working? and what is this illegal program status means? Can someone please help in this?

Thanks and Regards,

Sarika

Accepted Solutions (1)

Accepted Solutions (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Sarika,

Can you please give a bit more information on the error? Do you get a shortdump? If you get an error message, what is the message code and long text?

It is interesting to know where the error occurs, in standard SAP or your own implementation (which looks OK by the way). Please enter a break-point in the coding and run again using t/code RSRT. Does the debugger starts or the error occurs before it?

Just to be sure, please regenerate the BEx Query using t/code RSRT.

Best regards,

Sander

Former Member
0 Kudos

Hi,

please see below is the detils on the error:

Error for variable  in customer enhancement D_PBACALM12ROLL

Message no. BRAIN649

Diagnosis

This internal error is an intended termination resulting from an illegal program status.

The error occurred with variable  in customer enhancement D_PBACALM12ROLL .

Procedure

Check your customer enhancement.

I did check the code by entering the break point, the debugger starts and I am getting the 12 month range in the structure.

thanks and regards,

Sarika Gattawar

Former Member
0 Kudos

Hi Sarika,

I can see that iin your code you have mentioned as l_year     TYPE d, and l_month    TYPE d.

Please change them to:

Data: l_year     TYPE n LENGTH 4, 

         l_month    TYPE n LENGTH 2,

I think system is having issues while assinging values of type d to the ct_e_t_range.

Specifically, in your current code i.e. when its of data type d:

l_month = '01'. - will work just fine

l__year = l_year - 1. - will have wierd results

So change the data type to n and length as above.

Please let me know if this helps.

Thanks

Amit

Former Member
0 Kudos

Hi Amit,

you are absolutely right, When I was debugging eh code, i did notice that so I have updated the code as below:

DATA: l_year(4)     TYPE n,

         l_month(2)    TYPE n,


But with this changes, still getting the same error.


please see below is the details on the error:

Error for variable  in customer enhancement D_PBACALM12ROLL

Message no. BRAIN649

Diagnosis

This internal error is an intended termination resulting from an illegal program status.

The error occurred with variable  in customer enhancement D_PBACALM12ROLL .

Procedure

Check your customer enhancement.

Thanks

Sarika



Former Member
0 Kudos

Hi Sarika,

BRAIN649 is a error of invalid range being passed to the variable.

Whats the length of 'loc_var_range-low' in your code? It should be 6 as per your code.

Can you variable 'D_PBACALM' handle a range? I mean is it a select-options?

Can you debug your code and check what the values are finally being passed to ct_e_t_range?

Also let us know what is the input you are providing to the variable?

Thanks

Amit

Former Member
0 Kudos

Hi Amit,

Please see below debugging result:

L_YEAR2013
L_MONTH8
L_S_RANGE-LOW201308
L_S_RANGE-HIGH201409
CT_E_T_RANGE[1x9(264)]Standard Table

this is the structure values for low and high range.

1IBT2013082014090000

varibale input was 09.2014

Thanks and Regards,

Sarika

Former Member
0 Kudos

Hi Sarika,

In your query, is your custom variable a 'Interval' type? If yes, then ideally your code should work now.

Can you send the screenshot of your variable 'detail' part in your query? similar like below:

Thanks

Amit

Former Member
0 Kudos

Thank you all, for your valuable tips. Appreciated

Points assigned.

Thanks and Regards,

Sarika

Answers (3)

Answers (3)

anshu_lilhori
Active Contributor
0 Kudos

This was pointed out by Akansha long back.If you had noticed it carefully your issue would have resolved earlier.

rdate- to calculate range (interval value, mandatory,not ready for input)

Regards,

AL

Former Member
0 Kudos

Yes I noticed that now. sorry for that.

I did assign points to her as well.

thanks and regards,

Sarika

anshu_lilhori
Active Contributor
0 Kudos

I am not sure but just thinking if you have written the code inside the Include ZXRSRU01,then the name of customer exit variable is missing.

Regards,

AL

Former Member
0 Kudos

Can some one please help in this?

thanks

Sarika

former_member214274
Active Participant
0 Kudos

Hi Sarika,

I got your customer exit rqmnt like this-

Based on the date entered by the user in input variable,

the customer exit variable should have interval of last 12 months including the given month.

You have to define 2 customer exit variables based on calday-

udate-user input variable (single value, mandatory, ready for input)

rdate- to calculate range (interval value, mandatory,not ready for input)

then modify your code accordingly.

Thanks,

Akanksha

Former Member
0 Kudos

Hi,

I did create the two variables in the same way. Is there any other solution to fix this issue?

thanks and Regards,

Sarika

former_member214274
Active Participant
0 Kudos

Hi Sarika,

Did you get any error after activating the code?

Can you add WHEN <variable name> after the CHECK u_i_step=2 statement...

Try to log out and log in back to see if it works.

Thanks

Former Member
0 Kudos

Hi Akanksha,

I tried your suggestion, but it gives error saying that :

When statement can't be used in FORM. It can be used only in CASE.

Thanks and Regards,

Sarika

former_member214274
Active Participant
0 Kudos

Hi,

Just wondering where FORM will take the customer exit range variable, maybe your range values are going to the wrong variable-input variable vnam...

Thanks

Former Member
0 Kudos

Hi,

Clear statement is not helping Akanksha.

Thanks and Regards,

Sarika

former_member214274
Active Participant
0 Kudos

Hi,

Can you add some statements -what to do in case u_i_step=1..?