Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Submit program in workflow method.

Former Member
0 Likes
1,151

Hi i am calling a method in my workflow for PO approval to send a notification to approver on his external email address in the form of a smart form.

for this i have written a program which creates the smart form output converts it to PDF and sends mail to the approver.

When i test this program it is working properly.

In order to disable preview i am passing the following parametees

w_ctrlop-getotf = 'X'.

w_ctrlop-no_dialog = 'X'.

w_compop-tdnoprev = 'X'.

w_comfin-tddest = 'LP01'.

w_compop-tddest = 'LP01'.

This program is working properly and when i test my method in which i have called this program using

Submit <program name> and return

With <parameter value>.

This method is also working fine.

However when i test my workflow it stops at the step in which i am calling this method and workflow log shows it is in process.

Due to this my workflow is not executing the steps after this. Please help me.

5 REPLIES 5
Read only

Former Member
0 Likes
873

I feel the WF is waiting for the user action in ur submitted report.

Does your report display any output. If YES; then you may have to change your design.

Prabhu Rajesh

Read only

0 Likes
873

Hi

Yes my program is creating a smart form and sending a mail to avoid user action i have called smart form function module in no dialog mode by passing the values.

w_ctrlop-getotf = 'X'.

w_ctrlop-no_dialog = 'X'.

w_compop-tdnoprint = 'X'.

w_compop-TDFINAL = 'X'.

w_compop-tdnoprev = 'X'.

w_comfin-tddest = 'LP01'.

w_compop-tddest = 'LP01'.

and also there are no write statements in my program.

When i tested only my program it didnot prompt me for any input nor did it give any output.

I had to go to my outbox to see the output of my form.

when i commented the function module which was calling the smart form and tested my workflow it was working fine

And hence the error is in my call to the smart form .

Below is the part of my program to cal smart form.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = c_form

IMPORTING

fm_name = c_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

w_ctrlop-getotf = 'X'.

w_ctrlop-no_dialog = 'X'.

"w_ctrlop-device = 'LP01'.

w_compop-tdnoprint = 'X'.

w_compop-TDFINAL = 'X'.

w_compop-tdnoprev = 'X'.

w_comfin-tddest = 'LP01'.

w_compop-tddest = 'LP01'.

CALL FUNCTION c_fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = w_ctrlop

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = w_compop

user_settings = 'X'

im_fs_ekko = wa_ekko

v_rlwrt = v_rlwrt

v_first = v_first

v_last = v_last

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

job_output_info = w_return

  • JOB_OUTPUT_OPTIONS =

TABLES

im_it_ekkn = it_ekkn

im_lt_apprhistory = lt_cdhdr

im_it_ekpo = it_ekpo

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

here after i have called convert_otf and function module to send mail.

I know i am missing out something in my call to the smart form but am not able to figure out what please help me.

Read only

Former Member
0 Likes
873

Hi Chetan,

I think you should call the activity in background which calls your report. Then automatically it will execute your program and generate the smartforms and send it to your reciepent.

Thanks,

Chidanand

Read only

0 Likes
873

Hi Chidanand

I am calling the method in background execution.

But when i see my workflow log it shows the task in process

It shows no errors it says workitem Execution started automatically. and stays there. it is not completing the execution.

Read only

0 Likes
873

Hi i thing the problem is that you are calling it as background activity.

When you tested it was forground so there was no problem.

make it dialog step and try again if work fine.

Or call this report on some user action in WF such as Approve or reject button.