Skip to Content
0
Former Member
Apr 11, 2007 at 06:46 PM

Date Shift for ECO

88 Views

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