HOW TO CAPTURE LOG?

hi all
        how to capture a log in bdc to abap programme?

Hi,
While doing call transaction, if an error occurs in updation, we declare bdcmsgcoll and store our messages in it, but how to retreive error message from it
Using function module 'FORMAT_MESSAGE' you can capture the messages.
Here is a sample of the program code for that:
  LOOP AT it_messtab.
  CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      id     = it_messtab-msgid
      lang   = it_messtab-msgspra
      no     = it_messtab-msgnr
      v1     = it_messtab-msgv1
      v2     = it_messtab-msgv2
    IMPORTING
    msg    =  g_msg
  EXCEPTIONS
      OTHERS = 0.
  IF it_messtab-msgtyp = 'S'.
    it_sucess-sucess_rec = g_msg.
    it_sucess-lifnr = it_header-lifnr." Based on your field
    it_sucess-tabix = v_lines.
    APPEND it_sucess.
  ELSEIF it_messtab-msgtyp = 'E'.
    it_error-error_rec = g_msg.
    it_error-lifnr = it_header-lifnr.
    it_error-tabix = v_lines.
    APPEND it_error.
  ELSE.
    it_info-info_rec = g_msg.
    it_info-lifnr    = it_header-lifnr.
    it_info-tabix    = v_lines.
    APPEND it_info.
  ENDIF.
ENDLOOP.
Cheers,
Simha.
Reward all the helpful answers..

