Application Development 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: 

Bdc session

Former Member
0 Kudos

Hi

I have 500 records.

My requirement is to create session for every 100 records.

that means all together I need to create 5 sessions with 100 records each.

how can i do this.

<b>Points will be rewarded to all contributors.</b>

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use lsmw recording for this

its very easy and fast process for such less records

create the flat files with every 100 records

feed those files into the program

it will create the session at the end of all the steps

continue with the remaining 4 files in the same way

mark helpful answers

Regards,

Naveen

4 REPLIES 4

Former Member
0 Kudos

use lsmw recording for this

its very easy and fast process for such less records

create the flat files with every 100 records

feed those files into the program

it will create the session at the end of all the steps

continue with the remaining 4 files in the same way

mark helpful answers

Regards,

Naveen

former_member181962
Active Contributor
0 Kudos

cal the bdc_open_group bdc_insert and bdc_close_group after the end of every 100 records.

loop at itab.

v_count = v_count + 1.

if v_count = 100.

call function 'BDC_OPEN_GROUP'

endif.

.

.

PERFORM BDC_DYNPRO.....

PERFORM BDC_FIELD...

CALL FUNCTION 'BDC_INSERT'...

IF V_COUNT = 100.

CALL FUNCTION BDC_CLOSE_GROUP..

V_COUNT = 0.

ENDIF.

endloop.

Former Member
0 Kudos

Hi Venkat

Please check you can work as below:

data: counter type i.

perform bdc_open_group.
loop at <itab> into <wa>.
    .....
    perform bdc_insert.

    if counter = 100.
      perform bdc_close_group.
      counter = 0.
      perform bdc_open_group.
   endif.
    counter = counter + 1.

    at last.
        perform bdc_close_group.
    endat.

endloop.

Hope this gives you some idea.

Kind Regards

Eswar

Former Member
0 Kudos

Hi venkat,

Do logic like this :This logic is not only for 500 records, even for million records)

1.

DATA : MYCTR TYPE I.

DATA : NEWFLAG TYPE C.

LOOP AT ITAB (containing million records)

MYCTR = MYCTR + 1.

CLEAR NEWFLAG.

IF MYCTR > 100.

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

3. U may have to refine the logic somewhat.

Regards,

Kumar

Message was edited by:

kumar kk