Duplication when printing sapscript form
i have created a sapscript that is supposed to be printing a statement but when printing it prints the first record twice what could be the problem , the text elements are being generated from an internal table.
using the start and close form is not helping it still is printing the first record twice let me put the code and maybe you can see wat im doing wrongly
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZSECURITIES_REP'
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
SPONUMIV =
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
FORM = 'ZSECURITIES_REP '
LANGUAGE = 'EN '
STARTPAGE = ' '
PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
LANGUAGE =
EXCEPTIONS
FORM = 1
FORMAT = 2
UNENDED = 3
UNOPENED = 4
UNUSED = 5
SPOOL_ERROR = 6
CODEPAGE = 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.
clear itab_print.
refresh itab_print.
LOOP AT itab INTO itab_print.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'PRINT_ITEMS'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'END_FORM'
IMPORTING
RESULT =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SPOOL_ERROR = 3
CODEPAGE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
IF SY-SUBRC <> 0.
ENDIF.
Similar Messages
-
Problems when printing Sapscript...
We have imported a number Sapscripts in Russian into our unicode system. Looking at the Sapscript I can see Russian text in both the first and next page of the form. However, when printing the first page looks perfect and displays in Russian, however, the second page shows hashes (#) where the Russian text should be.
If none of it worked I might be able to understand what was going on, but when the first page prints fine I find it difficult to understand what is going on.
I have run a check agianst both pages in SE71 and re-activated, but still no joy. What could be going wrong?.
GaryThanks guys, I have now found out what the problem was.
All my test data was set up for me by the functional guys. The output messages that were repeated were originally set to language of English rather than Russian, and hence the problem.
Apologies everyone.
Regards
Gary King -
Printing SapScript form in background
Hi.
How can i print a sapscript form when i launch its program via job????
Thanks in advanceHi Javier,
Did your print program has been designed such a way that the pop up will not appear asking for the print options if you want to run as a Job.I think if this is taken care, then the required details can be displayed in the spool. Give a try.
Hope this helps.
Thanks,
Srinivasa -
Printing SAPSCRIPT FORM vai RFC---URGENT
Hi All
I have a requirement where i am calling a Function moule ( present in destinataion system ) via RFC , from the source system.
Inside the Function module , i have requirement to call/submit a print program for a script form (Considering that the Form and Print program are in destination system).
Doing this, is there a way to have the SAPSCRIPT output ( ie a Spool) captured or copied in the source system?
Any pointers on the above would be of great help.
Thanks
PankajDear all,
I think I've got the answer (even though it is 3 years after question was posted).
Let me re-cap the problem:
1) A set of SAPscript form and print program (beginning with 'Z') for physical inventory document are developed
2) This set of SAPscript form and print program produce similar printout as that in T-code: MI03, or MI01 or MI02
3) The SAPscript form is copied from "INVENT" or "INVENT_VKBW" and the print program is copied from "RM07IDRU" or "RWWVINVB"
4) However, there is no output types available for configuration for user to print physical inventory document using this new set of SAPscript form and print program
Am I correct ?
The re-solution is: Maintain the output types entries (program, form) in table "T159N"
1) T-code: MI01 , MI02, MI04 will call T-code: MI21 when user selects to print physical inventory document
2) T-code: MI21 will call print program "RM07IDRU" (this is maintained in T-code SE93)
3) Program RM07IDRU" will call SAPscript "INVENT" or "INVENT_VKBW" (this is maintained in table "T159N")
Hence, if you develop new sets of SAPscript form and print program (by copying from "INVENT" or "INVENT_VKBW" / "RM07IDRU" or "RWWVINVB"), try table "T159N".
Simon -
Print size does not default to form size when printing PDF form.
So, we have created an interactive new client form for our firm. The form was created in LiveCycle Designer ES 8.2 and is set to legal size (8.5 x 14). After the form was completed and exported, it was filled out for testing and printed. During the printing process it was noticed that in the print dialog box, the dimentions for the form were wrong. It showed that the default document size was 8.5 x 11. Where and how is this changed in LC?
A new form was created (starting from scratch) with the document settings set to legal again, and inside of LC in the PDF preview panel, I tried to print and the same thing occured.
Please advise as how to set the document to its default size when printing without have to do it in the print dialog box.The print dialog doesn't display the forms dimensions but those of the currently selected paper format of your printer.
If you change the page format in the printer driver the diemensions in the preview will change too. -
Select alternate tray when printing Adobe form from an ABAP prograram
I had a Smart Form where I printed to an alternate tray for 4 by 7 paper stock. I need to know how to do this in Adobe when printing a from from an ABAP program. I have printer types ZLX4039, HPLJ4 and HPLJ5SI to which I need to print my form to an alternate 4 by 7 tray.
Does anyone know how to set it up in the Adobe form and what I need to do in SPAD to handle it?
Thanks for any help,
James UgrinHi,
Go for the Device type AZPL300 : ZPL300 for PDF Documents only for the Interactive Forms
Take the Help of ur BASIS Team...in SPAD settings
Regards,
Vijaya Lakshmi.T
Edited by: Vijaya Lakshmi on Mar 25, 2009 5:49 AM -
Printing sapscript form out of ABAP report
Hello,
I was wondering if there is a way to trigger the print output of a sapscript form out of an ABAP report? Maybe some kind of function module?
Thanks
AnneHi Anne,
The Only way is that..
1 .You need to pass the necesary data to see the output... (WRITE_FORM)
2. To pass the data you need to open the form... (OPEN_FORM)
3. After all you need to close the form... (CLOSE_FORM)
If you follow these three you can call you sap script from anywhere,, example you can write these in FM's (SE37).
From interface programs as well...
but you need open, write, close the forms to run a Sap script.
Thanks & regards,
Dileep .C -
Crashes intermittantly ( every other print ) when printing PDF forms
using a mac osx lion running firefox 10.0.2 and adobe reader pre release 11.0.0 when printing these pdf forms for real estate industry fire fox will intermitantly crash. this happens to all users running adobe 9.x.x - 10.0.1 i have run thourgh firefoxes tests to no avail. any other suiggestions.
updated plug ins
checked for osx lion updates
updated firefox
staretd in safe mode
tested in adobe 9 - 11
tested on PC no issues
only firefox for macOK
I debugged further I solved my issue.
I found that the system crashed when it was reading an include text on the context. The include text was missing on the test case that whent wrong. So I whent to the context and ticked the flag "no error if no text exist" on the include text. Then I got no error and my PDF printed.
So, I don't think the issue Oscar is having comes from the printer or the RFC connexion. Just check the include texts you are using on the context and mark the "no error..." flag.
David -
When printing a form, blank drop downs do not print
I am creating a Form for people to use and wanted to give them the option to print it out and fill it out by hand if they preferred. I have encountered a problem with printing Drop Down Menus: if you select one of the options from a Drop Down Menu, everything prints fine, but if you don't select anything the empty box will not print. The weird part is that if you click on the Drop Down Menu, but don't select anything, it will then print the empty box. I also tried it with one of the existing templates and the same thing happened, i.e. prints the box with the selction if a choice is made, prints an empty box if the menu is clicked on but nothing is selected, prints no box if the Drop Down Menu is left alone.
I am not sure if this is a printer setting in Adobe Reader/Acrobat or if this is a setting in FormsCentral. Can anyone help me find a way to force all Drop Down Menus to print out the black box regardless of what is entered or clicked on? Thank you!How about just the file name of the attachment? How can I get this to print?
I need this to print in order to match up saved attachments to the respective messages when preflighting incoming files and then distributing hard copies. -
Issues when printing adobe forms
Hi All,
When I am trying to print a Adobe form in t-code se38 and the form is fp_test_00. The following error occurs in the and the
SAP session is getting terminated ........
Dump :- process terminated with signal 11.
The current ABAP "SAPLSPADS" program had to be terminated because the
ABAP processor detected an internal system error.
How to correct the error
The R/3 System work directory (e.g. /usr/sap/c11/D00/work ) often
contains a file called 'core'.
*****I tried moving the core file to .old this does not works for me *************
SM21 system log :-
Signal 11 received by operating system
> Include LSPADSU02 line 0034.
Run-time error "RUNT_ILLEGAL_SWITCH" occurred
Stop Workproc 0, PID 491598
Start Workproc 0, 6 times since system startup. PID 491600
Repost table TST01 (TemSe->XRTAB(3)->64; Flag: MDFF; Key )
TemSe error repair: 1 (Module , location )
Calling program reports invalid handle for TemSe object (magic==X'4f444f23'
Delete session 002 after error 023
Please help me in solving this issue ....thanks in advance ....
Regards,
Revanth Kumar KadaliHi MichaelPytel,
Reason for the GUI termination
This problem occurs due to the kernel program error (kernel version 236).
Resolution
Please check implementing the following OSS note 1134660.
My issue was resolved after implementing the above OSS note** Hope it works for you as well
All the best,
Thanks & Regards
Revanth Kumar Kadali -
Why the control parameters changed when print smart form
Hi experts:
I set the control parrameters in my source code to print the smart form, I use the loop table for printing, but I found the print device changed automatically, only the frist page is ok. that means, the control paramenters lost when loop. how to solve it?
this is my source:
LOOP AT it_outtab INTO wa_outtab WHERE flag = 'X' .
ssf_open ls_control_param outopt ls_composer_param.
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.
MESSAGE 'Call SSF_FUNCTION_MODULE_NAME Error' TYPE 'E'.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION lf_fm_name
EXPORTING
control_parameters = ls_control_param
zgl_k_stru = wa_outtab
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE 'Call LF_FM_NAME Error' TYPE 'E'.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ssf_close .
MOVE-CORRESPONDING outopt TO ls_composer_param.
ls_composer_param-tdimmed = ' '.
ls_control_param-no_dialog = 'X'.
IF outopt-tdpreview = 'X'.
EXIT.
ENDIF.
ENDLOOP.Hi Prabhat,
Please check following point in your smartform design.
1) In your smartform design, how many pages do you have? (Check the page format and margins, have a look at form painter
as well)
2) Check out the navigation from one page to another page.
3) Debugg the form and check at what point the last page is been added.
Regards,
Amee. -
Rearrange pages when printing adobe form with multiple master pages
Hello!
Good day to you all.
I have an issue in regards with printing my adobe form with multiple Master pages. I have 4 master pages:
1st master page: a
2nd master page: b
3rd master page: c
4th master page: d
all with different headers and footers all having the same contents (items). I don't have issue with one page content (it just prints 4 pages with different headers and footers). The issue comes out once the items exceed 1 page.
What happens is that the preview/print shows (example: 3-page item)
a1-a2-a3-b1-b2-b3-c1-c2-c3-d1-d2-d3.
What i need is to print these such that all 1st pages of the 4 master page to be printed first, then all the 2nd pages, then all 3rd pages. Please see below:
a1-b1-c1-d1-a2-b2-c2-d2-a3-b3-c3-d3
This is because we will be using carbonless copy paper during printing and it's possible that it would be printed on batch jobs. Please suggest ways to do this.
Thanks a lot in advance!
Best Regards,
abap_peer_dangsHi,
Is that requirement of multiple pages as groups only at the time of print or at print preview also...?
Can you have a Print button on this screen or you should be using the Abobe toolbar's Print button..?
Well if this on a click of a button in the form and the requirement is only at the time of print and not on print prieview I can have a JS script which does this...
Let me know if this suffice, I can try with a local file and send you the script.
@ Chris: I didn't understand what do you mean by reported, I was eager to hear and learn a solution from you may be a new approach which I am not aware of ...?
Cheers,
Sai. -
Corrupt file attachment when sending sapscript form by mail
i have requirment to send sapscript through mail but when open my attachment it is giving file is corrupted.let me know where i am wrong
i am specifying the code here
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
* MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
* PDF_USERNAME = ' '
IMPORTING
bin_filesize = binfilesize
* BIN_FILE =
TABLES
otf = datab[]
lines = pdftab[]
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.
REFRESH it_pdf[].
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_dst = '255'
TABLES
content_in = pdftab[]
content_out = it_pdf[]
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.
ELSE.
"Subject of the mail.
w_document_data-obj_name = 'MAIL_TO_HEAD'.
w_document_data-obj_descr = 'Regarding Mail Program by SAP ABAP'.
"Body of the mail
w_body_msg = 'This is body of mail msg.'.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
"Write Packing List for Body
DESCRIBE TABLE i_body_msg LINES g_tab_lines.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
w_packing_list-body_num = g_tab_lines.
w_packing_list-doc_type = 'RAW'.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Write Packing List for Attachment
w_packing_list-transf_bin = 'X'.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
DESCRIBE TABLE it_pdf LINES w_packing_list-body_num.
w_packing_list-doc_type = 'PDF'.
w_packing_list-obj_descr = 'PDF Attachment'.
w_packing_list-obj_name = 'PDF_ATTACHMENT'.
w_packing_list-doc_size = w_packing_list-body_num * 255.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Fill the document data and get size of attachment
w_document_data-obj_langu = sy-langu.
READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
"Receivers List.
w_receivers-rec_type = 'U'."Internet address
w_receivers-receiver = p_mail.
w_receivers-com_type = 'INT'.
w_receivers-notif_del = 'X'.
w_receivers-notif_ndel = 'X'.
APPEND w_receivers TO i_receivers .
CLEAR:w_receivers.
"Function module to send mail to Recipients
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
contents_bin = it_pdf
contents_txt = i_body_msg
receivers = i_receivers
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.
else.
MESSAGE 'Mail Successfully Sent' type 'S'.
ENDIF.
Edited by: sam_ins123524 on Oct 8, 2010 9:31 AM
Edited by: sam_ins123524 on Oct 8, 2010 9:33 AM
Moderator message: subject corrected for you, please use a more descriptive one next time, also use code tags.
Edited by: Thomas Zloch on Oct 8, 2010 10:51 AMHi,
Once you get otf data, Use FM 'SX_OBJECT_CONVERT_OTF_PDF' to convert it to PDF. Then use CONTENT_BIN to send mail.
Refer below code:
* Converting OTF data to single line
LOOP AT I_OTF INTO WA_OTF.
CONCATENATE WA_OTF-TDPRINTCOM WA_OTF-TDPRINTPAR INTO WA_PDF.
MOVE WA_PDF TO WA_CONTENT_TXT.
APPEND WA_CONTENT_TXT TO I_CONTENT_TXT.
CLEAR: WA_CONTENT_TXT.
ENDLOOP.
* Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
FORMAT_SRC = C_OTF
FORMAT_DST = C_PDF
DEVTYPE = C_PRINTER
CHANGING
TRANSFER_BIN = WA_TRANSFER_BIN
CONTENT_TXT = I_CONTENT_TXT
CONTENT_BIN = I_CONTENT_BIN
OBJHEAD = WA_OBJHEAD
LEN = V_LEN_IN.
*- Send mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = L_WA_DOCUMENT_DATA
TABLES
OBJECT_CONTENT = I_CONTENT_BIN
RECEIVERS = L_I_RECEIVERS. -
Hello,
is there a way to setup a printer that we can print sapscript form into a PDF file?
We don't want to go over the spool request and use RSTXPDFT4.
I have already setup a printer with device type PDF1, Host Spool Access Method F:Printing on Frontend Computer and Host Printer __Default. But for some reasons it doesn't work. We are running SAP Enterprise 470.
Any help?
Thanks
AnneYou must choose a FILE printer. See these notes:
[Note 576973 - Creating a file printer on a Windows PC|http://service.sap.com/sap/support/notes/576973]: steps to add a Windows (if it's Vista, see note 1164132) printer of type Generic/Text only, and to create an output device in SAP to print to this printer. It does not explain that we may just change the port of an existing printer.
[Note 1164132 - Front-end printing on Windows printer with FILE port|http://service.sap.com/sap/support/notes/1164132]: note 576973 applied to Windows XP and before, but it doesn't work anymore on Windows VISTA because the dialog box to enter the file name is no more displayed. A change in SAPGUI 7.10 was made (and it works only with access method G) to display a SAP dialog box to enter file name. -
Wrong dimensions when printing forms
Hi there!
I know, I know, no one should be printing forms and killing trees but, you know, the client is always right...
So, this client is creating forms in LC Designer and part of these forms (around 300) will be printed.
They are very picky when it comes to milimetric precision, so they need the printed versin to be exactly the size they define in LC Designer.
Now, when printed, the forms do not keep the right size, even when setting the proportion as 100%.
Is there a way to fix this?
Thank you very much for any ideas!
MarcosAre you sure "Fit to Printable Area" is not selected under Page Scaling in Acrobat's print dialogue?
Maybe you are looking for
-
HP Officejet Pro 8500 A909g - doesn't save a scanned PDF file on Windows 8.1 64 bit
I have just purchased a new PC with windows 8.1 and sucessuly installed the driver from here: http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=4158&lc=en&cc=us&dlc=en&sw_lang=&product=3752... I can print. I have properly set up the digital fili
-
Is it possible to use an external drive to play movies on my iPhone 5? I am going on a long flight and only have a 16gb iPhone 5. I will not have access to wifi, so it would have to connect manually. I've heard of apps that connect to an external
-
How to enable JavaScript after downloaded ff25 running on Mac OS 10.8
Since I updated to FF25 I can't enable JavaScript which I need for sites I use. I have the latest Java 7 version 45 but there is no plug-in appearing for Java. I added Quickjava 2.0.2 I think this is the version, and clicked to enable java. But when
-
What are the advantages of using an internal table with workarea
Hi, can anyone tell me What are the advantages of using an internal table with workarea over an internal table with header line? thnks in adv regards nagi
-
Trying to re-open Photoshop 12
I have spent the last two days trying to re-open this trial software that is Photoshop 12. Not only am I not that impressed with the software to begin with, especially the graphics and ergonomics, but I've spent hours going in circles trying to re-o