‎2009 Sep 22 10:02 PM
I did coding for tcode "COR6N" in badi : WORKORDER_GOODSMVT~IM_CALLED. like below
Select stmt.....
IF sy-subrc = 0.
MESSAGE 'Please enter Valid Batch' TYPE 'E'.
ENDIF.
while testing the tcode,
when I enter Process order in COR6N tcode and go to goods movement screen... then come back to original screen using "EXIT" button ...and tried to save then my above error getting displayed. as 'Please enter Valid'.
However after getting error, when we hit "ENTER" button, it is dumping.
Below is the dump analysis.
Error analysis
A RAISE statement in the program "SAPLCORB" raised the exception
condition "DUPREC".
Since the exception was not intercepted by a superior
program, processing was terminated.
Short description of exception condition:
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"RAISE_EXCEPTION" " "
"SAPLCORB" or "LCORBU08"
"CO_RU_DI_AFRU_INSERT"
or
"SAPLCORB" "DUPREC"
or
....
COULD YOU PLEASE SUGGEST ME HOW TO AVOID DUMP ?
THANKS IN ADVANCE.
YOUR HELP IS HIGHLY APPRECIATED.
‎2009 Sep 22 11:41 PM
Got solution :
DATA: l_tcvariant TYPE shdtvciu-tcvariant,
l_xclientind TYPE c,
l_rc LIKE sy-subrc.
IF sy-subrc = 0.
MESSAGE 'Please enter Valid Batch' TYPE 'I'.
IF sy-calld IS INITIAL.
CALL FUNCTION 'RS_HDSYS_GET_TC_VARIANT'
IMPORTING
tcvariant = l_tcvariant
flag_client_independent = l_xclientind
rc = l_rc.
IF l_rc > 2.
LEAVE TO TRANSACTION sy-tcode.
ELSE.
CALL FUNCTION 'RS_HDSYS_CALL_TC_VARIANT'
EXPORTING
tcode = sy-tcode
variant = l_tcvariant
i_flag_client_independent = l_xclientind
call_mode = space.
ENDIF.
ELSE.
*
LEAVE.
ENDIF.