Application Development 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: 

User-Exit for KO04(order manager)

Former Member
0 Kudos

Hi Gurus!

I have created a user-exit to check validation for internal orders that checks to see that the material number and serial number exist for a particular internal order type and it works fine . I had to include another order type for the same and I did it works fine, when I go through the transation KO02. Now they want this validation to take place through tarnsaction KO04 too . I looked into the exits , but unable to decide which one to use. Can anyone please advice which user-exit to use for the validation of internaal orders through transaction KO04.

EXIT_SAPLKAUF_001 -


include zxaufu03. or

EXIT_SAPLKOAU_002 -


include zxaufu08 or

EXIT_SAPLRKIO_001 -


include zxaufu01. or

EXIT_SAPLRKIO_002 -


include zxaufu02.

or is it that I have to use simply soem other exit . Please advice . Kind help will be greatly apprecaited.

Thanks

1 ACCEPTED SOLUTION

abhishek_shukla3
Explorer
0 Kudos

Try using BADI "CO_SRULE_CDOC", this is called when you save an order in KO04

9 REPLIES 9

abhishek_shukla3
Explorer
0 Kudos

Try using BADI "CO_SRULE_CDOC", this is called when you save an order in KO04

0 Kudos

So I cannot use an exit here , and I have to use BADI , is that right?

Thanks

0 Kudos

I tried finding exit but couldn't find..... this badi should work

0 Kudos

Hi Abhisheik!

Can you please tell me how to implement this BADI , I am not sure of it , if you can please help me out would be highly appreciated.

Thanks

Aarav

0 Kudos

I checked by debugging that in both the transaction ko02 and ko04 both of them goes through the exit that I have used. i.e

EXIT_SAPLRKIO_001---include zxaufu01. SO its going through that but its not checking the exit in case of KO04 I believe. Please help me out to locate the problem , I have my block of code that I ahve used in it please advice.

data: l_matnr type matnr,
      l_sernr type gernr.



check syst-dynnr = '0600'.
check i_actvt = '02'        "change
    or i_actvt = '32'.      "save
if ( i_aufk-auart = 'CENT' ) or ( i_aufk-auart = 'EXCV' ).



if i_aufk-aufex is initial.
    syst-msgid = 'Z001'.
    syst-msgno = '999'.
    syst-msgty = 'E'.
    syst-msgv1 = 'Enter the External order Number'.
    raise e_message.
endif.

l_matnr = i_aufk-aufex(5).
l_sernr = i_aufk-aufex+6(14).


call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = l_matnr
 importing
   output         = l_matnr.



call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = l_sernr
 importing
   output         = l_sernr.


select count(*) from equi where
    matnr = l_matnr and
    sernr = l_sernr.

if sy-dbcnt = 0.
    syst-msgid = 'Z001'.
    syst-msgno = '999'.
    syst-msgv1 = 'External order Number is Invalid'.
    syst-msgty = 'E'.
    raise e_message.

endif.
endif.

.

Thanks

0 Kudos

Ok so I thgink this may be the problem , the screen number , the screen number for KO02 is 600 which wont be the same for KO04 , but from where will I get the screen number for ko04 transaction , if possible do let me know .

Thanks

0 Kudos

For KO04 it is 660 . to check the screen no. at any time in the menu bar System -> status.

0 Kudos

Thanks all of you for your kind help I was able to get through with teh same exit with few changes in it by adding the screen nuber for the transaction KO04.

Thanks

Aarav

Former Member
0 Kudos

.