‎2012 Jun 02 5:56 PM
I get following dump while execution zfunction module z_ushrm_kronos_accrual_overrid
. The message says the table zglhrmm_trans_v doesn't exist in the database whereas when I check in se11 and se16 , the table does exist with meaningful content.*************************
piece of code in FM throwing error is:
EXEC SQL.
SELECT *
INTO :zglhrmm_trans_v
FROM zglhrmm_trans_v
WHERE trans_num = :trans_num
AND UPPER(in_val_01) = :zinVAL01
Help would be appreciated..
********************************
Dump:
Runtime Errors DBIF_DSQL2_SQL_ERROR
Except. CX_SY_NATIVE_SQL_ERROR
Date and Time 02.06.2012 16:47:09
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|Short text |
| An SQL error occurred when executing Native SQL. |
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|What happened? |
| The error 102 occurred in the current database connection "DEFAULT". |
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|Missing RAISING Clause in Interface |
| Program SAPLZGLHRM_TRANS |
| Include LZGLHRM_TRANSU43 |
| Row 1 |
| Module type (FUNCTION) |
| Module Name Z_USHRM_KRONOS_ACCRUAL_OVERRID |
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|Trigger Location of Exception |
| Program SAPLZGLHRM_TRANS |
| Include LZGLHRM_TRANSU43 |
| Row 33 |
| Module type (FUNCTION) |
| Module Name Z_USHRM_KRONOS_ACCRUAL_OVERRID |
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|Source Code Extract |
----------------------------------------------------------------------------------------------------
|Line |SourceCde |
----------------------------------------------------------------------------------------------------
| 3|*"*"Local Interface: |
| 4|*" IMPORTING |
| 5|*" REFERENCE(JOBNAME) TYPE BTCJOB OPTIONAL |
| 6|*" REFERENCE(TRANS_NUM) TYPE ZTRANS_NUM OPTIONAL |
| 7|*" REFERENCE(GROUP_NUM) TYPE ZGROUP_NUM OPTIONAL |
| 8|*" CHANGING |
| 9|*" REFERENCE(EMP_DEMO) TYPE ZGL_HRM_S_EMPLOYEE_DEMO_INFO OPTIONAL |
| 10|*" REFERENCE(DEPENDENT) TYPE ZGL_HRM_S_DEPENDENT_INFO OPTIONAL |
| 11|*" REFERENCE(BEN_PLAN) TYPE ZGL_HRM_S_PLAN_RECORD OPTIONAL |
| 12|*" REFERENCE(PAY_DEDUCT) TYPE ZGL_HRM_S_PAYROLL_DEDUCT OPTIONAL |
| 13|*" EXCEPTIONS |
| 14|*" CONVERSION_ERROR |
| 15|*" SPECIAL_CONVERSION |
| 16|*"---------------------------------------------------------------------- |
| 17| |
| 18|*Override Accrual Profile |
| 19|*HDEK907991 |
| 20| data: zrehiredt(8) type c value '20101231'. "rehire of 12/31/2010 |
| 21| data: zinVAL01(40) type c . "rehire of 12/31/2010 |
| 22| |
| 23|* clear EMP_DEMO-ZTRANSVAL02. |
| 24| if EMP_DEMO-dat05 > zrehiredt. |
| 25| else. |
| 26| zinVAL01 = EMP_DEMO-ZTRANSVAL02. |
| 27| translate zinVAL01 TO UPPER CASE. |
| 28|* select single * from zglhrmm_trans_v |
| 29|* where trans_num eq trans_num and |
| 30|* ( in_VAL_01 eq zinVAL01 or |
| 31|* in_VAL_01 eq EMP_DEMO-ZTRANSVAL02 ). |
| 32| EXEC SQL. |
|>>>>>| SELECT * |
| 34| INTO :zglhrmm_trans_v |
| 35| FROM zglhrmm_trans_v |
| 36| WHERE trans_num = :trans_num |
| 37| AND UPPER(in_val_01) = :zinVAL01. |
| 38| ENDEXEC. |
| 39| if sy-subrc eq 0. |
| 40|*out_val_01 into EMP_DEMO-ZTRANSVAL02 |
| 41| if not EMP_DEMO-dat02 is initial. "Adj Serv Dt is blank |
| 42| if EMP_DEMO-dat02 < zglhrmm_trans_v-in_val_02. "Adj Serv Dt < Val in table |
| 43| EMP_DEMO-ZTRANSVAL02 = zglhrmm_trans_v-out_val_01. |
| 44| endif. |
| 45| else. "Adj Serv Dt is blank use Orig Hire|
| 46| if not EMP_DEMO-dat01 is initial. "If Orig Hire date is not initial check for ove|
| 47| if EMP_DEMO-dat01 < zglhrmm_trans_v-in_val_02. "Orig Hire Dt < Val in table |
| 48| EMP_DEMO-ZTRANSVAL02 = zglhrmm_trans_v-out_val_01. |
| 49| endif. |
| 50| endif. |
| 51| endif. |
| 52| endif. |
----------------------------------------------------------------------------------------------------
ENDEXEC.
*****************************
‎2012 Jun 03 8:01 AM
Hi
First of all, what is the necessity to write Native SQL when you are managing the table using SE11 or SE16.
Anyways, ...
The Error is due to following situation.
Check the T-Code DBCON and verify the connection is perfect and test it whether you are able to connect successfully.
The Dump error clearly menthon that the connection to your database is not successfull.
Since connection thpe is Default, check what is your database, connection type, userid and password etc...
check with your db admin or basis inorder to get the connection detail.
Plase aware if it is useful
Regards,
Venkat