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: 

Precondition Violated while calling FM

Former Member
0 Kudos

Hi Expetrs ,

I am working on HR module . i created one FM to upload data into the HR infotypes . In my methods from WDA i called this FM . But i am getting the error . i am givng the error discription . It is very urjent for me .

The following error text was processed in the system DE1 : Precondition Violated

The error occurred on the application server sapde1ci_DE1_10 and in the work process 0 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: SET_CONTEXT of program CL_HRPA_INFOTYPE_FACTORY======CP

Form: INITIALIZE_PS_ADAPTER of program SAPFP50P

LOAD-OF-PROGRAM of program SAPFP50P

Form: DO_NOTHING of program SAPFP50P

LOAD-OF-PROGRAM of program SAPLZXR_ERM_UPDATE

Function: ZXR_SEARCH_HRDATA of program SAPLZXR_ERM_UPDATE

Method: ONACTIONSEARCH of program /1BCWDY/B5XW9J5A54KGWT0P5TFJ==CP

Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/B5XW9J5A54KGWT0P5TFJ==CP

Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP

Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP

Thanks in Advance

setu

14 REPLIES 14

Former Member
0 Kudos

Hi Sethu,

The Function Module which you created is RFC or not.If it is not RFC then you will get the error.

Make Functuion Module type as RFC your problem will be solved

0 Kudos

Thanx for your reply ,

But i am using RFC only ...

can you suggest any other solution for this .

thanks in advance

setu

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't see how this is a Web Dynpro ABAP question. You are getting a short dump in the business logic of your application. This is just normal ABAP. Please look at ST22 and see the details of the short dump to determine the cause of the problem in your application logic.

0 Kudos

Thanks for your reply Thomas ,

but if i call from normal ABAP programme i am not getting this error , in WDA only i am getting this error ..can you sugest me any soultion for this ..

thanks , setu

0 Kudos

>can you sugest me any soultion for this ..

Only if you can provide more details from the short dump on the actual cause. Right now just know that a short dump occurred isn't enough information. Assuming that your inputs are exactly the same when you call this from a non-Web Dynpro application, then the most likly cause would be that this application does a call screen, dialog popup or some other activity that is not allowed when running dark. However without the details of the short dump, all I can do is make guesses.

0 Kudos

The same FM , if i call in differnt WDA , it is working fine . but in other WDA it is giving precondition violated error .

any body come across this error ....

0 Kudos

Why not got to ST22 as I suggested and provide the details of the short dump? Otherwise everyone can only guess at best as to what is going on. Provide some actual facts.

Just because the same call works in another application seems inmaterial. There is much branching logic in any application that could lead to different outcomes/errors.

0 Kudos

FYI..

Runtime Errors UNCAUGHT_EXCEPTION

Exception CX_HRPA_VIOLATED_PRECONDITION

Date and Time 07.10.2008 11:57:17

-


-


Short text

An exception occurred that was not caught.

-


-


What happened?

The exception 'CX_HRPA_VIOLATED_PRECONDITION' was raised, but it was not caught

anywhere along

the call hierarchy.

Since exceptions represent error situations and this error was not

adequately responded to, the running ABAP program

'CL_HRPA_INFOTYPE_FACTORY======CP' has to be

terminated.

-


-


What can you do?

Note down which actions and inputs caused the error.

To process the problem further, contact you SAP system

administrator.

Using Transaction ST22 for ABAP Dump Analysis, you can look

at and manage termination messages, and you can also

keep them for a long time.

-


-


Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_HRPA_VIOLATED_PRECONDITION', was

not caught in

procedure "INITIALIZE_PS_ADAPTER" "(FORM)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

Precondition Violated

-


-


How to correct the error

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"UNCAUGHT_EXCEPTION" "CX_HRPA_VIOLATED_PRECONDITION"

"CL_HRPA_INFOTYPE_FACTORY======CP" or "CL_HRPA_INFOTYPE_FACTORY======CM007"

"SET_CONTEXT"

If you cannot solve the problem yourself and want to send an error

notification to SAP, include the following information:

1. The description of the current problem (short dump)

To save the description, choose "System->List->Save->Local File

(Unconverted)".

2. Corresponding system log

Display the system log by calling transaction SM21.

Restrict the time interval to 10 minutes before and five minutes

after the short dump. Then choose "System->List->Save->Local File

(Unconverted)".

3. If the problem occurs in a problem of your own or a modified SAP

program: The source code of the program

In the editor, choose "Utilities->More

Utilities->Upload/Download->Download".

4. Details about the conditions under which the error occurred or which

actions and input led to the error.

The exception must either be prevented, caught within proedure

"INITIALIZE_PS_ADAPTER" "(FORM)", or its possible occurrence must be declared

