Create Spool From OTF Data
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,
Preet
May 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
Similar Messages
-
I am trying to create xml from raw data. It works well in the format builder but
when I instanciate the MFLObject and run convert to xml, the output only contains
wrappers for my first field described in the mfl. Are there any known issues
using this progmattic conversion to XML.
My mfl is the following:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE MessageFormat SYSTEM 'mfl.dtd'>
<!-- Enter description of the message format here. -->
<MessageFormat name='BossRecord' version='2.01'>
<FieldFormat name='Header' type='String' length='102' codepage='windows-1252'/>
<StructFormat name='TransactionControlRecord' delim='999'>
<FieldFormat name='TransactionTypeNumber' type='String' length='3' codepage='windows-1252'/>
<FieldFormat name='TransactionData' type='String' codepage='windows-1252'>
<LenField type='Numeric' length='4'/>
</FieldFormat>
</StructFormat>
<StructFormat name='Generic' repeat='*'>
<FieldFormat name='GenericTypeNumber' type='String' length='3' codepage='windows-1252'/>
<FieldFormat name='GenericData' type='String' codepage='windows-1252'>
<LenField type='Numeric' length='4'/>
</FieldFormat>
</StructFormat>
<FieldFormat name='IgnoreTheRest' type='Filler' optional='y' length='1' repeat='*'>
<!--
This field is useful for testing partially constructed formats. Adding
this field to the
end of a format will cause any leftover bytes on the end of a binary file to be
ignored when the data is converted to XML.
-->
</FieldFormat>
</MessageFormat>
Are there any issues with this that are easy to spot?
Here is some sample output:
_BossRecordDoc : <BossRecord>
<Header>0601uskyloupw7vu0 IBVRTR 000006RSQ1010246000000000000020436000001-01-01-00.00.00.00000000000100170</Header>
<Header>90100581D4EBC00AA3C18629ACA0004AC02E54BD289357023141961111F1111 99900207141D4EBC00AA3C18629ACA0004AC0</Header>
<Header>2E54BD2893570231RIBBONS & BUTTONS 9 00000000000010.50CAD00000000000000.5</Header>
<Header>0USD00000000000000.00USD00000000000077.00CAD 0CAUS00000000000000.91KGSA215D100CF3C18619AC</Header>
<Header>90004AC02E54B 01 0001-0</Header>
<Header>1-012003-04-072003-06-2501P/P03003984196000010100000000000000.00CAD 00
FR00000000000000</Header>
<Header>.0000000000000000000.00KGS00000000000000.00USD 00UPS T1</Header>
<Header>0001-01-010001-01-01 0 000000000000000.00000000000000000.00USD0</Header>
<Header>000000000000000.00 1 22222222222220 0100304061DC30500AA3C18629ACA</Header>
<Header>0004AC02E54B1D4EBC00AA3C18629ACA0004AC02E54B</Header>
<Header> 0010001-01-01 00000000000000.00USD00</Header>
<Header>000000000000.00CAD00000000000010.00CAD</Header>
<Header> 00000000000010.00CAD000000000000000010001-01-01K00404862A8D2C00AA3C186</Header>
<Header>29ACA0004AC02E54B1DC30500AA3C18629ACA0004AC02E54B001 PURPLE RIBBONS</Header>
It just keeps finding my first record instead of finding the remaing structure.
I appreciate any help.
Thanks,
MichaelOkay, I've got some coding off a site that looks like it will do what I want. It's quite a robust applications which will do more than I need but as long as it does at least what I want, i could care less. As it will extract files from the datastream for me, it is going to save them to disk.
I believe I have to specify a directory to save it to. I believe this is the line I'm going to modify, so assuming that's the case, how do I specify a directory here:
private File fileOutPutDirectory = null;
Do I have to use absolute paths or can I use relative. Also, what directory construct is expected by java? Anyone with an example of what urls are supposed to look like in this case?
Thanks,
destin -
Create Spool from Internal table & converrt the spool to PDF
Hi All,
My requirement is take data from a table and find amount specific to each Vendors . So I took all the data into ITAB and do all the calculation. Later after calculation I have to create a spool from this ITAB and this spool have to convert to PDF. Later this PDF have to seend via email.
To convert the internal table to Spool , I used
LOOP AT t_summ INTO wa_summ.
w-amount = wa_summ-remittanceamount.
CONCATENATE wa_summ-vendorcode
wa_summ-controlnum
w-amount INTO wa_textdata SEPARATED BY space.
APPEND wa_textdata TO t_textdata.
ENDLOOP.
DESCRIBE TABLE t_textdata .
w-file_length = syst-tfill * 1022.
l_doctype = 'LIST'.
l_layout = 'X_POSTSCRIPT'.
CONCATENATE ' Listbill Summary Report for' syst-datum INTO
l_title SEPARATED BY space.
l_receiver = syst-uname.
* Create Spool
CALL FUNCTION 'RSPO_SR_OPEN'
EXPORTING
dest = 'LOCL'
* LDEST =
layout = l_layout
name = 'SUMREP'
* SUFFIX1 =
* SUFFIX2 =
copies = '1'
* PRIO =
* immediate_print = ' '
* AUTO_DELETE =
titleline = l_title
receiver = syst-uname "
* division = l_pri_params-prabt " abteilung
* authority = l_pri_params-prber "
* POSNAME =
* ACTTIME =
* LIFETIME = '8'
* APPEND =
* COVERPAGE =
* CODEPAGE =
doctype = l_doctype
* ARCHMODE =
* ARCHPARAMS =
* TELELAND =
* TELENUM =
* TELENUME =
IMPORTING
handle = l_spool_handle
spoolid = w-spoolid
EXCEPTIONS
device_missing = 1
name_twice = 2
no_such_device = 3
operation_failed = 4
OTHERS = 5
. "#EC DOM_EQUAL
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 'SLVC_C1022_TO_C255'
EXPORTING
i_file_length = w-file_length
TABLES
it_c1022 = t_textdata
et_c255 = lt_spool.
l_length = w-file_length.
LOOP AT lt_spool INTO ls_spool.
l_length = l_length - 255.
IF ( l_length > 0 ).
l_line_length = 255.
ELSE.
l_line_length = l_length + 255.
ENDIF.
* Write contents to spool
CALL FUNCTION 'RSPO_SR_WRITE'
EXPORTING
handle = l_spool_handle
text = ls_spool
length = l_line_length.
ENDLOOP.
* Close Spool
CALL FUNCTION 'RSPO_SR_CLOSE'
EXPORTING
handle = l_spool_handle
pages = 1
FINAL = 'X'
EXCEPTIONS
handle_not_valid = 1
operation_failed = 2
OTHERS = 3
By this I can see the spool with data in SP02.
Then to conver to PDF, I used
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = w-spoolid
no_dialog = 'X'
DST_DEVICE = 'LOCL'
* PDF_DESTINATION =
IMPORTING
* PDF_BYTECOUNT =
* PDF_SPOOLID =
list_pagecount = list_pagecount
* BTC_JOBNAME =
* BTC_JOBCOUNT =
TABLES
pdf = t_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
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 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\t\t.pdf'
filetype = 'BIN'
TABLES
data_tab = t_pdf
* FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
But later when I go and open the PDF, I am getting an error saying'Page cannot be open because it dont have any pages'
Please help me
Regards,
NikhilHi Nikhil,
<li>If you are still not able to find out the problem. You can an alternative way , which is used for the same purpose.
<li>Try this way. It creates spool and and same CONVERT_ABAPSPOOLJOB_2_PDF fm is used to convert spool to PDF. It works. Test this test program.
REPORT ztest_notepad.
DATA:g_val TYPE c,
w_pripar TYPE pri_params,
w_arcpar TYPE arc_params,
i_pdf TYPE TABLE OF tline,
spoolid LIKE tsp01-rqident,
l_no_of_bytes TYPE i,
l_pdf_spoolid LIKE tsp01-rqident,
l_jobname LIKE tbtcjob-jobname,
l_jobcount LIKE tbtcjob-jobcount.
DATA:it_t001 TYPE TABLE OF t001 WITH HEADER LINE.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_t001.
"Read, determine, change spool print parameters and archive parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = w_arcpar
in_parameters = w_pripar
layout = 'X_65_132'
line_count = 65
line_size = 132
no_dialog = 'X'
IMPORTING
out_archive_parameters = w_arcpar
out_parameters = w_pripar
valid = g_val.
IF g_val NE space AND sy-subrc = 0.
w_pripar-prrel = space.
w_pripar-primm = space.
NEW-PAGE PRINT ON NEW-SECTION PARAMETERS w_pripar ARCHIVE PARAMETERS w_arcpar NO DIALOG.
ENDIF.
LOOP AT it_t001.
WRITE:/ it_t001.
ENDLOOP.
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
spoolid = sy-spono.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolid
no_dialog = ' '
IMPORTING
pdf_bytecount = l_no_of_bytes
pdf_spoolid = l_pdf_spoolid
btc_jobname = l_jobname
btc_jobcount = l_jobcount
TABLES
pdf = i_pdf.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\temp\test.pdf'
filetype = 'BIN'
TABLES
data_tab = i_pdf.
Thanks
Venkat. -
Create Tree from Preordered data
Here is a quick summary of what I'm trying to do:
I have a file with formatted like this
Does it have legs?
Dog
Fish
and the resulting tree for it should look like this
Does it have legs?
Dog Fishand I'm trying to write a function that takes in a Scanner object that should already be tied to the data file and create a tree from this data that is already listed in Preorder fashion. I know tha recurison is probably the best way to go about this but everything that I have written hasn't worked. Also, I cant really figure out a way to use recursion when the function is taking in a Scanner I dont know how it would work.
Any help would be greatly appreciated.
Here is what I have now:
public BinaryTree<String> readTree(Scanner data)
BinaryTree<String> temp = new BinaryTree<String>();
temp.attachLeft(data.next());
temp.attachRight(data.next());
return temp;
}I know this function wont go through the whoel file, but I've tried many loops but I cant figure out how to get it to work so I'm convinced that I need to figure out how to make it recursive
(yes I know that everything that can be done through recursion can be done with a loop)@OP:
Here's how you could do it:
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.Stack;
class Main {
public static void main(String[] args) throws FileNotFoundException {
Scanner file = new Scanner(new File("data.txt"));
BinTree tree = new BinTree(file);
System.out.println(tree);
class BinTree {
private BinNode root;
public BinTree(Scanner file) {
// create the root (first line in the file)
root = new BinNode(file.nextLine());
// create a stack
Stack<BinNode> stack = new Stack<BinNode>();
// push the root on the stack: we need it to add nodes to the left and right of it
stack.push(root);
// call the insert method to build the tree
insert(stack, file);
private void insert(Stack<BinNode> stack, Scanner file) {
IF 'file' has no more lines left
stop this method
END IF
BinNode 'next' <- the next line in 'file'
IF the left node of the last node on the 'stack' equals null
the left child of last node of the stack <- 'next' (but leave the stack in tact)
ESLE
the right child of last node of the stack <- 'next' (remove the last node of the stack)
END IF
IF 'next' is a question
push 'next' on the stack
END IF
recursively call the insert(...) method here
class BinNode {
String data;
BinNode right, left;
public BinNode(String data) { this.data = data; }
public String toString() { return this.data; }
} -
Create Report from HFM Data Grid
Hi All,
I need to create a report out of the Data Grid created in HFM and then publish that as a PDF. I found the Reporting feature in Manage Documents that uses system reports.
And if I want a report from a data grid the Data Explorer option has to be selected for Report Type.But in this case I guess I need to create a Report Definition File and then upload it which seems to be complex.
But am not able to figure out how I can directly take a HFM Data Grid as the source and generate a PDF Report out of it.
Can this be done using BI Publisher? If so can anyone please provide the steps?
Or, can it be done using the Financial Reporting Studio ?
I sincerely appreciate any help!
Thanks in advance!
Chellaselect
decode( abs((sysdate - end_time)-1), (sysdate - end_time)-1, 'TOO LONG AGO', '-' ) "Check" ,
b.database_name , t.type_qualifier1 , b.host ,
to_char(b.end_time, 'YYYYMMDD-HH24:MI:SS') , b.time_taken_display , b.output_bytes_display
from mgmt$ha_backup b, mgmt$target t
where b.target_guid = t.target_guid
order by type_qualifier1, end_time; -
Creating Spool from function module
Hi friends,
I want to create a spool from my function module. I dont knw it is possible or not. Currently I am creating spool by submitting another report from my function module and exporting the values calculated in memory ID and importing in report which is not a good practise, kindly suggest some other way.
Thanks,
BrijeshNo. Spool is not possible from Function Module. You have to use that FM from one report/program.
Thanks
Subhankar -
Creating Spool from Smartform??
Hi
Can anybody tell how to get the spool from smartform?
Thanks in Advance
Davinder SinghHi Davinder,
After the execution of smartform function module the import parameter JOB_OUTPUT_INFO is populated with data. This is of type SSFCRESCL.
The component SPOOLIDS of JOB_OUTPUT_INFO contains list of spool id generated for smartform..
This spool id can be used to read spool request generated using any standard func module like RSPO_RETURN_ABAP_SPOOLJOB.
Hope this helps you....
Enjoy SAP.
Pankaj Singh. -
Having difficulty creating pdf from XML data source
I have a 'rpt' file built with a classic install of Crystal 10, using xml as a data source. I have tried using both ADO.NET(XML) connection and ODBC CR ODBCXML Driver 4.20.
The rpt file was built on Windows2000 NT platform. The report runs, and displays data from the sample xml file in the preview tab.
I am attempting to feed xml data into the rpt file with the intent to create pdf formatted output. I am using java with the Crystaldecisions packages. I am running this app out of an Apache server on an Ubuntu VM Hardy Heron release. This does not have any version of Crystal Reports installed on it.
I have followed the examples and I am comfortable that I have the correct package imports, I am able to open the rpt file, and convert both the xml and xsd to byte arrays. When I issue the command
reportClientDocument.getDatabaseController().setDataSource(xmlDataSet, '', '')
I get the response
Cannot find corresponding table information in the XML file
Set data source failed: The table 'criminal_case' could not be found.
Request failed and JRC Command failed to be undone
JRCAgent1 detected an exception: The table 'criminal_case' could not be found.
at com.crystaldecisions.reports.reportdefinition.datainterface.g.a(Unknown Source)
The xsd does validate the xml which contains a noNamespaceSchemaLocation pointer to the xsd.
The xml is the same data that was used to design the report on the NT box. This means that I see the same elements being byte streamed as were used to create the rpt file.
Is this as simple as I am running my webserver on Linux? I do see the connection attribute properties reference a Database DLL that is clearly windows based. What can I do?So why develop a report if there is no data? I can only think that you have a bunch of static text, maybe an instruction page you want to publish? If so, you still need a data source, it can be a dummy source
<?xml version="1.0"?>
<ROOT/>
ie no data per se. BIP needs a source even if there is not data to merge.
Cheers
Tim -
Create table from external data with dates
I have a CSV that looks somewhat like this:
abcuser,12345,5/12/2012,5,250.55
xyzuser,67890,5/1/2012,1,50
ghjuser,52523,1/1/1900,0,0
When I create the external table, then query it I get a date error:
CREATE TABLE xtern_ipay
userid VARCHAR2(50),
acctnbr NUMBER(20, 0),
datelastused DATE,
number_rtxns NUMBER(12, 0),
amtused NUMBER(12, 0)
organization external ( TYPE oracle_loader DEFAULT directory "XTERN_DATA_DIR"
ACCESS parameters (
records delimited BY newline fields terminated BY "," )
location ('SubscriberStatistics.csv') ) reject limit UNLIMITED;
Error I see in the reject log:
Field Definitions for table XTERN_IPAY
Record format DELIMITED BY NEWLINE
Data in file has same endianness as the platform
Rows with all null fields are accepted
Fields in Data Source:
USERID CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
ACCTNBR CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
DATELASTUSED CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
NUMBER_RTXNS CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
AMTUSED CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
error processing column DATELASTUSED in row 1 for datafile g:\externaltables\SubscriberStatistics.csv
ORA-01858: a non-numeric character was found where a numeric was expected
error processing column DATELASTUSED in row 2 for datafile g:\externaltables\SubscriberStatistics.csv
ORA-01858: a non-numeric character was found where a numeric was expected
error processing column DATELASTUSED in row 3 for datafile g:\externaltables\SubscriberStatistics.csv
ORA-01858: a non-numeric character was found where a numeric was expected
Any ideas on this? I know I need to tell oracle the format of the date on the external file, but I can't figure it out.Try this:
CREATE TABLE xtern_ipay
userid VARCHAR2 (50)
, acctnbr NUMBER (20, 0)
, datelastused DATE
, number_rtxns NUMBER (12, 0)
, amtused NUMBER (12, 2)
ORGANIZATION EXTERNAL
( TYPE oracle_loader DEFAULT DIRECTORY "XTERN_DATA_DIR"
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY "," MISSING FIELD VALUES ARE NULL
( userid
, acctnbr
, datelastused DATE 'mm/dd/yyyy'
, number_rtxns
, amtused)
location ('SubscriberStatistics.csv') ) reject LIMIT unlimited;
select * from xtern_ipay;
USERID ACCTNBR DATELASTU NUMBER_RTXNS AMTUSED
abcuser 12345 12-MAY-12 5 250.55
xyzuser 67890 01-MAY-12 1 50
ghjuser 52523 01-JAN-00 0 0
{code}
Sorry I had to correct the previous statement again for the date format and for the column amtused that was defined without decimals.
Regards
Al
Edited by: Alberto Faenza on May 31, 2012 6:34 PM
wrong date format mm/dd/yy instead of dd/mm/yy
Edited by: Alberto Faenza on May 31, 2012 6:40 PM
Fixed again the date format and the amtused defined with 2 decimals -
Report in background not create spool when no data found
Hello ,
I created simple rapport that should run in background. When I execute background job (sm37) I noticed that the spool exists only
for when the some data is found. When data is not found for any reason I do not have spool , and I need one saying
'records passed 0'. I am not sure what I can do about it. I saw insome programs that is possible but I cannot find how it was done. Please advice .
KrstoHi,
You might be checking if the Final Internal table has data in it or not (May be in END-OF-SELECTION). If you are not do have check on this and simple code a write statement like below.
IF IT_FINAL IS NOT INITIAL.
CREATING A SPOOL.
ELSE.
WRITE : / 'Records Passed are 0'.
ENDIF.
Let me know if you need any further help on this.
Regards,
SRinivas -
Unable to create Model from DOE Data Object
Hi,
I created a Mobile Laptop WebDynpro DC in NWDS 7.1, the build and deploy work fine.
The problem is that when I attempt to create a Model based on a Data Object from the
Mobile Middleware 7.1 DOE, I always get an exception when the Data Object metadata is
imported (the last step of the Model Creation Wizard).
Here's the exception :
Status ERROR
Plugin : com.sap.ide.cmi.core
code=0
Internal error
Plugin name: Common Model Tools Core
Internal error : com.sap.ide.cmi.core
Class : com.sap.tc.mobile.dt.metaimp.ModelImportWizard
Method : run(IProgressMonitor)
Message : Failed to create model
Exception : com.sap.ide.metamodel.general.exception.ObjectRequiredException: ModelClassPropertySetting "//WebDynpro/ModelClass:ca.test.sandbox.mitest1.test3.ZTESTDATAOBJ/Property:ACTUAL/Setting:backendKey", Role "SettingDefinition": A minimum of 1 object(s) is required
ObjectRequiredException: ModelClassPropertySetting "//WebDynpro/ModelClass:ca.test.sandbox.mitest1.test3.ZTESTDATAOBJ/Property:ACTUAL/Setting:backendKey", Role "SettingDefinition": A minimum of 1 object(s) is required
at com.sap.ide.metamodel.webdynpro.implementation.ModelClassPropertySettingProxy._validate(ModelClassPropertySettingProxy.java:358)
at com.sap.ide.metamodel.core.DevelopmentObjectProxy.validate(DevelopmentObjectProxy.java:825)
at com.sap.tc.mobile.dt.metaimp.MBOModelImporter.doImport(MBOModelImporter.java:170)
at com.sap.tc.mobile.dt.metaimp.ModelImportWizard.createModel(ModelImportWizard.java:200)
at com.sap.ide.cmi.core.model.importer.CMIWizard$2.run(CMIWizard.java:197)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
I know this is not related to Middleware authorization, I tested with a userid with full DOE authorization.
When I display the Data Object metadata from the Middleware, it shows as status 'active'.
The exception seems to complain about the backend key, but there is a backend key field in
the Data Object.
I have the same exception even with any SAP delivered Data Objects (MAM30_001, etc..).
any thoughts on what the problem is ?
thanks,
Yanick.Hi Yannick,
This type of error can occur with local non-dc Mobile App when some jars required for the model generation are missing.
The easiest way to fix this is to create a DC for your Mobile app from the
Mobile App Offline perspective.
Let me know if it works
Genevieve -
BPS: Create records from reference data in FOX
As writed in "How to Loop over Reference Data in Fox Formulas", I create FOX Function with DO statements, but unfortunetely if I have no data yet in the subset my fox formulas can't be executed at all.
It's write "0 data records were read, 0 of them were changed, 0 generated". Even if I put Break-point in fox formula, it doesn't take place. When I input somehow one or so "test" record, it works perfect, and creates new lines from reference as I want.
How can I execute fox formula at list one time with empty subset?Hello,
use a copy function to create one (dummy) record. Then call your FOX function (and delete the dummy record). You can combine them in a sequence.
Also see SAP Note <a href="http://service.sap.com/sap/support/notes/646618">646618</a> for looping over reference data.
Regards,
Marc
SAP Techology RIG -
Creating childSymbol from JSON data
Hi
This is a bit tricky one, i think.
I am trying to make a menu, from some JSON data. I want to make a function, that takes, in this case the id (this is not to be confused with Javascripd id. This is just the name in the JSON file) and creating a symbol. But i don't want it to repeat itself. Right now, it only says placeholder, in those places, it shouldn't create a symbol at all.
http://torbenvf.dk/ledelsehelehistorien/test/index.html
Heres the code from the ComposisionReady
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
//Edge symbol: 'stage'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
$.getJSON('slides.json', function(data) {
for(var i=0; i<data.length; i++)
var s = sym.createChildSymbol("slide", "Stage");
if(i)
{ if(repeat != data[i].id)
{s.$("title").html(data[i].id);}
else
else{
s.$("title").html(data[i].id);}
repeat = data[i].id;
Eventually, the whole thing is going to look something like this, just using dynamic data
http://torbenvf.dk/ledelsehelehistorien/grafiskprototype1koma5.html
Kind Regards1) So, the html() function is no longer available. See ==> Adobe Edge Animate CC JavaScript API
2) I looked at your json file.
Findings: Your json items have no html tags, therefore you can replace .html() by .text()
Note: i will test your website with iOS8 (iPad) and Mac OS X (MacBook Pro). -
XML info: D:\XMLDATA\mytable.xml
create directory XML_dir as 'D:\XMLDATA';
<INFO>
<Column_Name>Col1</Column_Name>
<Data_Type>Char(1)</Data_Type>
</INFO>
<INFO>
<Column_Name>Col2</Column_Name>
<Data_Type>VARCHAR2(50)</Data_Type>
</INFO>
I need to create a table based on the XML data.
Create Table mytable
Col1 Char(1),
Col2 Varchar2(50)
How to read and execute the xml data to create a table.
Thanks!Something like this :
SQL> declare
2
3 v_xmlinfo clob;
4 v_ddl varchar2(32767) := 'CREATE TABLE mytable ( #COLUMN_LIST# )';
5 v_column_list varchar2(4000);
6
7 begin
8
9 v_xmlinfo := dbms_xslprocessor.read2clob('TEST_DIR', 'info.xml');
10
11 select column_list
12 into v_column_list
13 from xmltable(
14 'string-join(
15 for $i in /INFO
16 return concat($i/Column_Name, " ", $i/Data_Type)
17 , ", "
18 )'
19 passing xmlparse(content v_xmlinfo)
20 columns column_list varchar2(4000) path '.'
21 ) ;
22
23
24 v_ddl := replace(v_ddl, '#COLUMN_LIST#', v_column_list);
25 --dbms_output.put_line(v_ddl);
26
27 execute immediate v_ddl;
28
29 end;
30 /
PL/SQL procedure successfully completed
SQL> select * from mytable;
COL1 COL2 -
User Defined field in UDT - how to create select from existing data
Hi
I want to create User Defined Table for purpose of storing records of sales visits made to customers.
I want to record detail for example: Date of Visit; Sales Employee; Activity number ref (which has attached PDF visit report); Related Opps)
I am not sure exact detail as I have never created User Defined Table before so I am not sure how best to achieve my requirement.
But I want one of the fields to be Business Partner code.
My question is How should I set the BP field so that available options are existing Business Partner codes?
I would like to set field so that if I enter for example:
"CAQ"... and I click Tab key then SAP will bring list of BP Codes which begin with CAQ (eg. CAQU001; CAQF001 etc) for my selection.
Is this possible?
Regards,
Karenhi.
u can create a user defined table enter your values..by creating columns like..
Customercode, customer name, vitst time, attachnment.
but
"CAQ"... and I click Tab key then SAP will bring list of BP Codes which begin with CAQ (eg. CAQU001; CAQF001 etc) for my selection.
above one u can not do it..
all the cutomer codes will come if u use coding........are u can filter as per ur requirement
else
if u say i am not using the coding..
u can get all the business master codes... but u have to use fms u have to put it..otherwise u can not do it...
Maybe you are looking for
-
Apps crash when MacBook not connected to external monitor
I have been using my macbook connected to a Samsung T240M 24 inch monitor/tv for several months now with no problems at all until 2 days ago. Everything functions perfectly when the computer is connected to the external monitor, however, when I disco
-
Chart XML country settings on WAD
Hi all, just a couple of questions about charts on WAD: - Where can i change the country configuration for charts ?, i need to change the format from 1,000 to 1.000. I've hear about a XML related to the chart settings but i can't find it. - i'm usi
-
Could you please recommend a book or two about data warehouse designing?
Want to read some books about data warehouse and how to build or deal with the problems during the data warehousing process. Anyone could recommend any book regard to this? I want the book to mainly talk about the common case scenarios in data wareho
-
EEWB : in CRM 4.0 adding field with data element = table type
Hi, Do you have experience in CRM4.0 to add a customer field with data element that is a table type ?
-
Hi, Is it possible to capture a link (from a J2EE application running as a callable object) as an output parameter in GP? I want the text of this link (not the value itself) as a parameter for the next step..Is it possible? Thanks, Sameer