Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

关于使用function model 作为数据源

大家好,小弟初学BW不久,目前苦于找不到使用function model 作为数据源的操作手册一类资料,想请教一下各位高手,用function model 作为数据源的操作步骤主要有些什么?有资料就最好了。感激不尽!!

Former Member
Former Member replied

这个问题前面的帖子里已经讨论过:

例子见FM:RSAX_BIW_GET_DATA_SIMPLE:

Function Module for Application Data Collection

This function module is used to get data for a DataSource that was created using generic data extraction (transaction RSO2). During an extraction process, this function module is called up several times in succession:

1. Initialization call up:

Only the request parameters are transferred to the module here (see below). The module cannot transfer any data as yet.

2. First read call up:

The request parameters are not transferred again. The extractor returns data typified by the extract stucture in an interface table. The request parameter (I_MAXSIZE) specifies the number of expected rows.

3. Second read call up:

The extractor returns data connected to the first data package, again in a package with I_MAXSIZE rows.

4. The function module is called up again and again until it calls up the exception 'NO_MORE_DATA'. No more data is allowed to be transferred in the call up in which this exception arose.

The function module must have the following interfaces:

Importing parameters:

I_DSOURCE type SRSC_S_IF_SIMPLE-DSOURCE DataSource

I_INITFLAG type SRSC_S_IF_SIMPLE-INITFLAG Initialization call up

I_MAXSIZE type SRSC_S_IF_SIMPLE-MAXSIZE Package size

I_REQUNR type SRSC_S_IF_SIMPLE-REQUNR Request number

Tables:

I_T_SELECT type SRSC_S_IF_SIMPLE-T_SELECT

I_T_FIELDS type SRSC_S_IF_SIMPLE-T_SELECT

E_T_DATA

Exceptions:

NO_MORE_DATA

ERROR_PASSED_TO_MESS_HANDLER

Notes to the individual parameters:

I_INITFLAG

When the function module is called up for the first time, this parameter is set to 'X', afterwards it is set to ' '.

I_MAXSIZE

This parameter contains the number of rows expected for a read call up.

Example

An example of a function module that meets these requirements is RSAX_BIW_GET_DATA_SIMPLE. A simple method of creating a syntactically correct module is to copy it into its own function group and to copy the top-include rows of RSAX (LRSAXTOP) function group into the top- include for this function group. Afterwards, you need to adjust the copied function module to meet your own requirements.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question