Read individual record of xth_data

Question: Hello SEM people,

I created an exit function in SEM-BPS. Simple copy and calculations within a LOOP at xth_īdata... works fine.

In a next step I have to calculate a total over some items before I can calculate a factor. For this reason I have to access directly single records of xth_data.
Can anybody give me some hints or ideas.
I am not sure aboute the structure of the key I have to build.

Best regards
PeCon

Answer:
read xth_data into planning cube structure lt_data & ls_data and from there you can go on selection basis.

hope following code might give u some idea.

TYPES: yt_data TYPE /1sem/_yt_data_xxxcube,
ys_data TYPE /1SEM/_YS_DATA_xxxcube.
DATA: lt_data TYPE yt_data,
ls_data TYPE ys_data.

lt_data = XTH_DATA.

LOOP AT LT_DATA into LS_DATA where S_CHAS-0METYPE = '1000' AND
S_CHAS-0VERSION = '999'.

ENDLOOP.

once data is collected into ls_data, you can acess keyfigures as
ls_data-S_KYFS-KF1= 100.

after changing ls_data, make changes into lt_data as

MODIFY LT_DATA FROM LS_DATA.

finally, copy lt_data into xth_data.

Answer:
Thank you very much!

this makes things much more easy than work with field-symbols to access the key figures.
Is is right, that I can also access LT_DATA with a simple read?

Best Regards
PeCon
Copyright ?2007 - 2008 www.jt77.com