cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when processing an action

Former Member
0 Kudos

Dear developers,

actually i have the problem to change the status of an crm-order by a customer programm, so i can't use the customizing in spro (action profile and actions).

For processing an action i use the function modules CRM_ACTION_GET_TOOLBAR_IL to get the toolbar actions and the function module CRM_ACTION_PROCESS_IL to process the action.

Agter prcessing the action i get the following error in the method CL_METHODCALL_PPF~SET_SAVE_LOG

"UNCAUGHT_EXCEPTION" "CX_OS_OBJECT_NOT_FOUND"

"CL_TRIGGER_PPF================CP" bzw.

"CL_TRIGGER_PPF================CM001"

"IF_OS_STATE~HANDLE_EXCEPTION"

Here's the source code of my program:

Data: LT_ACTION_OBJ type CRMT_ACTION_OBJ_TAB.

Data: L_ACTION_obj like line of lt_action_obj.

Data: LT_ACTION_FLD type CRMT_ACTION_TABLE_TAB.

Data: L_ACTION_FLD like line of lt_action_fld.

CALL FUNCTION 'CRM_ACTION_GET_TOOLBAR_IL'

EXPORTING

IV_REF_GUID = '4664EDDFEE3A5EFDE1000000C0A8674D'

IV_REF_KIND = 'A'

  • IV_ONLY_SPEC_OBJECT = FALSE

IMPORTING

ET_ACTION_OBJ = LT_ACTION_OBJ

ET_ACTION_FLD = LT_ACTION_FLD

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 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.

Data: IT_ACTION_OBJ type PPFTACTV.

Data: l_action_obj_ref like line of l_action_obj-action_ref.

Read table lt_action_obj index 1 into l_action_obj.

Read table l_action_obj-action_ref index 1 into l_action_obj_ref.

append l_action_obj_ref to IT_ACTION_OBJ.

CALL FUNCTION 'CRM_ACTION_REFRESH_IL'.

CALL FUNCTION 'CRM_ACTION_PROCESS_IL'

EXPORTING

IT_ACTION_OBJ = IT_ACTION_OBJ

IV_ACTIVATE = 'X'

IV_EXECUTE = ''

IV_DELETE = ''

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 2

OTHERS = 3.

CALL FUNCTION 'CRM_ACTION_PROCESS_IL'

EXPORTING

IT_ACTION_OBJ = IT_ACTION_OBJ

IV_ACTIVATE = ''

IV_EXECUTE = 'X'

IV_DELETE = ''

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 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.

Do you have an idea how to solve this problem?

Best regards,

Jens

Accepted Solutions (0)

Answers (8)

Answers (8)

dmitry_sharshatkin
Active Participant
0 Kudos

Hi Guys,

I had the same problem and it was coming from CB_METHODCALL_PPF=>MAP_LOAD_FROM_DATABASE_GUID, where there is a check over the table PPFTMETHRU.

    select single * from PPFTMETHRU into DB_ITEM_PPFTMETHRU
           where GUID = DB_GUID. 
*> * * error handling
if ( sy-subrc <> 0 ). class CX_OS_DB_SELECT definition load.
raise exception type CX_OS_DB_SELECT
exporting OID = DB_GUID TABLE = 'PPFTMETHRU' TEXTID = CX_OS_DB_SELECT=>BY_OID.
endif. "( Error )

Initially I though about data inconsistencies and check it via transaction SPPFP (SAP Note: 881266 - Catch exception CX_OS_OBJECT_NOT_FOUND when locking object) or using the report SPPF_CONSISTENCY_MISSING_CLASS. But all was fine.

Then I debugged the implementation of the PPF itself: IF_EX_EXEC_METHODCALL_PPF~EXECUTE and saw a call BAPI_TRANSACTION_ROLLBACK. :-)) And this was the root cause for my problem.

Hope this helps someone.

BR, Dima

former_member778536
Discoverer

Hello Dima,

May I know where can I find the IF_EX_EXEC_METHODCALL_PPF~EXECUTE? I am having the same problem where I am encountering "UNCAUGHT_EXCEPTION" "CX_OS_OBJECT_NOT_FOUND" in CL_METHODCALL_PPF~SET_SAVE_LOG. I believe it is also due to the commit work or rollback code.

Regards,

Roselle

dmitry_sharshatkin
Active Participant
0 Kudos

Hi Roselle,

