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

BDC SESSION ERROR LOG IN INTERNAL TABLE

Former Member
0 Likes
693

Hi All,

I have to use BDC session method for posting GL accounts (through FB01) and if something goes wrong with the posting then user must be informed about it through messages in the screen(interface). The crux of the problem is "How to fetch the error from BDC session and store it into the internal table". Any other alternative is also welcome , Please suggest !!!!!!!!

Thanks,

Manish

3 REPLIES 3
Read only

Former Member
0 Likes
488

If you are running the bdc transaction with call transaction:

CALL TRANSACTION TCODE USING BDCDATA

MODE 'N'

UPDATE 'S'

MESSAGES INTO MESSTAB.

All your messages are stored in internal table MESSTAB. So, after you run this command, you can loop this internal table and write it to screen.

Read only

Former Member
0 Likes
488

check this Program

RSBDC_PROTOCOL

check the Form

form get_logfiles_from_temse.
* are there any logs in the TemSe for this QID ?
  clear logtab_temse[].
  clear itab_bdcld[].
*----------------------------------------------------------------------*
  if log_quid eq 0.
    call function 'BDC_PROTOCOL_SELECT'
         exporting
              name         = d0100-mapn
              client       = sy-mandt
              date_from    = d0100-von
              date_to      = d0100-bis
              status       = '*'
              session_user = d0100-creator
         tables
              apqltab      = logtab_temse
         exceptions
              invalid_data = 1
              others       = 2.

    if sy-subrc <> 0.
      message s324.                    "Kein Protokoll vorhanden
      exit.
    endif.

  else.
    select * from apql into table logtab_temse
             where ( qid = log_quid ).
    check sy-subrc = 0.
  endif.
*----------------------------------------------------------------------*

* some logs were found: now put this info into table bdcld.
  data: wa_log like line of logtab_temse,
        wa_ld  like line of itab_bdcld.

  loop at logtab_temse into wa_log.
    clear wa_ld.
    wa_ld-temseid = wa_log-temseid.
    wa_ld-lmand   = wa_log-mandant.
    wa_ld-edate   = wa_log-credate.
    wa_ld-etime   = wa_log-cretime.
    wa_ld-luser   = wa_log-creator.
    wa_ld-grpn    = wa_log-groupid.
    wa_ld-quid    = wa_log-qid.
    wa_ld-local_host = wa_log-destsys.
    append wa_ld to itab_bdcld.
  endloop.

endform.

Read only

Former Member
0 Likes
488

Hi ,

Info : I am not using call transaction method.

How do i get the message from temseid ?