Capture SLG1 error message

Hi,
I want to download to excel all the error log messages which I get in SLG1 when I do mass article data upload for MM42 using BAPI.
Could someone tell me how to get message in SLG1 in the calling program so as to download only the text in excel.
Thanks in advance.

hi try functions like that
sample comes here:
TYPE-POOLS: icon.
Tabellen
DATA:
gt_log_handle       TYPE bal_t_logh,
gt_lognumber        TYPE bal_t_logn,
gt_msg_handle       TYPE bal_t_msgh,
gt_log_header       TYPE balhdr_t,
gt_log_filter       TYPE bal_s_lfil,           "Filter gesamt
gt_log_filter_obj   TYPE bal_s_lfil-object,    "Objekt
gt_log_filter_sub   TYPE bal_s_lfil-subobject, "Unterobjekt
gt_log_filter_extn  TYPE bal_s_lfil-extnumber, "Ext.Identifikation
gt_log_filter_user  TYPE bal_s_lfil-aluser,    "User
gt_log_filter_prcl  TYPE bal_s_lfil-probclass, "Protokollklasse
gt_log_filter_dttm  TYPE bal_s_lfil-date_time, "Datum/Zeit von-bis
gt_log_filter_alprog TYPE bal_s_lfil-alprog.   "Programmname
Strukturen
DATA:
gs_log_header       TYPE LINE OF balhdr_t,
gs_log_handle       TYPE LINE OF bal_t_logh,
gs_lognumber        TYPE LINE OF bal_t_logn,
gs_msg_ret          TYPE bal_s_msg,
gs_msg_handle       TYPE LINE OF bal_t_msgh,
gs_balloghndl       TYPE balloghndl,
gs_log_filter_obj   TYPE LINE OF bal_s_lfil-object,    "Objekt
gs_log_filter_sub   TYPE LINE OF bal_s_lfil-subobject, "Unterobjekt
gs_log_filter_extn  TYPE LINE OF bal_s_lfil-extnumber, "Ext.Ident.
gs_log_filter_user  TYPE LINE OF bal_s_lfil-aluser,    "User
gs_log_filter_prcl  TYPE LINE OF bal_s_lfil-probclass, "Protokollklasse
gs_log_filter_dttm  TYPE bal_s_lfil-date_time,  "Datum/Zeit
gs_log_filter_alprog TYPE LINE OF bal_s_lfil-alprog. "Programmname
Arbeitsfelder
DATA:
gs_txt_msg              TYPE c,
gs_msg_text(90)         TYPE c,
gv_do_not_load_messages TYPE boolean,
gv_tabix                TYPE sy-tabix,
gs_marav                TYPE marav.
Abgrenzungen                                                         *
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_object  FOR gs_log_filter_obj,   "Objekt
                s_subobj  FOR gs_log_filter_sub,   "SubObjekt
                s_extnum  FOR gs_log_filter_extn,  "Ext.Ident.
                s_aluser  FOR gs_log_filter_user,  "Benutzer
                s_prcl    FOR gs_log_filter_prcl,  "Protokollklasse
                s_alprog FOR gs_log_filter_alprog.  "Programmname
PARAMETERS:     p_err     DEFAULT 'X' RADIOBUTTON GROUP r1,
                p_all                 RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK 1.
SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-002.
PARAMETERS: p_datev  TYPE sy-datum DEFAULT sy-datum,
            p_timev  TYPE sy-uzeit DEFAULT '000000',
            p_dateb  TYPE sy-datum DEFAULT sy-datum,
            p_timeb  TYPE sy-uzeit DEFAULT '235959'.
SELECTION-SCREEN END OF BLOCK 2.
Initialisierung                                                      *
INITIALIZATION.
Objektname
  gs_log_filter_obj-low     = 'ZPP_MSG'.
  gs_log_filter_obj-option  = 'EQ'.
  gs_log_filter_obj-sign    = 'I'.
  APPEND gs_log_filter_obj TO s_object.
Sub-Objekt
  gs_log_filter_sub-low     = 'EDOK2ERP_STAMM'.
  gs_log_filter_sub-option  = 'EQ'.
  gs_log_filter_sub-sign    = 'I'.
  APPEND gs_log_filter_sub TO s_subobj.
