Skip to Content
0
Former Member
Mar 13, 2013 at 03:09 PM

Query scenario

22 Views

Dear all,

I have a scenario.

we need to have the variable on the 0cal month such tat it should be filled with the month+year of the last working day (Other than current day).

example 1.: current day: 13.03.2013.

Variable123 : 03.2013

example 2. current day:03.12.2012

Variable123: 11.2012.

for this, we have a function module to get the last working day--> DATE_CONVERT_TO_FACTORYDATE.

Please see the below code.

Variable123:

Processing type: Customer Exit.

Variable represents: Single value.

Variable is : Mandatory

Unchecked Variable is ready for input.

But when i execute this, its throwing dump.

Also, i tried debugging it RSRT. and it throws dump/exception in the function module.

Could you please guide me on this.????????????????

If I_step = 1.
IF i_vnam = 'Variable123'.
data: Month type /BI0/OICALMONTH,
date type /BI0/OICALday,
date1 type /BI0/OICALday,
Lastworking_day(10) type C.

date = Sy-datum - 1.

concatenate date+6(2) date+4(2) date+0(4) into date1.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
CORRECT_OPTION = '-'
DATE = date1
FACTORY_CALENDAR_ID = 'CB'
IMPORTING
DATE = lastworking_day.

Month = Lastworking_day+3(6).

L_S_RANGE-low = Month.
L_S_RANGE-opt = 'EQ'.
L_S_RANGE-sign = 'I'.

APPEND L_S_RANGE to E_T_RANGE.
endif.
Endif.