Smartform builder
hi experts,
i am very new to abap.
can anybody tell me how to build a smartform using tables VBAK and VBAP and fields matnr,vbeln,posnr,netwr,meins.
plz its urgent .tell me how?
SAP PRESS REFERENCE
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Check these step-by-step links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
Reward points if helpful.
Similar Messages
-
Error in smartform table builder
hi all,
i created a loop in a amartform builder.every thing is correct.
but when i test the smartform it says
"component" expected after "BY"
i don't understand what is this?
plz help me.
points will be rewarded if helpful.hi vamsi,
thank u.it solved my problem.
i rewarded points to u.
can u please tell me how to build a table in smartform builder using table painter.i am learning Smartforms.
can u tell me step by step plz....
points will be awarded for sure. -
Replace SAP Script of COPI transaction with new Smartform?
sorry ..wrong place
Edited by: Suzie on Apr 28, 2010 10:03 AMWhy? Do you have a couple of months to spend on the development?
SAPScript will be supported by SAP for the predictable future; there have clients all over the world relying upon it. If you need to change the output, SAP best practice is: leave the driver program as is, copy the script layout set into a custom (Z) version, and add any necessary /: PERFORM... routines and any new fields.
On the other hand, if your client or employer is (misguidedly, IMHO) insisting upon a new SmartForm (which will also mean a new driver program), you could try the programmed conversion. When I went to SmartForms class, even the instructor advised against using the tool, since (at that time, at least) you were likely to have an unusable pile of trash after the attempt to convert the layout set, but that was in 4.6c. Perhaps the "real" SmartForms build that became available beginning in WebAS has better tools. -
No new editor for Text elements in Smart forms
Hello all,
I've a problem on SAP demo system (version 7.2). When I add new Text element on window then on tab General Attributes I'm only able to see ComboBoxes for "Text Type", "Start", button pencil (for going into fullscreen old editor) and button for checking object. The last thing is that I can also see here label "Use the fullscreen text editor". When I've checked on other systems I saw that instead of that label there is new editor here, and clicking on pencil button leads to new fullscreen editor.
Does anybody know where I can enforce smartforms builder to use new editor?
Best regards
Marcin CholewczukHello Marcin,
Is the text edit portion showing as disabled?
FYI i don't have MS Office installed on my frontend & in my case the text edit is disabled. Is this the case with you as well
BR,
Suhas -
Print Campaign letters sorted by ZIP code
Hello SDN,
we want to print out the letters of a Campaign soted by the ZIP Code. We have 6000 Business Partners in our Target Group. If we not print them sorted by ZIP Code we had to pay 0.45 Euro per letter. If we print them sorted by ZIP Code it costs us only 0.25 Euro. That are 1200 Euro in total.
Is there a BAdI or Customizing which we can set up to get the output sorted by ZIP Code? I found no setting for our communication channel "Letter with Activity creation".
Best regards
GregorHello Christoph,
the print is done through a Campaign Channel. It uses a stripped down Version of smartforms build in transaction CRMD_EMAIL. There is no BAdI which I could use to influence the sorting when the printing is started during Campaign execution.
Regards
Gregor -
Can't send smartform to external mail address
Hi, everyone.
Now, after creating some self-defined smartforms, we want to send its
PDF copy to
our external mail address. From this point, I had some try.
Reference to SAP Library, I make a testing program named 'YPDF_TEST'.
However, one exception always exists when running and error message id
is 'XS806' - means
"No delivery to &, invalid recipient address"
I filled the address with following fields.
[ dev_mail_recipient-logsys = 'CLNT600'.
dev_mail_recipient-objtype = 'RECIPIENT'.
dev_mail_recipient-objkey = '[email protected]'. ]
I just can't understand the real reason why it doesn't work.
Through debugging, I found the error occurs when handling the following
codes
in function "SX_ADDRESS_TO_DEVTYPE".
[ swc_create_object o_recipient 'RECIPIENT' recipient_id-objkey.
swc_get_property o_recipient 'CommunicationType' m_recipient-type.
get_property_longvalue o_recipient m_recipient-address. ]
On the current situation, if can't come over this problem,
we may not build the connection and don't provide information in time.
Failed to send, I yet try another function - added the tail but on earthdidn't get it ~~~
Would you give me some hints or advice ?
Any help is appreciated.
====================
<i>REPORT ypdf_test .
DATA: fm_name TYPE rs38l_fnam.
DATA: my_control_pars TYPE ssfctrlop. "for CONTROL_PARAMETERS
DATA: my_output_info TYPE ssfcrescl. "for JOB_OUTPUT_INFO
DATA: output_options TYPE ssfcompop.
DATA: e_devtype TYPE rspoptype.
DATA: gw_lcprint TYPE ziebsflc001.
DATA: bin_file TYPE xstring,
bin_filesize TYPE i,
ndiv TYPE i, offset TYPE i,
nmod TYPE i.
DATA: BEGIN OF bin_table OCCURS 0,
x TYPE xstring,
END OF bin_table.
DATA: lines LIKE tline OCCURS 0.
DATA: dev_mail_sender LIKE swotobjid, "B20K061818
dev_mail_recipient LIKE swotobjid.
DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
DATA: param LIKE itcpp.
my_control_pars-no_dialog = 'X'.
my_control_pars-getotf = 'X'.
Get genereated function name of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZDEMO_SMART_FORM_PPF'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
Get Device type
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
e_devtype = e_devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5 .
IF sy-subrc <> 0.
ENDIF.
output_options-tdprinter = e_devtype.
set needed mail option
my_control_pars-device = 'MAIL'.
dev_mail_sender-logsys = 'CLNT600'.
dev_mail_sender-objtype = 'RECIPIENT'.
dev_mail_sender-objkey = 'CHI_DEV03'.
dev_mail_recipient-logsys = 'CLNT600'.
dev_mail_recipient-objtype = 'RECIPIENT'.
dev_mail_recipient-objkey = '[email protected]'.
CALL FUNCTION fm_name
EXPORTING
control_parameters = my_control_pars
mail_recipient = dev_mail_recipient
mail_sender = dev_mail_sender
output_options = output_options
ip_carrid = 'ID'
ip_connid = '8290'
ip_fldate = sy-datum
ip_bookid = '12345678'
ip_customid = '09876521'
ip_luggweight = 90
ip_wunit = 'KG'
ip_smoker = 'X'
IMPORTING
job_output_info = my_output_info
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.
Another try ***
*DATA: param LIKE itcpp.
*DATA: BEGIN OF off_obj.
INCLUDE STRUCTURE soodk.
*DATA: END OF off_obj,
ok TYPE c,
msgid TYPE symsgid,
msgno TYPE symsgno,
msgv1 TYPE symsgv,
msgv2 TYPE symsgv,
msgv3 TYPE symsgv,
msgv4 TYPE symsgv.
*DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
*CALL FUNCTION 'CONVERT_OTF_AND_MAIL'
EXPORTING
mailoptions = param
mail_sender = dev_mail_sender
mail_recipient = dev_mail_recipient
IMPORTING
office_objid = off_obj
mail_ok = ok
msgno = msgno
msgid = msgid
msgv1 = msgv1
msgv2 = msgv2
msgv3 = msgv3
msgv4 = msgv4
TABLES
mail_application_object_ids = dev_mail_applobj_tab
otf = my_output_info-otfdata.</i>Hi,
You can follow a different approach. Send the output of the Smartform to the spool.
You have a Function Module to read the spool and convert it to PDF . Then there is one more function module to attach the PDF and send it as a mail.
You need to configure SMTP in Tcode : SCOT.
Search the forum with emailpdfattachment
You have umpteen postings available.
Pls reward if useful.
Regards,
Laxman Nayak -
Hi experts
i did a print prg for sending the pdf attachment by smartforms.
but it's getting dumpped,this is my code
plz help me,its urgent.
i checked even SDN Forums also.i made some changes,
even though i don't get the output.
it shows not matching the I_OBJBIN in "SO_NEW_DOCUMENT_ATT_SEND_API1" function module.
REPORT ZCS_SF6.
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_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,
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.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZCS_FORM6'
importing
fm_name = v_form_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.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = W_CTRLOP
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = W_RETURN
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.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
LINES-TDLINE
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
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.
Attachment
Refresh: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear w_objhead.
Object with PDF.
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 = 'Chandu'.
*APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
read table i_objtxt index 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'.
w_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
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.
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
i_objpack-obj_descr = 'sf output'
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = '[email protected]'.
*i_reclist-express = 'X'. "Send express
i_reclist-rec_type = 'U'.
APPEND i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = '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.
points wl be rewarded,if it is useful
thanks in advance.HI,
Here is the complete program for you.. I have done the same requirment..
P R O G R A M D E C L A R A T I O N *
PROGRAM ID : ZF_QUERY_BANK
AUTHOR : Mahesh Raganmoni
OWNER(Process Team) :
CREATE DATE : 03/04/2004
R/3 RELEASE VERSION : 4.72
BASED-ON PROGRAM : none
ADS : BP14.B&CF.301
DESCRIPTION : This program calles the Bank Query Smartform
and sends this smartforms as an email to the
bank
MODIFICATION LOG CONTROL (Most recent on top):
DATE AUTHOR CTS REQ DESCRIPTION
*09/13/2004 Mahesh Raganmoni DR1K901766 Original Version *
T A B L E S *
TABLES : BUT021, "BP: Address usages
BUT020, "BP: Addresses
T001, "Company Codes
DFKKZP, "Payment lot: Data for payment
BUT000, "BP: General data I
ADR3, "Fax Numbers (Business Address Services)
BNKA, "Bank master record
T012. "House Banks
Internal Tables *
*Address Details of Business Partner
DATA :IT_ADDRESS LIKE STANDARD TABLE OF BUS020_EXT WITH HEADER LINE.
*Return Table
DATA : IT_RETURN LIKE STANDARD TABLE OF BAPIRET2.
PDF Data to hold the data to be sent as an attachment
DATA : IT_PDF_NUC_DATA TYPE STANDARD TABLE OF SOLI.
Converted data from OTF
DATA : IT_PDF_TABLE TYPE RCL_BAG_TLINE.
Data Declaration for Sendig Email
DATA: IT_OBJPACK LIKE SOPCKLSTI1 OCCURS 1 WITH HEADER LINE,
IT_OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE,
IT_OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
IT_OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
IT_OBJHEX LIKE SOLIX OCCURS 10 WITH HEADER LINE,
IT_RECLIST LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE,
IT_LISTOBJECT LIKE ABAPLIST OCCURS 1 WITH HEADER LINE.
Structures *
DATA :WA_BUS000 TYPE BUS000_EXT, "Business Partner Details
WA_ADDRESS TYPE BAPIADDR3, "Collector Address
WA_OUTPUT_OPTIONS TYPE SSFCOMPOP,
WA_CONTROL_PARAMETERS TYPE SSFCTRLOP,
WA_OUTPUT_DATA TYPE SSFCRESCL,
WA_HEADER TYPE ZFCOLL_HEADER, "Smartform Header Info
WA_DFKKZP TYPE DFKKZP,
WA_DOCDATA LIKE SODOCCHGI1.
Variables *
DATA : W_FORMNAME TYPE TDSFNAME, "Smartform Name
W_NAME_ORG TYPE CHAR35, "Business Partner Name
W_ADDRNUMBER LIKE BUT021-ADDRNUMBER, "Address Number of BP
W_ADDRESS1 TYPE CHAR35, "Address Line 1
W_ADDRESS2 TYPE CHAR35, "Address Line 2
W_ADDRESS3 TYPE CHAR35, "Address Line 3
W_GE_NAME TYPE CHAR35, "GE Contact Name
W_GE_PHONE TYPE CHAR35, "GE Contact Phone
W_GE_PHONE1 TYPE CHAR35, "GE Contact Phone
W_GE_PHONE_EX TYPE CHAR10, "GE Contact Phone
W_GE_EMAIL TYPE CHAR35, "GE Contact Email
W_CLIENT_NAME TYPE CHAR30, "Client Name
W_GE_FAX TYPE CHAR35, "GE Fax No
W_GE_FAX1 TYPE CHAR35, "GE Fax No
W_CLIENT_FAX TYPE CHAR35, "Client's Fax No
W_PDF_LEN TYPE I, "Length of PDF file
W_ERR_MESG(120) TYPE C, "Error Message
W_ORG1R LIKE DFKKCR-ORG1R, "Company Code
W_REFERENCE LIKE DFKKCR-REFERENCE, "Payment Reference
W_FNAME TYPE RS38L_FNAM, "Smartform Function Module
" Name
W_SFNAME TYPE TDSFNAME, " Smart Form Name
W_BANKN TYPE CHAR18, "Bank Account Number
W_BETRZ TYPE CHAR15, " Credit AMount
W_WAERS TYPE CHAR5, " Credit Currency
W_VALUT TYPE DFKKZP-VALUT. " Value Date
VARIABLES FOR EMAIL
DATA: W_TAB_LINES TYPE I,
W_DOC_SIZE TYPE I,
W_ATT_TYPE LIKE SOODK-OBJTP,
W_DATFM TYPE XUDATFM.
VARIABLES FOR DATE
DATA: W_DAY(2) TYPE C,
W_MONTH(2) TYPE C,
W_YEAR(4) TYPE C,
W_DATE(10) TYPE C.
Constants *
DATA : C_SELECTED TYPE C VALUE 'X', "Constant for Checked
C_COMMA(2) TYPE C VALUE ', ',"Constant for Comma
C_HYPHEN TYPE C VALUE '-'. "Constant for Hypen
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: P_KEYZ1 TYPE RFKZ0-KEYZ1 OBLIGATORY, "Payment Lot
P_POSZA TYPE DFKKZP-POSZA OBLIGATORY. "Item Number
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: P_REMIT TYPE C AS CHECKBOX DEFAULT 'X', " Remitter Form
P_GENRL TYPE C AS CHECKBOX USER-COMMAND RG1, " General Form
P_TEXT TYPE AD_SMTPADR MODIF ID SC1. " Free Text
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS:P_MAIL TYPE C AS CHECKBOX USER-COMMAND RG2, "Send Email
P_MAILID TYPE AD_SMTPADR MODIF ID SC2.
SELECTION-SCREEN END OF BLOCK b3.
Initialization *
WA_OUTPUT_OPTIONS-XDFCMODE = 'X'.
WA_OUTPUT_OPTIONS-XDF = SPACE.
WA_OUTPUT_OPTIONS-XSFCMODE = 'X'.
WA_OUTPUT_OPTIONS-XDF = SPACE.
At Selection Screen Output *
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
IF P_GENRL = C_SELECTED.
SCREEN-INPUT = 1.
ELSE.
CLEAR P_TEXT.
SCREEN-INPUT = 0.
ENDIF.
ENDIF.
IF SCREEN-GROUP1 = 'SC2'.
IF P_MAIL = C_SELECTED.
SCREEN-INPUT = 1.
ELSE.
CLEAR P_MAILID.
SCREEN-INPUT = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
IF P_REMIT NE C_SELECTED AND P_GENRL NE C_SELECTED.
MESSAGE E004 WITH TEXT-004.
ENDIF.
Start of selection *
START-OF-SELECTION.
IF P_GENRL EQ C_SELECTED.
IF P_TEXT IS INITIAL.
MESSAGE I004 WITH TEXT-023.
STOP.
ENDIF.
ENDIF.
IF P_MAIL EQ C_SELECTED.
IF P_MAILID IS INITIAL.
MESSAGE I004 WITH TEXT-005.
STOP.
ENDIF.
ENDIF.
**Getting Payment Lot and Payment Lot number
PERFORM GET_PAYMENT_DETAILS.
IF NOT WA_DFKKZP IS INITIAL.
Getting the Bank Details
PERFORM GET_BANK_DETAILS.
**Getting the Ge Contact Details
PERFORM GET_GE_CONTACT_DETAILS .
Populating the Structure fields to pass to smartform
PERFORM FILL_EXPORT_STRUCTURES.
CLEAR W_FNAME.
Getting the Function Module name for the Smartform
IF P_REMIT EQ C_SELECTED AND P_GENRL NE C_SELECTED.
W_SFNAME = 'ZF_REMITTER_FORM'.
PERFORM GET_FORMNAME .
ELSEIF P_REMIT NE C_SELECTED AND P_GENRL EQ C_SELECTED.
W_SFNAME = 'ZF_GENERAL_FORM'.
PERFORM GET_FORMNAME .
ELSEIF P_REMIT EQ C_SELECTED AND P_GENRL EQ C_SELECTED.
W_SFNAME = 'ZF_QUERY_BANK_FORM'.
PERFORM GET_FORMNAME .
ENDIF.
IF NOT W_FNAME IS INITIAL.
PERFORM CALL_FORM.
IF P_MAIL EQ 'X'.
IF NOT P_MAILID IS INITIAL.
PERFORM SET_PARAMETERS.
PERFORM DEVICE_TYPE.
PERFORM CALL_FORM.
PERFORM CONVERT_TO_PDF.
PERFORM CONVERT_PDF_TO_BINARY.
PERFORM SEND_MAIL_NO_DISPLAY.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
*& Form GET_FORMNAME
Fetch the Function module name for the Smartform
FORM GET_FORMNAME .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = W_SFNAME
IMPORTING
FM_NAME = W_FNAME
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.
ENDFORM. " GET_FORMNAME
*& Form CALL_FORM
To Call the Smartform
FORM CALL_FORM .
SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
CALL FUNCTION W_FNAME
EXPORTING
CONTROL_PARAMETERS = WA_CONTROL_PARAMETERS
OUTPUT_OPTIONS = WA_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
S_HEADER = WA_HEADER
V_ACNO = W_BANKN
V_AMOUNT = W_BETRZ
V_CURR = W_WAERS
V_DATE = W_VALUT
V_TEXT = P_TEXT
IMPORTING
JOB_OUTPUT_INFO = WA_OUTPUT_DATA
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.
ENDFORM. " CALL_FORM
*& Form FILL_EXPORT_STRUCTURES
Populate the structure to send to the smartform as input
FORM FILL_EXPORT_STRUCTURES .
WA_HEADER-BANKA = BNKA-BANKA.
WA_HEADER-ADDR_1 = BNKA-STRAS.
WA_HEADER-ADDR_2 = BNKA-ORT01.
WA_HEADER-ADDR_3 = BNKA-PROVZ.
WA_HEADER-ZZSRCBPNM = T012-NAME1.
SHIFT WA_HEADER-ZZSRCBPNM LEFT DELETING LEADING SPACE.
WA_HEADER-FAX_NUMBER = W_CLIENT_FAX.
WA_HEADER-BUTXT = T001-BUTXT.
WA_HEADER-NAME1 = W_GE_NAME.
WA_HEADER-TEL_NUMBER = W_GE_PHONE.
WA_HEADER-TEL_EXTENS = W_GE_PHONE_EX.
WA_HEADER-SMTP_ADDR = W_GE_EMAIL.
WA_HEADER-GE_FAX_NUMBER = W_GE_FAX.
ENDFORM. " FILL_EXPORT_STRUCTURES
*& FORM CONVERT_TO_PDF
Convert the final doucment (OTF FORMAT) into pdf format
FORM CONVERT_TO_PDF .
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = W_PDF_LEN
TABLES
OTF = WA_OUTPUT_DATA-OTFDATA
LINES = IT_PDF_TABLE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
ENDFORM. " CONVERT_TO_PDF
*& FORM SET_PARAMETERS
Set control parameters to get the output format (OTF) from smart form*
FORM SET_PARAMETERS .
WA_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
WA_CONTROL_PARAMETERS-GETOTF = 'X'.
WA_CONTROL_PARAMETERS-LANGU = SY-LANGU.
ENDFORM. " SET_PARAMETERS
*& FORM DEVICE_TYPE
Get the Device type
FORM DEVICE_TYPE .
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = WA_CONTROL_PARAMETERS-LANGU
IMPORTING
E_DEVTYPE = WA_OUTPUT_OPTIONS-TDPRINTER
EXCEPTIONS
NO_LANGUAGE = 1
LANGUAGE_NOT_INSTALLED = 2
NO_DEVTYPE_FOUND = 3
SYSTEM_ERROR = 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.
ENDFORM. " DEVICE_TYPE
*& FORM CONVERT_PDF_TO_BINARY
To convert PDF file to Binary format
FORM CONVERT_PDF_TO_BINARY .
CALL FUNCTION 'QCE1_CONVERT'
TABLES
T_SOURCE_TAB = IT_PDF_TABLE
T_TARGET_TAB = IT_PDF_NUC_DATA
EXCEPTIONS
CONVERT_NOT_POSSIBLE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CONVERT_PDF_TO_BINARY
*& FORM SEND_MAIL_NO_DISPLAY
To send a email
FORM SEND_MAIL_NO_DISPLAY .
DATA: L_SLINE(255) TYPE C,
L_INDEX TYPE SY-TABIX.
IT_OBJBIN[] = IT_PDF_NUC_DATA[].
Title and Description of the mail
WA_DOCDATA-OBJ_DESCR = TEXT-012.
Mail Body content
PERFORM MAIL_BODY.
DESCRIBE TABLE IT_OBJTXT LINES W_TAB_LINES.
READ TABLE IT_OBJTXT INDEX W_TAB_LINES INTO L_SLINE.
L_INDEX = W_TAB_LINES + 1.
WA_DOCDATA-DOC_SIZE = ( W_TAB_LINES ) * 255 + STRLEN( L_SLINE ).
WA_DOCDATA-OBJ_EXPDAT = '29991231'.
WA_DOCDATA-SENSITIVTY = 'O'.
WA_DOCDATA-OBJ_PRIO = '5'.
WA_DOCDATA-EXPIRY_DAT = '29991231'.
WA_DOCDATA-PROC_TYPE = 'R'.
CLEAR IT_OBJPACK-TRANSF_BIN .
IT_OBJPACK-HEAD_START = 0.
IT_OBJPACK-HEAD_NUM = 0.
IT_OBJPACK-BODY_START = 1.
IT_OBJPACK-BODY_NUM = W_TAB_LINES.
IT_OBJPACK-DOC_TYPE = 'RAW'.
IT_OBJPACK-OBJ_DESCR = TEXT-013.
APPEND IT_OBJPACK.
Create message attachment
W_ATT_TYPE = 'PDF'.
DESCRIBE TABLE IT_OBJBIN LINES W_TAB_LINES.
READ TABLE IT_OBJBIN INDEX W_TAB_LINES.
L_INDEX = W_TAB_LINES + 1.
IT_OBJPACK-DOC_SIZE = ( W_TAB_LINES ) * 255 .
IT_OBJPACK-TRANSF_BIN = 'X'.
IT_OBJPACK-HEAD_START = 0.
IT_OBJPACK-HEAD_NUM = 0.
IT_OBJPACK-BODY_START = 1.
IT_OBJPACK-BODY_NUM = W_TAB_LINES.
IT_OBJPACK-DOC_TYPE = W_ATT_TYPE.
IT_OBJPACK-OBJ_DESCR = TEXT-013.
APPEND IT_OBJPACK.
Create receiver list
IT_RECLIST-RECEIVER = P_MAILID. "<-- CHANGE ADDRESS
IT_RECLIST-REC_TYPE = 'U'.
IT_RECLIST-EXPRESS = 'X'.
APPEND IT_RECLIST.
Send Email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOCDATA
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X' "USED FROM REL.6.10
TABLES
PACKING_LIST = IT_OBJPACK
CONTENTS_BIN = IT_OBJBIN
CONTENTS_TXT = IT_OBJTXT
RECEIVERS = IT_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 'SO' TYPE 'S' NUMBER '023'
WITH WA_DOCDATA-OBJ_NAME.
ELSE.
SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
SET SCREEN 0.
ENDIF.
ENDFORM. " SEND_MAIL_NO_DISPLAY
*& Form GET_PAYMENT_DETAILS
Get the Payment Lot and Payment Number
FORM GET_PAYMENT_DETAILS .
Get the Payment Lot and Payment Number
SELECT SINGLE BETRZ
BVRKO
BUKRS
WAERS
VALUT
BANKS
BANKL
BANKN
FROM DFKKZP
INTO (WA_DFKKZP-BETRZ,WA_DFKKZP-BVRKO,
WA_DFKKZP-BUKRS,WA_DFKKZP-WAERS,WA_DFKKZP-VALUT,
WA_DFKKZP-BANKS,WA_DFKKZP-BANKL,WA_DFKKZP-BANKN)
WHERE KEYZ1 = P_KEYZ1
AND POSZA = P_POSZA.
IF SY-SUBRC NE 0.
MESSAGE I004 WITH TEXT-100.
EXIT.
ELSE.
W_ORG1R = WA_DFKKZP-BUKRS.
W_BETRZ = WA_DFKKZP-BETRZ.
W_BANKN = WA_DFKKZP-BANKN.
W_WAERS = WA_DFKKZP-WAERS.
W_VALUT = WA_DFKKZP-VALUT.
ENDIF.
ENDFORM. " GET_PAYMENT_DETAILS
*& Form GET_BANK_DETAILS
To Retrive the Bank Details
FORM GET_BANK_DETAILS .
*Get the Bank Address Details
SELECT SINGLE BANKA
STRAS
ORT01
PROVZ
FROM BNKA
INTO (BNKA-BANKA,BNKA-STRAS,BNKA-ORT01,BNKA-PROVZ)
WHERE BANKS = WA_DFKKZP-BANKS
AND BANKL = WA_DFKKZP-BANKL.
IF SY-SUBRC NE 0.
MESSAGE I004 WITH TEXT-101.
EXIT.
ENDIF.
GET The Bank Contact Name.
SELECT SINGLE NAME1
FROM T012
INTO T012-NAME1
WHERE BANKS = WA_DFKKZP-BANKS
AND BANKL = WA_DFKKZP-BANKL.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT W_ORG1R IS INITIAL.
Get the GE Legal Entity Name
SELECT SINGLE BUTXT FROM T001
INTO T001-BUTXT
WHERE BUKRS = W_ORG1R.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " GET_BANK_DETAILS
*& Form GET_COLLECTOR_DETAILS
To get the Collector Address Details
FORM GET_GE_CONTACT_DETAILS .
*Getting the Collector details
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
USERNAME = SY-UNAME
IMPORTING
ADDRESS = WA_ADDRESS
TABLES
RETURN = IT_RETURN.
IF NOT WA_ADDRESS IS INITIAL.
CONCATENATE WA_ADDRESS-FIRSTNAME0(18) WA_ADDRESS-LASTNAME0(17)
INTO W_GE_NAME SEPARATED BY SPACE.
W_GE_PHONE = WA_ADDRESS-TEL1_NUMBR.
W_GE_PHONE_EX = WA_ADDRESS-TEL1_EXT.
W_GE_EMAIL = WA_ADDRESS-E_MAIL.
IF NOT WA_ADDRESS-FAX_EXTENS IS INITIAL.
CONCATENATE WA_ADDRESS-FAX_NUMBER C_HYPHEN WA_ADDRESS-FAX_EXTENS
INTO W_GE_FAX.
ELSE.
W_GE_FAX = WA_ADDRESS-FAX_NUMBER.
ENDIF.
ENDIF.
ENDFORM. " GET_GE_CONTACT_DETAILS
*& Form MAIL_BODY
To Build the email body
FORM MAIL_BODY .
PERFORM GET_USER_DATE_FORMAT.
W_YEAR = W_VALUT+0(4).
W_MONTH = W_VALUT+4(2).
W_DAY = W_VALUT+6(2).
PERFORM GET_DATE.
IF P_REMIT EQ 'X' .
CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-021 WA_HEADER-BUTXT ',' TEXT-022
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
CONCATENATE TEXT-024 W_DATE
TEXT-025 W_BETRZ W_WAERS TEXT-026
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-027.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = WA_HEADER-NAME1.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-028 WA_HEADER-BUTXT INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-029.
APPEND IT_OBJTXT.
CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-032 WA_HEADER-SMTP_ADDR INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-033 WA_HEADER-BUTXT INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
ELSEIF P_GENRL EQ 'X'.
CLEAR IT_OBJTXT.
REFRESH IT_OBJTXT.
CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-021 WA_HEADER-BUTXT '.'
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-034 P_TEXT '.'
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-027.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = WA_HEADER-NAME1.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-028 WA_HEADER-BUTXT INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-029.
APPEND IT_OBJTXT.
CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-032 WA_HEADER-SMTP_ADDR INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
ELSEIF ( P_REMIT EQ 'X' AND P_GENRL EQ 'X' ).
CONCATENATE TEXT-020 WA_HEADER-ZZSRCBPNM ',' INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-021 WA_HEADER-BUTXT ',' TEXT-022
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
SHIFT W_BETRZ LEFT DELETING LEADING SPACE.
CONCATENATE TEXT-024 W_DATE TEXT-025 W_BETRZ W_WAERS TEXT-026
INTO IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-027.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = WA_HEADER-NAME1.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-028 WA_HEADER-BUTXT INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
IT_OBJTXT-LINE = TEXT-029.
APPEND IT_OBJTXT.
CONCATENATE TEXT-030 W_GE_FAX INTO IT_OBJTXT-LINE
SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-031 W_GE_PHONE TEXT-035 W_GE_PHONE_EX INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-032 WA_HEADER-SMTP_ADDR INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
CONCATENATE SPACE SPACE SPACE INTO IT_OBJTXT-LINE.
APPEND IT_OBJTXT.
CONCATENATE TEXT-033 WA_HEADER-BUTXT INTO
IT_OBJTXT-LINE SEPARATED BY SPACE.
APPEND IT_OBJTXT.
ENDIF.
ENDFORM. " MAIL_BODY
*& Form get_user_date_format
to get the User Date Format from USR01 table
FORM GET_USER_DATE_FORMAT.
CLEAR W_DATFM.
SELECT SINGLE DATFM INTO W_DATFM
FROM USR01
WHERE BNAME = SY-UNAME.
ENDFORM. " get_user_date_format
*& Form GET_DATE
Get the date in the user format
FORM GET_DATE .
CLEAR W_DATE.
CASE W_DATFM.
WHEN '1'.
CONCATENATE W_DAY '.' W_MONTH '.' W_YEAR INTO W_DATE.
WHEN '2'.
CONCATENATE W_MONTH '/' W_DAY '/' W_YEAR INTO W_DATE.
WHEN '3'.
CONCATENATE W_MONTH '-' W_DAY '-' W_YEAR INTO W_DATE.
WHEN '4'.
CONCATENATE W_YEAR '.' W_MONTH '.' W_DAY INTO W_DATE.
WHEN '5'.
CONCATENATE W_YEAR '/' W_MONTH '/' W_DAY INTO W_DATE.
WHEN '6'.
CONCATENATE W_YEAR '-' W_MONTH '-' W_DAY INTO W_DATE.
ENDCASE.
ENDFORM. " GET_DATE
Thanks
Mahesh -
How to upload a logo in smartforms
can anybody tell me how to upload logo in Smartorms
Hi,
Inserting Logo in SmartForm
Follow the given steps in order to add a logo,
1) In Smart Forms Editor, In left pane, right Click any Page (say Page1) and select Create -> Window, Give it a name and Description (Say Window1)
2) Right Click on Window (Window 1) and select Create -> Graphics, Give it a name and description
3) In general Attributes, Select Name, get search help (F4) , you will find a list of pictures
4) Select any picture and set its Resolution in DPI
5) Press F9 to open Smart Forms Builder, Select window (Window1) and In Output options window set, size and position of the Logo
6) Set any other parameters if required, save and activate.
7) If there is only 1 Window in the forms, set it as Main Window in general attributes.
8) User TCode SE78 to upload new pictures and logos.
or----
u can
Try executing program RSTXLDMC program. There also you can upload a graphic.
Run RSTXLDMC
Enter file name C:\MAIL\COMPLOGO.TIF
Resolution for Tiff file
Absolute X-position
Absolute Y-position
Absolute positioning
Reserved height
Shift to right
UOM = CM
Text title
Line width for text = 132
Text name ZHEX-MACRO-COMPLOGO
Text ID ST
Text language = E
Postscript scaling
Width & Height according to PS scaling
Number of Tiff gray levels (2,4,9) 2
Then Create a new window 'COMP' with attributes;
Window COMP description Company Logo
Window type CONST
Left margin 7.00 CH window width 10.00 CH
Upper margin LN window height 8.00 LN
Finally u can make use of the text name and text id to print the logo.
Please note that if object name is not indicated as 'ZHEX...', the logo may not be printed !
Go thru this,
http://www.zebra.com/id/zebra/na/en/documentlibrary/misc/sap_smartforms_technical.File.tmp/SAPSmartFormsVersion3.pdf
Refer these threads,
How to upload logo in Smartforms.
logo insertion in smartform..
Regards,
Padmam. -
Standard Smartform printing purchase requisition through - ME51N / ME52N
Hi Experts,
we are trying to build functionality to print Purchase requisition through transaction ME51N / ME52N / ME53N. we have created a print button on Customer data screen for that. Now we are looking for any standard smartform or script which can be used for printing Purchase requisition.
Please provide me some pointers for the same.
There is print button avalable at item level of purchase requisition. but it will not print header records. i am not able to find this form in system also. how can i find this form?
thanks>
rajpal sehrawat wrote:
> Hi,
>
>
> Header records means we might provide some header level information like PR number , short text and logo. Currently we are able to print only line items present in the ALV grid.
>
>
> we are looking for some similar form which can be enhanced.
>
>
> thanks
actually the PR number is a line item field - it comes out of table EBAN. You would have to store the logo someplace else, since it does not belong to the PR (EBAN) -> neither header nor item, but is 'simply' graphics stored elsewhere in the database.
I wouldn't know of any form in MM-PUR which you could easily adapt to printing PRs (and have never before heard of the need to print them) - so you will have to do a custom abap. Since there is no possibility to maintain NACE for PRs (it's simply not available) - I wouldn't know where you could use a smartform/sapscript ... that custom abap is all you can do ... -
Smartforms: no page break between last line item and footer in table?
Hello All,
my smartform has FIRST and NEXT pages. I would like to avoid a page break between last item line of a table in MAIN window and the footer of the same table.
Here is how it looks currently.
Output of FIRST page, MAIN window, table ITEMS:
1.line item
2.line item
3.line item
4.line item
page break
output of NEXT page, MAIN window, table ITEMS:
1.footer line
2.footer line
I would like that if a footer does not fit on FIRST page, it would be displayed on NEXT page with last item line.
It should be like this:
output of FIRST page, MAIN window, table ITEMS
1.line item
2.line item
3.line item
page break
output of NEXT page, MAIN window, table ITEMS
4.line item
1.footer line
2.footer line
Any ideas?
Thanks and best regards,
MindaugasDo you mean line item text or your want to print footer text?
If your trying yo display some footer text, then you either place a footer window or you can create a table inside your main window and place text under the footer of the table, then it will display the text without any page break.
If it is item tem.
Then you need to build additional logic. As we cannot guess, the total number of item text upfront.
Example: if page1 can hold 15 line items, check whether your header and item can fit in page one else call a new page by placing a condition FLAG = "X".
I hope it will help you to solve your problem.
Regards,
SaiRam -
How to use CALL FUNCTION '/1BCDWB/SF00000014' in smartform urgent
hiiiiiiiii
Iam doing classical report n i want my output to be printed in smartform.
So my output is in IT_FINAL table.In smartform in Form Interface Table column i had declare :::
Parameter Name: IT_FINAL
Type Assignment:LIKE
Associated Type:ZSD_FINAL ( Its a structure of IT_FINAL)
And in SE38..iam using...............
data: FM_NAME1 type RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZCSF_SDPRSR03_PR'
importing
FM_NAME = FM_NAME1.
CALL FUNCTION FM_NAME1
EXPORTING
IT_FINAL = IT_FINAL.
So while running its giving dump..
I DONT KNOW HOW TO USE THE ABOVE FUNCTION MODULE.
CALL FUNCTION '/1BCDWB/SF00000014'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please suggest me with example if possible......URGENT.
(Rewards if solved)
Regards.Hi
see the below doc and do accordingly
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Here is the procedure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
<b>call function 'SSF_FUNCTION_MODULE_NAME'</b>
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
<b>call function FM_NAME</b>
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
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.
Smartform
you can check this link here you can see the steps and you can do it the same by looking at it..
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
SMARTFORMS STEPS.
1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
2. Create Table type(t_struct) of stracture in se11.
3. In your program declare Internal table(Itab) type table of structure(struct).
4. Define work area(wa) like line of internal table.
5. Open Tcode Smartforms
6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
8. In form pages and window, create Page node by default Page1 is available.
9. In page node you can create numbers of secondary window. But in form there is only one Main window.
10. By right click on page you can create windows or Go to Edit, Node, Create.
11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
13. In table there are three areas Header, Main Area, Footer.
14. Right click on the Main area create table line by default line type1 is there select it.
15. Divide line into cells according to your need then for each cell create Text node.
16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
17. Save form and activate it.
18. Then go to Environment, function module name, there you get the name of function module copy it.
19. In your program call the function module that you have copied from your form.
20. In your program in exporting parameter of function pass the internal table(itab).
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
What Transaction to start SAP Smart Forms?
Execute transaction SMARTFORMS to start SAP Smart Forms.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
SmartForms System Fields
Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
System fields of Smart Forms
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
Example Forms Available in Standard SAP R/3
SF_EXAMPLE_01
Simple example; invoice with table output of flight booking for one customer
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
Regards
Anji -
How to change the size and font of my text in SMARTFORMS
Hello gurus,
I have a smartform as image below:
I want to know how can I change the font size, and if is there a way to auto adjust text within its container or window?
ThanlsTo maintain « Styles » in your Smart form, read first : Smart Forms > Maintenance of Styles with the Style Builder.
Transaction SMARTSTYLES
if not already created, create a new style (e.g. copy the style assigned to your form)
create a new paragraph format
select alignment "BLOCK Justified"
Then in transaction SMARTFORMS attach your style and use your new paragraph format.
Regards,
Raymond -
1.HOW TO USE IF CONDITIONS IN SMARTFORMS?
2.HOW TO DRAW BOXES IN SMARTFORMS
I TRIED TO DRAW BOX WITH FOLLOWING
POSITION XORIGIN 5 CH YORIGIN 12 LN
SIZE WIDTH 15 CH HEIGHT 2 LN
BOX FRAME 10 TW INTENSITY 10
DONT KNOW WHY ITS NOT WORKING
3.How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?I CAME TO KNOW THAT I SHOULD GIVE OUTPUT_OPTIONS AS PRINTER NAME IN SSF_OPEN,BUT DONT KNOW HOW TO DO THIS.TRIED GIVING BOTH SSF_OPEN,SSF_FUNCTION_MODULE_NAME,BUT NOT WORKING.
THANKS A LOThi gopi,
1.For boxes in sf-Create a window node in the navigation tree of the Form Builder.
If you create the window in the Form Painter using the context menu, you can use the mouse to position it immediately.
Enter a unique name for the node and a description (for example, booked flights).
On the General Attributes tab select a window type. The window types Copies Window and Final Window are secondary windows with additional attributes. See also: Processing Windows -
How to put smartform in mail body
Hi colleagues,
I would like to send a mail with content build from a SMARTFORM. I call the smartform function module and get the corresponding OTF file, but I did not succeed to put it in a readable way in the mail body.
How ot get the smartform as mail body?
My body contains this kind of data, if I do the conversion to PDF:
═䑆ⴱ⸳ഊ◢팍ਲu2030扪ഊ⽗楮䅮獩䕮捯摩湧ഊ敮摯扪ഊ㌠〠潢樍਼㰍ਥ䑥癴祰攠南䥎u2020u2020⁆潮琠䍏啒䥅删潲浡氠䱡湧⁅不ਯ呹灥 䙯湴ഊ⽓畢瑹灥 呹灥ㄍਯ䉡獥䙯湴 䍯畲楥爍ਯ乡浥 䘰〱ഊ⽅湣潤楮朠㈠〠刍ਾ㸍湤潢樍u2030扪ഊ㰼ഊ⽌敮杴栠㔠〠刍ਾ㸍ੳ瑲敡洍ਠ⽆〰ㄠㄲ⸰〠呦u2030⁂吠
㜰⸸㔠㜵㤮
and the pdf itself (I also try to attached it to the mail for test) cannot be open.
I already check a lot of thread, but cannot find any to solve this issue.
Thanks for your help.
BarbaraHi,
Refer to this link..Send an smartform as body of a mail -
Loop not working correctly in smartform
Hi Experts,
I have developed a smart form wherein, the import params of form is a table (multiple records).The design of the form is, the first 10 lines is populated with a static text followed by the import table and follwed by a conclusion text. in simple words the design is, in the header a static text (hard coded text) will be populated in the main body an internal table will be populated and in the footer a static text (hard coded text) will be populated.Initially I have created three seperate windows for header, main body and footer, this was working fine for few records (import table) sometimes it happened the records were very huge and table entries over lapped the footer text. How to handle this kind issue? Can we increase the page size dynamically?? and also as per the user requirement the output of the form should have a provision to download the form on thier desktop in word format. Can some one help me in building this functionality.
Thanks and Regards,
Srini...Hello Mr. Srinivas,
There is no provision to download the form in word format, but if you want to still download the form in real means open smartforms --> Utilities(M) --> download form.
this will download the whole program wahtever you hvae chnge made in this. Make the back copy of form and after edition in form make down load again this form and than find out the differnce. May be this will be helpful. And also if yr loop is not working with smartform. Do write the similar code in yr driver program for the loop this will definetely helpful.
Regards,
Akg
Edited by: akg.amit on Mar 25, 2011 10:08 AM
Maybe you are looking for
-
Windows 7 and ThinkVanta​ge System Update
I updated to the most recent release of the LSC (2.3.002) and now my warranty is showing. So that is good. However, when I go to the fix option for the Lenovo Software updates, and I click "launch" to fix the issue, all I get is a small pop up that s
-
TS3274 icloud backup box won't go away, so i can't turn off my ipad or do anything on it
icloud backup box won't go away, so i can't turn off my ipad or do anything
-
Opening stock column in report
Hi, I have a reporting requirement report name is "Purchasing during the year" one of the column in report is Opening Stock so from where can get the opening stock in this column.
-
Error messages when downloading Mavericks
Hello. I have tried to download Mavericks over two periods of time. My problem is that I keep getting the same error when trying to download the file. It just state than an error has occured and that I should try to redownload from Purchases. When I
-
Dates off by exactly one month. How do I fix this?
The dates for my photos are off. Usually by exactly one month. This happens sometime after I import them. For example I took a photo at the my kid's last Soccer practice on November 6, 2007. I imported it on November 7th, 2007. And yet iPhoto '08 say