|
Blogs
The requirement is to create a datasource using function module approach, which can handle delta as well. We can use the function modules RSAX_BIW_GET_DATA or RSVD BW_GET_DELTA_DATA as template. As the interface of the above mentioned templates is’ F1’, we can handle various extraction modes from within the function module (*make use of i_updmode). The Puzzle: Everything works perfectly for full mode, but for the delta extraction mode, the parameter i_updmode is not populated correctly. Let us debug the extractor program.
We observe, for the extraction mode – full, the variable l_fname has the value ZIRSVD_BW_GET_DELTA_DATA (user specified FM). But for delta request, the extractor program is calling the function module specified in RSAOT type group. And at a later stage, the Generic FM is being called with i_updmode as FULL. Hence in either way, the function module is not able to handle the selection based on the extraction mode. Let us try from the enhancement spot: Let us try to handle the entire logic (for full and delta) from the enhancement spot. In the following code, a cursor is set for the select statement based on the value of i_updmode. The value for the current pointer and repeat pointer can be referred from the table ROOSGENDLM. A sample code is given below. METHOD if_ex_rsu5_sapi_badi~data_transform. Alternatively, we can create another function module and pass the parameters . A word of caution: The function module will be called again and again if we do not raise any exception. Raise the exception no_more_data to get out of the function module.
Now the request is being handled from the enhancement spot.
Disclaimer: This document is provided without a warranty of any
kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or
non-infringement. All texts in this blog are
personal opinions and observations of the author. soorejkv
| |||||||||||||||||||||||