in the

RAISING clause of the procedure.

To prevent the exception, note the following:

-


-


System environment

SAP-Release 700

Application server... "sapde1ci"

Network address...... "10.10.60.82"

Operating system..... "SunOS"

Release.............. "5.10"

Hardware type........ "sun4u"

Character length.... 16 Bits

Pointer length....... 64 Bits

Work process number.. 1

Shortdump setting.... "full"

Database server... "chr7ca29"

Database type..... "ORACLE"

Database name..... "DE1"

Database user ID.. "SAPSR3"

Char.set.... "C"

SAP kernel....... 700

created (date)... "May 5 2008 21:37:50"

create on........ "SunOS 5.9 Generic_117171-13 sun4u"

Database version. "OCI_102 (10.2.0.2.0) "

Patch level. 159

Patch text.. " "

Database............. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE 10.2.0.."

SAP database version. 700

Operating system..... "SunOS 5.9, SunOS 5.10"

Memory consumption

Roll.... 16192

EM...... 10463480

Heap.... 0

Page.... 16384

MM Used. 8852400

MM Free. 1607680

-


-


User and Transaction

Client.............. 540

User................ "S13CGQ"

Language Key........ "E"

Transaction......... " "

Transactions ID..... "48EB35F12E4C6077E10000000A0A3C52"

Program............. "CL_HRPA_INFOTYPE_FACTORY======CP"

Screen.............. "SAPMHTTP 0010"

Screen Line......... 2

Information on Caller ofr "HTTP" Connection:

Plug-in Type.......... "HTTP"

Caller IP............. "10.160.248.65"

Caller Port........... 8010

Universal Resource Id. "/sap/bc/webdynpro/sap/zwd_gam_erm/"

-


-


Information on where terminated

Termination occurred in the ABAP program "CL_HRPA_INFOTYPE_FACTORY======CP" -

in "SET_CONTEXT".

The main program was "SAPMHTTP ".

In the source code you have the termination point in line 16

of the (Include) program "CL_HRPA_INFOTYPE_FACTORY======CM007".

The termination is caused because exception "CX_HRPA_VIOLATED_PRECONDITION"

occurred in

procedure "INITIALIZE_PS_ADAPTER" "(FORM)", but it was neither handled locally

nor declared

in the RAISING clause of its signature.

The procedure is in program "SAPFP50P "; its source code begins in line

