Skip to Content
avatar image
Former Member

Planning function Exit

Hi Friends,

let me explain my requirement.

At the moment I need to change the company code from 0353 to 2083 and contolling area form G353 to I083 (Later i need to change the cost centers also). Right now i am developeing the Exit functionfor changeing company code and controlling area.

I developed the code in the Exit FM like

FUNCTION Z_CONVERSION_EXIT.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_AREA) TYPE UPC_Y_AREA

*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL

*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE

*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD

*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM

*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP

*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL

*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA

*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF

*" EXPORTING

*" REFERENCE(ET_MSG) TYPE UPC_YT_MESG

*" CHANGING

*" REFERENCE(XTH_DATA) TYPE HASHED TABLE

*"----


data : begin of itab_data occurs 0,

compcode like /BI0/PCOMP_CODE-COMP_CODE,

contrarea like /BI0/PCO_AREA-CO_AREA,

end of itab_data.

itab_data[] = xth_data[].

Loop at itab_data where compcode = '0353' and contrarea = 'G353'.

itab_data-compcode = '2083'.

itab_data-contrarea = 'I083'.

modify itab_data.

endloop.

refresh itab_data.

xth_data[] = itab_data[].

ENDFUNCTION.

When i execute the planning function i got message like

107 data records were read, 107 of them were changed, 0 generated

it is reading the records from cube and changeing the recored also but not generating record.

As with SAP:

Using a function module for initialization is useful if you not only want to change data records with the exit function, but also want to create new ones. Initialization then makes sure that the key of the new data records to be created is transferred to the main function module via a parameter designated for this. This ensures that this function module is processed in any case, even if no data records exist yet.

I created another Exit FM with Init

i didn't write any code in the Init FM.

FUNCTION Z_CONVERSION_INIT.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_AREA) TYPE UPC_Y_AREA

*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL

*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE

*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD

*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM

*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP

*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL

*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA

*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF

*" EXPORTING

*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG

*" REFERENCE(ETO_CHAS) TYPE ANY TABLE

*"----


ENDFUNCTION.

I selected fields to be changed two characteristics comopany code and contalloing area in the Planning function.

Please suggest me how to proceed further to generate the new records

do i need add some code in the Init FM also.

do i need to pass any parametrs in the planning function.

Please share ur ideas on this.

Please share with me if you have any sample code.

Thanks in advance

Best regards

SS

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 26, 2008 at 08:13 AM

    Hi,

    please use the same principle as explained in [changing-char-value-in-ip-cthdata]. Instead of modifying the values append a new line to the table.

    Hope this helps.

    Regards Matthias Nutt

    Add comment
    10|10000 characters needed characters exceeded