on 08-01-2013 7:43 AM
I am creating a candidate registration form .
When i a loading the registration view i have called the auto generated id function which i have created.
But while i execute i get this error.
METHOD wddoinit .
DATA: count TYPE i VALUE 0,
wa_candidate TYPE zcanditate,
value TYPE char2 VALUE 'CN'.
CLEAR : wa_candidate.
" break-point.
wa_candidate-zdate = sy-datum.
CALL FUNCTION 'ZGET_NEXT_NUMBER'
EXPORTING
iv_object = value
IMPORTING
es_studentid = wa_candidate
EXCEPTIONS
nonumber = 1
notfound = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* SELECT COUNT(*) FROM zcanditate INTO count.
*
* count = count + 1.
* wa_candidate-candidate_id = count.
ENDMETHOD.
and the function that i have created is .
FUNCTION ZGET_NEXT_NUMBER.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_OBJECT) TYPE CHAR2
*" EXPORTING
*" REFERENCE(ES_STUDENTID) TYPE ZSTUDENT_ID
*" EXCEPTIONS
*" NONUMBER
*" NOTFOUND
*"----------------------------------------------------------------------
DATA: wa_zcadidate TYPE zcanditate.
IF sy-subrc EQ 0.
.
IF wa_zcadidate-candidate_id IS INITIAL.
wa_zcadidate-candidate_id = wa_zcadidate-from_number. ENDIF.
es_studentid = wa_zcadidate-candidate_id + 1. CONDENSE es_studentid.
wa_zcadidate-candidate_id = es_studentid.
IF wa_zcadidate-candidate_id LE wa_zcadidate-to_number.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING
input = wa_zcadidate-candidate_id
IMPORTING
output = wa_zcadidate-candidate_id. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = es_studentid
IMPORTING
output = es_studentid.
UPDATE zcanditate FROM wa_zcadidate. ELSE.
RAISE nonumber.
ENDIF. ELSE.
RAISE notfound. ENDIF.
CALL FUNCTION 'DB_COMMIT'.
ENDFUNCTION.
I dont understand this error as i am new to this enviornment.
Hello Disha,
There are many standard function modules which will auto generate numbers.I think in your case you no need to go for custom function module.
Check this FM : PRGN_GET_NEXT_NUMBER_NEW
Otherwise,refer the following link.It will help you.
http://saptechnical.com/Tutorials/ABAP/SNRO/SNRO.htm
Thanks
Katrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Your FM..
FUNCTION ZGET_NEXT_NUMBER.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_OBJECT) TYPE CHAR2
*" EXPORTING
*" REFERENCE(ES_STUDENTID) TYPE ZSTUDENT_ID
*"----------------------------------------------------------------------
Calling Of FM
CALL FUNCTION 'ZGET_NEXT_NUMBER'
EXPORTING
iv_object = value
IMPORTING
es_studentid = wa_candidate
this
wa_candidate TYPE zcanditate,
Error is... U are having exporting type in FM ZSTUDENT_ID and Storing that data in wa_candidate which is TYPE zcanditate.
Got na?
BR
Chandra...
i am not getting one thing when somebody already replied the useful ans then why all people are posting the same ans no. of time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Disha,
In Function Module, under importing parameter ES_STUDENTID is of type ZSTUDENT_ID. Whereas the parameter which you are passing to importing parameter wa_candidate is of type zcanditate.
Change the wa_candidate of type to ZSTUDENT_ID. And try to pass the value...
Hope it help to solve the issue.
Thanks,
Arun Nagaraju.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.