Question:
Hi all,
Well I am trying to run an exit in BPS planning. One of the question I have is
- how do I det the data from the planning area into the function. I am aware of xth_data and the fact that it is a structure similar to that of the SEM Context.
How do I get the data from the calling planning ( when I select “Set Variables” ) into the function.
CALL FUNCTION 'UPF_PRICE'
EXPORTING
I_AREA =
I_PLEVEL =
I_METHOD =
I_PARAM =
I_PACKAGE =
IT_EXITP =
ITO_CHASEL =
ITO_CHA =
ITO_KYF =
* IMPORTING
* ET_MESG =
CHANGING
XTH_DATA = what goes here????
Answer:
Hi Lucy,
Function group UPFX contains examples of exit-type planning functions.
basically you will need to define something like:
data: lth_data type t_th_yourplanningarea,
ls_data type t_s_yourplanningarea occurs 0 with header line.
* then to access the data in the layout you;
refresh lth_data.
loop at xth_data into ls_data.
or
field-symbols: <ls_data> type any.
loop at xth_data assigning <ls_data>.
* now <ls_data> points to a line of xth_data and can
* be used to reference each characteristic and/or
* keyfigure contained within.
after you have changed the data you can then;
append ls_data.
collect ls_data into lth_data.
clear ls_data.
endloop.
* when done save modified data to xth_data by
clear: xth_data.
xth_data[] = lth_data[].
I hope this helps Lucy.
DW