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

Reading session log

Former Member
0 Likes
3,473

Hi all

My requirement is to read the session data after the session has run.

Reading is done in a difefrent program.

Can any one please help me in how to read it.

Thanks & regards

sree

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,818

Get your TEMSEID MANDANT from APQL table, and call these four function modules in sequence.


DATA: CHARCP LIKE RSTSTYPE-CHARCO VALUE '0000'.

  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      AUTHORITY           = ' '
      CLIENT              = APQL-MANDANT
      NAME                = APQL-TEMSEID
    IMPORTING
      CHARCO              = CHARCP
    EXCEPTIONS
      FB_ERROR            = 1
      FB_RSTS_OTHER       = 2
      NO_OBJECT           = 3
      NO_PERMISSION       = 4
      OTHERS              = 5.

  CALL FUNCTION 'RSTS_OPEN_RLC'
    EXPORTING
      NAME         = APQL-TEMSEID
      CLIENT       = APQL-MANDANT
      AUTHORITY    = 'BATCH'
      PROM         = 'I'
      RECTYP       = 'VNL----'
      CHARCO       = CHARCP
    EXCEPTIONS
      FB_CALL_HANDLE =  4
      FB_ERROR       =  8
      FB_RSTS_NOCONV = 12
      FB_RSTS_OTHER  = 16
      NO_OBJECT      = 20
      OTHERS         = 24.

  IF SY-SUBRC > 0.
     EXIT.
  ENDIF.

  CALL FUNCTION 'RSTS_READ'
    TABLES
      DATATAB  = LOG_TABLE
    EXCEPTIONS
      FB_CALL_HANDLE =  4
      FB_ERROR       =  8
      FB_RSTS_NOCONV = 12
      FB_RSTS_OTHER  = 16
      OTHERS         = 16.

  IF SY-SUBRC > 0.
     EXIT.
  ENDIF.

  CALL FUNCTION 'RSTS_CLOSE'
    EXCEPTIONS
      OTHERS = 4.

LOG_TABLE will contain the log you want.

Srinivas

PS: This is what RSBDCLOG does.

13 REPLIES 13
Read only

Former Member
0 Likes
1,818

Hi

can you give more details . Are you trying to read BDC sessions data or ???

Cheers

Read only

0 Likes
1,818

Hi friends,

I have got a requirement to capture created Scheduling Agreement Number(SAN) after processing the session in SM35.

I have to use this number to pass as parameter in another program.

Is there any Function Module to read the Session Log to know the created SAN.

thanks

sree

Read only

Former Member
0 Likes
1,818

Sree - if it's batch input session logs that you're after, look at program RSBDCLOG. It reads tables BDCMH, BDCTH, T100, APQD, APQI, D0220 and D0300.

Rob

Read only

Former Member
0 Likes
1,818

Hi

Use CAll TRANSACTION instead of session method .

You will get the Req No. in BDCMSGCALL in MSGV1/2/3/4 .

Call transaction always returns success message like

"Pur Req XXXXXX Created " .

From SM35 also you can get it but you may need to know the session name . Check Session Log.

Cheers

Read only

Former Member
0 Likes
1,819

Get your TEMSEID MANDANT from APQL table, and call these four function modules in sequence.


DATA: CHARCP LIKE RSTSTYPE-CHARCO VALUE '0000'.

  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      AUTHORITY           = ' '
      CLIENT              = APQL-MANDANT
      NAME                = APQL-TEMSEID
    IMPORTING
      CHARCO              = CHARCP
    EXCEPTIONS
      FB_ERROR            = 1
      FB_RSTS_OTHER       = 2
      NO_OBJECT           = 3
      NO_PERMISSION       = 4
      OTHERS              = 5.

  CALL FUNCTION 'RSTS_OPEN_RLC'
    EXPORTING
      NAME         = APQL-TEMSEID
      CLIENT       = APQL-MANDANT
      AUTHORITY    = 'BATCH'
      PROM         = 'I'
      RECTYP       = 'VNL----'
      CHARCO       = CHARCP
    EXCEPTIONS
      FB_CALL_HANDLE =  4
      FB_ERROR       =  8
      FB_RSTS_NOCONV = 12
      FB_RSTS_OTHER  = 16
      NO_OBJECT      = 20
      OTHERS         = 24.

  IF SY-SUBRC > 0.
     EXIT.
  ENDIF.

  CALL FUNCTION 'RSTS_READ'
    TABLES
      DATATAB  = LOG_TABLE
    EXCEPTIONS
      FB_CALL_HANDLE =  4
      FB_ERROR       =  8
      FB_RSTS_NOCONV = 12
      FB_RSTS_OTHER  = 16
      OTHERS         = 16.

  IF SY-SUBRC > 0.
     EXIT.
  ENDIF.

  CALL FUNCTION 'RSTS_CLOSE'
    EXCEPTIONS
      OTHERS = 4.

LOG_TABLE will contain the log you want.

Srinivas

PS: This is what RSBDCLOG does.

Read only

0 Likes
1,818

Hi srininvas,

Thank you very much.

One doubt, how should i declare log_table.

regards

sree

Read only

0 Likes
1,818

Hi Srinivas

i got teh short dump in function module

'RSTS_OPEN_RLC.

EXPORTING

NAME = APQL-TEMSEID

CLIENT = APQL-MANDANT

AUTHORITY = 'BATCH'

PROM = 'I'

RECTYP = 'VNL----'

CHARCO = CHARCP.

Hi can you explain the parameters authority, PROM, RECTYP and CHARCP.

thanks & regards

sree

Read only

0 Likes
1,818

log_table is defined as follows


DATA: BEGIN OF LOGTABLE OCCURS 50,  " plain log information
     ENTERDATE LIKE BTCTLE-ENTERDATE,
     ENTERTIME LIKE BTCTLE-ENTERTIME,
     LOGMESSAGE(400) TYPE C,
END OF LOGTABLE.

Read only

0 Likes
1,818

What does the dump say?

Read only

0 Likes
1,818

If these answers helped you, please reward and close the post.

Thanks,

Srinivas

Read only

0 Likes
1,818

Srinivas, Is it possible to identify my BDC inputs (key fields that I provide on screen) during failed BDC transaction from the Session Log programmatically?

Read only

0 Likes
1,818

Dear Srinivas,

I have done exactly what you have mentioned in this form to get the data on the screen ( what is there in sm35) , but iam not getting the exactly what is there in sm35 . I have used the four function modules which you have explained and i have found the internal table logtable which i found is not fullfilling my requirement .

Please could you help me.

regards

divya.

Read only

Former Member
0 Likes
1,818

Hi Sree,

AS i found that you are displaying the SM35 success or failure messages as display after your report is executed i have same rquirement , if you have th code can you please send iam not able to get the data using the below function module said in the form.

regards

divya.