05-24-2011 2:08 PM
Hi All,
I am creating some warning messages in VKP5 from BADI " SPC_POSTING_CONTROL" .
1.Warning messages are not stroing in the LOGS , because logs badi is triggering after executing the VKP5.
2.When i am creating the pricing document from menubar option in the o/p of VKP5 Badi is not triggering .When i click on the save button then the badi triggering but i am unable see the messages in the log .
3.I have found one exit "EXIT_SAPLWVK1_003" this one triggering when i click from menu bar option but it does not have table paramater for storing more than one warning message it contains structure i can store only one message .
4.When i run the VKP6 also badi is not triggering but exit is triggering when i change any data in the o/p of vkp6 .
Our sytem is SAP-IS retails system ,same fucntionality working in SAP -R/3 . I donot the reason why its not working for SAP-IS retail system .
If any body have the solution please provide to me .
Regards
Srihari
08-08-2011 11:13 AM
08-08-2011 11:47 AM
Hi Shihari
Check the BADI 'PWL_SP_DETERMINATION'. You have a sample coding, en method PROCESSCHECK_AND_SP_DETSEQ_SET you have this coding:
* Assumption: No worklist entry if change of margin is less than 5%
* Caution: There might be prices that are zero, so exclude that case
if ( not pi_i_kalp-endpa is initial ) and
*--- Only external vendor or internal vendor with sales price (in case
*--- of a two step calculation purchase price can be zero, the
*--- following check does not make sense then)
( ( pi_i_kalp-bewrk is initial ) or
( not pi_i_kalp-bewrk is initial and
not pi_i_kalp-ekpnn is initial ) ).
*-- Determine margin with curr. sales price and new net/net purch price
workfield = ( pi_i_kalp-endpa - pi_i_kalp-ekpnn ) * proz100
/ pi_i_kalp-endpa.
*-- Relation of new and old margin ------------------------------------*
margin_relation = ( workfield / pi_i_wkbp_copy-spabr ) * proz100.
*-- Absolut change in margin ------------------------------------------*
margin_change = margin_relation - proz100.
margin_change = abs( margin_change ).
*-- Margin change lower than a certain limit -> Exclude worklist entry *
if margin_change lt margin_change_max.
pe_exclude_calc_item = 'X'.
*---- Create message in log -------------------------------------------*
clear i_log.
move-corresponding pi_i_kalp to i_log.
i_log-msgid = 'WV'.
i_log-msgty = 'I'.
i_log-msgno = '852'.
i_log-msgv1 = margin_change.
i_log-msgv2 = margin_change_max.
append i_log to pe_t_erro.
exit.
endif. " Change lower than a predefined maximum limit
endif. " PI_I_CALP-ENDPA not zero
I hope this helps you
Regards
Eduardo