Benutzer
  gs_log_filter_user-low    = sy-uname.
  gs_log_filter_user-option = 'EQ'.
  gs_log_filter_user-sign   = 'I'.
  APPEND gs_log_filter_user TO s_aluser.
Datenselektion                                                       *
START-OF-SELECTION.
Selektionstabellen übergeben
  gt_log_filter-object[]     = s_object[].  "Objekt
  gt_log_filter-subobject[]  = s_subobj[].  "SubObjekt
  gt_log_filter-extnumber[]  = s_extnum[].  "Ext.Ident.
  gt_log_filter-aluser[]     = s_aluser[].  "Benutzer
  gt_log_filter-probclass[]  = s_prcl[].    "Protokollklasse
  gt_log_filter-alprog[]     = s_alprog[].  "Programmname
Datum
  gt_log_filter-date_time-date_from = p_datev.
  gt_log_filter-date_time-time_from = p_timev.
  gt_log_filter-date_time-date_to   = p_dateb.
  gt_log_filter-date_time-time_to   = p_timeb.
Log's suchen
  CALL FUNCTION 'BAL_DB_SEARCH'
    EXPORTING
      i_s_log_filter     = gt_log_filter
    IMPORTING
      e_t_log_header     = gt_log_header
    EXCEPTIONS
      log_not_found      = 1
      no_filter_criteria = 2
      OTHERS             = 3.
  IF sy-subrc <> 0.
    STOP.
  ENDIF.
Log's in den Hauptspeicher laden
  CALL FUNCTION 'BAL_DB_LOAD'
       EXPORTING
            i_t_log_header     = gt_log_header
            i_t_log_handle     = gt_log_handle
            i_t_lognumber      = gt_lognumber
            i_do_not_load_messages = gv_do_not_load_messages
          I_DO_NOT_LOAD_MESSAGES = 'X'
       IMPORTING
            e_t_log_handle     = gt_log_handle
            e_t_msg_handle     = gt_msg_handle
       EXCEPTIONS
            no_logs_specified  = 1
            log_not_found      = 2
            log_already_loaded = 3
            OTHERS             = 4.
  IF sy-subrc <> 0.
    STOP.
  ENDIF.
  LOOP AT gt_log_header INTO gs_log_header.
    IF p_err <> space.
      CHECK gs_log_header-msg_cnt_a > 0 OR
            gs_log_header-msg_cnt_e > 0.
    ELSEIF p_all <> space.
      CHECK gs_log_header-msg_cnt_a > 0 OR
            gs_log_header-msg_cnt_e > 0 OR
            gs_log_header-msg_cnt_w > 0 OR
            gs_log_header-msg_cnt_i > 0 OR
            gs_log_header-msg_cnt_s > 0.
    ENDIF.
Meldungen zum Log lesen
    LOOP AT gt_msg_handle INTO gs_msg_handle.
      CHECK gs_msg_handle(22) EQ gs_log_header-log_handle.
      CALL FUNCTION 'BAL_LOG_MSG_READ'
        EXPORTING
          i_s_msg_handle                 = gs_msg_handle
      i_s_msg_handle                 = gs_balmsghndl
          i_langu                        = sy-langu
        IMPORTING
          e_s_msg                        = gs_msg_ret
      E_EXISTS_ON_DB                 = 'X'
      E_TXT_MSGTY                    =
      E_TXT_MSGID                    =
      E_TXT_DETLEVEL                 =
      E_TXT_PROBCLASS                =
          e_txt_msg                      = gs_txt_msg
      E_WARNING_TEXT_NOT_FOUND       =
        EXCEPTIONS
          log_not_found                  = 1
          msg_not_found                  = 2
          OTHERS                         = 3.
Meldungstext aufbereiten
      IF sy-subrc EQ 0.
        CLEAR: gs_msg_text.
        CALL FUNCTION 'BAL_DSP_TXT_MSG_READ'
          EXPORTING
            i_langu        = sy-langu
            i_msgid        = gs_msg_ret-msgid
            i_msgno        = gs_msg_ret-msgno
            i_msgv1        = gs_msg_ret-msgv1
            i_msgv2        = gs_msg_ret-msgv2
            i_msgv3        = gs_msg_ret-msgv3
            i_msgv4        = gs_msg_ret-msgv4
          IMPORTING
            e_message_text = gs_msg_text.
        WRITE: /     gs_log_header-extnumber(18),
                  21 gs_log_header-aldate,
                  33 gs_log_header-altime,
                  42 gs_log_header-probclass,
                  50 gs_log_header-aluser,
                  64 gs_log_header-alprog(25),
                  89 gs_msg_ret-msgid,
                  91 gs_msg_ret-msgno,
                  99 gs_msg_text.
      ENDIF.
    ENDLOOP.
  ENDLOOP.
