How to log in standard sap way in a jsp/servlet project

Hi expert,
To log and trace in sap standard mechanism always confuse me a lot.
Is there any how-to document for j2ee project?
I know for wdj you can add log configuration by select 'create log configuration file' in context menu, but I can not find this for a j2ee project.
I would like to see the log in LogViewer of VA, put all logs together in sap management make sense in our project.
Thank you for your hints.
William

Hi,
f
ile=new FileLog("f:/WebServiceTrace/trace2.%g.log", 800000, 10,                                        new  TraceFormatter());
The above code specifies the path for your log file.
Then add this file as a log location and then log the traces. For this you can use the following code like:
Location location=Location.getLocation(className);
          location.addLog(file);
          location.setEffectiveSeverity(Severity.ALL);
          location.entering(methodName);

Similar Messages

  • How to call a standard sap transaction in workflow

    Dear All,
    I want to know how to call a standard sap transaction inside my workflow , please tell me how to get this done .
    Kind Regards,
    Anshu Kumar

    Hi,
    You can use the FM - ABAP4_CALL_TRANSACTION u2013 Initiates a transaction in a separate window
    inside the method in the BO.
    Implement that BO and the method in the Activity of the WF..!!
    Use the FM like this:-
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
      EXPORTING
        tcode                         = 'ZSCREEN_884' - T-Code
       SKIP_SCREEN                   = ' '
       MODE_VAL                      = 'A'
       UPDATE_VAL                    = 'A'
    EXCEPTIONS
       CALL_TRANSACTION_DENIED       = 1
       TCODE_INVALID                 = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    If you do not want to use the FM u can use this Statement:-
    call transaction 'ZSCREEN_884'. - T_CODE
    Check the following links:-
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/delegationandRedefiningmethodsofbusinessobject+BUS1001
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/workflow%252bscenario
    Let me know if you still face any issues..!!
    Regards,
    Kanika

  • How to call a Standard SAP Program in Zprogram.

    Hi,
    how to call a SAP Standard program in SAP Program?
    Do we have to use any funtion module and pass paramters?
    I want to call a Standard SAP prg in to my prgram? can anyone explain me or give the piece of code to call standard prg.
    Thanks & Regards

    Again, ABAP related questions should be asked in the ABAP forum.
    To answer you question,  if the standard program is a report program, you can use the SUBMIT statement and pass parameters using the WITH Extention.
    Submit <report>
          with p_fld = 'X'
              and return.
    Please make sure to award points for helpful answers and mark your posts as solved when solved completely.  Thanks.
    Regards,
    RIch Heilman

  • Impact of Table Logging on Standard SAP Tables

    Table Logging is not currently active in our system, so if we activate this parameter what will be the impact on system standard tables.
    Please find the below example,
    For some Standard SAP Tables, the table logging is already enabled, but as overall logging is not activated in the system, the logs are not getting saved for these tables as well.
    in the above table the log data changes have been enabled, but as per the below screenshot the overall logging is disabled.
    so, if this is enabled, what impact will it have on the system standard tables.

    Please move this to BW area of SCN, BI platform space is for Analytics/Business Objects platform.

  • How to log on to SAP GUI 6.4?

    Hi
    after installing SAP gui 6.4 i have to log on into sap
    i read many Documents that says i have to copy a saplogon.ini
    to the SAP directory when i copy this file in description
    i have logon names.when i logon with one of them i have to connect to Internet and have a username and password.
    but i want to make logon without connect to internet.
    what should i do?

    Hi Javad,
    the server installations I mentioned are compete insofar as you can run them and connect to the server using SAP GUI. You can also run the basic transactions and do ABAP development.
    I assume when you say 'complete system' you mean including all business applications. This is not available as some sort of download, and I don't think it's feasible to set this up just for testing.
    Best regards,
    Christian

  • How to log in to SAP MII by using a custom xApp?

    Hi there,
    I'm developing a custom xApp with a context root of /mycustomapp
    I use some security contraints for it so the user has to log in to view the xApp.
    As I use some MII services the user has to be logged in to SAP MII, too. However, logging in to SAP NetWeaver doesn't automatically sign in the user to SAP MII, too.
    Is it possible at all?
    Accessing /mycustomapp leads to a login mask, but the user should be logged in to SAP MII, too.
    Regards
    Tobias

    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      id="WebApp_ID" version="2.5">
      <display-name>mycustomapp</display-name>
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <security-constraint>
      <display-name>Authentication of Users</display-name>
      <web-resource-collection>
      <web-resource-name>My Resource Name</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>My_User_Role</role-name>
      </auth-constraint>
      </security-constraint>
      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>MyRealm</realm-name>
      </login-config>
      <security-role>
      <role-name>My_User_Role</role-name>
      </security-role>
    </web-app>
    web-j2ee-engine.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="web-j2ee-engine.xsd">
      <spec-version>2.4</spec-version>
      <security-role-map>
      <role-name>My_User_Role</role-name>
      <server-role-name>My_User_Role</server-role-name>
      </security-role-map>
    </web-j2ee-engine>
    Besides having the role My_User_Role my user also has the SAP_XMII_User role (and the corresponding developer roles).
    Regards
    Tobias My_User_Role

  • ESR - How do you import standard SAP Models

    Hi,
    We've recently upgraded to PI 7.1 and I'm looking to model some integration scenarios.
    I have been reading the following help
    http://help.sap.com/saphelp_nwpi71/helpdata/en/73/70bfcc163b48b0bb5edb6cdd860766/frameset.htm
    Under the section - Modeling Guide for model types in the ES Repository - there is the following note
    Finally, the different models are a good way of documenting the whole process of an application and make it easier to enhance software later.
    Note
    SAP already works internally with the modeling environment, including a unification and standardization process (Governance Process), to increase the level of reusability. SAP delivers the models that were produced by this process as ESR content to aid the understanding of the SAP application.
    End of the note.
    I'm wondering if there is a way to import these models so I can view them.
    Regards,
    John

    Hi John,
    After the upgrade, if you drill down the SAP Standard Software Component Versions in the ESR you'll notice some of the models that SAP shipped with the upgrade. You can start looking at those to get a good idea of how SAP has used them.
    The other alternative is that if you import XI Content from Service Marketplace that you migh require for building Enterprise Services for a specific scenario you may have, SAP Models used to produce that Enterprise Service/s are shipped with the XI content. You can browse through those as well.
    Regards, Trevor

  • How to open a standard SAP fact sheet or any UI component ?

    Using a support user, I want to open a BYD standard Fact Sheet of interest.
    My goal is to see how certain fields are filled.  I thought about adding a BO extension, and then editting the screen, but am slightly stuck.
    Is there a way of opening a standard BYD screen (fact sheet) or any UI component ?
    Thanks ahead for any tips.

    Hi Tom,
    you need a PTP (Port Type Package), and to configure the outport.
    If you want to understand how to configure do:
    1) Create a custom BO
    2) Generate all the screens for the custom BO of type Object-Based Navigation
    3) Open the OWL and see what happen when the user click EDIT (the QA screen is opened through the PTP)
    4) Open the QA and see how the QA understand that it needs to be opened when the PTP receive the notification

  • How to edit a standard SAP Query

    I need to do authority check for satndard SAP Query....How to do it

    If you put code similar the following in the Infoset ---> Extras -> Code -> Start of Selection it should work
    CALL FUNCTION 'SD_ORGDATA_AUTHORITY_CHECK'
    EXPORTING
       I_VKORG            = P_VKORG
    *   I_VTWEG            =
    *   I_SPART            =
        I_ACTVT            = '01'
    EXCEPTIONS
       NO_AUTHORITY       = 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.
    So, if the user does not have the proper authorization, it will exit the program.  You will need to check with your Security administrator to verify what value to use for the Activity Code.

  • How to find browser is not supporting cookies using jsp/servlet?

    still....... now i develope one session tracking concept in my project using cookies.
    but after implementing my application to some client . Its browser dosen't support cookies.
    so how to avoid this problem before implementing application.

    Are you actually using cookies or you just need to retain session attributes?
    You can use URL rewriting to encode the session id into urls for browsers that do not accept session cookies.
    Check out HttpServletResponse.encodeURL.
    Note you would have to do this for all links/forms in your web app.

  • How to copy standard SAP report to a Z report?

    Hi All,
    Guys, I have a requirement to copy an standard SAP report and make some changes to it. Please let me know how to copy a standard SAP report as a Z report. Is there any simple way or will I have to open the source code and copy it into the new Z program? If that is the case, how will I copy the screens and related PBO/PAI events?
    Please provide me a step-by-step solution.
    Thanks & Regards,
    Madhur

    Hello Madhur,
    As Raja had said, yuo could just copy the program from SE38. But just remember a few points:
    1. If the standard report is being used in some other programs, then there's no way you can make your Z-report get used in all such instances. I suspect that you may not want to do that anyways, but just in case.
    2. Just also check out if the standard report you're talking about has any INCLUDE programs within it. If there are too many standard INCLUDEs in the main report, then you might have to decide whether you need to copy all of them too, or let them be as they are.
    3. You are likely to have some problems with the text-elements and translation that may have been maintained for the original report.
    I have experienced some problems with respect to the second and third points in the past, so it is worth it to be a bit careful.
    Regards,
    Anand Mandalika.
    Regards,
    Anand Mandalika.

  • Standard SAP Adobe Template in Adobe Interactive form

    Hi folks,
             Does any one knows how to import a standard SAP Adobe template (for eg :- PR template or SO create template) which is given by SAP into Adobe Interactive form UI element in Webdynpro perspective. I tried opening Adobe Interactive element by editing it and tried for import a std adobe template but I did not see any option to do so.
             Appreciate an early response.
    Regards,
    Guru Subramanian B

    Hi Guru
    if you are involved in an SAP-internal project, which includes the development of a form, there are probably internal ways to do that.
    If you need any of the official customer-ready forms we ship, you would need access to a mySAP ERP 2004 system and try and get one of the print forms out of that system. SAP is currently not providing any of their official forms outside the respective application.
    As for your second question, first a clarification: The template as such is not in the system as PDF, but in a format called XDP. The PDF is the generated document that includes the system data.
    Calling another system via BAPI and RFC is supported as part of the Web Dynpro for Java framework, and obviously in ABAP. As you need to define a form context to determine where your data for the form comes from, this data can come from other systems using BAPI/RFC. This is SAP functionality supported in SAP NetWeaver '04.
    Regards,
    Markus

  • How to configrate purchasing standard reporting?

    Hi, Experts
    I want to add two important display fields (MARA-GROES, MARA-WRKST)into the standard sap report ME55.
    I suppose below path can help me to solve this issue.
    Materials Management>Purchasing>Reporting-->Maintain Purchase Requisition Lists
    Anybody can tell me the how to do it ?

    Thank you for you reply, but ME55 is the t-code for release PR, not just a report.
    So I don't think Query can help.
    ofcourse , I know ABAP can do anything, if I develop a new report to release PR, which ofcourse can solve my problem. However I think SAP offer us the reporting function, which should can do somethings.
    Who knows how to use the standard SAP reporting customizing ?
    IMG>Materials Management>Purchasing-->Reporting

  • Populating our log message along with standard sap log in ck11n.

    Hi all,
    I have developed a user exit which is used in costing of material using ck11n.
    Here i have to show our custom log message along with the standard log shown by standard sap system after costing run is complete.
    I got one FM-- CM_F_MESSAGE  which is used by SAP. But i want the message along with SAP messages and not separately.
    Can u help me out for this. its very urgent.
    Thanks in advance.

    Hi
    I'm not sure because I don't know that trx, but I seem the function group of that function manages a log, so you can try.
    This is an extract of abap code of SAPLCKDI where that fm is used:
    CALL FUNCTION 'CM_F_MESSAGE'
       EXPORTING
         ARBGB = Y_CMF-CK
         MSGNR = '327'
         MSGTY = Y_CMF-W
         MSGV1 = SICHT
         MSGV2 = KLVAR.
    So I suppose you should call it by this way:
    CALL FUNCTION 'CM_F_MESSAGE'
       EXPORTING
         ARBGB = <your message class>
         MSGNR = <message number>
         MSGTY = <message type>
         MSGV1 = <text 1>
         MSGV2 = <text 2>
         MSGV3 = <text 3>
    I think MSGV* is optional parameter.
    Max

  • Exception handling for a standard SAP Function Module - the OO way

    Hello,
    I was wondering what is the correct way to call a standard SAP function module inside a method of global class.
    I want to display the error via the:
    get_text( ) and get_longtext( ) methods.
    I don't want to use the sy-subrc check. Is this possible?
    My example doesn't seem to work...
    See example bellow:
    DATA: ex_object_cx_root TYPE REF TO cx_root,
          ex_text TYPE string,
          ex_text_long TYPE string.
    TRY.
          CALL FUNCTION 'L_TO_CONFIRM'
            EXPORTING
              i_lgnum                        = i_lgnum      " Warehouse number
              i_tanum                        = i_tanum      " Transfer order number
              i_quknz                        = '1'          " '1' - confirm withdrawal only (picking )
              i_commit_work                  = 'X'          " Indicator whether COMMIT WORK in function module
            TABLES
              t_ltap_conf                    = it_ltap_conf " Table of items to be confirmed
            EXCEPTIONS
              to_confirmed                   = 1    " Transfer order already confirmed
              to_doesnt_exist                = 2
              item_confirmed                 = 3
              item_subsystem                 = 4
              to_item_split_not_allowed      = 51
              input_wrong                    = 52
              OTHERS                         = 53.
        CATCH cx_root INTO ex_object_cx_root.
          ex_text = ex_object_cx_root->get_text( ).
          ex_text_long = ex_object_cx_root->get_longtext( ).
          " Error:
          RAISE EXCEPTION TYPE zcx_transfer_order
            EXPORTING textid = zcx_transfer_order=>zcx_transfer_order
                 err_class = 'ZCL_WM_TRANSFER_ORDER'
                 err_method = 'CONFIRM_TO_2STEP_PICKING'
                 err_message_text = ex_text
                 err_message_text_long = ex_text_long.
      ENDTRY.
    Thank you very much in advance

    Hello Marko,
    If i understand correctly you've enclosed the call to the FM 'L_TO_CONFIRM' inside the TRY ... CATCH ... ENDTRY block.
    CATCH cx_root INTO ex_object_cx_root.
          ex_text = ex_object_cx_root->get_text( ).
          ex_text_long = ex_object_cx_root->get_longtext( ).
    You can't do this because the FM 'L_TO_CONFIRM' doesn't propagate OO exceptions!
    Your approach is almost correct, what you've to do is goes like this:
    CALL FUNCTION 'L_TO_CONFIRM'
      EXPORTING
        i_lgnum                        = i_lgnum      " Warehouse number
        i_tanum                        = i_tanum      " Transfer order number
        i_quknz                        = '1'          " '1' - confirm withdrawal only (picking )
        i_commit_work                  = 'X'          " Indicator whether COMMIT WORK in function module
      TABLES
        t_ltap_conf                    = it_ltap_conf " Table of items to be confirmed
      EXCEPTIONS
        to_confirmed                   = 1    " Transfer order already confirmed
        to_doesnt_exist                = 2
        item_confirmed                 = 3
        item_subsystem                 = 4
        to_item_split_not_allowed      = 51
        input_wrong                    = 52
        OTHERS                         = 53.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
              INTO ex_text. "Get the ex_text by this technique & not by CX_ROOT->GET_TEXT()
    ENDIF.
    I'll have to check how to fetch the long text of the message
    BR,
    Suhas

