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

Problem with BDC Session

Former Member
0 Likes
422

Hi all,

I am running BDC session like below.

PERFORM OPEN_GROUP.

REFRESH GI_BDCDATA.

LOOP AT GI_FILE INTO LS_FILE.

PERFORM BDC_DYNPRO USING 'TRANSACTION1' '0100'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'KNA1-KUNNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ENT1'.

PERFORM BDC_FIELD USING 'KNA1-KUNNR'

LS_FILE-KUNNR.

PERFORM BDC_FIELD USING 'TVKOT-VKORG'

LS_FILE-VKORG.

PERFORM BDC_DYNPRO USING Transaction1' '0200'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'.

....

.....

.....

....

....

....

....

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'Transaction1'

TABLES

DYNPROTAB = GI_BDCDATA

ENDIF.

ENDLOOP.

PERFORM CLOSE_GROUP.

SUBMIT RSBDCSUB EXPORTING LIST TO MEMORY

WITH SELECTION-TABLE LI_RSPAR

AND RETURN.

My session is errored for some reason. i tried to reprocess the session from SM 35 .but it is running only for first record of my internal table several times .My file is having first 3 records with out errors and next two with errors,but my session is updating only first record in data base .

i checked the GI_BDCDATA , it is having recording information for all records of the internal table.

i dont understand what is happening, can anyone help me out.

Thanks and regards,

Gopal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
400

use REFRESH GI_BDCDATA after calling the FM CALL FUNCTION 'BDC_INSERT'.

This will resolve your problem.

3 REPLIES 3
Read only

Former Member
0 Likes
401

use REFRESH GI_BDCDATA after calling the FM CALL FUNCTION 'BDC_INSERT'.

This will resolve your problem.

Read only

0 Likes
400

Thanks POORNA,

it is solved my problem

Read only

Former Member
0 Likes
400

The problem in your code is ur itab is not getting refreshed. So your r getting the problem. What you need to do is to write Refresh GI_BDCDATA. just before endloop statement and after BDC_Insert.

Your code must be like this:

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = Transaction1

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

dynprotab = GI_BDCDATA

EXCEPTIONS

internal_error = 1

not_open = 2

queue_error = 3

tcode_invalid = 4

printing_invalid = 5

posting_invalid = 6

OTHERS = 7

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

REFRESH GI_BDCDATA.

ENDLOOP.

This will definetly solve your problem.