cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Workflow and Update Ztable

former_member197475
Active Contributor
0 Kudos

Hi Experts,

I have created a WD application which consists of more than 60 fields, consisting of a lot number of nodes from different structure. Now on action of submit I need to save all those field data to Ztable and as well as I need to trigger workflow.

I just followed the below link for triggering workflow from WDA and am clear on it(Passing Emp ID alone).

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a069c42f-3ca6-2e10-85b4-c51418ff6...

But my doubt is

1. How can I pass all field data values to BO, such that need to use it in table swr_cont. Whether am I need to create 60 attributes or is there any other way?

2. How to update all those screen field values to my Ztable.

Please help me in understanding.

With Regards,

Ramakrishnan M.

Accepted Solutions (1)

Accepted Solutions (1)

ronen_weisz
Active Contributor
0 Kudos

1. The impotent data to pass to the workflow is the key of the object you are working on, the rest of the data should be saved to your z-tables. now the workflow can read them:

  • As an attribute, but you usually don't need all the fields of the table for the workflow, only the ones relevant for decisions in the workflow or workitem display.
  • You can build a get data method to get all the fields of the table to a structure in the workflow, but this is usually not needed since you can use attributes.
  • Workflow task can start screens / transaction which will use your z-table, the data does need to be in the workflow only the key.

2. save the data to the z-table before you call the SAP_WAPI_CREATE_EVENT to start the workflow.

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,


Ramakrishnan Murugan wrote:

1. How can I pass all field data values to BO, such that need to use it in table swr_cont. Whether am I need to create 60 attributes or is there any other way?

We need not to pass all data from WD application to workflow but only key data needs to be passed.

When we create a workflow object, we would define the key attributes ( like PERNR, or some UNIQUE_KEY ) & before tiggering workflow, this key data needs to be populated into SWR_CONT and pass to the FM/bapi.


Ramakrishnan Murugan wrote:

2. How to update all those screen field values to my Ztable.

To update the data into Ztable follow the below steps

  • First trigger workflow, because if any error during  workflow trigger, you can stop execution and raise error message. So data is not yet saved into Ztable
  • After workitem generation, Read the context data from context nodes by using CODE WIZARD tool into local table or structures
  • Now, prepare the local internal table of type ZTABLE and fill all required data from the context data
  • Now, you can push into ZTABLE by using .... MODIFY ZTABLE from table LT_ZTABLE

Hope this helps you.

Regards,

Rama