06-15-2006 6:56 AM
Hi,
Pls tell me is there any exit or badi with in
BAPI_GOODSMVT_CREATE or IDOC_INPut_mbgmcr.
I need to raise an exception with in this BAPI BAPI_GOODSMVT_CREATE.
Thanks
Bala
06-15-2006 7:02 AM
Do the following coding...
data : gd_identification like sy-uzeit,
msg_count like sy-tabix.
call function 'BAPI_GOODSMVT_CREATE'
EXPORTING
reservation_header = reservation_header
IMPORTING
reservation = reservation
TABLES
reservation_items = reservation_items
return = return.
if not return[] is initial.
Perform message.
read table return with key type = 'E'.
if sy-subrc = 0.
rollback work.
clear : v_text.
v_text = return-message.
perform messages_store using 'YT'
' '
'S'
'Error While '
'Saving'
'the'
'Records'
'204'.
perform fill_ielog using ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' '
' ' ' '
v_text.
loop at return.
it_errortab-message = return-message.
append it_errortab.
perform messages_store using 'YT'
' '
'S'
return-message
''
''
''
'204'.
perform messages_store using 'YT'
' '
'S'
return-message
''
''
''
'204'.
clear it_errortab.
endloop.
perform messages_show.
endif.
FORM MESSAGE.
CALL FUNCTION 'MESSAGES_INITIALIZE'
EXPORTING
COLLECT_AND_SEND = ' '
RESET = 'X'
LINE_FROM = ' '
LINE_TO = ' '
I_STORE_DUPLICATES = ' '
I_IDENTIFICATION =
CHECK_ON_COMMIT = ''
I_RESET_LINE = ' '
IMPORTING
E_IDENTIFICATION = gd_identification
.
ENDFORM.
FORM MESSAGES_STORE USING arbgb exception_if_not_active
msgty msgv1 msgv2 msgv3 msgv4 txtnr.
call function 'MESSAGES_ACTIVE'
EXCEPTIONS
not_active = 1.
if sy-subrc = 1.
call function 'MESSAGES_INITIALIZE'
exporting
check_on_commit = ' '
importing
e_identification = gd_identification.
endif.
call function 'MESSAGE_STORE'
EXPORTING
arbgb = arbgb
exception_if_not_active = exception_if_not_active
msgty = msgty
msgv1 = msgv1
msgv2 = msgv2
msgv3 = msgv3
msgv4 = msgv4
txtnr = txtnr
EXCEPTIONS
not_active = 1.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDFORM. " MESSAGES_STORE
FORM MESSAGES_SHOW.
msg_count = 0.
call function 'MESSAGES_COUNT'
IMPORTING
count = msg_count.
if msg_count ne 0.
call function 'MESSAGES_SHOW'
EXPORTING
object = 'IR'.
call function 'MESSAGES_INITIALIZE'
EXPORTING
check_on_commit = ' '
IMPORTING
e_identification = gd_identification.
endif.
ENDFORM. " MESSAGES_SHOW
Hope it would solve the purpose..
Kindly rewards the points...
06-15-2006 8:05 AM
Hey man ... I am usind IDOC to post GR. I am using the FM - IDOC_INPUT_MBGMCR to post the gr.
so i need to raise/handle an exception with in BAPI_GOODSMVT_CREATE or IDOC_INPut_mbgmcr.
thanks
bala