Skip to Content
author's profile photo Former Member
Former Member

Add message to the error log.

Hello Friends,

I am working on Marketing Planner.

I have implemented the BAdi CRM_MKTPL to automatically generate the Marketing Plan ID. The coding mask configuration is also in place. Now, my problem is when the coding mask is exhausted, and when we create a marketing plan element, the field will be blank, no Id is generated. This is the functionality required and it is working fine till now. Now, when I save it, this gives me an information message saying "Data has not been saved - see log". And when I go to the log button that is present in the right most corner, I can find the error "Enter an identification for the marketing element".

Now my requirement is, when I coding mask is exhausted and when I try to create the marketing plan there it should give a blank Id and also fill the log with the error message saying "Enter an identification for the marketing element".

I mean the error message that Iam getting on Save should come without the information message when I create a marketing plan after coding mask is exhausted.

I tried with CALL METHOD CL_CGPL_APPLICATION_LOG=>MESSAGE_ADD but it doesnt add a message to the log.

Regards,

Raju.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 12, 2007 at 05:12 AM

    Hi,

    I think you are talking about application log.Use the following code.

    data: gs_generate_log TYPE BAL_S_LOG.

    data gS_MSG_bal TYPE BAL_S_MSG.

    data gt_msg_bal type table of BAL_S_MSG.

    if not gt_msg_bal[] is initial. " check your message table is not empty

        • OBJECT and SUBOBJECT are maintained via SLG0

        gs_generate_log-OBJECT = give object name

        • lv_partner_log-SUBOBJECT = give subobject name.

        gs_generate_log-ALDATE = SY-DATUM.

        gs_generate_log-ALTIME = SY-UZEIT.

        gs_generate_log-ALUSER = SY-UNAME.

        gs_generate_log-ALPROG = SY-REPID.

        CALL FUNCTION 'BAL_LOG_CREATE'

        EXPORTING

        I_S_LOG = gs_generate_log.

        loop at gt_msg_bal into gs_msg_bal.

        CALL FUNCTION 'BAL_LOG_MSG_ADD'

        EXPORTING

        I_S_MSG = gs_msg_bal.

        endloop.

        CALL FUNCTION 'BAL_DB_SAVE'

        EXPORTING

        i_save_all = 'X'.

        endif.

        This will create a log.

        Object and subobject you can find using the message which is already logged in this log for your application.

        Reward with points.

        Smita.

        Add a comment
        10|10000 characters needed characters exceeded

      • author's profile photo Former Member
        Former Member
        Posted on Jun 12, 2007 at 04:17 AM

        Hi Friends,

        Did anyone get the solution for this?

        Is this the configuration part? Can we do this by any development?

        Regards,

        Raju

        Add a comment
        10|10000 characters needed characters exceeded

        • Hi Narayana,

          You can use the method object_message_add of the class cl_cgpl_application_log.

          Refer the following code sample :

          CALL METHOD cl_cgpl_application_log=>object_message_add

          EXPORTING

          im_msgty = 'E'

          im_msgid = 'ZCMK001'

          im_msgno = '000'

          IM_HIERARCHY_NODE = im_project.

          OR

          Check out if the method that you have implemented has ET_RETURN as exporting table. You can populate this table with the error message that you want to show in the application log.

          Refer the following code sample:

          ls_return-msgty = 'E'.

          ls_return-msgid = ''.

          ls_return-msgno = ''.

          ls_return-msgv1 = ''.

          append ls_return to et_return.

          <b>Reward points if it helps.</b>

      • author's profile photo Former Member
        Former Member
        Posted on Oct 08, 2007 at 07:54 PM

        can someone explain if this error can be removed by the CRM consultant and how?

        I am getting this error when saving a new campaign through Marketing Planner.

        thanks.

        Add a comment
        10|10000 characters needed characters exceeded

      Before answering

      You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
      You must be Logged in to submit an answer.

      Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.