‎2006 Mar 17 5:27 PM
I created a simple Smartform and added two of my own fields under Import Interface: MYDATE and REASON.
The reference text loks like this:
Dear Sir or madam,
This is in reference to the orders made on &MYDATE& for with the reason of &REASON&.......Thank-You.
I activated the Smartform and got the Function Module to execute. However when I test the function module and input my two fields with a date and a reason the output looks exactly like the ref text above....fieldnames are shown with the ampersands, not my input?
Also, is there a way to display the form before printing?
Thank-You.
‎2006 Mar 17 5:35 PM
Hi Tom,
Are you testing the function module from se37 itself?
You need to call this Function module in your print program, wherein you populate the fields mydate and reason before calling this FM.
Othre wise, if you test it in se37, it will treat &MYDATE& as just another text.
Regards,
Ravi
‎2006 Mar 17 5:35 PM
Hi Tom,
Are you testing the function module from se37 itself?
You need to call this Function module in your print program, wherein you populate the fields mydate and reason before calling this FM.
Othre wise, if you test it in se37, it will treat &MYDATE& as just another text.
Regards,
Ravi
‎2006 Mar 17 5:52 PM
Ravi, I tried putting the Smartform's function module in an SE38 program (I guess this is my print program)and called it by passing sy-datum for mydate and 'Testing' for reason.
It still printed the field names with ampersands. I still must be forgetting another step. Can you display this before printing?
Thanks for your response.
‎2006 Mar 17 6:09 PM
Hi
The call of sf in your print program should be like following code:
DATA: fm_smartform TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = <smartform name>
variant = ' '
direct_call = ' '
IMPORTING fm_name = fm_smartform
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION fm_smartform
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
MYDATE = SY-datum
REASON = 'Testing'
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.
Max
‎2006 Mar 17 6:12 PM
Hey Tom
i got ur point
while declaring the text in the main window i think u added these variables by typing as other text if u do it like this then u will get the same problem
so to to get the values other than variable while declaring the varibale along with the text in the main window u should use the insert command option for the variables and then for the text normal typing
in that above option u should secify those variables with in &xxxxx&
k if u have any further doubts let me know don't forget to award points if it is useful answer
‎2006 Mar 17 6:23 PM
‎2006 Mar 17 6:09 PM
I suggest you to copy a std. print prg. to a z-copy.
then remove all the unwanted code except the standard def.'s and make sure there is a call to SF also in it.
( SSF_FUN......) . populate your cuple of fields before the call is made in prg. Iam pretty sure it would work.
-Rav.