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

session problem in BDC

Former Member
0 Likes
1,120

Hello Experts,

I am doing BDC Session but it gives the error ' BDC_OPEN_GROUP , Create session ABC . NOT Allowed , as last session is still active '.

Actually the BDC i m using and upload the data by Call transaction successfully upload the data . But with session i got this error' BDC_OPEN_GROUP , Create session ABC . NOT Allowed , as last session is still active '.

please tell me how to solve this error.

regards

kamal

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
788

Hello,

Can you post the code you're using? For Batch Input method you should be using BDC_OPEN_GROUP, BDC_INSERT & BDC_INSERT in sequence.

BR,

Suhas

5 REPLIES 5
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
789

Hello,

Can you post the code you're using? For Batch Input method you should be using BDC_OPEN_GROUP, BDC_INSERT & BDC_INSERT in sequence.

BR,

Suhas

Read only

Former Member
0 Likes
788

Yeah , this is my program .

report ZSESSION111

no standard page heading line-size 255.

data: begin of it_edu occurs 0,

id like zedudata-subid,

name like zedudata-name,

end of it_edu.

data: bdcdata1 like bdcdata occurs 0 with header line.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = ' '

FILETYPE = 'DAT'

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

DATA_TAB = it_edu

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 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.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

  • CLIENT = SY-MANDT

  • DEST = FILLER8

GROUP = 'zsession111'

  • HOLDDATE = FILLER8

KEEP = 'X'

USER = sy-uname

  • RECORD = FILLER1

  • PROG = sy-cprog

  • DCPFM = '%'

  • DATFM = '%'

  • IMPORTING

  • QID =

  • EXCEPTIONS

  • CLIENT_INVALID = 1

  • DESTINATION_INVALID = 2

  • GROUP_INVALID = 3

  • GROUP_IS_LOCKED = 4

  • HOLDDATE_INVALID = 5

  • INTERNAL_ERROR = 6

  • QUEUE_ERROR = 7

  • RUNNING = 8

  • SYSTEM_LOCK_ERROR = 9

  • USER_INVALID = 10

  • OTHERS = 11

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

loop at it_edu.

refresh bdcdata1.

perform mapping.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

DYNPROTAB = bdcdata1

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

endloop.

CALL FUNCTION 'BDC_CLOSE_GROUP'

  • EXCEPTIONS

  • NOT_OPEN = 1

  • QUEUE_ERROR = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

include bdcrecx1.

start-of-selection.

form mapping.

perform open_group.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-TBMA_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=EDIT'.

perform bdc_field using 'RSRD1-TBMA'

'X'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'ZEDUDATA'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-TABCLTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_DISP_EDIT_TOGGLE'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-TABCLTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_DISP_EDIT_TOGGLE'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-DDTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=TDED'.

perform bdc_field using 'DD02D-DDTEXT'

'educational data'.

loop at it_edu.

perform bdc_dynpro using '/1BCDWB/DBZEDUDATA' '0101'.

perform bdc_field using 'BDC_CURSOR'

'ZEDUDATA-NAME'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'ZEDUDATA-SUBID'

it_edu-id.

perform bdc_field using 'ZEDUDATA-NAME'

it_edu-name.

endloop.

perform bdc_dynpro using '/1BCDWB/DBZEDUDATA' '0101'.

perform bdc_field using 'BDC_OKCODE'

'/EBACK'.

perform bdc_field using 'BDC_CURSOR'

'ZEDUDATA-SUBID'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-DDTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_BACK'.

perform bdc_field using 'DD02D-DDTEXT'

'educational data'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-TBMA_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'RSRD1-TBMA'

'X'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'ZEDUDATA'.

perform bdc_transaction using 'SE11'.

perform close_group.

endform.

Read only

Former Member
0 Likes
788

report ZSESSION111

no standard page heading line-size 255.

data: begin of it_edu occurs 0,

id like zedudata-subid,

name like zedudata-name,

end of it_edu.

data: bdcdata1 like bdcdata occurs 0 with header line.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = ' '

FILETYPE = 'DAT'

TABLES

DATA_TAB = it_edu

.

IF SY-SUBRC <> 0.

ENDIF.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

GROUP = 'zsession111'

KEEP = 'X'

USER = sy-uname

.

IF SY-SUBRC <> 0.

ENDIF.

loop at it_edu.

refresh bdcdata1.

perform mapping.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

TABLES

DYNPROTAB = bdcdata1

.

IF SY-SUBRC <> 0.

ENDIF.

endloop.

CALL FUNCTION 'BDC_CLOSE_GROUP'

.

IF SY-SUBRC <> 0.

ENDIF.

include bdcrecx1.

start-of-selection.

form mapping.

perform open_group.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-TBMA_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=EDIT'.

perform bdc_field using 'RSRD1-TBMA'

'X'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'ZEDUDATA'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-TABCLTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_DISP_EDIT_TOGGLE'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-TABCLTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_DISP_EDIT_TOGGLE'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-DDTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=TDED'.

perform bdc_field using 'DD02D-DDTEXT'

'educational data'.

loop at it_edu.

perform bdc_dynpro using '/1BCDWB/DBZEDUDATA' '0101'.

perform bdc_field using 'BDC_CURSOR'

'ZEDUDATA-NAME'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'ZEDUDATA-SUBID'

it_edu-id.

perform bdc_field using 'ZEDUDATA-NAME'

it_edu-name.

endloop.

perform bdc_dynpro using '/1BCDWB/DBZEDUDATA' '0101'.

perform bdc_field using 'BDC_OKCODE'

'/EBACK'.

perform bdc_field using 'BDC_CURSOR'

'ZEDUDATA-SUBID'.

perform bdc_dynpro using 'SAPLSD41' '2200'.

perform bdc_field using 'BDC_CURSOR'

'DD02D-DDTEXT'.

perform bdc_field using 'BDC_OKCODE'

'=WB_BACK'.

perform bdc_field using 'DD02D-DDTEXT'

'educational data'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-TBMA_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'RSRD1-TBMA'

'X'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'ZEDUDATA'.

perform bdc_transaction using 'SE11'.

perform close_group.

endform.

Read only

0 Likes
788

Seems like your are opening twice BDC, in main part of program and in form mapping. Keep only one opening/closing group. Restructure your program to make it more readable.

Regards,

Raymond

Read only

Former Member
0 Likes
788

This error will appear only in following scenario.

You have opened a session by "BDC_OPEN_GROUP" but no closed that by "BDC_CLOSE_GROUP". After that you are again trying to open a session by "BDC_OPEN_GROUP" .

No matter the session names are same or different. SAP allows only one session open at a time.