How to send output from SQL script to the specified log file (not *.sql)
## 1 -I write sql command into sql file
echo "SELECT * FROM DBA_USERS;">results.sql
echo "quit;">>results.sql
##2- RUN sqlplus, run sql file and get output/results into jo.log file
%ORACLE_HOME/bin/sqlplus / as sysdba<results.sql>>jo.log
It doesn't work please advise
$ echo "set pages 9999" >results.sql ### this is only to make the output more readable
$ echo "SELECT * FROM DBA_USERS;" >>results.sql
$ echo "quit" >>results.sql
$ cat results.sql
set pages 9999
SELECT * FROM DBA_USERS;
quit
$ sqlplus -s "/ as sysdba" @results >jo.log
$ cat jo.log
USERNAME USER_ID PASSWORD
ACCOUNT_STATUS LOCK_DATE EXPIRY_DAT
DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED
PROFILE INITIAL_RSRC_CONSUMER_GROUP
EXTERNAL_NAME
SYS 0 D4C5016086B2DC6A
OPEN
SYSTEM TEMP 06/12/2003
DEFAULT SYS_GROUP
SYSTEM 5 D4DF7931AB130E37
OPEN
SYSTEM TEMP 06/12/2003
DEFAULT SYS_GROUP
DBSNMP 19 E066D214D5421CCC
OPEN
SYSTEM TEMP 06/12/2003
DEFAULT DEFAULT_CONSUMER_GROUP
SCOTT 60 F894844C34402B67
OPEN
USERS TEMP 06/12/2003
DEFAULT DEFAULT_CONSUMER_GROUP
HR 47 4C6D73C3E8B0F0DA
OPEN
EXAMPLE TEMP 06/12/2003
DEFAULT DEFAULT_CONSUMER_GROUPThat's only a part of the file, it's too long :-)
Similar Messages
-
How to send data from internal table to the shared folder in ABAP
Hi experts,
My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is "
xxx\y\z....".
I do not have any idea on how to send data from internal table to the shared folder path.
can anybody please help me out how to do this?
Thanks & Regards
Sireesha.Where that folder is located, its on presentation server i.e. desktop or application server.
If its on presentation server, use FM GUI_UPLOAD.
If its on application server, then use DATASET functions. Have a look at below link.
[File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
I hope it helps.
Thanks,
Vibha
Please mark all the useful answers -
HT1766 How to send videos from ipad air to the cloud to free up storage space on ipad
How do I send videos from ipad air to the cloud to free up storage space on ipad?
I had a similar/same problem - when I deleted the video locally, it did not appear as a Cloud video.
To solve this, I deleted it locally, signed out of iCloud, powered of the iPad, powered back on, opened videos (empty), signed back into iCloud.
Now all my videos are present in the cloud, and none locally.
Not a great UX though -
Hi,
I am trying to install the SQL 2012 SP2 in one of the servers. I am getting the error as :
TITLE: SQL Server Setup failure.
SQL Server Setup has encountered the following error:
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Error code 0x84B10001.
The same setup is working in other servers, but on a particular server I am getting this error.
Server configuration: Windows server 2008 r2 standard edition, servvice pack 1 , 64 bit OS
How to fix this?
ThanksHi Venkatzeus,
Based on my research, the issue is caused by that some .dll files are corrupt or missing during the installing of SQL Server 2012 SP2.
In order to troubleshoot this issue, please view the detail error message in SQL Server Setup Log Files. We can read the Summary text under %programfiles%\Microsoft SQL Server\110\Setup Bootstrap\Log\, and the Detail text in the place %programfiles%\Microsoft
SQL Server\110\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\Detail.txt. For more details, please see:
View and Read SQL Server Setup Log Files
Besides, here are some similar issues for your references:
https://social.technet.microsoft.com/Forums/en-US/29e3cef1-4699-4710-9aa5-d56cf4a279c5/the-specified-module-could-not-be-found-exception-from-hresult-0x8007007e-systemwindowsforms?forum=sqlanalysisservices
https://social.technet.microsoft.com/Forums/en-US/b2faae67-19af-4f50-88c6-5a427556df3e/error-encountered-when-creating-new-integration-services-project-0x8007007e?forum=sqlintegrationservices
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
How to send sms from gsm modem(AT commands) to j2me application(not inbox)
hi
i want to send sms from gsm modem to a j2me application, for this to happen i have to send sms to a specific port in which j2me application is running.when i m trying to send sms from modem it doesnt go to application it goes to inbox.
is it related to udh settings if yes then how do i set port no in settings?if no what are the other ways.Hi Vignesh,
Might be you can call ActiveX or DLL objects of the software installed for modem from LabVIEW, if it is unblocked.
Have a look on the link > http://zone.ni.com/devzone/cda/tut/p/id/2983
CLA 2014
CCVID 2014 -
How to Recover database from old backup and full archive log file
Hi Oracle expert!
I met problem when restore my oracle database.
In my case:
- My database version: 10.2.0.2
- I have a database full backup (01-Nov)
- I have all Archived log file from (01-Nov -> 05-Nov)
- My database drop in 05-Nov with disk error (no datafile, no redo..).
- I have no any RMAN backup from (01-Nov -> 05-Nov)
How can i restore my database to 05-Nov?
Thanksuser10280724 wrote:
Hi Chinar.
When i used RMAN flow as your step, but i met the problem!
- After recover database i select sequence#, applied from v$archived_log;
--> it apply newest archived log that i had.
- but when I select Data from table created between 01-Nov to 05-Nov, it not found!
Not the same way the step:
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL?
It apply newest the same archived log i had table created between 01-Nov to 05-Nov.
How can i do with RMAN to recover my table?That is not possible,if your all available archive logs applied using rman or through sqlplus(recover database using backup controlfile until cancel) and one of these logs contain your table then there are not any problems.So there are not any difference between recovery using rman and user managed(using sqlplus),but there main matter is applying all archive logs.So first check through rman list copy of archivelog all or list backup of archivelog all and identify there in rman repository is any information or not about these logs. -
How to send output from an invoked service in BusinessConnector to Xi.
Hi,
I have configured BC sender adapter.
My scenario is such that when BC service is invoked, it's output must be forwarded to XI interface.
But when i invoke BC service there is no any message in the sxmb_moni,means no message is received from BC.
What parameters should i supply while configuring BC sender adapter?
Is there any naming convention restrictions on the XI interfaces while configuring BC sender adapter?
Has anyone an idea?Hi Shweta,
These docs will help you out..
http://help.sap.com/saphelp_nw04/helpdata/en/ed/319640c80b3528e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/61/4193404f673028e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
cheers,
Prashanth -
How to send Outputs from orders to multiple recipients
Hi,
I have a requirement to send the same output (order confirmations) to multiple contacts of the same customer. the contacts are set up in VAP1 and linked to the sold to but what is the configuration needed to enable this functionality? At the time the order is confirmed, we need to trigger these outputs by emails or by fax (can be any combination here) as required.
Appreciate any help and glad to provide nay clarifications if needed.
Thanks!Wouldn't it make more sense if the customers actually maintained their own distribution lists? They could then give you an email address of the distribution list, which they would maintain internally.
Otherwise imagine what would happen if the customer's employee leaves the company. First of all - how would you know? Second, you would need to make changes on your side (x 500 customers). In the best case you would just end up with an undeliverable email but in the worst you could expose the customer's private information. This is just a lawsuit waiting to happen IMHO.
If you still want to go ahead with this idea, this would require some ABAPing. Actually the same question has already been asked (with the same result):
Re: Output to more than 1 email -
How can I print from my ipad to the plain paper tray not the photo tray?
I have a new
HP Photosmart Plus All-in-One Printer - B209a
and an ipad on my showroom floor.
I let my customers use the ipad to browse through photos of items that are not on display, then print some of the photos. Right now the print job always goes to the photo tray - but I want it to print on plain letter size paper. If there is no photo paper in the tray, the print job fails with an out of paper error.
Is there a way to get this printer to print photos from the ipad photos app onto the standard paper tray?
Thanks in advance for any insight you can give me.
RichardPhotos will always print from the photo tray, if the printer has one. This cannot be configured by the user currently.
(Although I am an HP employee, I am speaking for myself and not for HP) -
Have tried turning explorer of and on again and other recommended solutions but nothing seems to work. Any suggestions?
David,
Can you please try Right-Click Setup.exe > Run As Administrator
and see if it helps.
Thanks,
Anwesha -
Urgent ...how to send output of sap through mail
Could you please guide me how to send output of SAP Script through mail in PDF format.
Thanks in Advance....
Regards,
Kumar.*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver,
p_sender LIKE somlreci1-receiver,
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
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.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_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.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
regards,
venkat -
I know there are a few other questions like this but I can't seem to find how it's relating to my issue. I am getting the familar failure sending mail: the specified string is not in the form required for an e-mail address.mail will not be resent.
in the reports feature of sccm.
I just picked a sample report Compliance 4. I right clicked hit create subscription and input my email into the TO: field. When it runs i get the above error. I checked the email notifcation under configure site components and was able
to successfully send a test message from there but I dont get why it doesnt work on the subscription.
Any Ideas?The log is pretty big so im not sure where I can upload it. I think it would be too big to paste here but I have copied what I think you are looking for in the log and will paste it here. Let me know some place I can send you the full log file
or if you want a different log.
schedule!WindowsService_37!a04!12/07/2014-00:02:03:: i INFO: Handling Event TimedSubscription with data 2946db38-5a07-4fb1-ad06-d7714e25b1ba.
library!WindowsService_37!a04!12/07/2014-00:02:03:: i INFO: Schedule 534ad96b-a680-4630-a865-9f99e1087e3f executed at 12/07/2014 00:02:03.
schedule!WindowsService_37!a04!12/07/2014-00:02:03:: i INFO: Creating Time based subscription notification for subscription: 2946db38-5a07-4fb1-ad06-d7714e25b1ba
library!WindowsService_37!a04!12/07/2014-00:02:03:: i INFO: Schedule 534ad96b-a680-4630-a865-9f99e1087e3f execution completed at 12/07/2014 00:02:03.
library!WindowsService_37!a04!12/07/2014-00:02:06:: i INFO: Initializing EnableExecutionLogging to 'True' as specified in Server system properties.
notification!WindowsService_37!a04!12/07/2014-00:02:06:: i INFO: Handling subscription 2946db38-5a07-4fb1-ad06-d7714e25b1ba to report Compliance 4 - Updates by vendor month year, owner: LEGISLATURE\mrykhoe, delivery extension: Report Server Email.
emailextension!WindowsService_37!a04!12/07/2014-00:02:06:: e ERROR: Error sending email. Exception: System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
at System.Net.Mail.MailAddress.ParseValue(String address)
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.CreateMessage(Notification notification)
at Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.Deliver(Notification notification)
notification!WindowsService_37!a04!12/07/2014-00:02:06:: i INFO: Notification f06f40a4-32f3-4fa6-8077-89083cc7a2a2 completed. Success: True, Status: Failure sending mail: The specified string is not in the form required for an e-mail address.Mail will
not be resent., DeliveryExtension: Report Server Email, Report: Compliance 4 - Updates by vendor month year, Attempt 0 -
How to send emails from HANA SQL Console
Hi,
Please guide how to send mail from HANA Studio SQL Console.
Is there any standard procedure in Hana Studio to send Mail( e.g. in MS SQL "sp_send_dbmail" Procedure)Hi Preethi,
Please go through the attached link:
How to send emails from HANA
Regards,
Krishna -
Send parameter from one script logic to another. SAP BPC 7.5 NW.
Hello!
Before i start, want to apologize for my English.
We work on SAP BPC 7.5 for NetWeaver.
In general, we want to send parameter from one Script logic file to another script logic file.
I will explain why :
1. We have parametr like %C_CATEGORY_SET% (and another four parameter, like groups, currency and etc.) that work on one script(next, i will named it A_Script).
We will send this parametr from BPC EXCEL (we will create button, then use command MNU_eData_SelectPackage(we also set parameters) and run package that we need, also before we set script for this package by the SAP Guide. We send some data, and this A_Script work good. Everything that we want from this script work correctly. )
2. Next we create another script(B_Script) , and we want use %C_CATEGORY_SET%, but we don't know how use this parametr, if we will just write this parametr on Script Logic, apears error ("C_CATEGORYDATAVALUE" is not assigned to the Data Administrator). We try to solve this problem by using System_Constants.lgf, but we get error.
Code:
*DIM C_CATEGORY WHAT=%C_CATEGORY_SET%; WHERE=<<<; USING=<<<; TOTAL=<<<
*DIM C_ENTITY WHAT=%ENTITYSET%; WHERE=<<<; USING=<<<; TOTAL=<<<
*DIM GROUPS WHAT=%GROUPS_SET%; WHERE=<<<; USING=<<<; TOTAL=<<<
*DIM RPTCURRENCY WHAT=%RPTCURRENCY_SET%; WHERE=<<<; USING=<<<; TOTAL=<<<
*DIM TIME WHAT=%TIME_SET%; WHERE=<<<; USING=<<<; TOTAL=<<<
If we will change %C_CATEGORY_SET% for ACTUAL, and also change another parameters, script will work, package will run correctly. But we need using parameters, because we didn't exactly what will choose our client.
Our question have BPC Script Logic some kind of Globar Parameter(Variable), that we will set in A_Script, and then use them on B_Script?
How can we define parameter from another script logic, maybe we should send it?
Should we use System_Constants for solving this problem, if yes, how?
Any help will be appreciated
Best Regards,
Erlan Kadraliev
Edited by: Erlan Kadraliev on Feb 8, 2011 4:50 PM
Edited by: Erlan Kadraliev on Feb 8, 2011 4:58 PM
Edited by: Erlan Kadraliev on Feb 8, 2011 4:59 PMHi Ethan Jewett
1. About %ENTITYSET% it is normal. Before this line i write :
*SELECT(%ENTITYSET%, "ENTITY", GROUPS, "[ID]=%GROUPS_SET%")
So it is not this problem. %ENTITYSET% just parameter, that i used.
2. Are you running the scripts using the same data manager package? I am running two different package for 2 different Script.
For example aPackage for aScript, and bPackage for bScript.
My questions was how can i send parametr from one script to another, for example i can run another script by using BADi command Runlogic, but how can send parameter that i need to used on another script. I have for example parameter %GROUPS_SET% (CG001) on aScript, but i can't get this parameter on another script, if i write %GROUPS_SET% i will get error ("GROUPSDATAVALUE" is not assigned to the Data Administrator)
OR
Maybe if you will answer for next question, i will be able solve problem , How can i send parameter CG001 (this is %GROUPS_SET%, for example it stay in EXCEL in cell A5) from excel to script logic by running package. Maybe i can get cell value on Dynamic Script Data Management?
My Dynamic Script on bPackage
PROMPT(RADIOBUTTON,%CHECKLCK%,"u0412u044Bu0431u043Eu0440 u0431u0430u0437u043Eu0432u043Eu0433u043E u043Fu043Eu043Au0430u0437u0430u0442u0435u043Bu044F.",1,{"u0412u0441u0435u0433u043E u0410u043Au0442u0438u0432u044B","u0421u043Eu0431u0441u0442u0432u0435u043Du043Du044Bu0439 u043Au0430u043Fu0438u0442u0430u043B","u0412u044Bu0440u0443u0447u043Au0430 u043Eu0442 u0440u0435u0430u043Bu0438u0437u0430u0446u0438u0438","u0414u043Eu0445u043Eu0434 u0434u043E u043Du0430u043Bu043Eu0433u043Eu0431u043Bu0430u0436u0435u043Du0438u044F u043Eu0442 u043Fu0440u043Eu0434u043Eu043Bu0436u0430u044Eu0449u0435u0439 u0434u0435u044Fu0442u0435u043Bu044Cu043Du043Eu0441u0442u0438"},{"BPAST_ALL","BPEQ","BPPROCE","BPOPIN_GO"})
INFO
(%EQU%,=)
INFO
(%TAB%,;)
TASK
(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)
TASK
(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)
TASK
(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)
TASK
(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,CHECKLCK%EQU%%CHECKLCK%%TAB%)
TASK
(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,MYTEST_145.LGF)
Best Regards,
Kadraliev Erlan -
How to send output by mail?
Hi Experts,
Current output type in our system:
Document: SD delivey note
Output type: LD00
Medium: 1
Form: Smartforms.
Now we are printing delivery note by LD00 and Medium 1.
In the future, we need to send ducument output to customer by mail, format still as original smartforms.
Would you please give me a guide line to do this?
Thank you.
Richard.Hi Richard,
you need to do following things to send output as an email.
The output type should have medium 5. thats to send an email. Along with this you need to check following two things.
if you are using a copy of a standard program it should have code to send an email. Then you just need to configure following output type with medium '5' to send an email.
If you dont have code to send it as an email you can use FM to send it as an email.
you can use following FM if its an adobe form.
CALL FUNCTION 'SD_PDF_SEND_DATA'
EXPORTING
iv_device = p_w_device
iv_email_subject = w_lv_subject
it_email_text = w_mail_text
is_main_data = p_wa_fp_formoutput
iv_language = w_langu
is_address = w_ls_address
IMPORTING
ev_send_to_all = w_lv_send_to_all
EXCEPTIONS
exc_document = 1
exc_send_request = 2
exc_address = 3
OTHERS = 4.
Else for smart form you need to convert it to PDF format first and send it as an email. Refer below code.
Call Smartform function module.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ssfctrlop
output_options = ssfcompop
IMPORTING
job_output_info = it_otf_data
TABLES
it_nfal = it_nfal.
***********appending the otf data into the final table*********************
it_otf_final[] = it_otf_data-otfdata[].
converting OTF data into pdf data**************************
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = bin_filesize
bin_file =
TABLES
otf = it_otf_final
lines = it_pdfdata[]
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
To send data as email attachment, we need to have a table of SOLISTI1.
This table contains line size of 255 characters. Below function module
does the trick of changing the table from X character sized lines into
any given Y character sized lines.
REFRESH it_pdf[].
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_dst = '255'
TABLES
content_in = it_pdfdata[]
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 = 1.
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 it_pdf INTO w_pdf INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_attachment ).
"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 i303(me) WITH 'Mail has been Successfully Sent.'.
ENDIF.
ENDIF.
Edited by: Sumit Naik on Oct 13, 2010 11:20 PM
Maybe you are looking for
-
Vertical Spry Menu Bar not working in all browsers
Hi, everyone! I'm hoping you'll help me troubleshoot something. I have a spry menu bar (vertical) that's expanding properly in IE but not in Firefox or other browsers. Here is the link: http://midlochorus.org/ Thanks in advance for any help! Karen
-
How can I get my 2001 copy of Photoshop Elements to run on my Windows 7 computer?
How can I get my 2001 copy of Photoshop Elements to run on my Windows 7 computer?
-
Mini Bridge doesn't show at bottom of work space
CS6 does not show Mini Bridge in bottom left corner. Opens as separate program. Is this right?
-
FYI when I login in my Adobe https://digitalpublishing.acrobat.com/ (still takes forever by the way ;-)) and clink on bottom right link for Adobe TV http://tv.adobe.com/show/undefined/#/show/learn-digital-publishing-suite/ it leads to "404 - Not Foun
-
How to install windows on separate internal drive?
Hello, I've been at this problem for a few days and need some help if anyone has a clue. I have a late 2008 macbook pro 15". I've taken out my optical drive to install a SSD so that I can run both the existing internal drive and SSD as a DIY Fusion D