cancel
Showing results for 
Search instead for 
Did you mean: 

Date Shift for ECO

Former Member
0 Kudos

I am trying to use Function Module CCAP_ECN_MAINTAIN to change 'Valid From' date of an ECO, but it is raising an exception. It is allowing me to change the date manually through CC32. I debugged the transaction and function module and found following difference.

Both (CC32 and FM) checks if ECO is used e.g. in Specification.

CC32 - Adjusts the dates in Specification accordingly

FM - Raises and exception.

<u><b>CC32</b></u>

<b>Include:</b> LCCAPFMN

<b>Form:</b> o60_date_chk

.........

perform c10g_aennr_use using i_aennr <----


This checks if ECO is used in Object Type 60 (Specification)

changing flg_isused.

check not flg_isused is initial.

call method g_o60_instance->o60_date_chk <----


This adjusts dates in Specification

exporting

i_aennr = i_aennr

i_datuv = i_datuv

exceptions

date_error = 1

lock_error = 2

others = 3.

<u><b>Function Module</b></u>

<b>Include:</b> LCCAPFA4

<b>Form:</b> aenvb_create

.........

*----


Stoff

when obt_o60.

perform c10g_aennr_use using akt_aennr <----


This checks if ECO is used in Object Type 60 (Specification)

changing flg_isused.

*----


Stoff vorhanden

if not flg_isused is initial.

perform msg_cc038_create using wa_cc01-aetyp. <----


This raises an exception with message CC(038)

endif.

I am calling the function module in a test program as follows:

*********************************************

DATA : ls_header_out TYPE aenr_api01,

ls_header_in TYPE aenr_api02.

PARAMETERS : p_aennr TYPE aennr.

CALL FUNCTION 'CCAP_ECN_HEADER_READ'

EXPORTING

change_no = p_aennr

IMPORTING

change_header = ls_header_in

EXCEPTIONS

no_record_found = 1

error = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

MOVE-CORRESPONDING ls_header_in TO ls_header_out.

ls_header_out-valid_from = '12/31/4100'.

CLEAR ls_header_out-indate_rule.

CLEAR ls_header_out-outdate_rule.

CALL FUNCTION 'CCAP_ECN_MAINTAIN'

EXPORTING

change_header = ls_header_out

fl_commit_and_wait = 'X'

EXCEPTIONS

error = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*********************************************

Let me know if I am doing anything wrong.

Thanks,

Pranav

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Great!! Congrats!!

Just got curious !! Pranav ,,Iam sure you are changing the valid from date before system status "Release Change" ,,,, all though you might be using a functional module to achieve it.

If that is not the case, appreciate if you can share it with me.

Regards,

Satya.

Former Member
0 Kudos

Hello everyone,

We found the solution for this. We also need to pass a parameter to indicate that ECO contains Specification as object.

object_substance-active = 'X'.

CALL FUNCTION 'CCAP_ECN_MAINTAIN'

EXPORTING

change_header = ls_header_out

object_substance = object_substance "60 Stoff

fl_commit_and_wait = 'X'

  • IMPORTING

  • CHANGE_NO =

EXCEPTIONS

error = 1

OTHERS = 2

.