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.
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