Regarding OTF Data
Hi All,
I need to know is it possible to get OTF data by calling FM CLOSE_FORM as well create a spool in SP01 for related script.
Regards
Dhiraj Shetty
Hi,
Manual conversion to OTF format
If there are more than 10 pages,
Tick the spool request
then click Edit -> OTF display -> No. of OTF pages
Convert SAP Script to text
Display the spool request
then click Goto -> List display
Automatic conversion to OTF format
tables: tline.
data: begin of int_tline1 occurs 100.
include structure tline.
data: end of int_tline1.
call function 'OPEN_FORM'
device = 'OTF_MEM'
after CLOSE_FORM
call function 'CONVERT_OTF_MEMORY'
exporting
format = 'ASCII'
max_linewidth = 132
tables
lines = int_tline1
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
write the text file to spool
loop at int_tline1.
if int_tline1-tdline = space.
skip.
else.
write:/ int_tline1-tdline.
endif.
endloop.
Regards
Sudheer
Similar Messages
-
Hi all,
Is there any way of creating a spool request or printing OTF data directly from an internal table.
Scenario is that I have read a spool request with multiple pages into OTF format and now have an internal table with OTF data. I have then split the spool data at page level into another internal table.
This table also contains OTF data . Is there anyway of printing this internal table directly to printer. If not is there any way of creating a spool request from this internal table?
Regards,
PreetMay be i can help to some extent. I will just tell you how to convert a internal table into spool. I have done the coding
REPORT zpmm_pdf .
TYPES : BEGIN OF itab,
name(20) TYPE c,
age TYPE i,
*** TYPE c,
END OF itab.
DATA : gt_itab TYPE STANDARD TABLE OF itab,
gw_itab TYPE itab.
DATA : counter TYPE i.
********************Data declaration for use in converting to pdf
DATA : pripar LIKE pri_params.
DATA : lw_space VALUE ''.
DATA : itab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
<b>*To get spool info</b>
DATA : rqident LIKE tsp01-rqident ,
rqcretime LIKE tsp01-rqcretime .
<b>DATA: spool_id LIKE tsp01-rqident.</b>
DATA : numbytes TYPE i,
cancel.
DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
********************END of Data declaration for use in converting to pdf
START-OF-SELECTION
DO 20 TIMES.
gw_itab-name = 'swetabh_shukla'.
gw_itab-age = counter + 1.
gw_itab-*** = 'M'.
counter = counter + 1.
APPEND gw_itab TO gt_itab.
CLEAR : gw_itab.
ENDDO.
<b>* Gt_itab is the internal table that we will write to spool</b>
*Start
SET PARAMETER ID 'ZPDF' FIELD lw_space.
<b>CALL FUNCTION 'GET_PRINT_PARAMETERS'</b>
EXPORTING
in_parameters = pripar
line_size = 255
layout = 'X_65_132'
no_dialog = 'X'
IMPORTING
out_parameters = pripar
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
<b>*********To write data in spool</b>
NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
RESERVE 5 LINES.
<b>*********From here data will be written in spool</b>
WRITE : 'Name',
'Age',
LOOP AT gt_itab INTO gw_itab.
WRITE : / gw_itab-name,
gw_itab-age,
gw_itab-***.
ENDLOOP.
<b>*****To switch off spool writing</b>
NEW-PAGE PRINT OFF.
************End of spool writing
<b>******To get the latest spool id of spool written by us</b>
SELECT rqident rqcretime FROM tsp01
INTO (rqident,rqcretime)
WHERE rqowner = sy-uname
ORDER BY rqcretime DESCENDING.
EXIT.
<b>******** It will just read the latest spool id and exit</b>
ENDSELECT.
MOVE rqident TO spool_id. <b>" We get the spool id here of the spool we wrote</b>
<b>*Now spool_id contains the spool id. We can convert this spool to pdf also as given *below</b>
****************************************************To convert spool to pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spool_id
NO_DIALOG =
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
PDF_SPOOLID =
LIST_PAGECOUNT =
BTC_JOBNAME =
BTC_JOBCOUNT =
TABLES
pdf = itab_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
END-OF-SELECTION
To download the pdf file as local file
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = numbytes
filename = gv_filename
filetype = 'BIN'
filetype_no_show = 'X'
IMPORTING
act_filename = gv_filename
filesize = numbytes
cancel = cancel
TABLES
data_tab = itab_pdf.
<b> I think i gave a lot of extra code, but i just gave it for proper understanding.
Only a few days ago i came across this concept. So had the ready made code.</b>
<b>Please do reward point if helpful</b>
Regards
swetabh -
Archive Smartform Copies - Error - OTF end command // missing in OTF data
Hi All,
We are printng invoices and archiving them at the same time.
When I try to print and archive just the original invoice it works fine
That is , it prints and archives.
However when I set the flag SSFCOMPOP-TDARCCOP to 'X' (Archive Copies as well),
I get the error OTF end command // missing in OTF data.
Im guessing that the system tries to archive multiple copies and the End of File Command // at the end of each copy is causing the issue. But I dont know how to go about solving it.
Regards,
Nehal.Implemented SAP Note 1123505 - OTF-PDF conversion. Archiving several copies
-
Print preview while getting otf data
hi experts,
can somebody tell me how to get the print preview of sap script
while getting the otf data.
I have set the ITCPO-TDGETOTF = 'X' option in OPEN FORM but when i give it its not showing the output. How can I see output ?hi ajay,
TABLES ITCPO.
DATA: T_OTF TYPE TABLE OF ITCOO.
ITCPO-TDGETOTF = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZPRG_TEST'
OPTIONS = ITCPO
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
OTHERS = 11.
IF SY-SUBRC 0.
ELSE.
CALL FUNCTION 'CLOSE_FORM'
TABLES
OTFDATA = T_OTF
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5.
ENDIF.
Check this code ok.
why dont you try giving a pdf preview which will be possible.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 12, 2008 11:01 AM
Edited by: Midhun Abraham on Oct 12, 2008 11:05 AM -
Get OTF data for a sales order document
I have a problem in getting the information of the created sales order document number as OTF data. I need this OTF data so to convert into PDF format using function module 'CONVERT_OTF_2_PDF'. My situation is i am keeping a parameter for sales order document number . when i execute the report after giving a sales order document number, i should get the OTF data .
Hi!
Firstly you have to define what technique is used for creation of sales order as printed document - smartform or sapscript. Then proceed as follows.
In case of smartform:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFORMNAME'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf[] = w_return-otfdata[].
In case of sapscript:
options-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
options = options
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
OTHERS = 5.
i_otf -
Regards,
Maxim. -
Getting OTF data of an SAPscript
Hello Experts,
Right now, I am receiving the OTF data from the combination of the Function Modules 'OPEN_FORM' and 'CLOSE_FORM' and the mail is already being sent by these function modules and the document is being archived. The transmission medium is External Send i.e. 5. However my new requirement is the subject line of the mail should be as high as 255 chars. So now I wish to restrict the use of OPEN_FORM and CLOSE_FORM only for archiving and Print Preview and send the mail using CL_BCS, which allows me the subject length of 255 chars.
I want to retrieve the OTF data. I know we can do that by setting the parameter itcpo-tdgetotf and get the OTF table at CLOSE_FORM. However, I have noticed that when I set the tdgetotf parameter, the archiving is not taking place, which again will be an issue. Is there some other way of retrieving OTF data. I cam acroos function modules such as CONVERT_OTF and CONVERT_OTF_MEMORY. But no use.
So in short, I just want to get the OTF data. Other all things are working for me now, and from what I have found out, I cannot use TDGETOTF and archiving in the same OPEN_FORM.
Any help will be greatly appreciated.
Regards,
ShaheenHi ssm,
the problem has been rectified. thanks for your inputs. i remodelled my programming. i set the tdgetotf and got the otf table from there. and used CONVERT_OTF_AND_ARCHIVE for archiving. it works great.
thanks again all...
Emanuel, are you interested to know how am I doing it or you were asking it to answer my question? let me know, in case if you want to, i will share my 2 cents of knowledge. -
How to receive OTF data out of spool request?
Hi Guys,
I want to write a program which reads out the OTF data of a spool request and then I want to send it either as eMail or as FAX to some receivers.
The function modules I found so far (CONVERT_OTF, CONVERT_OTF_AND_FAX etc.) assume that the OTF table is already filled. But what I have in the beginning is only the spool ID. Even the function RSPO_DISPLAY_SPOOLJOB doesn't pass back the OTF data. What I saw in this function is that the OTF data is read directly via C-CAll => Call 'C_RSTS_OPEN' and Call 'C_RSTS_READ'.
Does anyone of you have an idea how to solve my problem or could give me a hint?
Thanks,
ThomasHi Thomas,
As you said, the OTF is stored as is in the spool file, and you can read it using the C calls, or use RSPO_RETURN_SPOOLJOB function module for example.
Note that using SP01, you can send a spool via a menu entry, which corresponds to function module RSPO_SPOOLJOB_TO_OFFICE.
Best regards
Sandra -
How can I select a radio button in a table regarding the data in the cells?
Hi everyone
This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
Could you please help me with this problem?? I'm Kind of frustrated with this issue jejejeHere is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
Private Sub RSWVBAPage_afterPlay()
Dim tbl As HTMLTable
Dim tblRow As HTMLTableRow
Dim tblCell As HTMLTableCell
Dim strValue As String
Dim rButton As HTMLInputElement
' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
' Strip out the ; for inner text comparison
strValue = Replace(strValue, ";", "")
' This will get the table but can be modifoed to be more specific
Set tbl = RSWApp.om.FindElement(, "TABLE")
' This loops through all the rows in the table until a match to the strValue is found
' then clicks the radio button. Findelements allows you to specify a root element
' once the correct root row is found, FindElemets can get the correct radio button
For Each tblRow In tbl.rows
If tblRow.innerText = strValue Then
Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
rButton.click
End If
Next
End Sub
I also uploaded the script I created. You should be able to run it and see how it works.
This should get you going. -
hello,
Im trying to convert a script to pdf data.
In the open_form I set getotf = 'X' and in the close form , i get the OTf data.
I convert this otf to pdf data.
In the pdf output, I only have the static fields and no data.Though the number of pages generated are same in the PDF output and the script.
help me figure it out ..Hi,
There is a very useful post to check how you have converted otf to pdf:
Emailing Sap Scripts
Cheers,
Bhanu -
Error OTF end command // missing in OTF dat
Hi
I am converting a smartform of a PO into a PDF. when i am using the option of pint immediately in message option of PO. I am getting this error OTF end command // missing in OTF dat . when i am using option 3 which in not print immediately. i am able to convert it into pdf file and save in my local folder. please advice.when you click the message button while creating a PO. it will take to next page where you add your output type that is output, partner etc.. after you add and click on further data button there you will have option for dispatching here when you add slect option 4 whihc is print immediately. then i am getting the error. if i am using the other options i am able to down load into pdf but not able to see print preview. please advice
-
Query regarding the data type for fetcing records from multiple ODS tables
hey guys;
i have a query regarding the data type for fetcing records from multiple ODS tables.
if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
can any one help with some suggestion.Hi Mudit,
One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
AS is used to rename the column name when data is being selected from your DB.
So, the query Select ename as empname from emptable will return the data with column name as empname.
Regards,
Bhavesh -
OTF end command // missing in OTF data when using CONVERT_OTF_2_PDF
Hi
When using the function module CONVERT_OTF_2_PDF I am getting the strange scenario that for some users it is giving the error message "<u><b>TD 030: OTF end command // missing in OTF data</b></u>".
I am executing this function module using the OTF output data received from a smartform executed with the parameter control-parameters-getotf = X and I am not formatting it in any way.
any assistance in this is much appreciated.hi
good
go through this link,which ll give you detail idea about this function module
http://www.jt77.com/development2/programming-07636.html
thanks
mrutyun^ -
i want to show the base line date is unchangeble.how can i do that , for the base line date where can i supress.one of our friends told me regarding baseline date, you can supress by selecting FSG, or validations and parameter ID.
but i have tried the above scenarios , it is not showing any field in account groups,postingkeys and field status groups. and in the validations also it is not showing any baseline date. and in the parameter id it is not showing any parameter id for the baselind date.if i supress user cannot change that date.
please help meReddy,
Follow the menu path for validation
Spro-FA-GLA-Business Transactions-General Ledger posing-make check and document settings-validation for accounting documents.
In this you can select line items and in prerequisite step you can select Baseline Date, which is in almost down in the column, give the baseline date table and give the condition as you require. Make active callup point.
i hope it will work.
If it is useful award points.
sd/-
Sreenivasulu.P -
Question regarding Polling data from database using DB Adapters in BPEL
Hi,
I have the following question regarding Polling data from database using DB Adapters in BPEL -
If I am selecting data from multiple tables/view to ultimately generate hierarchical xml document, is there a way that I specify polling all of these tables/views. Is polling limited only to one table/view?
Thanks
RaviHi Ravi,
your question seems to have been answered for the question of polling a set of tables with one as the root, and getting back a hierarchical xml representing multiple related tables.
However you can also poll for changes to both the root table and its related tables. Not sure if this was your question or the one already answered. If the former please check out the sample
bpel/samples/tutorials/122.DBAdapter/advanced/polling/PollingForChildUpdates
Thanks
Steve -
Regarding Posting Date in IDOC for Intercompany Invoice
Hi,
We have priority issue regarding posting date in IDOC. When we create Intercompany invoice, billing date in intercompany is Actual GI date of delivery document and also Invoice posted with Actual GI date only. But, in IDOC, Posting date is appearing as Planned GI date of delivery document.
Actual GI date and Billing date and Posting date in IDOC should be same., but, posting date in IDOC is appearing as Planned GI date of delivery doc.
Kindly help in finding out the root cause of, why posting date in IDOC is not appearing as Billing date and appearing as Planned GI date of Delivery document. This issue is happening from past one month for Intercompany invoice, previously posting date in IDOC used to appear as Billing date only.
Thanks & Regards,
Jai Prabhu.Hi Jai,
Are you using standard message type INVOIC ?
If so check SEGMENT E1EDK02 for date field
and also check if there is no code put to overwrite the date
you can check the code in Function module "IDOC_OUTPUT_INVOIC"
thanks
santosh
Maybe you are looking for
-
hi..... i want to know all about process for cost of goods sold,cost of manufacture,cost of production. Thanks & Regards Rekha sharma
-
Email issues with Pantech Breakout
I wonder if anyone else has had this problem. I got my Pantech Breakout about 3 months ago or so. After having it for a bit, I set up my email on it. About 3 weeks ago it was time to change my password for my SBC Global/Yahoo email account and I d
-
TS1292 redeem code sent by apple for mountain lion doesn't work
why is this??
-
Impact of having one SCAN listener down
GI version: 11.2.0.2 Platform : Solaris 10 (64 bit) In our 2-node RAC, one among the 3 SCAN listeners is currently down due to a network misconfiguration. This is a fairly busy production cluster. Since this is just a 2-node RAC, will there be any im
-
Iphone 5 randomly vibrates with no notifications in iOS 7.1
My iPhone 5 randomly vibrates with no notifications and no sound ever since the 7.1 update. Has this happened to anyone else?