cancel
Showing results for 
Search instead for 
Did you mean: 

Help on code similar to RSAX_BIW_GET_DATA_SIMPLE

Former Member
0 Kudos

Hi,

I am having some doubts using the FM that I copied from RSAX_BIW_GET_DATA_SIMPLE. Here is the portion of my code:

OPEN CURSOR WITH HOLD S_CURSOR FOR

SELECT * FROM ZZTEST

where date in l_r_date.

ENDIF. "First data package ?

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE T_ZZTEST

PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

LOOP AT T_ZZTEST .

IF T_ZZTEST-ZOBJECT = '123456'.

MOVE-CORRESPONDING T_ZZTEST TO E_T_DATA.

APPEND E_T_DATA.

ENDIF.

ENDLOOP.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

When I go to the actual table to get the number of records for a particular date range, the number of records is different from the number of records when the data gets loaded to BW. It seems that different way of writing the code produces different number of records extracted, but never the number of records match with the one from the actual table when I use SE16 to see for a certain selection.

Is there an explanation for this?

For example, when I have the following:

OPEN CURSOR WITH HOLD S_CURSOR FOR

SELECT * FROM ZZTEST.

ENDIF. "First data package ?

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE T_ZZTEST

PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

LOOP AT T_ZZTEST .

IF T_ZZTEST-ZOBJECT = '123456' and

T_ZZTEST-DATE IN L_R_DATE.

MOVE-CORRESPONDING T_ZZTEST TO E_T_DATA.

APPEND E_T_DATA.

ENDIF.

ENDLOOP.

The number of records transferred to BW is about 300K records but only 33K records got updated in the InfoProvider.

What would be the best way to test this method to see the number of records produce by the FM to be similar to the one from the SE16 table? WOuld there be some slight differences?

Hope I am making sense.

Thank you

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Thank you for the info. I also have another question.

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

MOVE-CORRESPONDING L_S_SELECT TO L_R_UDATE.

APPEND L_R_UDATE.

ENDLOOP.

It seems that it is there with the purpose of allowing the selection "from" and "to" from the InfoPackage "Selection' tab, but the range selection doesn't show in the InfoPackage if I start enabling the generic delta from RSO2. I am trying to make sense of this, so my reasoning may be off somewhat.

Also, how can this be used in relation to initialization of the delta? When doing the init without specifying the date range "from" and "to" from the InfoPackage, will it retrieve all the records from the table? What if the table has 80M records? Will the full or in this case init delta will retrieve up to 80M records??

Well... this is probaly not making sense because I am trying to grasp the sequence of all this thing about delta, delta queues, initialization, full load, etc.

Any ideas is greatly appreciated.

Thank you

Former Member
0 Kudos

Hi,

Try this code:

<i>IF S_COUNTER_DATAPAKID = 0.</i> " This statement is

" importatnt.

OPEN CURSOR WITH HOLD S_CURSOR FOR

SELECT * FROM ZZTEST

where date in l_r_date.

ENDIF. "First data package ?

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE T_ZZTEST

PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

LOOP AT T_ZZTEST .

IF T_ZZTEST-ZOBJECT = '123456'.

MOVE-CORRESPONDING T_ZZTEST TO E_T_DATA.

APPEND E_T_DATA.

ENDIF.

ENDLOOP.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

With rgds,

Anil Kumar Sharma .P

edwin_harpino
Active Contributor
0 Kudos

hi Crystal,

....

The number of records transferred to BW is about 300K records but only 33K records got updated in the InfoProvider.

What would be the best way to test this method to see the number of records produce by the FM to be similar to the one from the SE16 table? WOuld there be some slight differences?

....

one way to check the total records in bw agree with r/3 or not is checking total records in PSA since it's exactly same as r/3 without any data transformation,

data that go to infoproviders (ods/infocube) may already sum ump (depend on the keyfields in ods and characteristics in infocube).

e.g we have data from r/3

documentnumber-documentitem-date-product-quantity

001-1-x-09.04.2006-10

001-2-y-09.04.2006-20

001-1-x-10.04.2006-15

002-1-x-10.04.2006-25 (4 records)

say we have keyfieds docnumber and docitem in ods,

and use update 'overwrite' for keyfigures quantity,

then data in ods (active table) will look like

documentnumber-documentitem-date-product-quantity

001-2-y-09.04.2006-20

001-1-x-10.04.2006-15

002-1-x-10.04.2006-25 (3 records)

  • 001-1-x-09.04.2006-10 updated by 001-1-x-09.04.2006-10

and we have characteristic product and date in infocube

date-product-quantity

y-09.04.2006-20

x-10.04.2006-40(2 records)

here we can see records from source system different with infoprovider 4 records vs 3 records and 2 records,

hope this also make sense and help