You can find the implementation of IF_EX_EXEC_METHODCALL_PPF~EXECUTE following: Document Type -> Action Profile -> Action Definition -> Processing Types. It's described here: https://wiki.scn.sap.com/wiki/display/CRM/Method+call+in+action+with+BADI+EXEC_METHODCALL_PPF

Regards, Dima

Former Member
0 Kudos

Hi Jens,

did u solve the issue...even i am struck in same problem.please do needful

Former Member
0 Kudos

Hello world,

we have updated to Solman 7.1 SP5. Afterwards I had to find a solution for the same problem where I recieved a html-dump in German within the ITSM resp. WEB UI resp. CRM_UI


Business Server Page (BSP) Fehler

Was ist passiert?

Der Aufruf der BSP-Seite wurde aufgrund eines Fehlers abgebrochen.

Hinweis

Folgender Fehlertext wurde im System prozessiert:

Das referierte Objekt mit der OID "object id number" (Instanz-GUID) und "i guess the ticket id number" (Klassen-GUID) wurde nicht gefunden.

Exception-Klasse CX_OS_OBJECT_NOT_FOUND

Fehlername

Programm CL_TRIGGER_PPF================CP

ABAP-Klasse CL_TRIGGER_PPF

Methode IF_OS_STATE~HANDLE_EXCEPTION

Zeile 32

Langtext -

Fehlerart: Exception

Ihr SAP Business Server Pages Team

The fantastic solution was a workaround and as simple as closing the spoiler of the action section (in German: Eingeplante Aktionen) instead of trying to observe the planned actions which led to the html-dump.

I completely removed the "planned action"-spoiler since our processors do not need it.

Kind regards

Former Member
0 Kudos

Hello,

i got a solution to trigger an PPF-action via a function module. Here is the source code:

##################

Data: EV_CONTEXT TYPE REF TO CL_DOC_CONTEXT_CRM_ORDER.

Data: ET_CONTEXT TYPE CRMT_ACTION_DOC_CONTEXT_T.

Data: CL_MANAGER_PPF type ref to CL_MANAGER_PPF.

Data: CL_CONTEXT_PPF type ref to CL_CONTEXT_PPF.

Data: CL_TRIGGER_PPF type ref to CL_TRIGGER_PPF.

Data: RP_STATUS type PPFDTSTAT.

*Context erzeugen (Aktionsprofil zum Beleg)

CALL FUNCTION 'CRM_ACTION_CONTEXT_CREATE'

EXPORTING

IV_HEADER_GUID = GUID

IV_OBJECT_GUID = GUID

  • IV_PPFDCNTXT =

  • IV_ITEM_TYPE =

  • IS_ORDERADM_I_WRK =

IMPORTING

EV_CONTEXT = EV_CONTEXT

ET_CONTEXT = ET_CONTEXT

EXCEPTIONS

NO_ACTIONPROFILE_FOR_PROC_TYPE = 1

NO_ACTIONPROFILE_FOR_ITEM_TYPE = 2

ORDER_READ_FAILED = 3

OTHERS = 4.

If sy-subrc NE 0 or EV_CONTEXT is initial.

raise NO_ACTIONPROFILE.

Endif.

  • Erzeugen eines Triggers

CL_CONTEXT_PPF ?= EV_CONTEXT.

CL_MANAGER_PPF = CL_MANAGER_PPF=>GET_INSTANCE( ).

CL_MANAGER_PPF->EXECUTION_MODE = 1.

CL_TRIGGER_PPF = CL_MANAGER_PPF->CREATE_TRIGGER( IP_MANUAL = 'X'

IP_TTYPE_NAME = ACTION

IO_CONTEXT = CL_CONTEXT_PPF ).

*Container lesen

call method CL_TRIGGER_PPF->IF_ACTION_PPF~GET_PROCESSING

IMPORTING

EI_PROCESSING = IF_MEDIUM_PPF.

*Aktion ausführen

call method CL_TRIGGER_PPF->IF_ACTION_PPF~EXECUTE

IMPORTING

RP_STATUS = RP_STATUS.

########################

In the SAP GUI the function module works fine :).

But when i implement this function module in a business server page there occurs the following problem.

When i start to process a ppf-action for the first time everything works fine. When i call a second ppf-action in the same session for the same order-guid there appears the following BSP error:

CX_OS_OBJECT_NOT_FOUND

Program: CL_METHODCALL_PPF

Method: IF_OS_STATE~HANDLE_EXCEPTION

When i process a second ppf-action with a different guid than the first processing everything works fine. I think there must be a problem with refreshing the GUID or something like this.

Does anybody have an idea how to solve the problem??