Similar Messages

  • Please Help! How to capture logged on user id and use it in applications

    Friends,
    I have created a procedure to view account balance which takes userid as parameters and displayes his latest account balance.
    I have put an URL in my page. but I am not able to capture the current logged on user id so that I can pass it to my procedure.
    reply for this question would be of great help to me, because all y applications require passing user login id.
    Thanks in advance.
    Murthy

    I have read this in Oracle Metalink, but I haven't tried it yet.
    Hope this will help !
    select * from portal30.wwctx_sso_session$ where trunc(session_start_time) = trunc(sysdate) and
    active = 1 and IS_LOGGED_ON = 1
    This should give you the logged in users..

  • How to capture the role of the user logged in  CRM

    Hi
    How to capture the role of the user logged in  CRM so as to restrict the Account group selection ; While creating a sales Order .
    Can we deternine the profile in the related view .If so how , and what tables can we use to do so.

    hi,
    I think you should check CRM table AGR_USERS.
    Regards
    Michael

  • How to get/capture log-on user name on PC (work station)

    Hi,
    Colud anyone give me how to get/capture log-on user name on my PC (work station)?
    I need to get the infomation by using a function module.
    Kind regards,
    Hisao

    Hi,
    TH_USER_INFO shows me terminal ID, IP address and other information. howerver it does't show me log-on user name of OS.
    Kind regards,
    Hisao

  • 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

  • How to capture the Logout time in xMII

    Hi Friends,
    How to capture the logout time in xMII when the user clicks on Logout link
    Thanks

    Srikanth,
    It would be better to use a database table(s) to store your audit trail information than an xml file, which could grow beyond a manageable size and then require housekeeping efforts and file rolling, etc.  It would also be much easier to query user related information out of the logs, pareto charts for failed vs. successful login attempts, etc. if the data was stored in a database.
    Have you considered modifying the Relogin.jsp page link in the portal's sub-menu bar?  How about making your own version of this web page and changing the link pointer?  Keep in mind that whatever result you come up with here will need a significant update for NetWeaver UME compatibility in version 12.0.
    Regards,
    Jeremy

  • How to capture Sony Hvr Z7 m2t Files FCPX 10.1.1

    Can any one help me there.
    I have a Sony Hvr Z7 - I can capture it with log and transfer with FCP7 or convert it with many programs out there. But
    I wanto to know how to capture straight from the Memory Recording Unit  connected by fire wire.
    Any Help there would much preciated
    Thanks

    First of all thanks for your answering. I know that.  But somewhere I came acros a way to do it
    but I have lost the link of it. I know, or think I know, there is a way. Kind a of archive or something like that.
    What I remember is that I had to import all the cf at once - and not been able to import file by file.
    I'll keep looking for it. If I find I'll post it here.
    Thanks any way!

  • How to add log details for marketing attributes

    Hi,
    when user is changing marketing attributes in bp transaction we need to show the log details in log file.how to capture the change log details in to log file ? is there any way to show change log files.
    rose

    Hi,
    You can view the change log using the report program:CRM_MKT_TOOLS or T-cd:CRMD_MKT_TOOLS. Choose 'History of attribute Evaluation for Business Partners'.
    You can manipulate this report and get the necessary log.
    This BADI CACL_VAL_CHANGE will be called after any change to the marketing attribute.
    Here you can capture the log to your custom table / you can log the data to a file.
    Hope this helps.
    Regards,
    Senthil.

  • Capturing log files from multiple .ps1 scripts called from within a .bat file

    I am trying to invoke multiple instances of a powershell script and capture individual log files from each of them. I can start the multiple instances by calling 'start powershell' several times, but am unable to capture logging. If I use 'call powershell'
    I can capture the log files, but the batch file won't continue until that current 'call powershell' has completed.
    ie.  within Test.bat
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > f.log 2>&1
    the log files get created but are empty.  If I invoke 'call' instead of start I get the log data, but I need them to run in parallel, not sequentially.
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    Any suggestions of how to get this to work?

    Batch files are sequential by design (batch up a bunch of statements and execute them). Call doesn't run in a different process, so when you use it the batch file waits for it to exit. From CALL:
    Calls one batch program from another without stopping the parent batch program
    I was hoping for the documentation to say the batch file waits for CALL to return, but this is as close as it gets.
    Start(.exe), "Starts a separate window to run a specified program or command". The reason it runs in parallel is once it starts the target application start.exe ends and the batch file continues. It has no idea about the powershell.exe process
    that you kicked off. Because of this reason, you can't pipe the output.
    Update: I was wrong, you can totally redirect the output of what you run with start.exe.
    How about instead of running a batch file you run a PowerShell script? You can run script blocks or call individual scripts in parallel with the
    Start-Job cmdlet.
    You can monitor the jobs and when they complete, pipe them to
    Receive-Job to see their output. 
    For example:
    $sb = {
    Write-Output "Hello"
    Sleep -seconds 10
    Write-Output "Goodbye"
    Start-Job -Scriptblock $sb
    Start-Job -Scriptblock $sb
    Here's a script that runs the scriptblock $sb. The script block outputs the text "Hello", waits for 10 seconds, and then outputs the text "Goodbye"
    Then it starts two jobs (in this case I'm running the same script block)
    When you run this you receive this for output:
    PS> $sb = {
    >> Write-Output "Hello"
    >> Sleep -Seconds 10
    >> Write-Output "Goodbye"
    >> }
    >>
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    3 Job3 Running True localhost ...
    PS>
    When you run Start-Job it will execute your script or scriptblock in a new process and continue to the next line in the script.
    You can see the jobs with
    Get-Job:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    3 Job3 Running True localhost ...
    OK, that's great. But we need to know when the job's done. The Job's Status property will tell us this (we're looking for a status of "Completed"), we can build a loop and check:
    $Completed = $false
    while (!$Completed) {
    # get all the jobs that haven't yet completed
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"} # if Get-Job doesn't return any jobs (i.e. they are all completed)
    if ($jobs -eq $null) {
    $Completed=$true
    } # otherwise update the screen
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    This will output something like this:
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    When it's done, we can see the jobs have completed:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Completed True localhost ...
    3 Job3 Completed True localhost ...
    PS>
    Now at this point we could pipe the jobs to Receive-Job:
    PS> Get-Job | Receive-Job
    Hello
    Goodbye
    Hello
    Goodbye
    PS>
    But as you can see it's not obvious which script is which. In your real scripts you could include some identifiers to distinguish them.
    Another way would be to grab the output of each job one at a time:
    foreach ($job in $jobs) {
    $job | Receive-Job
    If you store the output in a variable or save to a log file with Out-File. The trick is matching up the jobs to the output. Something like this may work:
    $a_sb = {
    Write-Output "Hello A"
    Sleep -Seconds 10
    Write-Output "Goodbye A"
    $b_sb = {
    Write-Output "Hello B"
    Sleep -Seconds 5
    Write-Output "Goodbye B"
    $job = Start-Job -Scriptblock $a_sb
    $a_log = $job.Name
    $job = Start-Job -Scriptblock $b_sb
    $b_log = $job.Name
    $Completed = $false
    while (!$Completed) {
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"}
    if ($jobs -eq $null) {
    $Completed=$true
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    Get-Job | where {$_.Name -eq $a_log} | Receive-Job | Out-File .\a.log
    Get-Job | where {$_.Name -eq $b_log} | Receive-Job | Out-File .\b.log
    If you check out the folder you'll see the log files, and they contain the script contents:
    PS> dir *.log
    Directory: C:\Users\jwarren
    Mode LastWriteTime Length Name
    -a--- 1/15/2014 7:53 PM 42 a.log
    -a--- 1/15/2014 7:53 PM 42 b.log
    PS> Get-Content .\a.log
    Hello A
    Goodbye A
    PS> Get-Content .\b.log
    Hello B
    Goodbye B
    PS>
    The trouble though is you won't get a log file until the job has completed. If you use your log files to monitor progress this may not be suitable.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Why use P2 technology - how do you log?

    Can anyone explain to me why they use P2 technology? When we shoot our DVCAM footage, we log in FCP on a Powerbook, we mark all the good takes, then digitize based on what we've already seen. We don't need to re-log everything in the edit suite, we just start cutting with known good footage. Scene numbers, take numbers are already entered, and we're ready to go.
    With P2, you record your footage, wait 8-10 minutes to copy the files to your laptop, then import the clips, with no markings; you don't know what the good takes are, you don't have any scene or take references, or useful in or out points. These all need to be added in FCP or P2 Log. You have to review all of the footage you've shot again, decide if the take is good or not (which can be fun if you've had 7 or 8 takes and it turns out take 5 was the 'good' one). This strikes me as an incredible waste of time, something we don't have the luxury of with ever shrinking budgets. I expect you have to keep some kind of paper log, (welcome to the 1980's) with an unpredictable file naming system, so that you know what you have when you're ready to post.
    So is this really a good solution? Yes, you don't have to digitize. But you do have to log everything, which is very simple as you shoot in FCP, but you can't merge the P2 footage with a log kept in P2 Log or in FCP. Which brings me to my question: Can you create a log for P2 footage as you shoot, that can be brought into FCP without having to review the footage again or do a lot of post production typing?
    To me, this is the Achilles heel of P2 production. Anyone have any thoughts? We don't shoot a frame without a scene number and tape number, we shoot 50 good shots a day from about 150 takes per day, and at about 60 days a year, we need to keep track of what we shoot as we go. I estimate at least a 1/2 day of logging for every day of shooting with the P2, and frankly, I don't have 30 working days in my year to create logs that I can easily make while we shoot.
    P2, on the surface, looks great. But P2 and any direct to disk technology, to me, looks like a big step backwards in terms of workflow.
    Fire away, folks.
    MacBook Pro   Mac OS X (10.4.8)   Non-linear since 1994

    As the editor of the productions I work on, I am never on set. And I and the producer prefer it that way. This way I come in with an objective point of view, does the shot work or not. I am not clouded by how much time and effort went into getting the shot, I just look at it afterwards and judge it by its value. So we never log on the set. We simply back up.
    When we shoot our DVCAM footage, we log in FCP on a Powerbook, we mark all the good takes, then digitize based on what we've already seen. We don't need to re-log everything in the edit suite, we just start cutting with known good footage. Scene numbers, take numbers are already entered, and we're ready to go.
    You do all this work on the set. We don't, we do it in post, so there isn't twice the amount of work...it is just done later. This is true of every production I have worked on...documentary, narrative TV, short film. We aren't in the field logging and capturing...that is done later. But it is still done. We also slate our footage, and if someone is on the set to do so, they act as Script Supervisor and mark the good and bad takes. So when I look at the footage in the P2 import window on FCP 5.1.2, I can take the good but not the bad. But...I am always in favor of getting everything, because even though a take might be bad, it might contain something good that I can use.
    With P2, you record your footage, wait 8-10 minutes to copy the files to your laptop, then import the clips, with no markings; you don't know what the good takes are, you don't have any scene or take references, or useful in or out points. These all need to be added in FCP or P2 Log. You have to review all of the footage you've shot again,
    Again, we slate in the field. Yes, the clips come in with odd names, but when you capture a tape there is no INSTANT name associated with that. You have to give it a name...as you import. You can do the same with FCP and P2, as you import give it a name, scene, take...mark it good. And again, we aren't reviewing the footage AGAIN...it is done for the first time in post. They may review it in the field with the P2 viewer to ensure it looks good, just like on any film production with a DVCAM deck recording thru the camera viewfinder or rewinding the camera tapes.
    So is this really a good solution?
    Works rather well for me. No problems whatsoever...except when I first started doing this and put ALL the imported P2 clips into one bin. 2000 clips. I'll never make that mistake again. I separate footage by card much like I make Dailies bins with tapes.
    http://lfhd.blogspot.com/2007/01/organizing-my-p2-media.html
    But you do have to log everything, which is very simple as you shoot in FCP,
    You said that you log everything...in the field. I am logging everything in post. Still have to log. And, how do you "shoot in FCP?" That is a non-linear edit, not a camera. What do you mean by this? I guess I don't get how you are logging in the field without having to log. You are still taking the time to log and name the footage...so you lost me here.
    Can you create a log for P2 footage as you shoot, that can be brought into FCP without having to review the footage again or do a lot of post production typing?
    Not that I know of. Achilles heel? I suppose if you look at it from the point of view of your current workflow. But you have to realize that it ISN'T your typical tape workflow. Stop trying to make it work like a tape workflow. Square peg in circular hole. Same thing happened when people switched from Film to Tape...the workflows they were accustomed to didn't work...they had to devise new ones.
    You are going to have to figure out a new way of doing things...or just not shoot with the HVX. It is a very different way of doing things, but production can be pretty slick if you work out a system. I have a system and it works great. If you don't like it, don't use it. Grab an HDV camera and struggle with THAT format.
    P2, on the surface, looks great. But P2 and any direct to disk technology, to me, looks like a big step backwards in terms of workflow.
    Tell that to David Fincher's crew on ZODIAK. Not one tape or scrap of film in that production...all digital.
    If the tapeless workflow doesn't work for you...don't use it. Easy decision.
    Click on Underdog for my experiences with the format. Start from the beginning and see how I progressed if you'd like.
    Shane

  • Could you anyone guide me how to capture no. of incoming request in weblogi

    Could you anyone guide me how to capture no. of incoming request in weblogic?

    Use a tool like webalilzer to process and graph the access logs. It wont be in real time, but you can certainly track accesses to your site.
    TGF

  • How to use log console

    how to use log console?

    kilty66 wrote:
    disk1s3: media is not present.
    Video capture fps 13.056067 , requested 15
    (com.conduit.loader.Agent[866]) Exited with code: 1
    The first means something is missing, most likely on an external HD.
    If the other two were sent at the same time, they're probably all related to a video capture problem.
    Many of the messages you'll see in your logs don't indicate a real problem -- they'll be status messages, info for developers, etc., so don't try to figure out every message you see.
    If you see the same message repeated over and over (as the MacKeeper ones probably did), that's clearly a problem, of course.
    If you're having specific problems, but not getting messages on your screen, check for log messages that seem related (ie, sent at the same time, and/or from a process you recognize as being related).  See the blue box in OSX Log Files for help deciphering the messages.  If you're not sure about what a particular process does, many of the names of Apple processes are listed here: http://triviaware.com/macprocess/all with a brief explanation.
    For other processes, or other references, Google will often turn up some info.
    If none of that helps, post a new thread for each such problem, with as much detail as you can about what you were doing and what kind of difficulty you were having, and, of course, the message(s) that seem related.
    Try to post them in the appropriate forum; if you're having a problem with a specific Apple app, there may be a forum for that app, where folks who know it well hang out.  

  • How to capture Wnidows(OS) event from Java program

    Hi,
    I am developing one application , in that if the user didn't do any thing in 15 mins,i need to log out from my application(not windows).Here i need to check Java event as weel as windows(OS) events also.Any one knows how to capture the OS events??

    I want to know the status of mouse and keyboard(Windows 2000).If the status of the mosue or keyboard doesn't change from 15min i need to log of the java application.

  • Capturing Log in BDC

    Hai..
    I want to capture error messages. I am able to do so with the normal error messages that appear on the status bar at the down. But I am not able to capture error messages that appear in the error log and not on the status bar. How to capture it?
    Thanks.

    Hi rajalaxmi,
    Use the following code
    CALL TRANSACTION 'ME51' USING bdcdata MODE 'N'
                                                    MESSAGES INTO t_msg.
    DATA:
        lw_msg TYPE string.
        LOOP AT t_msg INTO fs_msg where msgid eq 'E'.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = 'EN'
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = lw_msg
          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.
        WRITE:/ lw_msg.
      ENDLOOP.
    Regards and Best wishes.

  • How many Users Logged in ?

    Hi,
    I have a peculier requirement. I need to know, how many users logged in, when the system crashed. This is needed before restoring the system. Is there anyway from Unix level, this info can be captured?
    This we need for deciding, if system crashed notification to be sent or whom to send.
    Thanks,
    Raj

    Hi,
    Why do you need the users? You just restore and then put a message in SM02 when ever the users logins message will be shown.
    Regards,
    Vamshi.

Maybe you are looking for