Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Processing!!

Former Member
0 Likes
440

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

3 REPLIES 3
Read only

Former Member
0 Likes
413

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.

Read only

Former Member
0 Likes
413

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

Read only

Former Member
0 Likes
413

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.