Skip to Content

Assigning agent from the PM order created

Hi,

I am working on workflows and I want a workflow to sent the work item to be sent to the cordinator partner in the PM order maintained. I have already set up the workflow . Can any one tell me how to do that . I am using below code in the method

CONSTANTS : c_or(2) TYPE c VALUE 'OR'.

DATA: v_objno TYPE j_objnr,

w_parnr TYPE t_parnr.

* Prepare the OBJ no for passing to IHPA

CONCATENATE c_or object-key-number INTO v_objno .

* Get the partner function for the PM order

SELECT SINGLE objnr parvw parnr

INTO w_parnr

FROM ihpa

WHERE objnr EQ v_objno

AND parvw EQ 'AB'.

* Fetch the partner type

IF sy-subrc IS INITIAL .

CALL FUNCTION 'PM_PARTNER_LENGTH'

EXPORTING

parnr_imp = w_parnr-parnr

parvw = w_parnr-parvw

IMPORTING

nrart_exp = lv_nrart

EXCEPTIONS

parvw_and_nrart_inital = 1

invalid_parvw = 2

OTHERS = 3

.

IF sy-subrc = 0.

CASE lv_nrart.

WHEN 'US'.

ls_actor-otype = 'US'.

ls_actor-objid = ls_parnr-parnr.

APPEND ls_actor TO actor_tab.

WHEN 'PE'.

ls_actor-otype = 'P'.

ls_actor-objid = ls_parnr-parnr.

APPEND ls_actor TO actor_tab.

WHEN 'O'.

ls_actor-otype = 'O'.

ls_actor-objid = ls_parnr-parnr.

APPEND ls_actor TO actor_tab.

WHEN 'S'.

ls_actor-otype = 'S'.

ls_actor-objid = ls_parnr-parnr.

APPEND ls_actor TO actor_tab.

ENDCASE.

ENDIF.

*

* Update the ACTOR TAB

swc_set_table container 'ACTOR_TAB' actor_tab.


Thanks,

RG

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 14, 2016 at 05:53 PM

    Hi Ramya,

    Which method are you talking about ?

    Your dialog task has a section to set up the agent, choose rule (AC), either you have a standard rule or you build your own (transaction PFAC type function to be executed) you just insert your code here

    You do have to respect the mandatory parameters

    TABLES

    *" ACTOR_TAB STRUCTURE SWHACTOR

    *" AC_CONTAINER STRUCTURE SWCONT

    *" EXCEPTIONS

    *" NOBODY_FOUND


    When you save the rule you can insert it easily in the agents section, so this is not in a method of the BOR or the class that you should do this.


    Best regards

    Stephane

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 06:35 AM

    Hi,

    The code I suppose you wrote in the rule. Try to simulate the rule in PFAC to check agent populating or not. Then use it in your step with proper binding .

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Anjan,

      Could you please elaborate a bit,

      my method inside the BO method is not dialog and more over the task

      and more over my activity step is also not background processing

      Could you please explain how to create a rule in PFAC. and also how to check its populating or not and how to use it back at the step.

      Thanks,

      RG

      Capture.PNG (17.4 kB)
      Capture.PNG (17.8 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.