Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CALL FUNCTION 'Z_CHECK_EXIT'

Former Member
0 Likes
553

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.

2 REPLIES 2
Read only

surya_gupta3
Explorer
0 Likes
498

Hi,

This is a custom FM. Please send me the sourse code with documentation.

Read only

0 Likes
498

<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 .