Skip to Content
avatar image
Former Member

Trigger Workflow and Update Ztable

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-c51418ff642b?QuickLink=index&…

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 12, 2014 at 11:58 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 13, 2014 at 02:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded