‎2006 Sep 27 5:12 PM
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
‎2006 Sep 27 5:13 PM
Hi Shilpa,
For Handling Huge Data .. we go in using DIRECT INPUT METHOD .. try using this
‎2006 Sep 27 5:13 PM
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.
‎2006 Sep 27 5:19 PM
Hello Amit,
Can u pls send me some sample code for the same.
Thanks,
Shilpa
‎2006 Sep 27 5:23 PM
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.
‎2006 Sep 27 5:24 PM
Hello Amit,
Can u pls send me some sample code for the same.
Thanks,
Shilpa
‎2006 Sep 27 5:33 PM
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