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

Error in BDC Session

Former Member
0 Likes
1,221

Hi,

I am able to create the the BDC Session but when I goto transaction and select my session and click on process then it gives an information message that 'The requested session cannot be processed' .

My code used for creating BDC Session is given below :

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = c_session_name

user = sy-uname

EXCEPTIONS

OTHERS = 11.

CHECK sy-subrc <> 0.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = c_pa30

TABLES

dynprotab = it_bdcdata[]

EXCEPTIONS

OTHERS = 7.

CHECK sy-subrc <> 0.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

I have not used BDC sessions before. Please suggest solution to it.

Regards,

Nibha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,011

HI,

CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = c_session_name
user = sy-uname
EXCEPTIONS
OTHERS = 11.

CHECK sy-subrc 0.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = c_pa30
TABLES
dynprotab = it_bdcdata[]
EXCEPTIONS
OTHERS = 7.

* CHECK sy-subrc 0.        " Comment this line if you BDC session through's error 
 " then below FM will not get executed and session will not be closed.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

7 REPLIES 7
Read only

Former Member
0 Likes
1,012

HI,

CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = c_session_name
user = sy-uname
EXCEPTIONS
OTHERS = 11.

CHECK sy-subrc 0.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = c_pa30
TABLES
dynprotab = it_bdcdata[]
EXCEPTIONS
OTHERS = 7.

* CHECK sy-subrc 0.        " Comment this line if you BDC session through's error 
 " then below FM will not get executed and session will not be closed.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

Read only

0 Likes
1,011

Hi,

I have commented that line but I am still getting the same error.

Regards,

Nibha

Read only

0 Likes
1,011
CALL FUNCTION 'BDC_OPEN_GROUP'
   EXPORTING
   client                    = sy-mandt
     group                     = c_session_name
   prog                      = sy-cprog                " Porgram name
   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.

CALL FUNCTION 'BDC_INSERT'
   EXPORTING
     tcode                  = 'TCODE'
    TABLES
      dynprotab              = t_bdc
* 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.

Also try to catch the execptions and check wether there is any issue with creating Session.

Regards,

Gurpreet

Read only

Former Member
0 Likes
1,011

Hi,

Might be be data ur passing to internal table it_BDCdata is not correct or check out t-code ur passing to function module

Read only

Former Member
0 Likes
1,011

Hi,

U hv deleted the3 exceptions in the FM 'BDC_INSERT' except '7'.

Add all the exceptions & find out which exception is getting triggered ...

regards,

ajit.

Read only

0 Likes
1,011

Hi,

There was some problem with data. I am able to process that session now but that session name disappears from the list after being processed.

Also, after processing I receive a message 'Processing of batch input session completed' and the change is updated in the database too .

Am I proceeding correctly ? and where does that session name goes?

Read only

0 Likes
1,011

Just in the Parameters of 'BDC_OPEN_GROUP':

Pass KEEP = 'X'.

If you dont set KEEp ='X' once the session is completed succesfully it will not be in the list.

I SM35 Just check the logs(Logs Button)you will find the session listed there.

Regards,

gurpreet