Smartform output as html
Hello,
I want to convert smartform output to html and send the output in an email body. I have followed the blog Sending HTML Email from SAP CRM/ERP and got the output in outlook but its not formatted correctly in other email clients. If any body else had same issues and was able to resolve, please suggest. Also I am trying to convert form spool output to html and send it but I am not able to use LIST_FROM_MEMORY Fm , its not returning the abap list table. So is there a way to convert form spool output to abap list?
HI friend,
I am not having the exact solution for your requirement but i think this will help you a bit.
See this white paper in SND for sending mails in HTML format.
Link: [Sending mail with HTML attachment|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e009f97e-ee5d-2e10-31ba-9c9509e5925c?QuickLink=index&overridelayout=true]
I think this will help you. If you have any doubt in that white paper please revert back to me i will help you.
Thanks,
Sri Hari
Similar Messages
-
Dear all ,
I want to take smartform output in html format . the logos are not coming as well as the header template the records are coming in next line not side by side .my code is :
gs_output_options-xsfcmode = 'X'.
gs_output_options-xsf = 'X'.
gs_output_options-xsfoutmode = 'A'.
gs_output_options-xsfformat = 'X'.
xsfparam_line-name = 'GRAPHICS'.
xsfparam_line-value = 'EXTRACT'.
APPEND xsfparam_line TO gs_output_options-xsfpars.
xsfparam_line-name = 'GRAPHICS-DIRECTORY'.
xsfparam_line-value = c_gr_dir.
APPEND xsfparam_line TO gs_output_options-xsfpars.
xsfparam_line-name = 'CONTENT-ID'.
xsfparam_line-value = 'ENABLE'.
APPEND xsfparam_line TO gs_output_options-xsfpars.
CALL FUNCTION fm_name
EXPORTING
control_parameters = gs_ssfctrlop
output_options = gs_output_options
p_graphics[] = gs_job_output_info-xmloutput-xsfgr[].
p_html = gs_job_output_info-xmloutput-trfresult
CONCATENATE 'C:\TEST\TC1_' p_vbeln '.html' INTO p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = html_len
filename = p_file
filetype = 'BIN'"'ASC'
trunc_trailing_blanks = 'X'
TABLES
data_tab = p_html-content
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
document = p_fileThis question (logos and html smartform output) has been discussed several times related to email sending. Try searching the forum. You may find some relevant info in other posts. Have you tried reaching the url that's generated for the logo?
-
Smartforms output as HTML in email
Hi,
I want to send the output of a smartform as html in email body.
I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
I did everything as per the blog.
However I am getting the email as:
sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
Welcome
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
When I display the document using SOST, I get the output as
Address bar has this: C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
and window contains:
Welcome
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
Regards,
Reema
Message was edited by:
Reema Shahbazkar
In case anyone needs to have a look at my code:
REPORT ZSMARTFORM_2_HTML_EMAIL.
get generated function module for the smartform
DATA: FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSF_SAMPLE_HTML'
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.
get smartform contetnt
set smartform output options
data:
control_parameters type SSFCTRLOP,
OUTPUT_OPTIONS TYPE SSFCOMPOP,
DOCUMENT_OUTPUT_INFO TYPE SSFCRESPD,
JOB_OUTPUT_INFO TYPE SSFCRESCL,
JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
XSFPARAM_LINE TYPE SSFXSFP,
P_HTML TYPE TRFRESULT,
P_GRAPHICS TYPE TSF_XSF_GR,
WA_RETURN TYPE BAPIRET2.
CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
control_parameters-NO_DIALOG = 'X'.
*control_parameters-GETOTF = 'X'.
OUTPUT_OPTIONS-TDNEWID = SPACE.
OUTPUT_OPTIONS-TDIMMED = SPACE.
OUTPUT_OPTIONS-XSFCMODE = 'X'. "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
OUTPUT_OPTIONS-XSF = 'X'. "XSF OUTPUT ACTIVATED
OUTPUT_OPTIONS-XSFOUTMODE = 'A'. "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
CLEAR: OUTPUT_OPTIONS-XSFOUTDEV. "OUTPUT SPOOL DEVICE
OUTPUT_OPTIONS-XSFFORMAT = 'X'. "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
XSFPARAM_LINE-NAME = 'GRAPHICS'.
XSFPARAM_LINE-VALUE = 'EXTRACT'.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
XSFPARAM_LINE-VALUE = C_GR_DIR.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
XSFPARAM_LINE-NAME = 'CONTENT-ID'.
XSFPARAM_LINE-VALUE = 'ENABLE'.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
CALL FUNCTION FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL_PARAMETERS
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
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.
SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
PROCEED TO SEND EMAIL
DATA: HTML_DATA TYPE TRFRESULT,
L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
HTML_XSTR TYPE XSTRING.
CLEAR: HTML_XSTR.
LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
ENDLOOP.
HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
SPECIAL CHARACTER CONVERSION
DATA: HTML_STR TYPE STRING,
HTML_LEN TYPE I.
CALL FUNCTION 'SCP_TRANSLATE_CHARS'
EXPORTING
INBUFF = HTML_XSTR
INBUFFLG = 0
INCODE = '4110' "utf-8
OUTBUFFLG = 0
OUTCODE = '0000'
CSUBST = 'X'
SUBSTC_HASH = ' '
SUBSTC_DOT = ' '
SUBSTC_SPACE = 'x'
SUBSTC = '00035'
IMPORTING
INUSED =
OUTBUFF = HTML_STR
OUTOVERFLOW =
OUTUSED = HTML_LEN
SUBSTED =
INPUT_ENDS_IN_CHAR =
ERRMSG =
EXCEPTIONS
INVALID_CODEPAGE = 1
INTERNAL_ERROR = 2
CANNOT_CONVERT = 3
FIELDS_BAD_TYPE = 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.
CHANGE ENCODING UTF-8 TO LATIN1
REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
HTML_LEN = STRLEN( HTML_STR ).
DATA: L_OFFSET TYPE I,
L_LENGTH TYPE I,
L_DIFF TYPE I,
LT_SOLI TYPE SOLI_TAB,
LS_SOLI TYPE SOLI.
L_OFFSET = 0.
L_LENGTH = 255.
WHILE L_OFFSET < HTML_LEN.
L_DIFF = HTML_LEN - L_OFFSET.
IF L_DIFF > L_LENGTH.
LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
ELSE.
LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
ENDIF.
APPEND LS_SOLI TO LT_SOLI.
ADD L_LENGTH TO L_OFFSET.
ENDWHILE.
DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
CREATE OBJECT LO_MIME_HELPER
EXPORTING
CODEPAGE = '1133'.
CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
EXPORTING
CONTENT = LT_SOLI
FILENAME =
DESCRIPTION =
HANDLE GRAPHICS
DATA: L_GRAPHIC TYPE SSF_XSF_GR,
GR_XSTR TYPE XSTRING,
L_GR_RAW TYPE BAPICONTEN,
L_CONTENT_ID TYPE STRING,
L_CONTENT_TYPE TYPE W3CONTTYPE,
L_OBJ_LEN TYPE SO_OBJ_LEN,
L_FILENAME TYPE STRING,
LT_SOLIX TYPE SOLIX_TAB,
LS_SOLIX TYPE SOLIX.
LOOP AT P_GRAPHICS INTO L_GRAPHIC.
CLEAR: GR_XSTR.
LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
ENDLOOP.
GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
L_OFFSET = 0.
L_LENGTH = 255.
CLEAR LT_SOLIX[].
WHILE L_OFFSET < L_GRAPHIC-LENGTH.
L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
IF L_DIFF > L_LENGTH.
LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
ELSE.
LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
ENDIF.
APPEND LS_SOLIX TO LT_SOLIX.
ADD L_LENGTH TO L_OFFSET.
ENDWHILE.
CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
L_OBJ_LEN = L_GRAPHIC-LENGTH.
ADD IMAGES TO EMAIL
CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
EXPORTING
CONTENT = LT_SOLIX
FILENAME =
EXTENSION =
DESCRIPTION =
CONTENT_TYPE = L_CONTENT_TYPE
LENGTH = L_OBJ_LEN
CONTENT_ID = L_CONTENT_ID
ENDLOOP.
DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
P_SUBJECT TYPE SO_OBJ_DES,
LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
TRY.
CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
EXPORTING
I_SUBJECT = P_SUBJECT
I_LANGUAGE = SY-LANGU
I_IMPORTANCE = '5'
I_SENSITIVITY = 'F'
I_MULTIREL_SERVICE = LO_MIME_HELPER
RECEIVING
RESULT = LO_DOC_BCS
CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
CATCH CX_GBT_MIME INTO LV_GBT_MIME.
ENDTRY.
RECEIVERS
DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
RECEIVER TYPE SOMLRECI1,
L_MAIL_ADDRESS TYPE AD_SMTPADR,
LO_BCS TYPE REF TO CL_BCS,
LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
L_USERNAME TYPE UNAME,
SEND_PARTNER TYPE BU_PARTNER,
LI_SENDER TYPE REF TO IF_SENDER_BCS,
LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
LV_SENT_TO_ALL TYPE BOOLEAN.
CLEAR RECEIVER.
RECEIVER-RECEIVER = '[email protected]'.
RECEIVER-REC_TYPE = 'U'.
RECEIVER-COM_TYPE = 'INT'.
APPEND RECEIVER TO P_RECEIVERS.
L_USERNAME = SY-UNAME.
CLEAR RECEIVER.
LOOP AT P_RECEIVERS INTO RECEIVER.
L_MAIL_ADDRESS = RECEIVER-RECEIVER.
TRY.
CALL METHOD CL_BCS=>CREATE_PERSISTENT
RECEIVING
RESULT = LO_BCS
CALL METHOD LO_BCS->SET_DOCUMENT
EXPORTING
I_DOCUMENT = LO_DOC_BCS
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
CREATE SENDER
CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
TRY.
IF L_USERNAME NS '@'.
L_USERNAME = SEND_PARTNER.
TRANSLATE L_USERNAME TO UPPER CASE.
LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
ELSE.
DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
L_FROM_MAIL_ADDRESS = L_USERNAME.
LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
ENDIF.
CALL METHOD LO_BCS->SET_SENDER
EXPORTING
I_SENDER = LI_SENDER
CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
create recepient
data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
TRY.
CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
EXPORTING
I_ADDRESS_STRING = L_MAIL_ADDRESS
I_ADDRESS_NAME =
I_INCL_SAPUSER =
RECEIVING
RESULT = LO_RECEPIENT
CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
ENDTRY.
TRY.
CALL METHOD LO_BCS->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = LO_RECEPIENT
I_EXPRESS =
I_COPY =
I_BLIND_COPY =
I_NO_FORWARD =
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
SEND EMAIL DOCUMENT
TRY.
CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
EXPORTING
I_REQUESTED_STATUS = 'N'
TRY.
CALL METHOD LO_BCS->SEND
EXPORTING
I_WITH_ERROR_SCREEN = SPACE
RECEIVING
RESULT = LV_SENT_TO_ALL
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
ENDTRY.
ENDLOOP.
COMMIT WORK.Hi,
I want to send the output of a smartform as html in email body.
I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
I did everything as per the blog.
However I am getting the email as:
sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
Welcome
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
When I display the document using SOST, I get the output as
Address bar has this: C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
and window contains:
Welcome
<IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
Regards,
Reema
Message was edited by:
Reema Shahbazkar
In case anyone needs to have a look at my code:
REPORT ZSMARTFORM_2_HTML_EMAIL.
get generated function module for the smartform
DATA: FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSF_SAMPLE_HTML'
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.
get smartform contetnt
set smartform output options
data:
control_parameters type SSFCTRLOP,
OUTPUT_OPTIONS TYPE SSFCOMPOP,
DOCUMENT_OUTPUT_INFO TYPE SSFCRESPD,
JOB_OUTPUT_INFO TYPE SSFCRESCL,
JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
XSFPARAM_LINE TYPE SSFXSFP,
P_HTML TYPE TRFRESULT,
P_GRAPHICS TYPE TSF_XSF_GR,
WA_RETURN TYPE BAPIRET2.
CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
control_parameters-NO_DIALOG = 'X'.
*control_parameters-GETOTF = 'X'.
OUTPUT_OPTIONS-TDNEWID = SPACE.
OUTPUT_OPTIONS-TDIMMED = SPACE.
OUTPUT_OPTIONS-XSFCMODE = 'X'. "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
OUTPUT_OPTIONS-XSF = 'X'. "XSF OUTPUT ACTIVATED
OUTPUT_OPTIONS-XSFOUTMODE = 'A'. "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
CLEAR: OUTPUT_OPTIONS-XSFOUTDEV. "OUTPUT SPOOL DEVICE
OUTPUT_OPTIONS-XSFFORMAT = 'X'. "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
XSFPARAM_LINE-NAME = 'GRAPHICS'.
XSFPARAM_LINE-VALUE = 'EXTRACT'.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
XSFPARAM_LINE-VALUE = C_GR_DIR.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
XSFPARAM_LINE-NAME = 'CONTENT-ID'.
XSFPARAM_LINE-VALUE = 'ENABLE'.
APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
CALL FUNCTION FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL_PARAMETERS
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
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.
SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
PROCEED TO SEND EMAIL
DATA: HTML_DATA TYPE TRFRESULT,
L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
HTML_XSTR TYPE XSTRING.
CLEAR: HTML_XSTR.
LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
ENDLOOP.
HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
SPECIAL CHARACTER CONVERSION
DATA: HTML_STR TYPE STRING,
HTML_LEN TYPE I.
CALL FUNCTION 'SCP_TRANSLATE_CHARS'
EXPORTING
INBUFF = HTML_XSTR
INBUFFLG = 0
INCODE = '4110' "utf-8
OUTBUFFLG = 0
OUTCODE = '0000'
CSUBST = 'X'
SUBSTC_HASH = ' '
SUBSTC_DOT = ' '
SUBSTC_SPACE = 'x'
SUBSTC = '00035'
IMPORTING
INUSED =
OUTBUFF = HTML_STR
OUTOVERFLOW =
OUTUSED = HTML_LEN
SUBSTED =
INPUT_ENDS_IN_CHAR =
ERRMSG =
EXCEPTIONS
INVALID_CODEPAGE = 1
INTERNAL_ERROR = 2
CANNOT_CONVERT = 3
FIELDS_BAD_TYPE = 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.
CHANGE ENCODING UTF-8 TO LATIN1
REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
HTML_LEN = STRLEN( HTML_STR ).
DATA: L_OFFSET TYPE I,
L_LENGTH TYPE I,
L_DIFF TYPE I,
LT_SOLI TYPE SOLI_TAB,
LS_SOLI TYPE SOLI.
L_OFFSET = 0.
L_LENGTH = 255.
WHILE L_OFFSET < HTML_LEN.
L_DIFF = HTML_LEN - L_OFFSET.
IF L_DIFF > L_LENGTH.
LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
ELSE.
LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
ENDIF.
APPEND LS_SOLI TO LT_SOLI.
ADD L_LENGTH TO L_OFFSET.
ENDWHILE.
DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
CREATE OBJECT LO_MIME_HELPER
EXPORTING
CODEPAGE = '1133'.
CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
EXPORTING
CONTENT = LT_SOLI
FILENAME =
DESCRIPTION =
HANDLE GRAPHICS
DATA: L_GRAPHIC TYPE SSF_XSF_GR,
GR_XSTR TYPE XSTRING,
L_GR_RAW TYPE BAPICONTEN,
L_CONTENT_ID TYPE STRING,
L_CONTENT_TYPE TYPE W3CONTTYPE,
L_OBJ_LEN TYPE SO_OBJ_LEN,
L_FILENAME TYPE STRING,
LT_SOLIX TYPE SOLIX_TAB,
LS_SOLIX TYPE SOLIX.
LOOP AT P_GRAPHICS INTO L_GRAPHIC.
CLEAR: GR_XSTR.
LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
ENDLOOP.
GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
L_OFFSET = 0.
L_LENGTH = 255.
CLEAR LT_SOLIX[].
WHILE L_OFFSET < L_GRAPHIC-LENGTH.
L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
IF L_DIFF > L_LENGTH.
LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
ELSE.
LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
ENDIF.
APPEND LS_SOLIX TO LT_SOLIX.
ADD L_LENGTH TO L_OFFSET.
ENDWHILE.
CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
L_OBJ_LEN = L_GRAPHIC-LENGTH.
ADD IMAGES TO EMAIL
CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
EXPORTING
CONTENT = LT_SOLIX
FILENAME =
EXTENSION =
DESCRIPTION =
CONTENT_TYPE = L_CONTENT_TYPE
LENGTH = L_OBJ_LEN
CONTENT_ID = L_CONTENT_ID
ENDLOOP.
DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
P_SUBJECT TYPE SO_OBJ_DES,
LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
TRY.
CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
EXPORTING
I_SUBJECT = P_SUBJECT
I_LANGUAGE = SY-LANGU
I_IMPORTANCE = '5'
I_SENSITIVITY = 'F'
I_MULTIREL_SERVICE = LO_MIME_HELPER
RECEIVING
RESULT = LO_DOC_BCS
CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
CATCH CX_GBT_MIME INTO LV_GBT_MIME.
ENDTRY.
RECEIVERS
DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
RECEIVER TYPE SOMLRECI1,
L_MAIL_ADDRESS TYPE AD_SMTPADR,
LO_BCS TYPE REF TO CL_BCS,
LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
L_USERNAME TYPE UNAME,
SEND_PARTNER TYPE BU_PARTNER,
LI_SENDER TYPE REF TO IF_SENDER_BCS,
LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
LV_SENT_TO_ALL TYPE BOOLEAN.
CLEAR RECEIVER.
RECEIVER-RECEIVER = '[email protected]'.
RECEIVER-REC_TYPE = 'U'.
RECEIVER-COM_TYPE = 'INT'.
APPEND RECEIVER TO P_RECEIVERS.
L_USERNAME = SY-UNAME.
CLEAR RECEIVER.
LOOP AT P_RECEIVERS INTO RECEIVER.
L_MAIL_ADDRESS = RECEIVER-RECEIVER.
TRY.
CALL METHOD CL_BCS=>CREATE_PERSISTENT
RECEIVING
RESULT = LO_BCS
CALL METHOD LO_BCS->SET_DOCUMENT
EXPORTING
I_DOCUMENT = LO_DOC_BCS
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
CREATE SENDER
CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
TRY.
IF L_USERNAME NS '@'.
L_USERNAME = SEND_PARTNER.
TRANSLATE L_USERNAME TO UPPER CASE.
LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
ELSE.
DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
L_FROM_MAIL_ADDRESS = L_USERNAME.
LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
ENDIF.
CALL METHOD LO_BCS->SET_SENDER
EXPORTING
I_SENDER = LI_SENDER
CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
create recepient
data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
TRY.
CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
EXPORTING
I_ADDRESS_STRING = L_MAIL_ADDRESS
I_ADDRESS_NAME =
I_INCL_SAPUSER =
RECEIVING
RESULT = LO_RECEPIENT
CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
ENDTRY.
TRY.
CALL METHOD LO_BCS->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = LO_RECEPIENT
I_EXPRESS =
I_COPY =
I_BLIND_COPY =
I_NO_FORWARD =
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
SEND EMAIL DOCUMENT
TRY.
CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
EXPORTING
I_REQUESTED_STATUS = 'N'
TRY.
CALL METHOD LO_BCS->SEND
EXPORTING
I_WITH_ERROR_SCREEN = SPACE
RECEIVING
RESULT = LV_SENT_TO_ALL
CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
ENDTRY.
ENDTRY.
ENDLOOP.
COMMIT WORK. -
Smartforms output in HTML format
Hi Experts,
I want to save my smartforms in HTML format.Is there any Standard programe is available for it.
Like as RSTXPDFT4 for converting output in PDF format.Hi,
Check this link.In that,I am converting the output of smartform to PDF and then attaching it through mail.
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/smartforms/smartform in abap.pdf -
Converting Smartforms output content into HTML File
Hi,
I have a requirement, Smartforms output contents needs be converted as HTML File and it should be sent as email.
I am able to get the Smartforms output in html format but the output is shown as binary format.
After the fm call the job_output_info parameter is holding the smartforms output content in
job_output_info-XMLOUTPUT[] (xsf content)
job_output_info-XMLOUTPUT-STSHEET[] (css content)
job_output_info-XMLOUTPUT-TRFRESULT[] (html content)
Help me out how to handle the job_output_info details to html format.
Code
DATA v_fm_name TYPE rs38l_fnam.
DATA v_tdsfname TYPE tdsfname VALUE 'ZVR39_SF'.
DATA output_options TYPE ssfcompop.
DATA job_output_info TYPE ssfcrescl.
DATA document_output_info TYPE ssfcrespd.
DATA job_output_options TYPE ssfcresop.
DATA w_control TYPE ssfctrlop.
*-Finding the Smartform Layout Name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = v_tdsfname
IMPORTING
fm_name = v_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
*-Defining the output to HTML Format
*-Activating XSF Output
output_options-xdfcmode = 'X'.
output_options-xdf = space.
output_options-xsfcmode = 'X'.
output_options-xsf = 'X'.
output_options-xsfoutmode = 'A'. "
output_options-xsfoutdev = 'P863'.
output_options-xsfformat = 'X'.
*-Calling the Smartform Layout
CALL FUNCTION v_fm_name
EXPORTING
output_options = output_options
user_settings = 'X'
IMPORTING
document_output_info = document_output_info
job_output_info = job_output_info
job_output_options = job_output_options
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
GiriHi,
Check this link.In that,I am converting the output of smartform to PDF and then attaching it through mail.
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/smartforms/smartform in abap.pdf -
Urgent : Display logo in Smartform with XSF+ HTML as Output Format
Hi,
Through the Portal we are displaying ESS Salary Statement of a Employee for last 24 monthys in the iView using the Customized Smartform ZHR_ESS_PAYSLIP_TO_PDF which is copy of Standard Smartform HR_ESS_PAYSLIP_TO_PDF .
Requirement is that we have to change the Output Option to "XSF+HTML" and Display a logo at Top-Middle of the form.
But the problem is that Logo is only visible only when Output Option is "Standard Output". and not visible when Output Option is "XSF+HTML".
Please tell me how to display the Logo in the Smartform so that it is visible in "XSF+HTML" or "XSF" as Output Option.
Asnwers will be suitably rewarded.
Thanks,
Ajay JangidHi Ajay,
Following threads may help you
Smartforms to Xsf & Html format
/message/1484753#1484753 [original link is broken]
Regards,
Manoj -
SAPFM06P - Can this program be used for triggering a Smartform Output??
Hi Experts!
I researched a lot and came to a conclusion that Program SAPFM06P can only be used trigger either a SAP SRIPT Output or a PDF FORM output. It cannot be used to trigger a SMARTFORM output directly as there is no code in it to trigger a SMARTFORM.
My understanding:
I will have to either create an Enhancement to the Program or a Zcopy of SAPFM06P where I need to write the logic in form routine ENTRY_NEU to call a SMARTFORM.
Please tell me if my understanding is correct and please guide me if there is any easier way to achieve the same functionality.
Thanks for help!
Greetings,
AmitHi,
U can Copy this standard Program to ZProgram and Insert the FM SSF_FUNCTIONMODULE_NAME and call ur smartform and assign the same combination to the Output type Given to u in NACE Transaction..
This is the Driver Program which I used for PO Smartform
[http://vjkvijaya.blogspot.com/2009/03/puchace-order-smartform-driver-program.html]
Regards,
Vijaya Lakshmi.T -
Produce smartform output in word doc
I want to get my smartform output in a word doc instead of PDF. I've gone thorough the previous threads for the same thing but couldn't find any exact solution. can anyone tell me how this is to be done?
<promise removed by moderator>
Moderator message: please do more research before asking.
Edited by: Thomas Zloch on Apr 13, 2011 3:26 PMHi yogesh.,
There is no standard possibility to do Word outputs in SAP.
you can do manually..
After the print preview, Select the menu Goto->List Display.
Now select the menu System->List->Save->Local File.
Now you can select the radio buttion Rich Text Format.
Now you save the document as a .doc file (say test.doc)
That is it!!!!!
Anyway you can develop connection of Mail-merge technology of Microsoft and SAP ABAP class i_oi_document_proxy.
http://help.sap.com/saphelp_sm32/helpdata/EN/e9/0be980408e11d1893b0000e8323c4f/content.htm
with interface get_mail_merge_interface:
http://help.sap.com/saphelp_sm32/helpdata/en/6e/8fc2e3dd0d11d2bdba080009b4534c/content.htm
Refer this use ful link for word output
http://www.sap2word.de/abap.html
hope this helps.,
Thanks & Regards
Kiran
Moderator message: copy/pasted from several sources, please do not repeat if you want to keep your user ID!
http://www.google.com/search?q=%22Aftertheprintpreview%2CSelectthemenu+Goto%22&hl=en&source=hp&lr=&aq=f&aqi=&aql=&oq=
http://www.google.com/search?hl=en&source=hp&q=%22AnywayyoucandevelopconnectionofMail-merge%22&meta=lr%3D&aq=f&aqi=&aql=&oq=
Edited by: Thomas Zloch on Apr 13, 2011 3:35 PM -
How to send a SmartForm output as Email to external id?
I want the Smartform output to email to extrenal email-id.
I don't want the Smartform output as any kind of attachment, but the Smartform output needs to be shown on the main email body. Can anyone pls. help me out?First, thanks for your responses.
I haven't found the demo program 'BCS_EXAMPLE_6' in SAP 4.7. But then I got it in SAP 5.0 version. But this program only describes how to send Form output as PDF attachment with email. But this is well-known and I haven't asked for this. I want the Smartform output within the mail-body without attachment.
The weblog at "/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp seems a more logical one, though I have already tried it out. Here the html page creation and graphics load -- everything is going right. But this HTML page is being delivered as an Attachment within the email. The normal HTML Email is not coming. I think this technique wouldn't work with all mailing tools. Here in the weblog, Pavan has shown the example with Microsoft Outlook. But I have tested with Lotus Notes and Yahoo. And In both cases, the mail is coming with attached HTML file (in .mht format), but not as a notmal html mail without attachments. -
Adobe Bridge CS6, Output to HTML Gallery coding issue.
Adobe Bridge CS6, Output to HTML Gallery coding issue.
I have created the html, JavaScript, css file using the output function in Bridge CS6, which nicely generates the coding, pages, folders and files. I can edit the html files such as gallery title, name, etc., in Dreamweaver CS6 just fine and preview them in a selected browser (both chrome and IE) and everything works fine.
When I ftp upload the files and directories into my hosting account (Go Daddy), the images do not show up. The file table appears but the thumbs images does not appear and when selected to preview the larger image, it does not appear either. I have not altered the file structure at all. Go Daddy says it is a coding issue, but I cannot fine any errors.
Have you seen this issue before? All Adobe help research have failed. Any suggestions??Have you asked on Go Daddy site for help in uploading Adobe Bridge script? Just to say it is coding is not helpful.
-
Convert smartform output in to PDF using CONVERT_OTF function how to do it
Hi Anil , and Hi All
I am trying to display smartforms output in java webdynpro
for that i have got the following code in sdn.
can anybody please clarify these doubts in the below code
1) What are the mandatory input and output parameters
I have to pass here in this code to my application
2) please check my previous post also in this regards please
. Please reply at the very earliest. Check the below code
Convert smartform output in to PDF using CONVERT_OTF function module and you can write pdf using parameter 'binfile' of this function in WebDynpro using the following code:
It is copied from my prg. I hope you understand it.
public void onActionGetQuote(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionGetQuote(ServerEvent)
wdThis.wdGetOppt_QwriterCustController().executeZquote_Writer_Input();
String fileName = wdContext.currentZquote_Writer_InputElement().getOrder().toString().trim() + System.currentTimeMillis() + ".pdf";
String pdfOutput = new String(wdContext.currentOutputElement().getBinfile());
if (pdfOutput != null)
try
String pdfResoucePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), fileName);
FileOutputStream fileOutputStream = new FileOutputStream(new File(pdfResoucePath));
PrintStream ps = new PrintStream(fileOutputStream);
ps.print(pdfOutput);
ps.close();
//Display the PDF to the browser
String fileURL = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(), fileName);
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(fileURL, "Pdf Browser", false);
window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
window.removeWindowFeature(WDWindowFeature.MENU_BAR);
window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
window.open();
// To collect all the file created in the server by user
quoteFiles.add(quoteFiles.size(), pdfResoucePath);
} catch (Exception e)
throw new WDRuntimeException(e);
//@@endHi
ABAPers prepared a BAPI function module which calls Smart form , how can i execute it from java Webdynpro, so that I can display the smart form in Webdynpro. Pleas reply at the very earliest. Every answer will be rewarded.
regards
jalandhar -
Smartforms output in Duplex mode
Hello Gems,
I have defined 3 pages and i had set all the pages to duplex mode.
I need to print set of instructions in my smartform output in duplex mode (front & back of page)
Page1 : next window is Page 2 and i have a command to print Instructions (page INST)
Page2 : next window is blank(or page 2) and i have a command to print conditions (page INST)
Page INST : Does not has main window and next page is Page 2.
My pages flow in the following way:
page1>Page INST>Page2
Page 1 & 2 have main windows.
I need to see the INSTRUCTONS on every page that is printed with data. But i am getting an extra page that is blank
with no INSTRUCTIONS at the back.
when i print, i am 1st page properly but also getting an xtra blank page with no INSTRUCTIONS on the back.
Can some one suggest me ?
Thanks
DanHi,
Define a first page named FIRST for a form to be printed in duplex mode. You therefore set the Print mode in FIRST to D.
To make the duplex printing work correctly, you must define a second page FOLLOWER in which Print mode is left empty. In the form definition, you specify FOLLOWER as the follow-on page for FIRST and for itself as well.
Your text is then printed in duplex mode. FIRST switches the printer to duplex mode and forces printing of the first page on the front side of a new sheet. FOLLOWER accepts the duplex mode and sends no further mode print controls to the printer. The printer therefore alternately prints FOLLOWER pages on the fronts and backs of sheets.
For more details please refer to the below limk
http://help.sap.com/saphelp_nw70/helpdata/en/d1/802e77454211d189710000e8322d00/frameset.htm
Thank U,
Jay.... -
How can I put an output stream (HTML) from a remote process on my JSF page
Hello,
I've a question if someone could help.
I have a jsf application that need to execute some remote stuff on a different process (it is a SAS application). This remote process produces in output an html table that I want to display in my jsf page.
So I use a socket SAS class for setting up a server socket in a separate thread. The primary use of this class is to setup a socket listener, submit a command to a remote process (such as SAS) to generate a data stream (such as HTML or graphics) back to the listening socket, and then write the contents of the stream back to the servlet stream.
Now the problem is that I loose my jsf page at all. I need a suggestion if some one would help, to understand how can I use this html datastream without writing on my Servlet output stream.
Thank you in advance
A.
Just if you want to look at the details .....
// Create the remote model
com.sas.sasserver.submit.SubmitInterface si =
(com.sas.sasserver.submit.SubmitInterface)
rocf.newInstance(com.sas.sasserver.submit.SubmitInterface.class, connection);
// Create a work dataset
String stmt = "data work.foo;input field1 $ field2 $;cards;\na b\nc d\n;run;";
si.setProgramText(stmt);
// Setup our socket listener and get the port that it is bound to
com.sas.servlet.util.SocketListener socket =
new com.sas.servlet.util.SocketListener();
int port = socket.setup();
socket.start();
// Get the localhost name
String localhost = (java.net.InetAddress.getLocalHost()).getHostAddress();
stmt = "filename sock SOCKET '" + localhost + ":" + port + "';";
si.setProgramText(stmt);
// Setup the ods options
stmt = "ods html body=sock style=brick;";
si.setProgramText(stmt);
// Print the dataset
stmt = "proc print data=work.foo;run;";
si.setProgramText(stmt);
// Close
stmt = "ods html close;run;";
si.setProgramText(stmt);
// get my output stream
context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
ServletOutputStream out = response.getOutputStream();
// Write the data from the socket to the response
socket.write(out);
// Close the socket listener
socket.close();The system exec function is on the Communication palette. Its for executing system commands. On my Win2K system, the help for FTP is:
"Ftp
Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. Click ftp commands in the Related Topics list for a description of available ftp subcommands. This command is available only if the TCP/IP protocol has been installed. Ftp is a service, that, once started, creates a sub-environment in which you can use ftp commands, and from which you can return to the Windows 2000 command prompt by typing the quit subcommand. When the ftp sub-environment is running, it is indicated by the ftp command prompt.
ftp [-v] [-n] [-i] [-d] [-g]
[-s:filename] [-a] [-w:windowsize] [computer]
Parameters
-v
Suppresses display of remote server responses.
-n
Suppresses autologin upon initial connection.
-i
Turns off interactive prompting during multiple file transfers.
-d
Enables debugging, displaying all ftp commands passed between the client and server.
-g
Disables file name globbing, which permits the use of wildcard characters (* and ?) in local file and path names. (See the glob command in the online Command Reference.)
-s:filename
Specifies a text file containing ftp commands; the commands automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
-a
Use any local interface when binding data connection.
-w:windowsize
Overrides the default transfer buffer size of 4096.
computer
Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last paramete
r on the line."
I use tftp all of the time to transfer files in a similar manner. Test the transfer from the Windows command line and copy it into a VI. Pass the command line to system exec and wait until it's done. -
How to send smartform output in body of email?
Hi all ,
I have to send smartform output in body of email (not as an attachement in mail) .PLease help me in this regard.
Thanks,
Ananth S.Hi Ananth
See these threads.
[https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6889194]
[https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6861330]
[https://forums.sdn.sap.com/click.jspa?searchID=23497094&messageID=6855364]
Regards
Hareesh Menon -
Smartform Output to PDF conversion
Hi experts,
i want to convert the smartform output to PDF Format and stored it in system level.But i got the following information message "OTF end command // missing in OTF data".
I used "CONVERT_OTF" for conversion of smartform output and "WS_DOWNLOAD & GUI_DOWNLOAD".
wt it means,can i make any changes,if tl me why it shows the message.
points wl be rewarded.
Thank you
chandu
Edited by: Chandu Valluri on Jan 4, 2008 12:56 PMhi,
*& Report ZPDF_DNLD_TEST2 *
*& DEVK904540 *
REPORT ZPDF_DNLD_TEST2 .
data: i_otf LIKE itcoo OCCURS 100 WITH HEADER LINE,
i_pdf LIKE tline OCCURS 100 WITH HEADER LINE.
data: op_option type SSFCTRLOP,
job_output type SSFCRESCL.
op_option-getotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000005'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = op_option
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
itab1 = itab1
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = job_output
JOB_OUTPUT_OPTIONS =
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.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE =
BIN_FILE =
TABLES
otf = job_output-otfdata
lines = i_pdf
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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'c:\test_pdf_sf.pdf'
FILETYPE = 'BIN'
tables
data_tab = i_pdf
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Maybe you are looking for
-
Can not access Central Administration in SharePoint Foundation 2010
Hi, I have installed SharePoint foundation 2010 in Windows 7 machine. I can able to login into Central Administration. I can view Main page. But I can not enter into even any one setting. If i click any link i am getting login page again and I entere
-
How to get out of full screen mode in Firefox 4?
How to get out of "Full Screen Mode" in firefox 4 ?
-
Selecting a group of files and putting them in a newly created folder?
If I select a group of files in finder or on my desktop -- is there a command to create a new folder and put them in it? (I'm thinking of how you can take a selection in iTUNES and create a playlist from the selection). (I know how to create a folder
-
what is AD-HOC query
-
Satellite L505-10K - Unexpected error when using recovery disk creator
Toshiba Satellite L505-10k Can't make any recovery disc when I open toshiba recovery media creator, it says: an unexpected error occurred. Close the program and then restart it (error code: 0D00F6-49-00000015) and then I click ok and then it comes ag