‎2006 Aug 07 12:52 PM
Hi all ,
I have one global variable <b>gf_count</b> which is getting incremented in a loop.
<b>Now, Until the count reaches 100, It should be in one session. After that for every 100, a new session should be created for every 100 records...
For ex: if there are 300 Records, 3 sessions should be created - one each for every 100 records.</b>
I had posted this earlier.. But i guess it was not clear.
Please Suggest the possibilities...
‎2006 Aug 07 12:56 PM
hi,
pseudo logic like this::
in side loop.
if gf_count = 100.
close the already opened session.
open new session.
set count = 0.
endif.
endloop.
‎2006 Aug 07 12:58 PM
clear gf_count.
loop at itab.
gf_count = gf_count + 1.
If gf_count = 1.
call function 'OPEN_GROUP'.
endif.
all the bdc_insert logic in betwen...
if gf_count = 100.
call function 'CLOSE_GROUP'.
clear gf_count.
endif.
endloop.
Regards,
Ravi
‎2006 Aug 07 1:23 PM
Hi Abhijith,
Delare a local count which should get reset after every 100 records.
loop at itab.
lc = lc + 1.
if lc = 100.
concatenate session_name '_' gf_count into session_name.
GROUP = 'session_name'.
your session name after every 100 records will be
session_name_100,session_name_200...... so on
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING CLIENT = SY-MANDT
GROUP = GROUP
USER = USER
KEEP = KEEP
HOLDDATE = HOLDDATE.
endif.
CALL FUNCTION 'BDC_INSERT'
EXPORTING TCODE = TCODE
TABLES DYNPROTAB = BDCDATA.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
endloop.