Smartforms output different in two systems
Hi Gurus,
I've a smartform in Q and Prd. Versions are same but the font and style look different in both systems. In Q, the form is in bold, but not in Prd. Is it related to printer settings? What to check in SPAD? Both systems use LOCL printer. I also noticed the device type in SPAD is different. Does it impact the font?
Regards,
Raj.
Hello Raju.
1) If you have used smartstyle for font, check if it is transported to PRD. It may still be in QAS.
2) Get the smartform backup from PRD and upload it in DVT and transport to QAS.
Now check the output in QAS.
Regards.
Similar Messages
-
Hello,
I have some smartforms, the output is different in my two systems. In the developpement system everything is ok, when I go in the consolidation system ... the text is not align, the gray is not the same, the tabulation are sometimes different ...
I have no idea how to check if the smartforms in the two system are the both, and what could be different ..
Any help are welcome
Regards
Frédéric
PS: I have check the request order.Hi Wojtek,
I have check the form style, but I see something strange in the table STXSADM, there is the same creation date, but not the same modification date (with the same version number).
So I ask a new request order for this form style. I'm waiting the result.
I have check the output device also, it's the same, I use local device of my Windows.
Thanks for your answer
Frédéric
Message was edited by: Frédéric Girod -
% DB increase differs for two system from the same landscape
Hi all ,
I have done upgrade and then unicode conversion for the two system- sandbox and development from 4.6 C to ECC 6.0 with oracle 10 G and AIX 5.3
On sandbox % db( used db size in DB02 ) increase is 60 to 80 which is as per SAP figures after unicode conversion however on dev it is almost 150 % .
Has anybody faced the same problem before or can you suggest somthing for this tremendous data growth
Also what I have observed is threre are 7 tablespace on sandbox and 8 on Dev with "PSAPSR370" as the additional one on DEV ( PSAPSR3700 is different )
Please help me on this
-GaneshHi Ganesh,
the database growth depends heavily on the content. Which languages do you have installed in your system and which modules are used by your company?
I think the normal growth should be in a range of zero to 30 percent. The lower end comes from the reorganization effect due to the migration and 30 percent comes due to the fact that most data is normally numeric and numbers are the same with or without Unicode. But in rare situations it could be possible to see much higher values. The reason is, that Oracle, and also DB2, are using UTF-8 encoding if you're running your system as Unicode system. In UTF-8 a two byte Unicode character could be encoded in up to four bytes. That means if your systems contains lots of double byte characters it could grow much more than 30% but it seems unusual to me.
Are you sure that nothing was wrong with your migration?
Best regards
Ralph Ganszky -
Same font appears different in two systems
The problem principally lies with transaction MM03 (Material Master - Display). The material description in "Additional Data" tab in any Material View is appearing to be of different fonts in two different client systems.
Upon checking, I found that both systems use the same font (Arial Monospace for SAP) with fotn size of 9.
Hence, I am not able to understand the difference in appearance of the two.
I have tried comapring I18N settings of both the systems. Please suggest a way to get rid of this problem.
Regards,
AnkurHI,
Font depends on client.............so first check the client
Just check the SE73 Font download
-Rick -
Number field displays differently on two systems.
I have a ColdFusion front end/Oracle backend application I inherited from the company that lost the contract to my company. In one screen, there is a field the customer wished to increase from NUMBER (10,3) to NUMBER (10,8). After researching and conferring with the Gov't DBAS supporting the production and test systems, it was suggested that I just alter the field to plain NUMBER, I did so on my Development system and changed the CF code to allow for proper display. It worked quite well. I had the Gov't DBAs change the field in the production and test databases to match. I then FTP'd the CF code to the test system. It allows for entry and initial display of the new field size, but upon saving it (unlike my Development test) truncates/rounds up (i.e.- 123.87654321 becomes 123.87700000). I have ensured the proper code is there and verified with the Gov't DBAs that the databases matches my Develop database. What things could cause this problem? It has me baffled. All the instances are identical and the code on Development and Test is identical. Any ideas?
es336td wrote:
I remove all designation and set to just NUMBER. From Oracle documentation...
NUMBER(p,s)
Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127.
There are 2 different concepts of number here. You should not mix them up.
With Number, there is no explicit precision and no explicit scale. That is, there are no arguments p, s. In that case, Oracle stores a number in the form d * 10^s, where d is a number that can have up to 38 digits and s ranges between -84 and 127. This is similar to the so-called scientific notation.
However, your original question is about 123.87654321. You want this number to differ from 123.87700000. These are decimals, which imply you require precision and scale. The number 123.87654321 requires the type Number(11,8). You had allocated Number(10,8) to it, which falls short.
I also notice that the conversion 123,87700000 has a comma. If that is indeed so, and not just a typing mistake, then it means two things: (1) The conversion already occurred, even before the database, in a locale in which a comma is used as decimal separator; (2) the database column is not of numeric type. -
Last changed date different between two systems after transport
Hi, first of all, I am not from basis background and just want to make sure whether is this something correct or not.
I found that the "Last changed date" and "username" are not same between the original system and the target system. Is this something configurable?
And the "username" field is totally empty. However, the program code's version is identical in both systems.I think I misunderstood your question. You are referring to the system Transports not the connections between systems. If the Transports are not transferring all the contents, you really should talk to your basis folks and tell them which items are not being reproduced correctly.
Regards,
Mike -
Smartform output in two different printers
Hi Experts,
I want to take the Smartform output in two different printers. printers has been added in the table <b>pkhd</b> .
please anyone suggest how to pass these two in the smartform function module?
Thanks in Advance
Kavya DevaHi Kavya,
You can execute the Smart form Function Module. It will then pop-up a dialog box asking for an output device. There you can specify the Output device type and go for Print or Print Preview as necessary.
Manoj -
Can two different SRM clients systems connect to one R/3 Back-end system?
Hello,
Trying to developing SRM Co-Exist/Global strategy, based on the following scenario:
1. Two different SRM client systems, each at DIFFERENT SRM Version/Release Level. SRM system "A" runs in Stand-Alone and Extend Classic Scenario mode. SRM system "B" runs in Classic Scenario mode
2. Two different R/3 back-end systems, each with SAME R/3 4.7 Version/Release Level.
Question 1: Can the two (2) different SRM client systems be connected to one (1) of the R/3 back-end systems?
Question 2: Are there any Basis Plug-In (PI_BASIS) issues/difficulties to consider from either the SRM client or R/3 back-end side?
Question 3: Does each SRM client need it own unique transaction document type(s) and number range(s) definitions?
Question 4: Are there any other difficulties, for example, with RFC and Partner Profile related definitions and what are the steps to address/resolve difficulties?
Please advise and thanks in advance for your feedback!
Regards,
Ed
Edited by: Ed Shigo on Mar 16, 2009 6:40 AMQuestion 1: Can the two (2) different SRM client systems be connected to one (1) of the R/3 back-end systems?
They can be connected
Question 2: Are there any Basis Plug-In (PI_BASIS) issues/difficulties to consider from either the SRM client or R/3 back-end side?
Make sure that you have unique consumer entries for Middleware for Material replication, RFCs etc
Question 3: Does each SRM client need it own unique transaction document type(s) and number range(s) definitions?
Yes you need to have them.
Question 4: Are there any other difficulties, for example, with RFC and Partner Profile related definitions and what are the steps to address/resolve difficulties?
Don't see any difficulties as long as the a structured approach is followed. -
Need smartform output in different languages
Hi expert,
Can you please let me know how can I see the output of a smartform in different languages. I'm seeing the output of a sales order. I have three output types . ZZAC,ZZ00, ZZ01. The smarform is developed with the language attributes of Translate into all languages. Is it required to convert the forms in SE63? or there are other ways we can see it.
I need the output in all the languages like FR,EN,DE,IT,ES ,EN etc.
Thanks in Advance,
AbhiHI,
Try This... hope it will solve your problem....
To maintain the translations:
1. Go to transaction SE63 in R/3. Go to menu Translation->R/3 Enterprise->Other Long Texts.
2. Select the object type in the pop up. Smartform (SSF) object type is found under Forms and Styles(FS).
3. Enter the name of the Smart form and choose the source and target language(Let the Source Language be 'EN'). Now Click on 'EDIT'.
4. This would open a screen with the Smartform code in Source language on the top and an editor with the same code in the bottom. Find the text for which you need to maintain the translation and insert the translation in that place.
As usual after required texts are maintained Save and Activate.
To see the translated Smartform create an output type and assign the smartform and the driver program to this output type. In the transaction that sends output to this smartform, select the output type and select the language in which the smartform has to be displayed (translations have to be maintained in this language).This will give the smartform in the required language.
Regards,
Shri -
Loading two different SAP BW system from one SAP R/3
Hi all,
is it possible to load the data from one SAP R/3 4.7 to two different SAP BW systems in parallel?:
A) BW 2.1C
B) BW 3.5
I mean not because R/3 has for example version of R/3 Plug-In which is compatible only to one R/3 Plug-In installed on BW side.
Are there any other restrictions? Ar there any workarounds how to hande this situation?
Thanks,
m./Hi dear,
I think you shouldn't have any problem!
Look at OSS Note 775568 'Two and more BW systems against one OLTP system' to have more details...
"R/3 has for example version of R/3 Plug-In which is compatible only to one R/3 Plug-In installed on BW side"...what's your plug-in version in R/3 ? I can't understand what do you mean with "R/3 Plug-In installed on BW side" !!!
Hope it helps!
Bye,
Roberto
...and please don't forget to reward the answers...it's THE way to say thanks here, my dear colleague ! -
Smartforms have different FM,Program Name in different system
Hi,
I have created few Smartforms in our DEV system & imported to QAS & PRD.
Here I found the Smartform - Function Module, Programs names are different in each system.
Smartform: Z_SD_INV_LETTER_V3
Sys Function Module
DEV /1BCDWB/SF00000006
QAS /1BCDWB/SF00000002
PRD /1BCDWB/SF00000002
On import the changes are reflected correctly in the corresponding Function Module & programs
in each system.
1. I want to know why there is a change in version of the Function Module/Program in each system.
2. How are the changes been applied on importing to each system as the version differs.
Regards
VincentHi Guys,
Thanks for your answers...
From my investigation found that few tests smartforms was created in DEV system, which was the cause of the problem. My Smartform present versions across the landscape looks as follows:
Smartform: Z_SD_INV_LETTER_V3
Sys Function Module
DEV /1BCDWB/SF00000006
QAS /1BCDWB/SF00000002
PRD /1BCDWB/SF00000002
In order to maintain all the function module name to be the same across the landscape, is there anything that can be done
in DEV as follows:
Smartform: Z_SD_INV_LETTER_V3
Sys Function Module
DEV /1BCDWB/SF00000002
QAS /1BCDWB/SF00000002
PRD /1BCDWB/SF00000002
Like something I could reset the internal number range for the smartforms & load the smartform again and activate or so...?. Please let me know...
Regards
Vincent -
Can't install TCS4 on two different XP SP3 systems
I can't install the TCS4 trial version on two different XP SP3 systems. Adobe has no solution to this problem. The Installer says "System Requirements" as error message after selection of the different applications. Then I get the link to the Adobe TCS homepage. Any idea?
Thanks in advance
Martin KellnerHave you read my sentence "Adobe has no solution to this problem" ? ;-) I'm in contact with Adobe. I have an open support issue since the 8th Feb.
-
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. -
Converting smartforms output into PDF
Hi ALL,
How to convert the smartforms output into PDF based form. After executing the form, it should directly open in PDF. How to do this?
Points will be awarded.
Thanks and regards,
vinoth.Hi Vinoth Kumar,
Please go throuh the below procedure and sample Code, this might help you.
Procedure
When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
Environment => Function Module_Name . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is /1BCDWB/SF00000152 . In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be X. Setting this field will activate the OTF field in smartform.
In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
In every Smartform output in OTF format, TDPRINTCOM begins and ends with //. EP represents the end-of-page value for TDPRINTCOM field.
In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method cl_gui_fronted_services=>file_save_dialog to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
Here is a sample code of program to perform the function.
SAMPLE CODE
*& Report ZAMIT_SMART_FORM_PDF *
REPORT ZAMIT_SMART_FORM_PDF .
data: carr_id type sbook-carrid,
cparam type ssfctrlop,
outop type ssfcompop,
fm_name type rs38l_fnam.
DATA: tab_otf_data TYPE ssfcrescl,
pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
file_size TYPE i,
bin_filesize TYPE i,
FILE_NAME type string,
File_path type string,
FULL_PATH type string.
parameter: p_custid type scustom-id default 1.
select-options: s_carrid for carr_id default 'LH' to 'LH'.
parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
data: customer type scustom,
bookings type ty_bookings,
connections type ty_connections.
start-of-selection.
suppressing the dialog box for print preview****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = SPACE.
cparam-getotf = 'X'.
select single * from scustom into customer where id = p_custid.
check sy-subrc = 0.
select * from sbook into table bookings
where customid = p_custid
and carrid in s_carrid
order by primary key.
select * from spfli into table connections
for all entries in bookings
where carrid = bookings-carrid
and connid = bookings-connid
order by primary key.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
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.
exit.
endif.
Hope this resolves your query.
Reward all the helpful answers.
Regards
calling the generated function module
call function fm_name
exporting
archive_index =
archive_parameters =
control_parameters = cparam
mail_appl_obj =
mail_recipient =
mail_sender =
output_options = outop
user_settings = SPACE
bookings = bookings
customer = customer
connections = connections
importing
document_output_info =
job_output_info = tab_otf_data
job_output_options =
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc <> 0.
error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
tab_otf_final[] = tab_otf_data-otfdata[].
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.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = FILE_NAME
path = FILE_PATH
fullpath = FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
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 = FULL_PATH
filetype = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
filelength = file_size
TABLES
data_tab = pdf_tab
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.
ENDIF. -
Text and table structure getting jumbled up in the smartform output
Hi all ,
While viewing the print preview of a smartform output , i am facing a strange issue.
The hardcoded text is getting jumbled up .For eg:"As soon as possible" becomes " as possible . soon as"
The structure of the table is also getting reversed.That is the table is now getting displayed with the last couloum first.The data in the table is also coming in the reverse order.
While executing the smartform directly , the layout is coming in the proper order.But while executing this through a transaction (FINT) , this issue is coming up.The print program is a standard program.
I have tried deleting the window , copying it to a new smartform etc.I have also tried in different systems to check whether if it is an issue with the system.
If anyone has faced a similar issue , please let me know how to solve it.Thanks a lot in advance.
Regards,
RashmiHi
Please check the Printout rather the print Preview. and also check the Structure/table entries also that u printing and also if u r using template, then check the assignment 1 of 1 , etc to the texts.
surya
Maybe you are looking for
-
HP ENVY m6 Notebook PC trackpad issue even after HP repair
2 weeks ago i sent my HP ENVY m6 Notebook to the HP Repair center because i was having major issues with the trackpad. It would not move fluidly,and click, and move on its own. I received my laptop back today anticipating that everything would work p
-
All pdf files come up in code no optin to open with
all pdf files come up in code no way to change to word no option to open with ?
-
Change the default color and backgroundcolor in Ac...
Hi. I'm sick an tired of the white on cyan color in the Active Notes. Does somebody know how to change that? I know about the possibility to select the text and change the color, but I want to set the colors by default. Thanks.
-
Creation of table or grid in the application
Hi, Can we create a table or grid in the front end to display some values selected from some multiselect list or a list manager... or is there any other way to do the same.. Help me Regards, Pa
-
Problem z rejestracją adobe photoshop cs6
Proszę o pomoc z rejestracją photoshopa. Dzisiaj zakupiłem photoshopa cs6. Zainstalowałem, następnie założyłem konto na adobe.com. Potem zarejestrowałem produkt. Niestety na początku instalacji program nie mógł połączyc się z internetem. Wybrałem zar