‎2006 Jun 14 7:31 AM
Hi All!
Is it possible to trigger two smartforms with a single output.It is possible with SAP scripts and I am not sure whether it can be done with Smartforms.Advise appreciated.
Regards
Praneeth
‎2006 Jun 14 7:34 AM
Hi Praneeth,
Tell me if this is the requirement.
"You want to combine multiple smartform output to a single final OTF table".
If that is the requirement, then I can help you .
Regards,
SP.
‎2006 Jun 14 7:34 AM
Hi Praneeth,
Tell me if this is the requirement.
"You want to combine multiple smartform output to a single final OTF table".
If that is the requirement, then I can help you .
Regards,
SP.
‎2006 Jun 14 7:40 AM
Hi Prasad,
My actual requirement was I have two dynamic iterations in the form which I could not accomadate in a single main window of the form.So was thinking on the lines if I can cretae two SF's for a single output and trigger them one after the other.
Also is it possible to attach one smartform and one SAP script to a single output type?
egards
Praneeth
‎2006 Jun 14 9:32 AM
Hi Praneeth,
As per your information, if you have two dynamic iterations, you can just keep two TABLE Nodes or you can use 2 LOOPs in the MAIN WINDOW.
If you want to use 2 MAIN WINDOW for your requirement, here is the solution for you.
First create one MAIN WINDOW and use one dynamic interation. In that iteration, you have to write piece of code to check whether that iteration is end or not. If it is end you will have to use COMMAND to trigger NEXT page. In the NEXT page, you have same MAIN WINDOW but different iteration.
But when you see your MAIN WINDOW code, both iterations are one after another. So, you will get the desired output. I have done it several times and you dont need to create 2 smartforms or 1 smartform and 1 script.
Just create 1 smartform with 4 page formats.
PAGE1
NEXT1
PAGE2
NEXT2.
Let me know if you need more information.
regards,
ram.
pls award points if it is helpfull.
‎2006 Jun 14 7:34 AM
Praneeth,
I dont think you can do that. Let assume for now that it does.
When a message is created, based on the output how will the processing program know which form to pick up. So practically it is not possible.
You should have two output types for two forms.
Thanks,
Message was edited by: Naren Somen
‎2006 Jun 14 7:43 AM
HI
GOOD
AS YOU HAVE MENTIONED IN YOUR REQUIREMENT IT IS NOT POSSIBLE IN THE SMARTFORM BUT HAVE TO TRY TO CALL THROUGH INCLUDE PROGRAM , TRY TO CALL ANOTHER SMARTFORMS USING INCLUDE IN THE DRIVER PROGRAM .
THANKS
MRUTYUN
‎2006 Jun 14 7:47 AM
‎2006 Jun 14 8:05 AM
Hi Praneeth,
I tried to combine multiple smartforms and put it into PDF file in the local PC.
Just check this program and tell me if this is what you want..
REPORT yshail_smartform1_new .
TABLES: zshail_t1,sflight.
DATA: cparam TYPE ssfctrlop,
outop TYPE ssfcompop,
fm_name TYPE rs38l_fnam,
my_tabix TYPE sy-tabix,
file_size TYPE i,
bin_filesize TYPE i.
DATA: tab_otf_data TYPE ssfcrescl,
pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
itab LIKE TABLE OF zshail_t1 WITH HEADER LINE,
otab TYPE TABLE OF sflight WITH HEADER LINE,
tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE.
start-of-selection.
suppressing the dialog box****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = space.
cparam-getotf = 'X'.
******for first smartform***************************************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSHAIL_SMFORM2'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = 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.
SELECT my_id my_income my_name FROM zshail_t1 INTO TABLE itab.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = outop
user_settings = space
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = tab_otf_data
JOB_OUTPUT_OPTIONS =
TABLES
it_tab = itab[]
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.
*********appending the otf data into the final table*********************
tab_otf_final[] = tab_otf_data-otfdata[].
*************for the second smartform************************************
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSHAIL_SMTAB'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = 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.
SELECT carrid connid fldate price FROM sflight INTO CORRESPONDING FIELDS
OF TABLE otab.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = outop
user_settings = space
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = tab_otf_data
JOB_OUTPUT_OPTIONS =
TABLES
itab = otab[]
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.
**removing the initial and final markers from the OTF data*********
DELETE tab_otf_data-otfdata WHERE tdprintcom = '//'.
searching for the end-of-page in OTF table************
READ TABLE tab_otf_final WITH KEY tdprintcom = 'EP'.
my_tabix = sy-tabix + 1.
appending the modified OTF table to the final OTF table****
INSERT LINES OF tab_otf_data-otfdata INTO tab_otf_final INDEX my_tabix.
converting OTF data into pdf data**************************
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
IMPORTING
bin_filesize = bin_filesize
BIN_FILE =
TABLES
otf = tab_otf_final
lines = pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 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.
************downloading the converted PDF data to your local PC*******
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = bin_filesize
filename = 'D:\TEST.PDF'
filetype = 'BIN'
IMPORTING
filelength = file_size
TABLES
data_tab = pdf_tab.
Regards,
SP.
‎2006 Jun 14 8:49 AM
What you can do is to design two different smart forms and combine the output into the same spool, so that user will not know the difference.
Take a look at this link which explains how to club the output of multiple smart forms into one spool request
http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm
Regards,
Ravi