10-13-2008 8:32 AM
In Tcode ME21n if valuation type is empty then it gives the warning message. i want to convert it into the error message when the Document Type is "INT" before saving the PO.
For this i am using the user exit EXIT_SAPMM06E_012 but not able to create the error message.
I am using the version ECC5.
Can u suggest me the code to do the same.
10-13-2008 9:59 AM
Hi,
CALL FUNCTION 'POPUP_TO_DECIDE_INFO'
EXPORTING
defaultoption = 'N'
textline1 = text-001
textline2 = text-002
titel = text-003
start_column = 45
start_row = 9
IMPORTING
answer = answer.
IF answer EQ 'J'.
MESSAGE ID 'YMM' TYPE 'E' NUMBER '033' WITH TEXT-029.
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
Also try with EXIT_SAPMM06E_017.
Regards..
10-13-2008 9:59 AM
Hi,
CALL FUNCTION 'POPUP_TO_DECIDE_INFO'
EXPORTING
defaultoption = 'N'
textline1 = text-001
textline2 = text-002
titel = text-003
start_column = 45
start_row = 9
IMPORTING
answer = answer.
IF answer EQ 'J'.
MESSAGE ID 'YMM' TYPE 'E' NUMBER '033' WITH TEXT-029.
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
Also try with EXIT_SAPMM06E_017.
Regards..
10-13-2008 10:16 AM
Thanks for your quick answer.
But i am not able to decide the parameters to be passed in it & for what exactly this function module is used.
Reply.
10-13-2008 10:25 AM
Hi,
defaultoption = 'N' "N stands for No, and curson stays here
textline1 = text-001 "Your information line one, like "do u want to save"
textline2 = text-002 " your second line information " like warning..this action will lose the data"
titel = text-003 "title for the pop up
start_column = 45 "start position at the screen
start_row = 9 "start row at the screen
IMPORTING
answer = answer. "contains either J or N for Yes and No
10-13-2008 11:59 AM
can u give me a piece of code using tables TEKPO & I_EKKO of the function modules tables of the same exit.
so that i can generate error message when the document type
EKKO-BSART = 'INT' & EKPO-BWTAR = space.
thanks.
10-14-2008 7:46 AM
10-14-2008 10:38 AM
Hello In the exit we have to create the error message with the Functional modules
see the error messages in SLGO, SLG1
To see the subobject or object name go to SLGO
y_i_log_handle TYPE bal_t_logh,
y_wa_bal_s_msg TYPE bal_s_msg,
y_wa_bal_s_log TYPE bal_s_log,
p_loghandle TYPE balloghndl.
y_v_balloghndl TYPE balloghndl.
&----
*& Form y_f_log_create
&----
text
----
FORM y_f_log_create.
CONSTANTS:y_lk_e TYPE c VALUE 'E',
y_lk_pclas TYPE char1 VALUE '1'.
y_wa_bal_s_log-subobject = 'BUKRS'.
y_wa_bal_s_log-extnumber = text-001.
y_wa_bal_s_log-aluser = sy-uname.
y_wa_bal_s_log-alprog = sy-repid.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = y_wa_bal_s_log
IMPORTING
e_log_handle = y_v_balloghndl
EXCEPTIONS
log_header_inconsistent = 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.
y_wa_bal_s_msg-msgty = y_lk_e.
y_wa_bal_s_msg-msgid = 'YLO1'.
y_wa_bal_s_msg-msgno = '044'.
y_wa_bal_s_msg-probclass = y_lk_pclas.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = y_v_balloghndl
i_s_msg = y_wa_bal_s_msg
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
APPEND y_v_balloghndl TO y_i_log_handle .
ENDIF.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_in_update_task = space
i_t_log_handle = y_i_log_handle
EXCEPTIONS
OTHERS = 4.
IF sy-subrc EQ 0 .
COMMIT WORK .
ELSE .
ROLLBACK WORK .
ENDIF .
REFRESH y_i_log_handle .
ENDFORM. "y_f_log_create