cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow is triggered ,before the values are updated into table REGUH and REGUP table

ayyappan_venugopal2
Participant
0 Kudos

Gurus,

I have a requirement to trigger workflow when payment proposal is created. so I have used the BADI " FI_F110_SCHEDULE_JOB" to trigger workflow.

Workflow is getting triggered properly.Before sending work item to agents, I am sending external email notification with table of contents of Payment Proposal details which is taken from REGUH and REGUP  tables to agents.

But the problem problem is if  I process more than 10  vendors in the payment proposal the SAP server is slow to complete the process. But my workflow started to send the external mail notification to the respective agents even though the values are not getting updated into REGUH and REGUP table so my external mail contents having empty table .

suppose if process 2 to 5 vendors in payment proposal the SAP server is comparatively faster than previous scenario, By this time I am getting the external mail with the table of contents which is updated in REGUH and REGUP tables.

To avoid this I made "WAIT UP TO 120 SECONDS" in external mail notification method. But some cases it is working fine, but in future if they process Payment Proposal for more than 10 vendors , I don't know how much the time the SAP server will take to complete to the process.If it exceeds more than 120 seconds my external mail notification method will send empty table in the mail.

Please tell me how can i handle this situation.

Its urgent.

Thanks & Regards

Ayyappan.V

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

In your workflow you could check to see if the values are in the table before sending the mail.

If not, then wait.

regards

Rick Bakker

ayyappan_venugopal2
Participant
0 Kudos

Hi Rick,

How can I can do that ? because at the time of executing this mail notification task by workflow if I check the table  has an entry or not. If it doesn't contain, how could I know how much time I need to wait ?

Whether I need to check this in loop ?

Thanks & Regards

Ayyappan.V

former_member185167
Active Contributor
0 Kudos

Hello,

You could do a loop, or you could do a Wait step that waits for a condition to be true.

regards

Rick

ayyappan_venugopal2
Participant
0 Kudos

Thanks a lot Rick, its worked out.

Thanks & Regards

Ayyappan.V

Answers (1)

Answers (1)

dirk_wittenberg
Contributor
0 Kudos

Hi Ayyappan,

how are you triggering the event to start your workflow?

Within the update-process or directly without the update process?

Kind regards,

Dirk

ayyappan_venugopal2
Participant
0 Kudos

Hi Dirk,

I don't know whether I am triggering workflow within update-process or without the update process.

How can I find out this? Please advice me

This is my piece of code which I implemented in the BADI "FI_F110_SCHEDULE_JOB"

 

  "Checking the workflow, only run to Payment proposal creation.

  IF i_f110v-xvorl = 'X'.

    IF i_f110v-bukls = '4100' OR i_f110v-bukls = '4111' OR

       i_f110v-bukls = '4150' OR i_f110v-bukls = '4050' OR

       i_f110v-bukls = '4053' OR i_f110v-bukls = '4048' OR

       i_f110v-bukls = '4065'.

      IF i_zwels_combined = 'H' OR i_zwels_combined = 'F'.

*

        DATA: t_input_container TYPE STANDARD TABLE OF  swr_cont,

              w_input_container TYPE swr_cont,

              v_objkey          TYPE swr_struct-object_key.

*------------------Event Parameters----------------------*

        w_input_container-element = 'COMPANY_CODE'.

        w_input_container-value   = i_f110v-bukls.

        APPEND w_input_container TO t_input_container.

        CLEAR w_input_container.

*------------------Event Parameters----------------------*

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

        CONCATENATE  i_f110v-laufd i_f110v-laufi  INTO v_objkey.

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

       CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

          EXPORTING

            object_type             = 'ZVN_EPAYMT'

            object_key              = v_objkey

            event                   = 'CREATED'

*     COMMIT_WORK             = 'X'

*     EVENT_LANGUAGE          = SY-LANGU

*     LANGUAGE                = SY-LANGU

           user                    = sy-uname

*     IFS_XML_CONTAINER       =

*   IMPORTING

*     RETURN_CODE             =

*     EVENT_ID                =

         TABLES

           input_container         = t_input_container.

*     MESSAGE_LINES           =

*     MESSAGE_STRUCT          =

*.

      ENDIF.

    ENDIF.

  ENDIF.

Thanks & Regards

Ayyappan.V

ayyappan_venugopal2
Participant
0 Kudos

Hi Dirk,

I don't know whether I am triggering workflow within update-process or without the update process.

How can I find out this? Please advice me

