cancel
Showing results for 
Search instead for 
Did you mean: 

Delta with 2 fields from table EKBE

10-19-2009 11:32 AM
1786 views 8 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

I have created a customized datasource for table EKBE using function module as interface.

I want to make this datasource as delta enabled using field CPUDT and CPUTM. However, in RSO2, during datasource creation, in delta tab, I could only set delta with one field. How to set delta using more than one field ?

I have tried to search similar threads in forum, but failed to solve my problem.

Could you please share ?

Thanks.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi,

Any updates please ?

I have created a customized datasource for EKBE table using a function module. I set the generic delta using field CPUDT, but it didn't work. My delta extraction keeps on extract 0 records, eventhough I have created a few new documents.

Please share.

Thanks.

Former Member
0 Likes

Hi Handoko

You can have 2 ways for this -

1. Base you delta only on CPUDT and put safety limit as 1 hr rather than 1 day i.e. 3600 seconds

2. Create a timestamp field based on CPUDT and CPUTM as explained in below link

[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30aefb04-7043-2c10-8e92-941536eebc79&overridelayout=true]

regards

sanjyot

Former Member
0 Likes

Hi Sanjyot,

Can you please tell me how to set Safety limit as 1 hr in RSO2.

In which one do I have to set - Safety Interval Upper Limit or Safety Interval Lower Limit ?

Is the below snapshot correct ?

Thanks & Regards,

Shruti Yendigeri

Answers (4)

Answers (4)

Former Member
0 Likes

Hi Handoko

i got the same requirement for EKBE TABLE oit dunmp into BW

Can you explain the process for me..

can we do delta on view or table or do we need to write to Function module

thanks

nag

Former Member
0 Likes

Thanks so much Sanjyot. My issue has been resolved.

Points have been awarded.

Thanks to all also.

Former Member
0 Likes

Hi Handoko,

Sanjyot had mentioned the two options.

It will be helpfull if you can say me which option resolved your issue.

Thanks & Regards,

Shruti Yendigeri

Former Member
0 Likes

Hi Anil,

Thanks. As per your suggestion, I have used CPUDT as delta field and set Safety Internal Lower Limit value as 1.

However, when I tried to run delta after successful INIT in BW, I got all the records from EKBE table rather than only newly created document. Thus, every time I execute delta in BW, it behaves like a full load.

Could you please advice again ? Thanks.

Below is my code in the function module.

FUNCTION zrsax_biw_get_data_simple.

*"----


""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

*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL

*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF

*" 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_DATA STRUCTURE ZAAMR_DV_EKBE OPTIONAL

*" EXCEPTIONS

*" NO_MORE_DATA

*" ERROR_PASSED_TO_MESS_HANDLER

*"----


  • Example: DataSource for table SFLIGHT

TABLES: zaamr_dv_ekbe.

  • 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_CARRID FOR SFLIGHT-CARRID,

  • L_R_CONNID FOR SFLIGHT-CONNID.

RANGES:

p_ebeln FOR zaamr_dv_ekbe-ebeln.

  • 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 'ZAAMR_DS_EKBE'.

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 = 'CARRID'.

  • MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.

  • APPEND L_R_CARRID.

  • ENDLOOP.

*

  • LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.

  • MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.

  • APPEND L_R_CONNID.

  • ENDLOOP.

LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'EBELN'.

MOVE-CORRESPONDING l_s_select TO p_ebeln.

APPEND p_ebeln.

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 SFLIGHT

  • WHERE CARRID IN L_R_CARRID AND

  • CONNID IN L_R_CONNID.

SELECT ebeln ebelp gjahr belnr buzei bewtp bwart

budat menge dmbtr wrbtr waers shkzg cpudt

cputm matnr werks FROM ekbe

WHERE ebeln IN p_ebeln.

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_data

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.

Former Member
0 Likes

Hi,

I think, Delta on 2 fields is not possible.

But you can go ahead with CPUDT as delta enabled field and with Lower saftly limit as "1".

Due to this you will get same records in more than one time into BI ( if you trigger delta more than 1 time in a day) , but you will not miss any new deltas but also you can get newly created records immidately into BI . But here first of all you need to upload to DSO.

Regards,

Anil Kumar Sharma .P