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

Can we create multiple session in BDC using Call session?

Former Member
0 Likes
1,218

Hi Experts,

Can we create multiple sessions in BDC using Call Session?

Scenario:

Program has to upload 1 million records,so can we programmatically create multiple sessions such that after every 50thousand records we create a different session.

For moment due to large number of records BDC DYNPRO and BDC Field are unable to hold the large number of records,due to which we get a Out of memory error.

Thanks in advance.

Shilpa

6 REPLIES 6
Read only

Former Member
0 Likes
683

Hi Shilpa,

For Handling Huge Data .. we go in using DIRECT INPUT METHOD .. try using this

Read only

Former Member
0 Likes
683

Hi shilpa,

1. For that we have to write our own

logic / counter

so that for every 50,000 record,

we create another session,

2. one full session consists of

OPEN GROUP, INSERT DATA, CLOSE GROUP

regards,

amit m.

Read only

0 Likes
683

Hello Amit,

Can u pls send me some sample code for the same.

Thanks,

Shilpa

Read only

0 Likes
683

hi again,

1. Do logic like this :

DATA : MYCTR TYPE I.

DATA : NEWFLAG TYPE C.

LOOP AT ITAB (containing million records)

MYCTR = MYCTR + 1.

CLEAR NEWFLAG.

IF MYCTR > 50000.

MYCTR = 0.

NEWFLAG = 'X'.

ENDIF.

IF NEWFLAG = 'X'.

CALL FUNCTION BDC_OPEN_GROUP.

ENDIF.

*------

CALL FUNCTION BDC_INSERT

IF NEWFLAG = 'X'.

CALL FUNCTION BDC_CLOSE_GROUP.

ENDIF.

ENDLOOP.

2. The counter and flag will take

care of multipe sessions,

in batches of 50000 records.

3. U may have to refine the logic somewhat.

regards,

amit m.

Read only

0 Likes
683

Hello Amit,

Can u pls send me some sample code for the same.

Thanks,

Shilpa

Read only

Former Member
0 Likes
683

Hi

If ITAB is your table with the data to be transfered:

  • Open the first session:

CALL FUNCTION 'BDC_OPEN_GROUP'.........

IF SY-SUBRC = 0.

FL_OPEN = 'X'.

ENDIF.

LOOP AT ITAB.

IF FL_OPEN = SPACE.

  • Create new session

CALL FUNCTION 'BDC_OPEN_GROUP'.........

IF SY-SUBRC = 0.

FL_OPEN = 'X'.

ENDIF.

ENDIF.

  • Here elaborate your data and fill BDCDATA

  • Insert the transaction:

CALL FUNCTION 'BDC_INSERT'

IF SY-SUBRC = 0.

COUNT = COUNT + 1.

IF COUNT = COUNT_MAX.

COUNT = 0.

  • Close the session

IF FL_OPEN = 'X'.

CALL BDC_CLOSE_GROUP

IF SY-SUBRC = 0.

FL_OPEN = SPACE.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

Max