This is my piece of code which I implemented in the BADI "FI_F110_SCHEDULE_JOB"

 

  "Checking the workflow, only run to Payment proposal creation.

  IF i_f110v-xvorl = 'X'.

    IF i_f110v-bukls = '4100' OR i_f110v-bukls = '4111' OR

       i_f110v-bukls = '4150' OR i_f110v-bukls = '4050' OR

       i_f110v-bukls = '4053' OR i_f110v-bukls = '4048' OR

       i_f110v-bukls = '4065'.

      IF i_zwels_combined = 'H' OR i_zwels_combined = 'F'.

*

        DATA: t_input_container TYPE STANDARD TABLE OF  swr_cont,

              w_input_container TYPE swr_cont,

              v_objkey          TYPE swr_struct-object_key.

*------------------Event Parameters----------------------*

        w_input_container-element = 'COMPANY_CODE'.

        w_input_container-value   = i_f110v-bukls.

        APPEND w_input_container TO t_input_container.

        CLEAR w_input_container.

*------------------Event Parameters----------------------*

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

        CONCATENATE  i_f110v-laufd i_f110v-laufi  INTO v_objkey.

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

       CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

          EXPORTING

            object_type             = 'ZVN_EPAYMT'

            object_key              = v_objkey

            event                   = 'CREATED'

*     COMMIT_WORK             = 'X'

*     EVENT_LANGUAGE          = SY-LANGU

*     LANGUAGE                = SY-LANGU

           user                    = sy-uname

*     IFS_XML_CONTAINER       =

*   IMPORTING

*     RETURN_CODE             =

*     EVENT_ID                =

         TABLES

           input_container         = t_input_container.

*     MESSAGE_LINES           =

*     MESSAGE_STRUCT          =

*.

      ENDIF.

    ENDIF.

  ENDIF.

Thanks & Regards

Ayyappan.V

ayyappan_venugopal2
Participant
0 Kudos

Hi Dirk,

I don't know whether I am triggering workflow within update-process or without the update process.

How can I find out this? Please advice me

This is my piece of code which I implemented in the BADI "FI_F110_SCHEDULE_JOB"

 

  "Checking the workflow, only run to Payment proposal creation.

  IF i_f110v-xvorl = 'X'.

    IF i_f110v-bukls = '4100' OR i_f110v-bukls = '4111' OR

       i_f110v-bukls = '4150' OR i_f110v-bukls = '4050' OR

       i_f110v-bukls = '4053' OR i_f110v-bukls = '4048' OR

       i_f110v-bukls = '4065'.

      IF i_zwels_combined = 'H' OR i_zwels_combined = 'F'.

*

        DATA: t_input_container TYPE STANDARD TABLE OF  swr_cont,

              w_input_container TYPE swr_cont,

              v_objkey          TYPE swr_struct-object_key.

*------------------Event Parameters----------------------*

        w_input_container-element = 'COMPANY_CODE'.

        w_input_container-value   = i_f110v-bukls.

        APPEND w_input_container TO t_input_container.

        CLEAR w_input_container.

*------------------Event Parameters----------------------*

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

        CONCATENATE  i_f110v-laufd i_f110v-laufi  INTO v_objkey.

*-------Business Object Key in_TRIGGER_WORKFLOW----------*

       CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

          EXPORTING

            object_type             = 'ZVN_EPAYMT'

            object_key              = v_objkey

            event                   = 'CREATED'

*     COMMIT_WORK             = 'X'

*     EVENT_LANGUAGE          = SY-LANGU

*     LANGUAGE                = SY-LANGU

           user                    = sy-uname

*     IFS_XML_CONTAINER       =

*   IMPORTING

*     RETURN_CODE             =

*     EVENT_ID                =

         TABLES

           input_container         = t_input_container.

*     MESSAGE_LINES           =

*     MESSAGE_STRUCT          =

*.

      ENDIF.

    ENDIF.

  ENDIF.

Thanks & Regards

Ayyappan.V

anjan_paul
Active Contributor
0 Kudos

Hi,

  Also put the parameter COMMIT_WORK = ' ' in the FM SAP_WAPI_CREATE_EVENT, and check it is working properly or not.

And As Rick suggested , use LOOP

dirk_wittenberg
Contributor
0 Kudos

Hi Ayyappan,

you can execute a function module in the update task via

"Call Function 'SAP_WAPI_CREATE_EVENT'

     in update task

     exporting

..."

But the function module must be designed for the update task. You can check that in the properties of the function module.

Kind regards,