2006 Dec 22 8:29 AM
How can I use CALL FUNCTION 'Z_CHECK_EXIT' for checking two conditions :
1) The enhancement is to be triggered while creation(va01)/change(va02) of sales orders for Africa fleet card sales only.So check whether va01 or va02.
2) Check whether the sales order type is one from ZSDS,ZSDR,ZSCD and ZSCR.
How can I use CALL FUNCTION 'Z_CHECK_EXIT' for checking two conditions :
1) The enhancement is to be triggered while creation(va01)/change(va02) of sales orders for Africa fleet card sales only.So check whether va01 or va02.
2) Check whether the sales order type is one from ZSDS,ZSDR,ZSCD and ZSCR.
2006 Dec 22 8:30 AM
Hi,
This is a custom FM. Please send me the sourse code with documentation.
2006 Dec 22 9:11 AM
<b>source code for the function module:</b>
FUNCTION Z_CHECK_EXIT.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(USEREXIT) TYPE CHAR10
*" REFERENCE(CK1) TYPE CHAR10
*" REFERENCE(CK2) TYPE CHAR10 OPTIONAL
*" REFERENCE(CK3) TYPE CHAR10 OPTIONAL
*" REFERENCE(CK4) TYPE CHAR10 OPTIONAL
*" REFERENCE(CK5) TYPE CHAR10 OPTIONAL
*" EXPORTING
*" REFERENCE(EXECUTE) TYPE CHAR1
*" TABLES
*" I_ZA01 STRUCTURE ZA01
*"----------------------------------------------------------------------
* Initialize:
CLEAR: EXECUTE.
REFRESH: I_ZA01.
CLEAR: ZA01, I_ZA01.
* Null userexit value results in non-execution of user exit.
IF NOT USEREXIT IS INITIAL.
* start of performance enhancement (BRBU 6/20/02)
describe table xza01 lines i_lines.
if I_lines = 0.
select * from za01 into table xza01.
endif.
read table xza01 with key ZZUSEREXIT = USEREXIT
CK1 = CK1
CK2 = CK2
CK3 = CK3
CK4 = CK4
CK5 = CK5.
* SELECT SINGLE * FROM ZA01 WHERE ZZUSEREXIT = USEREXIT AND
* CK1 = CK1 AND
* CK2 = CK2 AND
* CK3 = CK3 AND
* CK4 = CK4 AND
* CK5 = CK5.
* end of performance enhancement (BRBU 6/20/02)
IF SY-SUBRC EQ 0.
* Determine if execution restricted to a single userid
IF xzA01-UNAME IS INITIAL OR xZA01-UNAME = SYST-UNAME.
EXECUTE = 'X'.
I_ZA01 = xZA01.
APPEND I_ZA01.
ENDIF.
ENDIF.
ENDIF.
ENDFUNCTION.
<b>and This is the way it is called in the program:</b>
CALL FUNCTION 'Z_CHECK_EXIT'
EXPORTING
USEREXIT = 'EFNDTAXWAR'
CK1 = ' '
CK2 =
CK3 =
CK4 =
CK5 =
IMPORTING
EXECUTE = EXECUTE
TABLES
I_ZA01 = I_ZA01 .
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |