cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Workflow Issue - Unable to pass a key parameter

Former Member
0 Kudos
97

Hi,

I have a custom form which has a profile number as key field.

now on submitting the form a profile no is created and a workflow is triggered.

I have to show the same form in the workitem based on the profile no generated to the approver in his inbox.

I have to pass the profile no as it is key field in the form to display the form in approver's inbox and that has to be passed the moment the workflow is started - so as to display the same in 1st approver's inbox.

so how do i pass the profile no which is generated the moment the form is submiited.

Workflow start - SWU_START_WORKFLOW.

Kindly suggest me in this regards,

shankar

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185167
Active Contributor
0 Kudos

Hello,

Use SAP_WAPI_START_WORKFLOW and pass it in the container. Even better: create an event.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Hi,

First option..........before triggering the workflow......

As the profice number is created after submitting, please get the profile number before start of the workflow.

Whenever the profile number is generated this must be stored in a table. You can read the table to get the profile number. Now pass this profile number in the container ( in tables ) of the FM SWU_START_WORKFLOW.

Please ensure that one workflow container element need to be reated in the workflow as well to store the value.

wa_container-element = 'PROFILE_NO' .
      wa_container-value   = lv_profile_number .
      APPEND wa_container TO it_container.

  CALL FUNCTION 'SWU_START_WORKFLOW'
    EXPORTING
      task            = lv_wfname
      user            = user
      sender_id       = lv_sender
    IMPORTING
      return_code     = status
      workitem_id     = lv_workitem_id
    TABLES
      container       = it_container
      message_lines   = messages
      attachment_list = it_attachment_list.

here 'PROFILE_NO' is the workflow container element and lv_profile_number holds the value of the profile number.

Second option.....after triggering the workflow.....

Write down the code in a method to get the profile number and update ina workflow container element.

Call this method in your workflow.

Thanks and regards,

SNJY