Best regards

Jens

Former Member
0 Kudos

Hi Jens,

Iam executing an action which will confirm the product from Contracts Screen(CRM_ORDER). The confirmation is also being done. But after the confirmation is done,the above exception is being triggered and dump is being achieved. Is there any way to avoid the above dump. This dump comes from SAP Standard code. Can you please help me out, Iam struggling with this for the past 1 week.

Regards

Hari

Former Member
0 Kudos

I think there is problem with interface IF_OS_STATE.

Do you know how to register an object service in this interface? This could be an solution.

Former Member
0 Kudos

Hello,

I did not use the BAPI_ACTIVITYCRM_CHANGEMULTI.

First of all i selected the actions from the toolbar of the crm order:

CALL FUNCTION 'CRM_ACTION_GET_TOOLBAR_IL'

EXPORTING

IV_REF_GUID = lv_guid_ref

IV_REF_KIND = 'A'

  • IV_ONLY_SPEC_OBJECT = FALSE

IMPORTING

ET_ACTION_OBJ = ET_ACTION_OBJ

ET_ACTION_FLD = ET_ACTION_FLD

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 2

OTHERS = 3

.

In the following step i activate the action i want to process:

Data: IT_ACTION_OBJ type PPFTACTV.

Data: l_action_obj_ref like line of l_action_obj-action_ref.

Read table et_action_obj index 1 into l_action_obj.

Read table l_action_obj-action_ref index 1 into l_action_obj_ref.

append l_action_obj_ref to IT_ACTION_OBJ.

CALL FUNCTION 'CRM_ACTION_PROCESS_IL'

EXPORTING

IT_ACTION_OBJ = IT_ACTION_OBJ

IV_ACTIVATE = 'X'

IV_EXECUTE = ''

IV_DELETE = ''

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 2

OTHERS = 3.

And the last step is the execution of this step.

CALL FUNCTION 'CRM_ACTION_PROCESS_IL'

EXPORTING

IT_ACTION_OBJ = IT_ACTION_OBJ

IV_ACTIVATE = ''

IV_EXECUTE = 'X'

IV_DELETE = ''

EXCEPTIONS

PARAMETER_ERROR = 1

ERROR_OCCURRED = 2

OTHERS = 3.

This request is followed by the short dump above.

I think the action i want to process is not registered to be processed.

Former Member
0 Kudos

Hello,

thank you for your post.

My intention is to trigger an action from a web based application with BSP.

In this case i can't use the function module CRM_ACTION_REGISTER_IL. Do you kow another way to register the action to be processed?

I'm trying this for 3 days, but i can't see a possible solution.

Best regards,

Jens

former_member187506
Contributor
0 Kudos

Oooh, that sounds like challenge.

I am guessing this is a custom BSP app. Have you gone through the activity change bapi?

If the activity exists, you should be able to get into the transaction using BAPI_ACTIVITYCRM_CHANGEMULTI.

You should be able to set a flag or memory id that you would be able to reteive in a badi off of the bapi. This could allow you branch off into you own logic. Once you are inside of the bapi you may be able to register the action since many of the bapi calls are similar to the actual transaction.

Sorry I can't be of more help.

TC

former_member187506
Contributor
0 Kudos

Jens:

I struggled with this one.

I have a custom action. I added a button to my opportunity to simplify the emailing of the opportunity.

On the click of the button the custom email action is published and registered.


   *  register for save because action has been activated via toolbar     
         call function 'CRM_ACTION_PUBLISH'                               
           exporting                                                      
             iv_kind = z_ref_kind                                         
             iv_guid = z_ref_guid.                                                                                
*     register for manual changes                                      
         call function 'CRM_ACTION_REGISTER_IL'.                                                                                

The action does not actually fire until the document is saved. At the conclusion of my custom email routine I use the following to set the status:



        call function 'CRM_STATUS_SET_INTERN'
          exporting
            iv_objnr            = l_guid
            iv_status           = gc_status-printed
            xnoauto             = true
          exceptions
            object_not_found    = 1
            status_inconsistent = 2
            status_not_allowed  = 3
            others              = 4.

      else.
        case sy-subrc.
          when 1.
            message e016(sppf_media) into dummy.
          when 2.
            message e017(sppf_media) with function_name into dummy.
          when 3.
            message e018(sppf_media) with function_name into dummy.
        endcase.
*        call method cl_log_ppf=>add_message
*          exporting
*            ip_problemclass = '1'
*            ip_handle       = ip_application_log.

I hope this helps.

TC