550 of the (Include program "FP50PE11 ".

-


-


Source Code Extract

-


Line

SourceCde

-


1

METHOD set_context.

2

3

IF a_context IS INITIAL.

4

CASE context.

5

WHEN context_default OR

6

context_legacy.

7

a_context = context.

8

9

WHEN OTHERS.

10

RAISE EXCEPTION TYPE cx_hrpa_invalid_parameter

11

EXPORTING

12

parameter = 'CONTEXT'.

13

ENDCASE.

14

ELSE.

15

  • context must never be set twice

>>>>>

RAISE EXCEPTION TYPE cx_hrpa_violated_precondition.

17

ENDIF.

18

ENDMETHOD.

-


-


Contents of system fields

-


Name

Val.

-


SY-SUBRC

0

SY-INDEX

6

SY-TABIX

1

SY-DBCNT

1

SY-FDPOS

45

SY-LSIND

0

SY-PAGNO

0

SY-LINNO

1

SY-COLNO

1

SY-PFKEY

SY-UCOMM

SY-TITLE

HTTP Control

SY-MSGTY

I

SY-MSGID

PG

SY-MSGNO

136

SY-MSGV1

99

SY-MSGV2

SY-MSGV3

SY-MSGV4

SY-MODNO

0

SY-DATUM

20081007

SY-UZEIT

115717

SY-XPROG

SY-XFORM

-


-


Active Calls/Events

-


No. Ty. Program Include Line

Name

-


20 METHOD CL_HRPA_INFOTYPE_FACTORY======CP CL_HRPA_INFOTYPE_FACTORY======CM007 16

CL_HRPA_INFOTYPE_FACTORY=>SET_CONTEXT

19 FORM SAPFP50P FP50PE11 557

INITIALIZE_PS_ADAPTER

18 EVENT SAPFP50P FP50PTOP 466

LOAD-OF-PROGRAM

17 FORM SAPFP50P FP50PE11 599

DO_NOTHING

16 EVENT SAPLZXR_ERM_UPDATE SAPLZXR_ERM_UPDATE 15

LOAD-OF-PROGRAM

15 FUNCTION SAPLZXR_ERM_UPDATE LZXR_ERM_UPDATEU01 9

ZXR_HR_EXTUPDATE

14 METHOD /1BCWDY/B71XO7K1KYOJ9R4HEYAM==CP /1BCWDY/B_B6WE8MX68KFCQBGDGVAS 4424

CL_ZWD_V1_GAM_CTR=>ONACTIONSAVE_RETURN

Web Dynpro Component ZWD_GAM_ERM

Web Dynpro Controller ZWD_V1_GAM

13 METHOD /1BCWDY/B71XO7K1KYOJ9R4HEYAM==CP /1BCWDY/B_B6WE8MX68KFCQBGDGVAS 367

CLF_ZWD_V1_GAM_CTR=>IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER

Web Dynpro Component ZWD_GAM_ERM

Web Dynpro Controller ZWD_V1_GAM

12 METHOD CL_WDR_DELEGATING_VIEW========CP CL_WDR_DELEGATING_VIEW========CM005 3

CL_WDR_DELEGATING_VIEW=>INVOKE_EVENTHANDLER

11 METHOD CL_WDR_ACTION=================CP CL_WDR_ACTION=================CM00A 38

CL_WDR_ACTION=>IF_WDR_ACTION~FIRE

10 METHOD CL_WDR_WINDOW_PHASE_MODEL=====CP CL_WDR_WINDOW_PHASE_MODEL=====CM009 62

CL_WDR_WINDOW_PHASE_MODEL=>DO_HANDLE_ACTION_EVENT

9 METHOD CL_WDR_WINDOW_PHASE_MODEL=====CP CL_WDR_WINDOW_PHASE_MODEL=====CM002 62

CL_WDR_WINDOW_PHASE_MODEL=>PROCESS_REQUEST

8 METHOD CL_WDR_WINDOW=================CP CL_WDR_WINDOW=================CM00V 11

CL_WDR_WINDOW=>PROCESS_REQUEST

7 METHOD CL_WDR_MAIN_TASK==============CP CL_WDR_MAIN_TASK==============CM00I 76

CL_WDR_MAIN_TASK=>EXECUTE

6 METHOD CL_WDR_MAIN_TASK==============CP CL_WDR_MAIN_TASK==============CM00U 6

CL_WDR_MAIN_TASK=>IF_WDR_RUNTIME~EXECUTE

5 METHOD CL_WDR_CLIENT_ABSTRACT_HTTP===CP CL_WDR_CLIENT_ABSTRACT_HTTP===CM01A 105

CL_WDR_CLIENT_ABSTRACT_HTTP=>HANDLE_REQUEST

4 METHOD CL_WDR_MAIN_TASK==============CP CL_WDR_MAIN_TASK==============CM00J 69

CL_WDR_MAIN_TASK=>IF_HTTP_EXTENSION~HANDLE_REQUEST

3 METHOD CL_HTTP_SERVER================CP CL_HTTP_SERVER================CM017 365

CL_HTTP_SERVER=>EXECUTE_REQUEST_FROM_MEMORY

2 FUNCTION SAPLHTTP_RUNTIME LHTTP_RUNTIMEU02 960

HTTP_DISPATCH_REQUEST

1 MODULE (PBO) SAPMHTTP SAPMHTTP 13

%_HTTP_START

-


0 Kudos

I go back to my original opinion that this is an application logic error. It is an application exception that is being triggered:

15 * context must never be set twice

>>>>> RAISE EXCEPTION TYPE cx_hrpa_violated_precondition.

You have a comment line just above the raise exception that might help. However given the evidence here, this would appear to be an issue with the way you are calling the class CL_HRPA_INFOTYPE_FACTORY and/or the data being passed to it. I don't see anything related to Web Dynpro ABAP.

0 Kudos

Hi Thomas ,

i checked in the debbgging one constructor of the class is not getting called when i called this FM from WDA .i dont know why it is not getting called can any body help on this .

setu

0 Kudos

I compared the two callings in debbugging mode ;

CREATE DATA invalid_parameter_ref.: = this statement is not creating any object in calling where i am getting dump .

so can you help on this ..

0 Kudos

Hello ,

Can share solution for this issue.

Regards

Mallikarjuna P

0 Kudos

Hi Thomas,

The strange thing is this error came up for me only when I called hr_infotype_operation from WDA assistant class.When I call it from a report it does not dump.The infotype I tried to update was 0000 and 0001.We are on ECC 6.0 Enph 5.

Regards,

Chamu

0 Kudos

Hi Karan,

The same thing happend with me, when i created one FM to convert internal Table data to PDF. i was using adobe form to convert table data to pdf. converted data need to send via Mail. when i was using one Customer Exit to taking data into table and passing table to my FM. got exeption USAGE_ERROR = 2.

     Then i used submit statement to call report program that call's my FM in Customer Exit, this is working Ok.

Can u Tell me, is it Bugg or something else ???

Thanks,

Amit Gupta