Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

PO display to multiple buyers - Not happening

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.

Not what you were looking for? View more on this topic or Ask a question