cancel
Showing results for 
Search instead for 
Did you mean: 

Xth_data and Parameters in Exit function

Former Member
0 Kudos

Hi Frineds,

I am working Exit function in BW BPS 3.5 version.

I gone through document i did n't get clar idea

what is the Xth-data

I know like Xth-data will contain all the fileds to be changed which includes characterstics and key figures and also it contain structures like S-char and S-kyf

but my question is Xth-data is internal table or any thing else.

i am accessing characetics which i selcted fileds to be changed in the Exit function.

Once i modify this values in the exit function , how this changes will effect into Exit function

Do i need to use any "append statemnt like append xth_data to ls_data

This statment is required or not. Here i am changeing only characterstics.

And what is the use of parameters in Exit function.

please share ur ideas on this.

Thanks in advance.

Best regards

SAP

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

done

Former Member
0 Kudos

xth_data is a hashed table which is given as changing parameter in the exit function module. It gets the data from the buffer and writes the data back to buffer. What you need to do in the exit is to take this data to one internal table, do whatever modifications are needed, to that internal table and at the last, assign this table data to xth_data which will automatically writes the data to buffer. When you save, this buffer data will be saved to cube. The structure of xth_data is same as the planning area which includes all the characteristics and keyfigures present in the planning area.

Former Member
0 Kudos

Thanks fro ur reply Bindu. I assigned the points.

I understand the concept of Xth data.

Do u have any sample code to convert the Hash table to Internal table and again convert the Internal table to Has table. I can write my logic in internal table.

My requirement at the moment is changeing Ccode from aaaa to xxxx and Contr area from bbbb to yyyy. ( later i need to change to cost centers also)

Please post here if you have any sample code.

Thanks in advance.

Best regards

SAP

Former Member
0 Kudos

Say you have defined one internal table i_data.

you can directly assign xth_data to i_data.

i_data[] = xth_data[].

Now do the manipulations in this table i_data.

At the last, you can use modify statement to modify xth_data based on i_data.

Former Member
0 Kudos

Thanks for your reply Bindu. I assigned the points.

I will try with your steps and i will let you know if i get any issues.

Former Member
0 Kudos

Hi Bindu,

I developed the following code and executed the Exit function

when i execute the function i got error message like "Planning are does not exist"

But when i execute the repost function for same functioanlity it is working fine and it is changeing the company code and controlloing area values from 0353->2083

G353->I083.

It seems to be some thing is wrong in the code. Please look in to the code and suggest me if anything is wrong in the code.

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

*"----


FIELD-SYMBOLS: <ls_data> type any,

<s_chas> type any,

<value1> type /BI0/PCOMP_CODE-COMP_CODE,

<value2> type /BI0/PCO_AREA-CO_AREA.

data : begin of wa_data ,

compcode like /BI0/PCOMP_CODE-COMP_CODE,

contrarea like /BI0/PCO_AREA-CO_AREA,

end of wa_data.

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.

data: data_ref type ref to data.

create data data_ref like line of xth_data.

assign data_ref->* to <ls_data>.

assign component 'S_CHAS' of structure <ls_data> to <s_chas>.

assign component '0COMP_CODE' of structure <s_chas> to <value1>.

assign component '0CO_AREA' of structure <s_chas> to <value2>.

itab_data = <ls_data>.

Loop at itab_data.

read table itab_data with key compcode = '0353'

contrarea = 'G353'.

if sy-subrc = 0.

wa_data-compcode = '2083'.

wa_data-contrarea = 'I083'.

modify itab_data from wa_data.

endif.

endloop.

collect <ls_data> into xth_data.

ENDFUNCTION.

Former Member
0 Kudos

Hi Bindu,

I developed the code like this

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.

and when i execute this code

i got the following message.

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

It seems to be it is reading data from cube and change ing the data also but it is not genetarting new records.

Please suggest me if i did any wrong in my code.

i think something i am missing in the code.

what changes are required in the code generate the new record

thanks

Best regards

SAP