cancel
Showing results for 
Search instead for 
Did you mean: 

Remove forms after executing it

Former Member
0 Kudos

Hi,

I have 3 forms to be sent in one pirnt job.

So I am calling ssf_open and call each forms one by one with respective data and the calling ssf_close. which is working fine.

Here is it little difficult to explain. The form1 is common for different output types using the same print program. the problem looks simple but it is critical. I am trying to explain the best. Here is the scnario for one output type.

the problem is sometimes we have cases with no data for the form 2 and form 3. In this case the only header page is sent to the customer. we don't want to do that. We have to stop sending the output and do turn the message green.

So here is I want. If there is no data for form2 and form3, I need recall/delete the form1(which is already ran using call <form1fm> ). Basically I want to cancel the remove the form1 and cancel sending the smartform before calling ssf_close.

If this is not clear please let me know your qesitons.

Thank you,

Surya

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

Thanks for your quick response. Here is my requirement.

This is little tricky requirement, difficult to explain. To cut short consider this that I can not call ssf_open before checking the form data. Form1 data is required in all cases. Form2 and Form3 are checked later and if both are initial the I want to remove the Form1 and cancel proceding further and want make the return code to 0. Can this be possible?

Thank you,

Surya`

naimesh_patel
Active Contributor
0 Kudos

If you don't have a control on te FORM2 and FORM3 data before generating the FORM1, you might consider this workaround.

1. Call SSF_OPEN to print the FORM1 (which you are doing) without immediate output.

2. If FORM2 and FORM3 data is initial and they should not be generated, than call the FM SSF_CLOSE.

3. Get the SPOOLIDs from the exporting parameter of the FM JOB_OUTPUT_INFO-SPOOLIDS.

4. Now, Since you don't want the FORM1, call FM RSPO_R_RDELETE_SPOOLREQ by passing the Spool number from JOB_OUTPUT_INFO-SPOOLIDS to delete the generated Spool for FORM1.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi surya,

In the driver program on the selection screen provide the radiobutton based on the condition print the data acoordingly.

SELECTION-SCREEN BEGIN OF BLOCK block  WITH FRAME.
PARAMETERS:
p_form1 RADIOBUTTON GROUP rad1,
p_form2 RADIOBUTTON GROUP rad1,
p_form3 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK block.


if p_form1 EQ 'X'.
   w_form = 'Y_FORM1'.
   elseif p_form2 EQ 'X'.
    w_form = 'Y_FORM2'.
     elseif p_form3 EQ 'X'.
       w_form = 'Y_FORM3'.

Regards,

Sravanthi

Former Member
0 Kudos

Hi

You can check the condition before calling the form1, 2 3,

if not form1 and form2 and form3 are initial

then cal ssf_ for form1 2 3

endif.

Check this if you can modify the driver program.

Regards'

Shiva

naimesh_patel
Active Contributor
0 Kudos

Can you able to check if the data is there for the Form2 and Form3 before even calling the SSF_OPEN?

It is like:


* ITAB2 and ITAB3 are data for your FORM2 and FORM3 respectivly.
DESCRIBE TABLE ITAB2 LINES LINES_2.
DESCRIBE TABLE ITAB3 LINES LINES_3.
IF LINES_2 IS NOT INITIAL
AND LINES_3 IS NOT INITIAL.

CALL FM SSF_OPEN

CALL FM FOR FORM1

CALL FM FOR FORM2

CALL FM FOR FORM3

CALL FM SSF_CLOSE.

ENDIF.

Regards,

Naimesh Patel