Maybe you are looking for

  • I can't save anything to my hard drive. I get a permissions denied message.

    This problem showed up out of nowhere. It began right before I installed Lion. Installing Lion didn't fix the problem. I am able to save work to my dropbox folder, but I can't save to my documents folder. I've tried restarting my computer. It didn't

  • Shortcut to close multiple folders in List View

    In the Finder, in list view, I have multiple folders open (using the triangle by the Folder name). I'd like to be able to close all the open folders at once. I know that holding Option while clicking the red Close button on a window will close multip

  • How do you make .aiff the default file format to send to iTunes

    I am using Garagebend 10.0.2 to edit my audio (nothing fancy just cutting peices I do not want out) and when I go to Share>Song to itunes the default is AAC. I want the default to be .aiff. There is nothing in preferences that allows me to change the

  • PO report: Problem in printing the last page

    Hi all, In my PO report, i need to print a table specifying 'continued' in every page and a table containing total amount in the last page for one PO. By using 'start@last-page-first:body' , i am getting the solution. But i also need to print 'Terms

  • Are you using the Extended Classic Scenario ?

    Hello everybody, Is somebody using the Extended Classic Scenario - SRM 4.0 ? If yes, could you describe briefly the config steps that you follow ?     I have received and followed some advices here and I have checked all the official documents withou