Newspaper format in Smartforms
Hi All,
Could anyone plz explain me how to print the text in the main window of a smartform with a newspaper format?
KK
Hi,
I think u are reffering to Classifieds..in news papers..
cant think of how can we get that in smarforms but in scripts it is possible as we can have multiple main windows..
create multiple main windows side by side and you would get the classified effect..
hope it helps..
santhosh
Similar Messages
-
How to create paragraph format in smartforms
Hi All,
Let me know how to create paragraph format in smartforms?
Thanks&Regards
MaheshHi
When we create a smartform we can see in <b>global settings</b> , <b>form attributes</b>.
In <b>form attributes</b> we set the over all style of the smartform. Goto <b>form attributes</b> and open the tab <b>output options</b>. Here you can see the <b>Style box</b>. In this style box we enter the smartstyle created in transaction code <b>smartstyles</b>.
Open transaction <b>smartstyles</b>.
Create a new style.
Upon creating a new style you will see 3 folder structures under style name.
1. Header data
2. Paragraph format
3. Character format
To create paragraph format right click on the paragraph format node and click Create Node. Give it name. Now you will get a screen with 4 tabs.
Indents and spacing
Fonts
Tabs
Numbering and outline
Here you can provide the look you want.
Now add this smartstyle in your smartform's form attribute.
You can also provide individual smartstyles to each text element you create by giving the name of smartstyle in its output options tab. Each text element has a individual output option tab here you can give any smartstyle.
Click on the general attribute tab of any text element and give the paragraph format directly or by going to SAPScript editor mode.
Any more questions you can ask me directly mailing me.
Please do reward points if satisfied. -
Whats mean by multiple page formats in smartform?
Hi!
Can u pls tell me whats mean by multiple page formats in smartform?
Thanks
Imran.Hi Imran,
multiple page formats in smart forms means...
the first can be landscape, and the second one portrait...viveversa is also possible
go with tcode:smartforms,specify some name and go with create.place the cursor on 'Pages and windows' folder.on right side we will have option page format:go with f4 .u will find many page formats.
Reward points if helpful.
Regards,
Omkar. -
Dynamic formating in smartforms
I'm just curious if there is a possible to create a dynamic formatting in Smartforms. What I mean saying dynamic? Lets imaging that I've a strucure where I've following information;
LINE_NUMBER
TEXT
This structure is used to build a table, where I can assign one or more text to one line.
So my example data in this table will be:
LINE_NUMBER | TEXT
1 | my first item
1 | first item description
1 | some other text
2 | second item
2 | second item extended name
2 | second item additional text
2 | second item summary text
and so one...
So I can have varying texts number assigned into one line (max 8).
Now I want to use paragraph, with 8 prepared tabs.
Now the problem comes, how to pass this texts into tableline inside smartform and do not prepare separate lines for 1,2,3... elements?
Any idea? It is possible to prepare data in variable which looks like:
1,,my first item,,first item description,,some other text
and display this data in such way, that commas will be recognized as tabs formatting in paragraph instead displaying them?hi..try this...
create table->create a line type as required.
loop at itab containing ur data.
in the main area of the table create a row:
right click on main area->table line
in the output options of the row assign the line type from the drop down. in the condition of the row give the condition wa-LINE_NUMBER = 1.
similarly create other rows(table lines) giving the conditions 1 to 8.
that is you will have 8 table lines with conditions:
row1 condition -> wa-LINE_NUMBER = 1
row2 condition -> wa-LINE_NUMBER = 2
row3 condition -> wa-LINE_NUMBER = 3
row8 condition -> wa-LINE_NUMBER = 8
so if line_number = 1 then row 1 will be use..
if its 8 then row 8 will be used......
inside the rows u can use different text elements with different para formats... -
Dynamic character format in SMARTFORMS
Dear Gurus,
I want to make a dynamic character format in smartforms. I did it in SAPscript and success.
what I did in program before passing to smartform :
d_note = '<XX> dynamic text </>'
and pass it to SAPscript and smartforms :
&d_note&
in SAPscript I made new character format XX as BOLD and UNDERLINED. it works for SAPscript. the output become = dynamic txt
unfortunately when I do this in smartforms, it is a fail although I have set new character format XX as bold and underline in smartstyles. the output become = <XX> dynamic text </>
any guru has a solution for this smartform?Hi Sendy,
You cant use tags (eg- <XX>) in smartfomrs like you did in sap scripts. Use your style in the smartform( form attributes) with all character formats and paragraph formats which you need. When you create a new text module in the smartform you will get two drop down lists for the paragraph formats and character formats in the top of the editor. Type your text there and highlight then choose 'XX'(or any other character format) character format from the drop down list.
Hope this would help.
Cheers,
Jeewana -
Design Landscape format in smartforms
Can anyone explain how to design Landscape format in smartforms.
Regards,
KaaviyaIt's right there on the first screen of transaction SMARTFORMS.
Please look before asking here.
Rob
Corrected TX
Edited by: Rob Burbank on Oct 20, 2008 12:38 PM -
Customizing font size ,format in smartform....
Hi,
I m tried to create new style,and created t zstyle with paragraph format as A1 Arial, bold Italic
and character format as C1 Times, Bold with font size as 15, and standard paragraph has A1.
I checked and activated it succesfully.
I used this zstyle in Form attributes>output options>style> zstyle, and n the specified windows and tables.
But the output hasn't changed to the new style format,i m getting only the standard format, nothing has changed ...
so, give me a soln how to do this and ay corrections i have to make....
Thanks & Regards,
BDK....Hi,
Check these points
1. Make sure the Smart style is active.
2. Have you applied the Paragraph and Character format to smartform text. Just mentioning the style as zstyle in attributes will not cause any change.
Character format must be specified like <B>Terms of Prices :</>
3. Try the print preview with actual printer and not with "LP01" or "LOCL"
Regards -
Hi All,
I am working on smartforms.
I have created a new page format of width 25 cm and width 30cm according to client's requirement.
Smartform is for customer invoice which is a pre-printed and i have to get data into that.
In sform i have given the my own page format name.
Now problem is am getting print preview correctly but while giving print its givivng the error
' OUTPUT COULD NOT BE ISSUED' and print is not coming.
Please help me regarding this issue.
Thanks in advance.
Regards,
Murthy.Hi,
I have checked it but its ok.
I have created page format through SPAD only.
Regards,
Murthy. -
PDF file format error - Smartform to e-mail attachment
Hi All,
I am trying to convert smartform output to PDF and send as an e-mail/fax attachment. Every thing works fine except when I try to open attachment in e-mail it says Not supported file type or File Damage > May be not correctly decoded. I have attached my code for reference, any hints much appreciated. Thanks in advance.
Regards,
Tim
data: t_otf type table of itcoo,
t_tline type table of tline,
g_filesize TYPE I.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
w_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
<b> CALL FUNCTION FM_NAME</b>. .......
t_otf[] = wa_outinfo-otfdata[].
CALL FUNCTION <b>'CONVERT_OTF'</b>
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = g_filesize
BIN_FILE = g_binfile
TABLES
OTF = t_otf
LINES = i_tline
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
convert PDF 132 to 255
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING ' ~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~ '.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Refresh: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear w_objhead.
Object with PDF.
loop at i_record.
i_objbin-line = i_record-line.
append i_objbin.
endloop.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Object with main text of the mail.
i_objtxt = 'Find attached the output of the smart form.'.
APPEND i_objtxt.
i_objtxt = 'Regards,'.
APPEND i_objtxt.
i_objtxt = 'test'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
*Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = v_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Smartform_output' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'. "Internet address
APPEND i_reclist.
Sending mail.
CALL FUNCTION <b>'SO_NEW_DOCUMENT_ATT_SEND_API1'</b>
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
COMMIT_WORK = 'X'
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_hex = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Hi Tim,
I used this to send a smartform in pdf format by email.
Hope it helps
Cristian
REPORT y_cb_test_051 .
DATA DECLARATION
TYPE-POOLS: meein.
TABLES: toa_dara,
nast,
tnapr,
arc_params.
DATA: ent_retco TYPE sy-subrc,
ent_screen TYPE c,
l_xkomk LIKE TABLE OF komk WITH HEADER LINE,
xscreen. "Kz. Probeausgabe
DATA: i_texto_cuerpo LIKE solisti1 OCCURS 0 WITH HEADER LINE.
SELECT OPTIONS / PARAMETERS
PARAMETERS:
p_kappl LIKE nast-kappl OBLIGATORY DEFAULT 'EF',
p_objky LIKE nast-objky OBLIGATORY DEFAULT '0010001125',
p_kschl LIKE nast-kschl OBLIGATORY DEFAULT 'NEU',
p_spras LIKE nast-spras OBLIGATORY DEFAULT 'EN',
p_parnr LIKE nast-parnr OBLIGATORY DEFAULT '50009123',
p_parvw LIKE nast-parvw OBLIGATORY DEFAULT 'BA',
p_erdat LIKE nast-erdat OBLIGATORY DEFAULT '20050908',
p_eruhr LIKE nast-eruhr OBLIGATORY DEFAULT '130105',
p_aende LIKE nast-aende DEFAULT 'X',
p_nacha LIKE nast-nacha DEFAULT '1',
p_ndialo TYPE tdsfflag DEFAULT ' ',
p_telfx LIKE nast-telfx DEFAULT '1-720-220-4274',
p_tland LIKE nast-tland DEFAULT 'US',
p_sform TYPE tdsfname DEFAULT 'ZMMNABPR3PFMMPO_L3' OBLIGATORY.
*PDF TABLES
DATA: tb_pdf LIKE tline OCCURS 0.
DATA: tb_pdf255 TYPE so_text255 OCCURS 0.
MAIN PROCESSING SECTION
START-OF-SELECTION.
SELECT SINGLE *
INTO nast
FROM nast
WHERE kappl = p_kappl
AND objky = p_objky
AND kschl = p_kschl
AND spras = p_spras
AND parnr = p_parnr
AND parvw = p_parvw
AND erdat = p_erdat
AND eruhr = p_eruhr.
IF sy-subrc <> 0.
MESSAGE s000(00) WITH 'Record in NAST not found.'.
nast-kappl = p_kappl.
nast-objky = p_objky.
nast-kschl = p_kschl.
nast-spras = p_spras.
nast-parnr = p_parnr.
nast-parvw = p_parvw.
nast-erdat = p_erdat.
nast-eruhr = p_eruhr.
nast-nacha = p_nacha.
nast-telfx = p_telfx.
nast-tland = p_tland.
ENDIF.
nast-aende = p_aende.
tnapr-sform = p_sform.
PERFORM entry_neu
USING
ent_retco
ent_screen.
FORMS
*& Form entry_neu
text
-->ENT_RETCO text
-->ENT_SCREEN text
FORM entry_neu
USING
ent_retco
ent_screen.
DATA: l_druvo LIKE t166k-druvo,
l_nast LIKE nast,
l_from_memory,
l_doc TYPE meein_purchase_doc_print.
DATA: ls_print_data_to_read TYPE lbbil_print_data_to_read.
DATA: ls_bil_invoice TYPE lbbil_invoice.
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
xscreen = ent_screen.
clear ent_retco.
IF nast-aende EQ space.
l_druvo = '1'.
ELSE.
l_druvo = '2'.
ENDIF.
CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'
EXPORTING
ix_nast = nast
ix_screen = ent_screen
IMPORTING
ex_retco = ent_retco
ex_nast = l_nast
doc = l_doc
CHANGING
cx_druvo = l_druvo
cx_from_memory = l_from_memory.
CHECK ent_retco EQ 0.
IF nast-adrnr IS INITIAL.
PERFORM get_addr_key
CHANGING ls_addr_key.
ELSE.
ls_addr_key = nast-adrnr.
ENDIF.
*Set the print Parameters
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
ent_retco.
*Get the Smart Form name.
IF NOT tnapr-sform IS INITIAL.
lf_formname = tnapr-sform.
ELSE.
lf_formname = tnapr-fonam.
ENDIF.
determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
ent_retco = sy-subrc.
perform protocol_update_i.
ENDIF.
ls_control_param-getotf = 'X'.
DATA: l_document_output_info TYPE ssfcrespd,
l_job_output_info TYPE ssfcrescl,
l_job_output_options TYPE ssfcresop.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
zxekko = l_doc-xekko
zxpekko = l_doc-xpekko
zxaend = l_doc-xaend
IMPORTING
document_output_info = l_document_output_info
job_output_info = l_job_output_info
job_output_options = l_job_output_options
TABLES
l_xekpo = l_doc-xekpo[]
l_xekpa = l_doc-xekpa[]
l_xpekpo = l_doc-xpekpo[]
l_xeket = l_doc-xeket[]
l_xtkomv = l_doc-xtkomv[]
l_xekkn = l_doc-xekkn[]
l_xekek = l_doc-xekek[]
l_xaend = l_doc-xaend[]
l_xkomk = l_xkomk
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.
BREAK-POINT.
ENDIF.
Converts OTF to PDF
DATA: v_len_in TYPE i.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = l_job_output_info-otfdata
lines = tb_pdf
EXCEPTIONS
err_max_linewidth = 0
err_format = 1
err_conv_not_possible = 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.
Change the PDF format from 132 to 255.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src =
line_width_dst =
transfer_bin = 'X'
TABLES
content_in = tb_pdf
content_out = tb_pdf255
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 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.
DATA: lw_subject TYPE so_obj_des.
DATA: lwa_body TYPE solisti1.
DATA: ltb_body TYPE TABLE OF solisti1.
DATA: lw_filename TYPE char100.
DATA: ltb_recipients TYPE TABLE OF somlreci1.
DATA: lwa_recipients TYPE somlreci1.
lw_subject = 'This is the email subject'.
lwa_body-line = 'This is the email body - Line1'.
APPEND lwa_body TO ltb_body.
lwa_body-line = 'This is the email body - Line2'.
APPEND lwa_body TO ltb_body.
lwa_body-line = 'This is the email body - Line3'.
APPEND lwa_body TO ltb_body.
lwa_body-line = 'This is the email body - Line4'.
APPEND lwa_body TO ltb_body.
lw_filename = 'Contract'.
*RECIPIENTS
lwa_recipients-rec_type = 'U'.
lwa_recipients-express = 'X'.
lwa_recipients-receiver = sy-uname.
lwa_recipients-copy = ''.
APPEND lwa_recipients TO ltb_recipients.
RECIPIENTS
lwa_recipients-rec_type = 'U'.
lwa_recipients-express = 'X'.
lwa_recipients-receiver = '[email protected]'.
lwa_recipients-copy = ''.
APPEND lwa_recipients TO ltb_recipients.
RECIPIENTS
lwa_recipients-rec_type = 'U'.
lwa_recipients-express = 'X'.
lwa_recipients-receiver = '[email protected]'.
lwa_recipients-copy = ''.
APPEND lwa_recipients TO ltb_recipients.
Sends the PDF by email.
PERFORM f_send_pdf_by_email
TABLES
tb_pdf255
ltb_body
ltb_recipients
USING
lw_subject
lw_filename.
ENDFORM. "entry_neu
*& Form ZCA_MAIL_BIN
text
FORM f_send_pdf_by_email
TABLES
ptb_pdf255 STRUCTURE solisti1
ptb_body STRUCTURE solisti1
ptb_recipients STRUCTURE somlreci1
USING
pw_subject TYPE so_obj_des
pw_filename TYPE char100.
*-DATA DECLARATION----
Variables y tablas internas.
DATA: BEGIN OF ltb_objbin OCCURS 0.
INCLUDE STRUCTURE solisti1.
DATA: END OF ltb_objbin.
DATA: lwa_doc_chng LIKE sodocchgi1,
lw_tab_lines LIKE sy-tabix,
ltb_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
ltb_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
*-MAIN PROCESSING SECTION----
clear: ltb_objbin, ltb_objtxt, ltb_objpack, lwa_doc_chng.
refresh: ltb_objbin, ltb_objtxt, ltb_objpack.
Control Data
lwa_doc_chng-obj_name = 'URGENT'.
lwa_doc_chng-sensitivty = 'P'.
lwa_doc_chng-no_change = 'X'.
lwa_doc_chng-priority = '1'.
lwa_doc_chng-obj_prio = '1'.
lwa_doc_chng-obj_langu = sy-langu.
lwa_doc_chng-no_change = 'X'.
Email Subject
lwa_doc_chng-obj_descr = pw_subject.
Email Body
ltb_objtxt[] = ptb_body[].
CLEAR ltb_objtxt.
DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
IF lw_tab_lines GT 0.
READ TABLE ltb_objtxt INDEX lw_tab_lines.
lwa_doc_chng-doc_size =
( lw_tab_lines - 1 ) * 255 + STRLEN( ltb_objtxt ).
CLEAR ltb_objpack-transf_bin.
ltb_objpack-body_start = 1.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'RAW'.
APPEND ltb_objpack.
ENDIF.
Attachment
Move the binary attachment to other internal table.
ltb_objbin[] = ptb_pdf255[].
ltb_objpack-transf_bin = 'X'.
ltb_objpack-body_start = 1.
Get the number of lines in the Attachment (PDF FILE)
DESCRIBE TABLE ltb_objbin LINES lw_tab_lines.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'PDF'.
ltb_objpack-obj_descr = pw_filename.
ltb_objpack-obj_name = pw_filename.
ltb_objpack-doc_size = lw_tab_lines * 255.
APPEND ltb_objpack.
Call the function to send the PDF file by email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = ltb_objpack
contents_bin = ltb_objbin
contents_txt = ltb_objtxt
receivers = ptb_recipients
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
CASE sy-subrc.
WHEN 0.
WHEN 1. RAISE too_many_receivers.
WHEN 2. RAISE document_not_sent .
WHEN 3. RAISE document_type_not_exist.
WHEN 4. RAISE operation_no_authorization.
WHEN 5. RAISE parameter_error.
WHEN 7. RAISE enqueue_error .
WHEN OTHERS. RAISE x_error.
ENDCASE.
COMMIT WORK.
ENDFORM. "ZCA_MAIL_BIN
*& Form get_addr_key
text
-->P_CS_BIL_INVOICE_HD_ADR text
<--P_CS_ADDR_KEY text
FORM get_addr_key
CHANGING l_addr_key LIKE addr_key.
DATA: l_lfa1 LIKE lfa1.
SELECT SINGLE * FROM lfa1 INTO l_lfa1
WHERE lifnr = nast-parnr.
IF sy-subrc = 0.
MOVE l_lfa1-adrnr TO l_addr_key.
ENDIF.
ENDFORM. " get_addr_key
*& Form set_print_param
text
-->P_LS_ADDR_KEY text
<--P_LS_CONTROL_PARAM text
<--P_LS_COMPOSER_PARAM text
<--P_LS_RECIPIENT text
<--P_LS_SENDER text
<--P_CF_RETCODE text
FORM set_print_param USING is_addr_key LIKE addr_key
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
lf_repid = sy-repid.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
CALL FUNCTION 'Z_MMNA_WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
cs_composer_param-tdimmed = ' '.
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-no_dialog = p_ndialo.
cs_control_param-preview = xscreen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
ENDIF.
ENDFORM. "set_print_param
Message was edited by: Cristian Berri -
Multiple page formats in smartforms
we say that multiple page format is possible in smartforms but not in SAP Script. What does this multiple page format exactly means and whar does label means exactly in smartforms.
Please help.multiple page formats in smart forms means...
the first can be landscape, and the second one portrait...viveversa is also possible
label means... for example u want to print addresses of employees in an organisation... then through scripts ypu can print the labels... -
Hi,
How can I change the format of a Smartform to the different output formats "Html" or "PDF" in the programm?.
Have I to change the output-options ? What are the combinations?.
Where can I read anything about these questions?.
Thanks.Thank you ,
I have solved the problem with your tips.
I have made a program and I can change my smartform in normal Print or PDF or HTML format.
Perfect.
Thanks again -
Change a number into word format in Smartforms.
hi....
plz tell me how can I display word format of a number in a smartforms.
i have a prientout form which display the net value Rs 3250 .my task to write in word like 'three thausands two hundred fifty rupies only'spell_amount FM
Check this..
DATA : money TYPE p DECIMALS 2,
in_letters LIKE spell.
money = '1000.00'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = money
IMPORTING
in_words = in_letters
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
WRITE : / in_letters-WORD.
Madhavi -
Hi Friends,
i am working in Smartforms, i have a date field when used in smartform its date formate is dd.mm.yyyy but i need dd.mm.yy
example while taking printout its coming as 15.05.2008 but i need is 15.05.08,
i used SET DATE MASK but its not working.
is there any Function Module there to convert
please help me
Regards
kumar Mchange it in print program...
data: date(10) type c value '15.02.2008',
day(2),
month(2),
year(4),
lv_year(10).
day = date+0(2).
month = date+3(2).
year = date+6(4).
year = year+2(2).
concatenate day month year into lv_year seperated by (whatever u want).
**and use this lv_year in your smartform.
regards -
Hi ,
In Smartforms i have to display the NETPR, NETWR ,MENGE fields in the following format........
1,00,000.00
Usually these fields will be shown as 100000.00
How to format these fields.
Is there any FM to do this.
Kindly let me know.
Vikki.HI,
DATA:l_v_sep TYPE sy-batch,
l_v_dec TYPE sy-batch,
v_kzwi1 TYPE kzwi1.
DATA:l_v_dis_temp TYPE char20,
l_v_char2 TYPE char2,
l_v_gross_sale TYPE char20.
CONSTANTS:l_c_dot TYPE char1 VALUE '.',
l_c_comma TYPE char1 VALUE ','.
CALL FUNCTION 'CLSE_SELECT_USR01'
EXPORTING
username = sy-uname
IMPORTING
X_USR01 =
DATE_FORMAT =
decimal_sign = l_v_dec
separator = l_v_sep .
v_kzwi1 = '10000.00'.
WRITE v_kzwi1 TO l_v_dis_temp.
SPLIT l_v_dis_temp AT l_v_dec
INTO l_v_gross_sale
l_v_char2.
CONDENSE l_v_char2.
REPLACE ALL OCCURRENCES OF l_v_sep
IN l_v_gross_sale
WITH l_c_comma.
CONCATENATE l_v_gross_sale
l_v_char2
INTO l_v_gross_sale
SEPARATED BY l_c_dot.
Regards
Jana -
Date format within smartforms printing
Hello,
I have an issue regarding date format.
When I print a delivery note date format is e.g. 08.04.2011, printing an invoice it shows 04-08-2011.
It seems that depending on the customers country the invoice printing converts to date format within country settings
(V_T005-DATFM) while delivery form doesn't.
If I always want to print in date format of sales company what should I do?
Thanks a lot,
Wolfi.I guess, it should work if you define
/: SET COUNTRY &country_key&
in the Initialization section of your smartform.
Note: The country-dependent formatting options are stored in the T005X table.
Regards,
SaiRam
Maybe you are looking for
-
Failed to install php-oci8 with instant Client for linux 64
Hello, I have a 64-bits Linux box with RHEL4, and PHP version has been upgraded from 4.3.9 to 5.1.6. I try to make the connection to remote oracle server. I download instantclient-basic-linuxppc-10.2.0.2-20060327.zip , and follow the instruction to i
-
Good day! I'm working on AIR mobile application for iOS. This is a great feature on iOS which can show the static image before the AIR is initialized. But my app has a really lot of content. When the AIR is initialized user can see the black screen f
-
Hierarchical query - CONNECT BY and result in different columns.
Hi everyone, I have a small question, hoping that someone can help me. As you will see, this is not very important. It's just me wondering if I can learn something in SQL. Let's suppose I have an ORGANIZATIONS table: CREATE TABLE ORGANIZATIONS ( ID
-
Retrieve data from gridview into excel
I have a gridview which fetches its data from SQL server, The code that i have used is shown below using which i want to export the data into an excel sheet, but it throws the following exception Server Error in '/' Application. Control 'ctl00_m_g_e
-
DBMS_JOB not exported by DATAPUMP?
Hi We are setting up expdp, and we cannot get DBMS_JOBS to be exported. And so far we have not found any documentation of wether DBMS_JOBS are supposed to be exported or not. And I know DBMS_JOB are going to be deprecated, and DBMS_SCHEDULE is beeing