Log's wieder freigeben
  LOOP AT gt_log_handle INTO gs_log_handle.
    gs_balloghndl = gs_log_handle.
    CALL FUNCTION 'BAL_LOG_REFRESH'
      EXPORTING
        i_log_handle  = gs_balloghndl
      EXCEPTIONS
        log_not_found = 1
        OTHERS        = 2.
    IF sy-subrc <> 0.
    ENDIF.
  ENDLOOP.

Similar Messages

  • How to capture Exception error message in Odata ?

    Hi,
      I am new to sap gateway. Currently i am creating a Odata Service through the transaction SEGW. In the query i have mapped a RFC. When i execute the service sometimes the RFC throws exception like 'No data Found'. But i dont know how to capture the exception returned from the RFC.
    I read some threads which says use
    RAISE EXCEPTION TYPE /IWBEP/CX_MGW_BUSI_EXCEPTION
          EXPORTING
            textid            = /iwbep/cx_mgw_busi_exception=>business_error
            message       =  lv_text
            message_container = io_message_container.
    My doubt is since i have not done any code in the DPC method. As said in many threads should i go to DPC_EXT method and redefine the method or how to capture the exception.
    Kindly advise. Thanks in advance

    Hello Velsankar,
    You need not to capture the error messages explicitly by writing custom code in you DPC_EXT if you are using service builder when the return error message table is of type BAPIRET2.
    GW itself will handle and return the error messages.
    If at all the return error message table is of different type , i mean to say if it is not of type BAPIRET2 then you need to capture explicitly.
    The below is the code you need to write in DPC_EXT to capture.
    DATA: LO_MECO TYPE REF TO /IWBEP/IF_MESSAGE_CONTAINER.
    DATA: LX_BUSI_EXC TYPE REF TO /IWBEP/CX_MGW_BUSI_EXCEPTION.
            LO_MECO = MO_CONTEXT->GET_MESSAGE_CONTAINER( ).
             LO_MECO->ADD_MESSAGES_FROM_BAPI( IT_BAPI_MESSAGES = LT_ERR_RET_TAB ).
             CREATE OBJECT LX_BUSI_EXC
               EXPORTING
                 MESSAGE_CONTAINER = LO_MECO.
             RAISE EXCEPTION LX_BUSI_EXC.
    Note : where LT_ERR_RET_TAB is your internal table where you would have captured all the error messages.
    That is it. You will be able to see the messages .
    Regards,
    Ashwin

  • How to capture the error messages from incorrect session?

    Hi SDNs.,
    i am using BDC Session method to update transaction FB01. So my job runs daily. here i want to capture the error messages and i want to send it to mail.  Can i capture the unprocessed records???
    i think FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> used for sending mail? but how to capture mes or records?
    or Is there any other way to Do it???
    Thankning you.,
    Ram

    Hi Ramakrishna,
       Once you create the session, Process the session using
    the report RSBDCSUB using submit statement.
    It would list out the erroneous records.
    Hence, while submitting, just say submit RSBDCSUB in background and export output list to memory.,
    Then you can retrieve the list from memory using the FM LIST_FROM_MEMORY into the internal table and finally send the email by the fm you have already mentioned.
    Regards,
    Ravi

  • Capturing the error messages generated by ALV Grid

    Hi,
    I have a ALV Grid, and a field date of DATS type.
    If i enter wrong date a message pops up with invalid date entry.
    How can i capture this error message in ALV Grid.

    Hi,
    Instead of displaying the error message directly, capture the message into a string variable and display it along with the grid display.
    Thanks,
    Sri.

  • Capturing Oracle Error Messages

    Hi when developing some applications, I come across some error messages that I would like to make custom error messages.
    for example: ORA-00001: unique constraint (CREATE_USER.IC_ITEM_GENDERS_PK) violated
    Is there a way to capture this message and then make a user friendly message. Any info. would be great.
    Thanks

    If you write your own after-submit processes, you can write an appropriate exception handler, something like
    begin
    exception when dup_val_on_index -- ORA-0001
    then :P1_ERROR := 'Nice error message';
    end;Then show some "Error" HTML region with &P1_ERROR. conditional upon P1_ERROR being not null.
    AFAIK, there is no way to do this when the error is raised by the wizard-generated automatic DML or MRU processes. For that, you could try to put your error checking code in a Validation (and specify your nice error message). If the validation fails, the after-submit processes are not fired so the "ugly" error messages will not be seen by the user.
    Hope this helps.

  • Capturing custom error message from alert category

    We are using XSLT mapping and We are raising custom error message based upon some conditions i.e if vendor number is invalid or blank.If it doesn't meet the requirement,mapping will fail and it will throw error message as" IDoc XXXXXXXXX is having invalid vendor number".
    My question is,we would like to send this custom error message to email receipients through RWB-AFW.
    How do we capture this custom error message is alert category or alert rule?

    You can not unless u use BPM.
    VJ

  • Capturing Runtime Error Messages From ODI (Sunopsis) Operator

    Hi
    I have following question
    1) I want to capture error message of an activity that has failed during execution
    I have created a variable and used following query to capture it
    select T.TXT
    from <%=odiRef.getObjectName("L","SNP_EXP_TXT","D")%> T,
    <%=odiRef.getObjectName("L","SNP_STEP_LOG","D")%> S
    where S.SESS_NO = <%=odiRef.getSession("SESS_NO")%>
    and S.I_TXT_STEP_MESS = T.I_TXT
    order by T.TXT_ORD asc
    unfortunatly am not getting entire error message ,instead am getting first row of the error from SNP_EXP_TXT table.How to get entire error message in a variable.
    2) How can we know scenario name if we know session number?
    Please provide your inputs
    Thanks
    Baji

    Hi,
    Don't use this query, it won't work.
    Use the API GetPrevStepLog, it is simple and better...
    Take a look at:
    Use the http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/documentation/oracledi_api_reference.pdf
    For the session name, just use getSession() Method ( too is at the pdf)
    I hope be helpful.
    Cezar
    Edited by: Cezar Santos on 21/11/2008 09:16

  • Capturing ECATT error messages in flat file

    Hi  Floks,
    i captured what i am uploaded data in test script . i want cature what i am getting error log  in test script that's i want to load in flat file .how can i fulfil this requirement let me get some idea on this .
    thanks,
    Suresh

    Perhaps function module ECATT_LOG_GET_MESSAGE_LIST might be useful. If you call the function module with the log key (apparently identical to the number of the test configuration) using IM_ALL_MESSAGES = 'X' then it returns for each eCATT statement (e.g. FUN) the collected messages.
    Regs
    Tushar

  • IMac G5 Capture - General Error Message

    Hi guys,
    I've just sold my trusty (old) Powerbook, and bought a new iMac G5 (1.9Ghz) 1Gb Ram etc.
    When I installed FCP4.5HD I got the first problem - no AGP card, so checking through the forums I found the answer lies in renaming <AGP> to <PCI> in the File Contents/Plist folder - OK so now FCP at least boots.
    Now I can't seem to capture from my new Sony DCR-HC90E Mini DV Camera.
    I've been through all the settings I can think of, but still I'm not able to capture. . . . . no previous problems on the PB!
    If I run the tape via the FW Controller in the capture window, the main capture window opens as if to start the capture, but then I get a message telling me "General Error!" - That's it! No other explanation.
    Is there something wrong with my new purchase, or do I still have a setting wrong somewhere?
    I've set my system up for DV-PAL Basic at 48Khz Audio.
    Hope someone can let me know where I'm going wrong here!
    Thanks

    Are you using the appropriate firewire protocol (Firewire, not Firewire Basic?)
    Are there any other devices between the camera and the computer?
    If yes, remove them and try again.
    Does the camera capture using iMovie?
    If yes, you may have a quicktime issue and may need to do a full quicktime reinstall.
    Go to /library/receipts and delete any files that say Quicktime followed by a number e.g. Quicktime703.pkg
    Go to the Apple quicktime site and download the appropriate version of Quicktime to your hard drive.
    Run the Quicktime installer.
    Repair Disk Permissions for your System Disk (Disk Utility > Select the system disk > Repair Disk Permissions)
    Reboot
    Good luck.
    x

  • Image Capture sends error message when importing photos from my camera

    I tried to import photos from my Fuji FinePix JX600 using Iphoto. Received an error notice and was unable to import. Tried Image Capture and it imported 220 of 407 pictures and then sent an error notice. Very frustrated. It's a new camera and I never had any problem with my old camera. Can anyone tell me what the issue may be and how to resolve it?
    Thanks

    Good afternoon
    There seem to be a number of possibilities.
    Here is a thread that conatins a number of solutions.  The most common one is to load 50 pics at a time.
    https://discussions.apple.com/thread/3947440?start=0&tstart=0
    Hope this helps

  • Capturing Custom Error Messages from Database Triggers

    Hi Everybody
    When i fired a trigger it should show only the custom message from RAISE_APPLICATION_ERROR
    instead of showing all the message....
    ORA-20103: We Cannot Delete the emp_id 5610
    ORA-06512: at "emp_id", line 89
    ORA-04088: error during execution of trigger 'delete_emp_id.trg'I want to show only the custom message
    We Cannot Delete the emp_id 5610Thanks in Advance

    Not possible AFAIK.
    Instead of RAISE_APPLICATION_ERROR, define a custom exception, call it and just print it onto the console (using dbms_output). You can't pop it out though.

  • Unable to capture error message while creating an SO using bapi

    Hi,
    Can anybody suggest how to capture the error message while creating a SO using BAPI.
    I have developed a customeized BAPI and using the BDC format to create the SO.
    Note: i am using a call transaction method for the BDC.
    I am sending the message into message1.
    but i am unable to send the same into an internal table
    shyam.

    Hi Shyam
    If my understanding is correct, you are performing BDC process within the customized BAPI...
    And you want to collect the messages from BDC to an internal table and pass to the output.
    Proceed as below:
    1. While calling BDC, use CALL TRANSACTION .... with addition: <b>MESSAGES INTO itab</b>. The structure of itab should be like <b>BDCMSGCOLL</b>.
    2. Now the messages will be collected in ita.
    3. Prepare the messages using FM: <b>FORMAT_MESSAGE</b>
    4. Collect to the returning table.
    Hope this helps...
    Though i could not understand the reason of creating a BDC within BAPI, you can opt for loading orders via BAPI's like: BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2.
    Kind Regards
    Eswar

  • How to capture error message log for Tcode MIR7

    Hi ,
    I have a problem to capture the error message outside the tcode which are created by MIR7/MIR0 .
    Are they stored in any database table?
    Is there any other way to access them?
    Anybody knows how to solve this that will be very helpful.
    Thanks,
    Anu

    call transaction 'XK01' using i_bdcdata
                     mode 'N'
                     update 'S'
                     messages into i_bdcmsgcoll.
    if sy-subrc <> 0.
        perform get_error.
            write:/ itab , v_text.
    endif.
    *Form
    form get_error.
    loop at i_bdcmsgcoll.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = i_bdcmsgcoll-MSGID
       LANG            = sy-langu
       NO              = i_bdcmsgcoll-MSGNr
       V1              = i_bdcmsgcoll-MSGV1
      V2              = SY-MSGV2
      V3              = SY-MSGV3
      V4              = SY-MSGV4
    IMPORTING
       MSG             = v_text
    EXCEPTIONS
      NOT_FOUND       = 1
      OTHERS          = 2
    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.
    endform.                    " get_error
    Edited by: Bala Krishna on Sep 9, 2008 7:50 PM

  • How to capture error message in a FM call during exception

    Hi,
    The FM i'm trying to call is giving an exception and don't have the built in mechanism to pass on the error message that occured during processing.
    However, if i see the job log in SM37, I'm able to see the corresponding error message.
    Please let  me know on how to capture this error message with in my program.
    Thanks,
    Vijay.

    Hi,
    add the exceptions...ERROR_MESSAGE to capture the error message..raised in the function module.
             EXCEPTIONS
                  ERROR_MESSAGE = 1.
    Thanks
    Naren

  • Capture Error Message Log

    How do we capture the Error Message Log generated by the OWB Process Flow (Execution Results window)? I would like to email this message in the process flow when there is an error.

    For this release you cannot capture this. The best thing you can do is email a link to the Runtime Audit Browser.
    We are implementing this in the new release.
    Jean-Pierre

Maybe you are looking for