2007 Mar 07 11:37 AM
hi,
i got this in the previous post.
1) i need to define not_found in exception tab in 'string_split' function module right?
2) what is the type for not_found?
3) why not_found can equal to 7? how do we know 7 is not success?
4) why not_found value can same as sy-subrc?
5) may i know the difference for FM raise exception and bapi bapiret2.
thanks
FUNCTION-POOL CSTR.
FUNCTION STRING_SPLIT.
...
IF STRING NA DELIMITER.
RAISE NOT_FOUND.
ENDIF.
...
ENDFUNCTION.
The calling program could then include the following code:
PROGRAM EXAMPLE.
...
CALL FUNCTION 'STRING_SPLIT'
...
EXCEPTIONS
NOT_FOUND = 7.
IF SY-SUBRC = 7.
WRITE / 'There is a problem.'.
ELSE.
...
ENDIF.
hi,
i got this in the previous post.
1) i need to define not_found in exception tab in 'string_split' function module right?
2) what is the type for not_found?
3) why not_found can equal to 7? how do we know 7 is not success?
4) why not_found value can same as sy-subrc?
5) may i know the difference for FM raise exception and bapi bapiret2.
thanks
FUNCTION-POOL CSTR.
FUNCTION STRING_SPLIT.
...
IF STRING NA DELIMITER.
RAISE NOT_FOUND.
ENDIF.
...
ENDFUNCTION.
The calling program could then include the following code:
PROGRAM EXAMPLE.
...
CALL FUNCTION 'STRING_SPLIT'
...
EXCEPTIONS
NOT_FOUND = 7.
IF SY-SUBRC = 7.
WRITE / 'There is a problem.'.
ELSE.
...
ENDIF.
2007 Mar 07 11:46 AM
1) i need to define not_found in exception tab in 'string_split' function module right?
The exception NOT_FOUND is already there, why do you want to define another?
Even if you want to include another exception, you cannot simple define in the same function module. You have to copy the fm into a Z function module and then do wahtever you want to do.
2) what is the type for not_found?
No need for TYPE. the exceptions tab doesnt have any type.
3) why not_found can equal to 7? how do we know 7 is not success?
In general the order in which the exceptions are definned determines the subrc value they represent.
example
NOT_FOUND 1
NOT_VALID 2
TOO_LONG 3
TOO_SMALL 4
4) why not_found value can same as sy-subrc?
????
sy-subrc is a system field which would have the value of the exception that is raised
5) may i know the difference for FM raise exception and bapi bapiret2.
bapiret2 is a structure like any other structures that we see in the se11.
a filling the values in the bapiret2 structure wouldn't set the sy-subrc value to non zero.
thanks
Regards,
Ravi
2007 Mar 07 11:48 AM
1) i need to define not_found in exception tab in 'string_split' function module right?
The exception NOT_FOUND is already there, why do you want to define another?
Even if you want to include another exception, you cannot simple define in the same function module. You have to copy the fm into a Z function module and then do wahtever you want to do.
2) what is the type for not_found?
No need for TYPE. the exceptions tab doesnt have any type.
3) why not_found can equal to 7? how do we know 7 is not success?
In general the order in which the exceptions are definned determines the subrc value they represent.
example
NOT_FOUND 1
NOT_VALID 2
TOO_LONG 3
TOO_SMALL 4
4) why not_found value can same as sy-subrc?
????
sy-subrc is a system field which would have the value of the exception that is raised
5) may i know the difference for FM raise exception and bapi bapiret2.
bapiret2 is a structure like any other structures that we see in the se11.
a filling the values in the bapiret2 structure wouldn't set the sy-subrc value to non zero.
thanks
Regards,
Ravi
2007 Mar 07 12:11 PM
hi
need to clarify a bit.
1) these are the standard exception? the return value is fixed? they return value in sy-subrc for 1 = not_found, 2 for not valid and so on?
NOT_FOUND 1
NOT_VALID 2
TOO_LONG 3
TOO_SMALL 4
2)why in my example is 7?
3)can i say for bapi, the message in return table and sy-subrc will always 0. but for other FM exception, sy-subrc will not be 0 if having exception. correct?
thanks again and will reward
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |