cancel
Showing results for 
Search instead for 
Did you mean: 

i want to download smartform with the help of radio button?

former_member809080
Participant
0 Kudos
DATA : LV_NAME TYPE RS38L_FNAM.
PARAMETERS: p_ebeln TYPE ekko-ebeln OBLIGATORY.
PARAMETERS: rd1 RADIOBUTTON GROUP r1 DEFAULT 'X',
rd2 RADIOBUTTON GROUP r1.


at SELECTION-SCREEN .


if rd1 = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_PUR_SF'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = LV_NAME
* EXCEPTIONS
* NO_FORM = 1
* NO_FUNCTION_MODULE = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.


IF LV_NAME IS NOT INITIAL.

CALL FUNCTION LV_NAME "'/1BCDWB/SF00000315'
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
in_ebeln = p_ebeln
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

ENDIF.

ELSEIF RD2 = 'X'.



ENDIF.
Jeansy
Active Contributor

Can you provide some more details please?

What do you mean by download? Do you just want to print the SSF (that's how the coding looks like). What is your goal and what problem do you have?

Marissa
Advisor
Advisor
0 Kudos

We helped you to accept the answer, since there were no updates after 7 days.

You can unaccept it anytime if you have further questions.

Accepted Solutions (1)

Accepted Solutions (1)

FredericGirod
Active Contributor

If you would like to print Smartforms in first radiobutton, and download in second button, you could check the blog : https://blogs.sap.com/2013/05/30/sending-mail-using-oo-2-smartforms/

look example : Send the Smartform in PDF attachment with a text message


* Set the parameters of the forms.
CLEAR : is_control_param, is_composer_param.
MOVE : ‘X’ TO is_control_param–no_dialog ,
‘ ‘ TO is_control_param–preview ,
‘X’ TO is_control_param–getotf ,
sy–langu TO is_control_param–langu ,
‘PRINTER’ TO is_control_param–device ,
‘X’ TO is_composer_param–tdnoprint ,
‘X’ TO is_composer_param–tdnoprev ,
‘X’ TO is_composer_param–tdfinal.
* Call the Smartforms
CALL FUNCTION w_funcname
EXPORTING
control_parameters = is_control_param
output_options = is_composer_param
user_settings = ‘ ‘
IMPORTING
job_output_info = is_job_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
FredericGirod
Active Contributor
0 Kudos

And the PDF convertion:

* Convert the OTF to PDF.
CALL FUNCTION ‘CONVERT_OTF_2_PDF’
IMPORTING
bin_filesize = w_doc_size
TABLES
otf = is_job_info–otfdata
doctab_archive = it_docs
lines = it_tline
EXCEPTIONS
OTHERS = 3.
CLEAR w_gr_xtxt.
CREATE OBJECT obj_conv.

Answers (0)