Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in the ABAP Code for Customer Exit Variable

Former Member
0 Likes
707

Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW

i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input

In CMOD i had written the below Code:

When 'ZVWKNO'.

DATA: WEEK(2) TYPE N,

WEEKNO(2) TYPE N.

IF i_step = 1.

l_st_date = SY-DATUM.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

DATE = l_st_date

IMPORTING

WEEK = l_fn_week.

CHECK sy-subrc = 0.

WEEK = l_fn_week+4(2).

If WEEK 0.

WEEKNO = WEEK - 1.

l_s_range-low = WEEKNO.

l_s_range-sign = k_sign_inclusive.

l_s_range-opt = k_option_equals.

APPEND l_s_range to e_t_range.

ENDIF.

ENDIF.

But when i execute the query the default value is not populated with Week-1 No in the variable screen

Please update me what went wrong

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675


Case ZVWKNO.                "write this with out comments

 When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes

 DATA: WEEK(2) TYPE N,
 WEEKNO(2) TYPE N.
 
 IF i_step = 1.
 l_st_date = SY-DATUM.
 CALL FUNCTION 'DATE_GET_WEEK'
 EXPORTING
 DATE = l_st_date
 IMPORTING
 WEEK = l_fn_week.
 
 CHECK sy-subrc = 0.
 WEEK = l_fn_week+4(2).
 If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
 WEEKNO = WEEK - 1.
 
 l_s_range-low = WEEKNO.
 l_s_range-sign = k_sign_inclusive.
 l_s_range-opt = k_option_equals.
 APPEND l_s_range to e_t_range.
 
 ENDIF.
 ENDIF.

Prabhudas

5 REPLIES 5
Read only

Former Member
0 Likes
675

Hi,

Please declare the variale without quotes

write When ZVWKNO INSTEAD OF When 'ZVWKNO'.

Try this and let me know if it works

Regards,

Ganesh Sawant

Read only

0 Likes
675

Hi Ganesh

Thanks for the update

I removed the ' ,When i perform a error check it is showing me an error

ZVWKNO is unknown it is either defined in data statement

Please advise how to proceed

Thanks

Read only

Former Member
0 Likes
676


Case ZVWKNO.                "write this with out comments

 When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes

 DATA: WEEK(2) TYPE N,
 WEEKNO(2) TYPE N.
 
 IF i_step = 1.
 l_st_date = SY-DATUM.
 CALL FUNCTION 'DATE_GET_WEEK'
 EXPORTING
 DATE = l_st_date
 IMPORTING
 WEEK = l_fn_week.
 
 CHECK sy-subrc = 0.
 WEEK = l_fn_week+4(2).
 If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
 WEEKNO = WEEK - 1.
 
 l_s_range-low = WEEKNO.
 l_s_range-sign = k_sign_inclusive.
 l_s_range-opt = k_option_equals.
 APPEND l_s_range to e_t_range.
 
 ENDIF.
 ENDIF.

Prabhudas

Read only

0 Likes
675

HI,

Define variable ZVWKNO and assign proper value from parametere in customer exit.

Regards,

Ganesh

Read only

0 Likes
675

HI,

Define variable ZVWKNO and assign proper value from parametere in customer exit.

Regards,

Ganesh