cancel
Showing results for 
Search instead for 
Did you mean: 

PO display to multiple buyers - Not happening

Former Member
0 Kudos

Hello,

In our project we have a requirement to notify multiple buyers when PO is created. I have created a new triggering event in ZBUS2012 and developed a new WF for this notification.

Step1- PO created - triggering event.

Ste2: Get buyer from Ztable

Step3: Display PO

i have created a container element in workflow & task called 'ZUSER' of type SWHACTOR ( import,export and multiline)

in the step 2: i have implemented the below logic to get the list of buyers from ztable.

DATA: wa_ekpo TYPE ekpo,

wa_eban TYPE eban,

wa_prno type eban-ebeln,

wa_cust type zptb_cust_tb_enh,

pr_agent TYPE eban-ernam.

DATA:it_cust LIKE zptb_cust_tb_enh occurs 0 with header line.

DATA:c_frice TYPE ZFRICEID VALUE 'P-RE-FS-E-0005',

c_active TYPE c VALUE 'X',

c_zcode TYPE zcode_10 VALUE 'BUYER',

c_otype type char2 value 'US'.

DATA:zagents like swhactor occurs 0 with header line,

ZUSER like swhactor occurs 0 with header line.

SWC_CONTAINER it_event_container.

SWC_CREATE_CONTAINER it_event_container.

SELECT SINGLE * FROM EKPO

INTO wa_ekpo

WHERE ebeln = object-key-purchaseorder.

IF SY-SUBRC = 0.

wa_prno = wa_ekpo-banfn.

SELECT SINGLE * FROM EBAN

INTO wa_eban

WHERE BANFN = wa_prno.

IF SY-SUBRC = 0.

pr_agent = wa_eban-ernam.

zagents-otype = c_otype.

zagents-objid = pr_agent.

APPEND zagents.

ENDIF.

ENDIF.

SELECT * FROM ZPTB_CUST_TB_ENH

INTO TABLE it_cust

WHERE ZPTB_FRICEID = c_frice

AND ZPTB_BUKRS = wa_ekpo-bukrs

AND ZPTB_WERKS = wa_ekpo-werks

AND ZCODE = c_zcode

AND ACTIVE = c_active.

Loop at it_cust into wa_cust.

zagents-otype = c_otype.

zagents-objid = wa_cust-zuser .

APPEND zagents.

CLEAR wa_cust.

endloop.

CLEAR: wa_ekpo,

wa_eban,

wa_prno,

pr_agent.

zuser[] = zagents[].

SWC_SET_TABLE it_event_container 'ZUSER' zagents.

After this step is been executed

Step 3: task with PO display method is been called. here i have called agent expression as 'ZUSER'.

I have did all the bindings from step2 to step3. ZUSER table is not getting passed in the task. Cna you please help me out to fix this issue.

If you have any other logic to achieve this multiple agents, please pass on the info to me. I would be greatful for you. thanks

Regards,

Paris.

006-0142603230.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The requirement is not clear. If you want that all the Users will receive a workitem and all will display the PO then i recommend to use Prallelk processing in which each single notifier will receive 1 workitem and on clicking on this will display the PO> Search the forum for Prallel processing and you will get your answer.

Thanks

Arghadip

Former Member
0 Kudos

let me explain you the issue in simple way. i got the list of buyers from a method, when i tried to pass back the values to the workflow. this is not happening..hope this clears ...please reply back if you have any answers.

Former Member
0 Kudos

Have you passed the SAP User ID of the Users concatenated with 'US' in front and pass this as an expression in the agent assignement. I think if you do this your issue will be solved.

Thanks

Arghadip

Former Member
0 Kudos

. thanks for the reply..yes already i have done that in my code. Issue is Binding is not happening. main issue is my agent values are not getting passed back to workflow. I did swc_set_table to pass back the value, also container is available in workflow. But when i checked it in workflow log, workflow container is not getting populated.

Former Member
0 Kudos

Is this working fine when you are executing the method in the Business Object level from SWO1

If yes then I think you need to do a object(PO:BUS2012) to object(PO:BUS2012) binding from Workflow to task. Also make sure you are using the same Business Object in both Workflow and Task which means if you are using BUS2012 then in task also it should be BUS2012 and you can refer to custom BO by delegation.

Thanks

Arghadip

Former Member
0 Kudos

Yeah even i have done that one aleady..couldnt trace the exact failure...