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: 

Reg:BDC session method

Former Member
0 Kudos

Hi Friends,

In call transaction we can display both updated and error records separately in a report.

Like that in session method i want to capture and display in a separate report both error and updated records.

Please let me know if you have any ideas

Thanks and Regards

V.Raja sekaran

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Raja,

There is no need to display anything in the session method. User can just go and see those details in session.

Regards,

Atish

8 REPLIES 8

Former Member
0 Kudos

Hi Raja,

There is no need to display anything in the session method. User can just go and see those details in session.

Regards,

Atish

Former Member
0 Kudos

hi,

Use the BDC_OPEN_GROUP function module to create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT.

You cannot re-open a session that already exists and has been closed. If you call BDC_OPEN_GROUP with the name of an existing session, then an additional session with the same name is created.

A batch input program may have only one session open at a time. Before opening a session, make sure that any sessions that the program closes any sessions that it previously had opened.

BDC_OPEN_GROUP takes the following EXPORTING parameters:

· CLIENT

Client in which the session is to be processed.

Default: If you don't provide a value for this parameter, the default is the client under which the batch input program runs when the session is created.

· GROUP

Name of the session that is to be created. May be up to 12 characters long.

Default: None. You must specify a session name.

· HOLDDATE

Lock date. The session is locked and may not be processed until after the date that you specify. Only a system administrator with the LOCK authorization for the authorization object Batch Input Authorizations can unlock and run a session before this date.

Format: YYYYMMDD (8 digits).

Default: No lock date, session can be processed immediately. A lock date is optional.

· KEEP

Retain session after successful processing. Set this option to the value X to have a session kept after it has been successfully processed. A session that is kept remains in the input/output queue until an administrator deletes it.

Sessions that contain errors in transactions are kept even if KEEP is not set.

Default: If not set, then sessions that are successfully processed are deleted. Only the batch input log is kept.

· USER

Authorizations user for background processing. This is the user name that is used for checking authorizations if a session is started in background processing. The user must be authorized for all of the transactions and functions that are to be executed in a session. Otherwise, transactions will be terminated with “no authorization” errors.

The user can be of type dialog or background. Dialog users are normal interactive users in the SAP system. Background users are user master records that are specially defined for providing authorizations for background processing jobs.

check this link

http://help.sap.com/saphelp_nw04/helpdata/en/fa/097126543b11d1898e0000e8322d00/frameset.htm

Regards,

pankaj

Former Member
0 Kudos

Hi,

Diffrenecs.

Session method.

1) synchronous processing.

2) can tranfer large amount of data.

3) processing is slower.

4) error log is created

5) data is not updated until session is processed.

Call transaction.

1) asynchronous processing

2) can transfer small amount of data

3) processing is faster.

4) errors need to be handled explicitly

5) data is updated automatically

Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is

not bi-directional.

BDC works on the principle of simulating user input for transactional screen, via an ABAP program.

Typically the input comes in the form of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The transaction is then started using this internal table as the input and executed in the background.

In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling. It can also be used for real-time interfaces and custom error handling & logging features. Whereas in

Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.

Batch Input (BI) programs still use the classical BDC approach but doesn’t require an ABAP program to be written to format the BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and invokes the transaction mentioned in the header record of the file.

Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are not available for all application area

Thanks&Regards,

Phani.

Former Member
0 Kudos

The report what you are talking about is to decode the messages from the log generated by the session method.

For every log generated there will be a Queue ID .

The parameter to your program will be this Qid.

Now from this Queue ID you need to differentiate the success records and errors based on message type from BDCLM table .

The Queue iD can be seen from APQI table .

Regards,

Vijay.

Former Member
0 Kudos

1) In sesssion method , system automatically generates log, so user can view all the details of error records there. There is no provision in sm35 to distinguish success and failure reocrds.

but while dispalying output in se38, we can display the no sucessful records and failur records and total records according to the user requirement.(only in number)

for ex :

total no of records to be uploaded : 200

success records : 180

failure records : 020

you need to obtain the information in inernal tables and you have to display.

Rgds

Umakanth

Former Member
0 Kudos

Hi,

I understand that you want to capture errors in session method, which you can do in call transaction.

You have two solution to it, but I feel you would like the 2nd one... Here is the solution:

Solution1) Generate session through your program... the session can be seen in SM35... you can process the session, and check the log from there only.

Solution2) You will create a session, and have to process the session from your program itself, and now you can capture the errors and display it as the case may be.

Here are the steps:

Step1) Process BDC session (say v_session) programatically

SUBMIT rsbdcsub WITH mappe EQ v_session

WITH von EQ sy-datum

WITH bis EQ sy-datum

AND RETURN.

Step2) Get session qid and display session error log

  • Get session qid

SELECT SINGLE qid

INTO v_qid FROM

apqi WHERE

datatyp = 'BDC'

AND groupid = v_session

AND progid = sy-repid

AND userid = sy-uname

AND credate = sy-datum.

IF v_qid IS NOT INITIAL.

  • Generate BDC session error log

SUBMIT rsbdc_protocol

WITH session EQ v_session

WITH user EQ sy-uname

WITH queue_id EQ v_qid

AND RETURN.

ENDIF.

Hope your query is answered:-)

Regards, Tapas

<Reward pts if useful or answered>

Former Member
0 Kudos

Hi,

try the below approach, u will get the complete session details.

REPORT ZTEST_121.

data handle type RSTSTYPE-FBHANDLE.

  • Internal table to hold Batch input: Log messages data

data i_tab TYPE STANDARD TABLE OF bdclm WITH

DEFAULT KEY.

  • get the Session details(QID) from APQI table by specifying

  • the session name,creation date and creation time

  • By using the above QID and Session name get the TEMSEID

  • from APQL table

  • Use the above TEMSEID in FM

CALL FUNCTION 'RSTS_OPEN_RLC'

EXPORTING

  • ALLINE = ' '

  • AUTHORITY = ' '

  • CHARCO = '*'

CLIENT = SY-MANDT

name = 'BDCLG183252000120828' " TEMSEID

  • OWN_FBHANDLE = ' '

  • PROM = 'E'

  • RECTYP = '*'

  • OBJTYPE = 'TEXT'

  • ENQLOCK = 'N'

IMPORTING

FBHANDLE = handle

EXCEPTIONS

FB_CALL_HANDLE = 1

FB_ERROR = 2

FB_RSTS_NOCONV = 3

FB_RSTS_OTHER = 4

NO_OBJECT = 5

NO_PERMISSION = 6

ENQ_FOREIGN_LOCK = 7

ENQ_SYS_FAIL = 8

ENQ_OTHER = 9

OTHERS = 10

.

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 'RSTS_READ'

EXPORTING

fbhandle = handle

TABLES

datatab = i_tab

EXCEPTIONS

fb_call_handle = 1

fb_error = 2

fb_rsts_noconv = 3

fb_rsts_other = 4

OTHERS = 5.

IF sy-subrc EQ 0.

ENDIF. " IF sy-subrc EQ 0

CALL FUNCTION 'RSTS_CLOSE'

EXPORTING

fbhandle = handle

EXCEPTIONS

fb_call_handle = 1

fb_error = 2

fb_rsts_other = 3

OTHERS = 4.

IF sy-subrc <> 0.

ENDIF. " IF sy-subrc <> 0

  • i_tab contains the details like TCNT - Transaction number is

  • nothing but your record number

  • and mart - message type, mid - Messag ID MNR - Message

  • number, so that u can

  • find the corresponding message from T100

Former Member
0 Kudos

Hi,

In session method go to Tcode SM35 and Log option is there where you can find Detailed information about log.

Reward plz if satisfy