cancel
Showing results for 
Search instead for 
Did you mean: 

Data source base on FM

Former Member
0 Kudos

hi ,experts

   About the data source base on FM ,the standard sample is use open cursor(like part 1 on picture).Because after open cursor,I wanna use select * from Table konp ...all entries in konh... to get the delta records.(as there is no create date in the table konp,  there is create date in the table konh).Both of tables are big,so there is a low performance.(  change the code use select package size 10000 ...endselect can rise the performance)

  So I wanna use the code like part 2(before this I have put the data of konp to itab lt_temp_result use select package size 10000 ...endselect).

   

  The question is extrator the data source from bw, the traffic light is always yellow.

   Does data source base on FM must be use open cursor?

Accepted Solutions (0)

Answers (2)

Answers (2)

RafkeMagic
Active Contributor
0 Kudos

how about:

   a) not using select * (because it is bad for performance)

and

  b) use a join of both tables in the open cursor command?

Former Member
0 Kudos

Hi Lim,

First thing first - It is not mandatory to use OPEN CURSOR in FM based datasource.

I am assuming that you are trying to create a delta data source based on FM. So using a Select...Endselect will have a huge performance impact, reason is obvious even if you have 10000 package size then it will be 10000 times database hit to extract the data.

Now, open cursor is actually efficient and is used in standard datasources for a reason. First it uses cursor and next it extracts package size data at once from database.

As you said KONH have date and not KONP so you can use open cursor only for KONH and then do a for all entries in KNOP for all the selected entries from KONH i.e. after fetch statement of KONH.

Also in part 2, if you are using binary search you should sort the internal tables by KNUMH but I see KNUMH is  a single key in KONH for you can define it a HASH table - it will be much faster.

I would recommend to ensure that ERDAT in KONH table gets updated everytime a condition record is changed or created. Else in your delta you might miss the new condition creations or changes.

Have you explored option of using 2LIS_13_VDKON datasource?


Thanks

Amit


Former Member
0 Kudos

Hi Amit,

    Like you said,I can open cursor only for konh, but I need get the fields KBETR and KPEIN from konp.After do a for all entries in konp for all the selected entries from konh.How can I get kbert and kpein.

    And about the miss the new condition creations or changes.I wanna set generic delta 's low limit as long as the performance allowed.It maybe reduce the miss risk.

   As your mention 2LIS_13_VDKON datasource that I not really know much about it. I think it maybe just related with the sales document. But in my situation, I need the records from konp which the condition number are in table a018 and a445.I have check the data and can not find the records with a018-KNUMH = konp-KNUMH or  a445-KNUMH = konp-KNUMH.

Thanks

Lim