This website is not affiliated with, sponsored by, or approved by SAP AG.

Datasource for Table KONV

Business Warehouse

Moderators: Snowy, thx4allthefish

Datasource for Table KONV

Postby echoes on Tue Nov 18, 2003 1:32 am

Dear all,

When I try to create Datasource for table KONV via function module, I met some problems.

The error messages below when I try to save the datasource:
-----------------------------------------------------------------------------------
Units field AWEI1 for field KAWRT of DataSource ZDS_KONV is hidden
Units field KOEI1 for field KBETR of DataSource ZDS_KONV is hidden
Units field WAERK for field KDIFF of DataSource ZDS_KONV is hidden
Units field WAERK for field KWERT of DataSource ZDS_KONV is hidden
Units field STEI1 for field KSTBS of DataSource ZDS_KONV is hidden
-----------------------------------------------------------------------------------

(My function module is copied from Standard FM RSAX_BIW_GET_DATA_Simple and modified to fit my requirement)

I know this issue is coming from the reference table/fields of Field quantity/currency units. But I don't know how to correct it as KONV is a cluster table and I can't create view instead.

Does somebody here experiece on it?

Anyone's any help is apprieciated!
Thanks a lot,echoes

echoes
 
Posts: 49
Joined: Mon Oct 20, 2003 1:56 am
Location: China - BeiJing

Postby SSH on Tue Nov 18, 2003 2:11 am

Go to transaction RSA6.

Select your data source and press change datasource button.

Here remove Hide indicator from your field.

Cheers.
SSH.
SSH
 

Postby echoes on Tue Nov 18, 2003 3:08 am

SSH,

Thank you very much for your quickly reply!

The problem occurs when I try to save the datasource. That is the creation of datasource is failed. So I can't using RSA6.

BTW, this issue is not caused by the field hide but reference field in another structure.

example:

1. The reference field of KONV-KAWRT is RV61A-AWEI1;
2. The reference field of KONV-KWERT is komk-WAERK;


Thanks,echoes
echoes
 
Posts: 49
Joined: Mon Oct 20, 2003 1:56 am
Location: China - BeiJing

Postby SSH on Tue Nov 18, 2003 4:21 am

Suggestion for you,

Create two fields in your extract structure for Data Element : KAWRT and KWERT. and assign this field as a reference field into your structure. Then try to same your data source.

I think your problem will be solved.

(The reference field of KONV-KAWRT is RV61A-AWEI1; The reference field of KONV-KWERT is komk-WAERK)

SSH.
SSH
 

Postby echoes on Wed Nov 19, 2003 12:06 am

SSH,

Thanks!

Would you please tell me how to do it?

As this datasource is coming from a FM which is copied from SAP standard FM RSAX_BIW_GET_DATA_SIMPLE and adapted to table KONV, the only extruct structure is KONV and I don't wanna do anything with table KONV.


Thanks a lot,echoes

-------------------------------------------------------------------------
FUNCTION RSAX_BIW_GET_DATA_KONV.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE
*" OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE
*" OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG
*" OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_KONV STRUCTURE ZSKONV OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"----------------------------------------------------------------------

* Example: DataSource for table KONV
TABLES: KONV.

* Auxiliary Selection criteria structure
DATA: L_S_SELECT TYPE SRSC_S_SELECT.

* Maximum number of lines for DB table
STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,

* counter
S_COUNTER_DATAPAKID LIKE SY-TABIX,

* cursor
S_CURSOR TYPE CURSOR.
* Select ranges
RANGES: L_R_KNUMV FOR KONV-KNUMV,
L_R_KPOSN FOR KONV-KPOSN,
L_R_STUNR FOR KONV-STUNR,
L_R_ZAEHK FOR KONV-ZAEHK.

* Initialization mode (first call by SAPI) or data transfer mode
* (following calls) ?
IF I_INITFLAG = SBIWA_C_FLAG_ON.

************************************************************************
* Initialization: check input parameters
* buffer input parameters
* prepare data selection
************************************************************************

* Check DataSource validity
CASE I_DSOURCE.
WHEN 'ZDS_KONV'.
WHEN OTHERS.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
* this is a typical log call. Please write every error message like this
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_DSOURCE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.

APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.

* Fill parameter buffer for data extraction calls
S_S_IF-REQUNR = I_REQUNR.
S_S_IF-DSOURCE = I_DSOURCE.
S_S_IF-MAXSIZE = I_MAXSIZE.

* Fill field list table for an optimized select statement
* (in case that there is no 1:1 relation between InfoSource fields
* and database table fields this may be far from beeing trivial)
APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.

ELSE. "Initialization mode or data extraction ?

************************************************************************
* Data transfer: First Call OPEN CURSOR + FETCH
* Following Calls FETCH only
************************************************************************

* First data package -> OPEN CURSOR
IF S_COUNTER_DATAPAKID = 0.

* Fill range tables BW will only pass down simple selection criteria
* of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'KNUMV'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_KNUMV.
APPEND L_R_KNUMV.
ENDLOOP.

LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'KPOSN'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_KPOSN.
APPEND L_R_KPOSN.
ENDLOOP.

LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'STUNR'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_STUNR.
APPEND L_R_STUNR.
ENDLOOP.

LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZAEHK'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_ZAEHK.
APPEND L_R_ZAEHK.
ENDLOOP.

* Determine number of database records to be read per FETCH statement
* from input parameter I_MAXSIZE. If there is a one to one relation
* between DataSource table lines and database entries, this is trivial.
* In other cases, it may be impossible and some estimated value has to
* be determined.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT (S_S_IF-T_FIELDS) FROM KONV
WHERE KNUMV IN L_R_KNUMV AND
KPOSN IN L_R_KPOSN AND
STUNR IN L_R_STUNR AND
ZAEHK IN L_R_ZAEHK.
ENDIF. "First data package ?

* Fetch records into interface table.
* named E_T_'Name of extract structure'.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_KONV
PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

ENDIF. "Initialization mode or data extraction ?

ENDFUNCTION.
echoes
 
Posts: 49
Joined: Mon Oct 20, 2003 1:56 am
Location: China - BeiJing


Return to Business Warehouse

Who is online

Users browsing this forum: No registered users and 3 guests



This website is not affiliated with, sponsored by, or approved by SAP AG.