Commas in Hiearchy Nodes from SAP Source
Hi,
We are still using the old way of transfer rules to import hiearchies to SAP BW.
The node descriptions contain commas which i want to remove.
The leaves also contained commas but removed that via the transformation in when loading texts.
Can you please advise me the me the best way to remove the commas in the description of the nodes?
Thanks,
description must be maintained at source side.
inform about this comma issue, so now onwards they won't maintain commas.
at bw side in at field level you can write any routine to remove that comma.
About logic you can get help from ABAP expert.
if comma coming at one place for every record(which have comma) then no issue. if its coming at different places in deceptions then code maycontain more if else condiitons. it may degrade loading performance.
Similar Messages
-
Data Flow from SAP Source (ECC) system to SAP BI system
Hi All,
I wanted to know how data will be flown from SAP Source system to SAP BI system.Data flow should include
1) Data will be flown by using the IDOCs?
2) What all are the interfaces involved while data is transferring?
3) What will happen exactly, if you execute the PSA?.
If you have any info on this, could you please post here....I
Regards,
K.Krishna Chaitanya.Hi Krishna,
Please go through this article :
"http://www.trinay.com/C6747810-561C-4ED6-B85C-8F32CF901602/FinalDownload/DownloadId-C2EB7035A229BFC0BB16C09174241DC8/C6747810-561C-4ED6-B85C-8F32CF901602/SAP%20BW%20Extraction.pdf".
Hope this answers all the mentioned questions.
Regards,
Sarika -
Data Reconciliation Node on SAP Source System
Hi Gurus,
I'm working on Data Reconciliation between SAP BI and SAP R3 systems. I've read on the forum that the reconciliation DataSource technology is available as of PI-BASIS 2005.1 / SAP NetWeaver 2004s. I'm using
SW Comp Release Level Highest Support Desc
PI_BASIS 2005_1_640 0017 SAPKIPYJ6H Basis Plug-In (PI_BASIS) 2005_1_640
I wonder that I cannot see the Data Reconciliation Node in the transaction RSA6 in the SAP Source System. Please throw some light on this whether I need to activate them.
Thanks & Regards,
Ash.Hi Sunny,
Thanks for your response. Can you suggest me what should I do to get those DataSources? Are there any patches that SAP has released to overcome this problem for lower versions as the one which I'm using?
Thanks,
Ash. -
How To Remove Empty Node From Source XML
Hi,
How can I remove an empty node from the source xml in a XSLT mapping.
For e.g. If the source xml is like:
<SRC>
<Node1>SAP</Node2>
<Node2/>
<Node3>XI</Node3>
</SRC>
Then the xml should become:
<SRC>
<Node1>SAP</Node2>
<Node3>XI</Node3>
</SRC>
I need to do this because the output of my XSLT mapping is showing blank spaces for each blank node.
Thanks,
Abhishek.Use <xsl:if>
Or else you may find different options here
http://www.dpawson.co.uk/xsl/sect2/N3328.html#d4804e304
Regards,
Prateek -
Upload fields from SAP R/3 to BW
Dear All,
I'm looking for a method to upload fields from SAP R/3 to BI 7.0.
My testing case as following:
- Upload table DFKKKO \ field OBEL from R/3 to BW
- I created a Generic Datasource and select this field.
- When coming back to BI, I replicate the metadata from SAP source system and can display my Generic Datasource.
- I create the Info Package for this Generic Datasource but when I run the scheduling, I didn't find any data in PSA table.
So this is my questions:
- Is this method (generic datasource) suitable for uploading from SAP R/3 to BI or there is anything else better?
- Why the data cannot uploaded to PSA table? (I got this error message from Monitor "EDI: Partner profile inbound not available" and "Some IDocs have error status" but don't know how to correct)
If there is any possible response, I shall give reward point.
Many thanks,Hi
I think you have missed the mapping part in BW....did you create the transformation in BW side before loading the date?You have to map the R/3 field to BW infoobject. -
How to merge key field from external source system with SAP R/3 master
Hi,
In SAP BW 7.0 system, our scenario is Master Data for 0GL_ACCOUNT is coming from SAP R/3 alongwith the Transactional data records for standard FI cubes. Then, one more set of transaction data is coming from external source system, a flat file, into another custom DSO(ZDSO_FI), which also has this GL Account field.
This flat file's GL account, GL_file, has to be basically mapped/merged with the standard 0GL_ACCOUNT field so that at the time of loading the transactional data for custom DSO, ZDSO_FI (with transformation mapping GL_file > 0GL_ACCOUNT), system automatically refers to the 0GL_ACCOUNT master data to load these incoming transactional values, from the external flat file system. How can this be done?
To illustrate the scenario, say I have 5 records in 0GL_ACCOUNT, loaded from SAP R/3 into SAP BW-
0GL_ACCOUNT Short Description Source System
100 D1 R/3
200 D2 R/3
300 D3 R/3
400 D4 R/3
500 D5 R/3
Now suppose if my flat file has following sample transactional data, to be uploaded in SAP BW ZDSO_FI-
GL_file Key Figure1
400 789
200 567
Then after uploading this transactional data in ZDSO_FI (with transformation mapping GL_file > 0GL_ACCOUNT), the 0GL_ACCOUNT data becomes as below-
0GL_ACCOUNT Short Description Source System
400
200
100 D1 R/3
200 D2 R/3
300 D3 R/3
400 D4 R/3
500 D5 R/3
So note that the system did not refer the incoming GL's from flat file, although the field is mapped to 0GL_ACCOUNT in transformation, to the already available master data. Rather created 2 new data rows for the GL accounts coming from external system. Because of this I am not able to perform the calculations common from standard FI cube and ZDSO_FI, with GL account as key field. I need to synchronise these data values based on GL Account to proceed with further calculation and am badly stuck.
Request if anyone can please throw some light on how to achieve this seemingly simple requirement?
Thanks in advance.
NirmitBetter post this thread is in the [Enterprise Data Warehousing|Data Warehousing; forum.
-
Master Data cleansing and transformation from non-SAP source systems
Hi all,
Our client (Media)wants to cleanse and transform his master data from non-SAP source system to be uploaded into BW (no R/3 yet). If anybody has a document regarding this topic that i could use, i will appreciate if u sent it to me.
thanks.Hi,
https://websmp203.sap-ag.de/~sapidb/011000358700001965262003
https://websmp203.sap-ag.de/~sapidb/011000358700006591612001
https://websmp203.sap-ag.de/~sapidb/011000358700001971392004
https://websmp203.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000471477&_OBJECT=011000358700008927932002E
/manfred -
Restarting J2EE server nodes from Developer Studio Vs SAP Management Consol
Hi,
What makes the difference between restarting server nodes from Dev Studio and SAP Management console.
Please let me know if any documents related to this.
ThanksThanks for your quick reply.
I observed that options for restarting services from Dev Studio are disabled.
Could you please let me know where we need to configure to enable these options when right click on server instances.
Thanks -
Extracting delta's with ODP-data source 0MATERIAL_ATTR from SAP ECC
We are using ODP-replication to extract data from SAP ECC to a MS SQL-database by SAP BusinessObjects Data Services.
For extracting Material-data we use the standard data source 0MATERIAL_ATTR in SAP ECC.
This data source delivers a full load with all Materials in it.
In the properties of this data source (tab attributes) we saw that this data source is Delta_Extractor_Capable.
Therefore we set the extraction mode from 'Query' to CDC (= Change Data Capable) and did a new initial load to get all Materials again.
After changing a Material in ECC, we did a delta-load, but unfortunately we received ZERO records.
Is there anyone with experience on extracting delta's with data source 0MATERIAL_ATTR or another standard masterdata data source in ECC?
Thank you for your reaction in advance,
Best regards,
Jan-HendrikHi,
You can check the delta records in RSA3 see teh article. in https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
Checking the Data using Extractor Checker (RSA3) in ECC Delta Repeat Delta etc...
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/80f4c455-1dc2-2c10-f187-d264838f21b5&overridelayout=true
Data Flow from LBWQ/SMQ1 to RSA7 in ECC and Delta Extraction in BI
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/d-f/data%20flow%20from%20lbwq_smq1%20to%20rsa7%20in%20ecc%20and%20delta%20extraction%20in%20bi.pdf
Delete the Queue in LBWQ/RSA7 and then freshly load Init and Check the Delta.
Once you load the Init then if there are no new records then it won't get any data. so 0 records
Check in SM37 in ECC why the job is terminated. See in ST22 also.
Thanks
Reddy -
Transaction iView(from remote source) does not open a new SAP session
Hi All,
We are on portal 7.4 and are calling a transaction from ECC system. Within the transaction we have a button which displays graphs based on the output of the transaction. Since we are calling this transaction from portal, a new session does not open after clicking on this button.
In order to enable a new session, I have changed the configuration for 'disable new session buttons in SAP GUI' to false yet the new SAP session does not open. I have also verified the webgui setting and ensured that we do not have '~singletransaction' maintained, yet we are unable to enable the new session. Could you kindly suggest on how I can get this button to function?
Additional inputs:
- Referred to note 125814 for changing the new sessions value.
- Tried changing the iview type to 'SAP GUI for window' from SAP HTML type(which was default).
- In case I type '/o' in the command box for SAP, it gives me a 'maximum sessions reached' message, but this message does not come when I click on this button. In fact, nothing happens after I click on the button.
I still think there might be a possibility to enable this, however, I seek your inputs on this.
Awaiting response...
Warm Regards,
VinayHi Harini,
thanks for your answer!
I can tell you that the same command used from the SAP Client open a new session with the same transaction...
Is strange that from the portal it has a different behaviour...
Best Regards -
Spot instead comma in Excel from SAP
Hi all.
I get a Excel file from SAP. One of the fields is material, with format XXXXX.X in SAP, but in Excel it is shown with format XXXXX,X I need in Excel the material is shown with a spot, like SAP. What can I do?
The code is:
CREATE OBJECT Excel 'EXCEL.APLICATION'.
CALL METHOD OF Excel 'WORKBOOKS' = books.
CALL METHOD OF books 'ADD' = book.
LOOP AT tab.
PERFORM rellenar_celdas USING x1 tab-gltri.
PERFORM rellenar_celdas USING x2 tab-matnr.
ENDLOOP.
SET PROPERTY OF Excel 'VISIBLE' = 1.
FORM rellenar_celdas USING i j val.
CALL METHOD OF Excel 'CELLS' = cell
EXPORTING
#1 = i
#2 = j
SET PROPERTY OF cell 'VALUE' = val.
ENFORM.
Thanks a lot.
Marta.I did like this
FORM CREATE_GRID USING
X1 TYPE I Y1 TYPE I
X2 TYPE I Y2 TYPE I
NAME.
*Workbooks.workSheets(1).columns(GS_CELLS).
*Worksheets("Sheet1").Cells(5, 3).Font.Size = 14
CALL METHOD OF GS_EXCEL 'Cells' = GS_CELL1
EXPORTING #1 = X1 #2 = Y1.
CALL METHOD OF GS_EXCEL 'Cells' = GS_CELL2
EXPORTING #1 = X2 #2 = Y2.
CALL METHOD OF GS_EXCEL 'Range' = GS_CELLS
EXPORTING #1 = GS_CELL1 #2 = GS_CELL2.
CALL METHOD OF GS_CELLS 'Select' .
CALL METHOD OF GS_CELLS 'Merge' .
CALL METHOD OF GS_CELLS 'BorderAround'
EXPORTING #1 = 1 #2 = 2.
SET PROPERTY OF GS_CELLS 'NumberFormat' = '#,##0.00' .
SET PROPERTY OF GS_CELLS 'RowHeight' = 13.
SET PROPERTY OF GS_CELLS 'Value' = NAME.
SET PROPERTY OF GS_CELLS 'VerticalAlignment' = 2.
* SET PROPERTY OF gs_cells 'HorizontalAlignment' = -4108.
SET PROPERTY OF GS_CELLS 'WrapText' = 1.
GET PROPERTY OF GS_CELLS 'Font' = GS_FONT.
SET PROPERTY OF GS_FONT 'Size' = 8.
ENDFORM. -
Tag commis from SAP AII - Printronix sl5000 r ?
Hi Friends ,
I am trying to print a label from SAP AII 5.1 . We are using Printronix sl5000 r RFID Printer .
1. As per the Configuration guide i have configured the Spool Administaration :Output Device as in Device Attributes i have Selected Device Type as LB_ZEB :Zebra label printer IBM850 .
But i coludn't find the Device Type for Printronix.
2 . In Acces Method 's Tab Host Spool Access Method , I have selected the Access method as U:Print Using Berkeley Protocal .Will it work for Printronix ?
3. if pre deployed label formats exists in Printroniox ( as xxxxxx.PGL file ), Do i need to use the name of that xxxxxx as Label format name assigment in SAP AII ?
Please clarify the above
Thanks & regards.,
V.RangarajanHi Friends,
Problem solved by Uploding sample PGL file directly to FTP of Printronix .
Thanks
V.Rangarajan -
Sending Mail from SAP to External Source
Hi Experts,
We are on ECC 6.0. I have configured the standard SAP system for
sending mails from within SAP to our company mail server. The
mails from SAP are going successfully to our official company
ids, But when i am trying to send mails to outside address like
eg. " email@removed " or " email@removed ", it is not going and
giving an error recipient unknown.
The configuration of SAPConnect is correct because mails are
going successfully to our company id, to send outside do i need
to do something extra???It's Mail Relaying and it allows a mail server to send email (or relay it) on behalf of other systems. Many companies have relaying turned off because it is a security risk.
For example, allowing relaying will allow your system to send an email from xxx.com though your email server which manages emails for company.com. This could be used by a rogue to send spam through your email server.
Also, if you try to send an email from an account that your mail server does not handle some receiving servers may assume it is spam and block it.
For this reason, only allow mail relaying on the email server for your domain and only from the SAP systems. This will prevent abuse from occuring because relaying is enabled.
Have you set the default domain for SAPconnect:
[http://help.sap.com/saphelp_nw04/helpdata/EN/00/7c9962df8111d3a36400a0c943858e/content.htm]
Microsoft note on SMTP Relaying:
[http://support.microsoft.com/kb/304897] -
NW 7.3 + iView from remote source wizard + R3 Web Dynpro ABAP, not working
Hi,
I think this forum is my last resort.
I'm running NetWeaver 7.3 Enterprise Portal and also have an existing ECC6 on backend.
Our ABAP Programmer has built some WD4A application on ECC, I'd like to made them available
on EP as ABAP WebDynpro iView.
From the document, I know the way to create ABAP WD iView is different since 7.3. I have to use "iView from remote source" to do it.
On EP side, I have made an system alias (test ok) for ECC, assigned permission, provide mapping id/pwd, and test.
On ABAP side, all webdynpro app are activated (T-code sicf, /sap/bc/webdynpro, /sap/public/bc/webdynpro...). I can even test WAS by bringing up browser and access some sample ABAP webdynpro .
However, I cannot success on "iView from remote source" wizard and it always show me "Nothing found. Check your search Criteria.". Eventhough I use "*" as search criteria.
Anyone has the similar situation ? I even doubt that it is a placeholder of a feature , not working for now. Anyone made it work on NW 7.3 ?
More detail:
My System Alias for ECC:
Application Host: myr3.mydomain.com
SAP Client: 600
SAP System ID: DEV
SAP System Number: 00
Server Port: <leave it blank>
System Type: SAP_R3
Logon Method: UIDPW
User Mapping Type: admin,user
ICM Host: myr3.mydomain.com:8000
ICM Protocol: http
ICM URL prefix: <leave it blank>
SAP Netweaver AS Description: <leave it blank>
All other fileds are leave it as default value
I also assign a group to have "read" and "user" permission to this system
Also assign Alias to the system.
I also create a user belong to the group, assign his system mapping an ECC user ID & PWD to it.
I tested the System alias, it is working (both WEB AS test, and R3 test)
Then I try to create an iView on EP, under a PCD folder , new->iview->iview from remote source. A wizard show up. Then I can select the ECC alias just created, and provide * as application search criteria, and then select "WEB DYNPRO ABAP" as the application type. Then "GO"
as I mentioned, it always show "Nothing Found. Check your search crieteria"
But I'm sure the web dynpro applications are activated on R3.
OK, that's it, please help this one. Thanks
IF YOU DID MAKE IT WORK ON YOUR NW 7.3, PLEASE DROP A LINE HERE SO I KNOW IT IS MY OWN PROBLEM !!!
Edited by: Wilson KU on Nov 14, 2011 10:42 AM
Edited by: Wilson KU on Nov 14, 2011 10:46 AMThanks for the reply,
[About Backend]
I feel confident about the backend R3 system because I can use the WAS URL to access the sample WD4A application, for example, I can bring up the wd4a application ui in my browser. It is purely browser and R3 stuff, no EP involved.
http://soeprdev.mydomain.com:8000/sap/bc/webdynpro/bobf/demo_sales_order?sap-client=600&sap-language=ZF
I also already activate all nodes and sub-nodes (in SICF Services) under /sap/bc/webdynpro as well as /sap/public/bc/webdynpro. (and some other nodes to make icon and include work)
[About the system object in EP]
I have done all kind of test on the system object (alias):
1. In EP System Administration -> Landscape Configuration, I select the system object, click "Test Connection", It shows me a Check mark, and the detail message is SOE_DEV_600 connection
2. Edit the System object, then click on "Connection Tests" page, I see two lines there, check both and click test, here is the result:
SAP Web AS Connection:
: Test Details:
The test consists of the following steps:
1. Check the validity of the system ID in the system object
2. Check if the system can be retrieved
3. Check if the system object has a valid system alias
4. Check if an SAP system is defined in the system object
5. Validate the following parameters: Web AS protocol; Web AS hostname
6. Checks if the host name of the server can be resolved.
7. Pings the Web AS Ping service (works only if the service is activated on the Web AS, and only on ABAP Web AS)
8. Check HTTP/S connectivity to the defined back-end application
Results
1. The system ID is valid
2. System retrieved successfully
3. Retrieval of the default alias was successful
4. The system object represents an SAP system
5. The following parameters are valid: ICM Protocol (http) ICM Host Name (soeprdev.mydomain.com:8000)
6. The host name (soeprdev.mydomain.com) was resolved successfully
7. The Web AS ping service http://soeprdev.mydomain.com:8000/sap/bc/ping was pinged successfully
8. An HTTP/S connection to http://soeprdev.mydomain.com:8000 was obtained successfully.
Connection Test for Connectors:
: Test Details:
The test consists of the following steps:
1. Retrieve the default alias of the system
2. Check the connection to the back-end application using the connector defined in this system object
Results
Default alias retrieved successfully
Connection successful -
Send mail from SAP system to another SAP system
Hello Xperts
I need to send a mail from one SAP box (ECC) to another SAP box (SRM,CRM, EP etc). I know how to send mail from SAP to external address but unable to find the parameters in this case. Kindly help.
thkx
Prabhu
PS: Kindly DONOT post on "How to send mail from SAP" as my questions is all abt how to send mail from one sap system to another sap systemHi
To send mail Internally check this sample code it works fine this code was developed by me
*& Report ZMATURITYREPORT *
*& Title - Maturity report *
*& ABAP/4 Consultant *
*& Name- Pavan Praveen Valluri Created on 26/07/2007 *
*& Module - FI *
REPORT ZMATURITYREPORT.
tables: bseg.
* SELECTION SCREEN--------------------------------------------------- *
parameters: p_email type somlreci1-receiver default
'@gujaratpetro.com'.
* Data: p_email(25) type c value '[email protected]'.
* END OF SELECTION SCREEN ------------------------------------------- *
*----------DATA DECLARATION--------------------------------------------*
data: it_message type standard table of solisti1 initial size 0
with header line.
data: it_message1 type standard table of solisti1 initial size 0
with header line.
data: it_message2(10) type N.
data: it_message3 type standard table of solisti1 initial size 0
with header line.
data: it_message4 type standard table of solisti1 initial size 0
with header line.
data: it_attach type standard table of solisti1 initial size 0
with header line.
data: text(150).
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,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
start-of-selection.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.
data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.
data: var1(4) type c,
var2(2) type c,
var3(2) type c.
data: begin of int_bseg occurs 0,
BELNR LIKE BSEG-BELNR,
ZUONR LIKE BSEG-ZUONR,
GJAHR LIKE BSEG-GJAHR,
DMBTR LIKE BSEG-DMBTR,
HKONT LIKE BSEG-HKONT,
end of int_bseg.
data: begin of int_SKAT occurs 0,
TXT50 LIKE SKAT-TXT50,
SAKNR LIKE SKAT-SAKNR,
KTOPL LIKE SKAT-KTOPL,
end of int_SKAT.
data: begin of int_bkpf occurs 0,
BELNR LIKE BKPF-BELNR,
BUKRS LIKE BKPF-BUKRS,
GJAHR LIKE BKPF-GJAHR,
BUDAT LIKE BKPF-BUDAT,
end of int_BKPF.
data: 2days_out type sy-datum.
2days_out = sy-datum + 2.
data: var4(4) type c,
var5(2) type c,
var6(2) type c.
*-------- END OF DATA DECLARATION--------------------------------------*
*--- CONCATENATING AND ARRANGING DATE ---------------------------------*
lv_date = 2days_out.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).
concatenate var3 var2 var1 into lv_formatdate separated by '.'.
*--- END OF CONCATENATING AND ARRANGING DATE -------------------------*
*-------------------------SELECTION FOR BSEG---------------------------*
select zuonr belnr bukrs GJAHR DMBTR HKONT from bseg into
corresponding fields of table int_bseg
where bukrs = 'company name' and
ZUONR = lv_formatdate.
*--------------END OF SSELECTION FOR BSEG--------------------------- *
*-------------------------SELECTION FOR BKPF---------------------------*
select BUDAT BUKRS BELNR GJAHR from BKPF into
corresponding fields of table int_BKPF
where bukrs = 'company name'.
append int_BKPF.
*------------------END OF SELECTION FOR BKPF---------------------------*
*-------------------------SELECTION FOR SKAT---------------------------*
select SAKNR TXT50 from SKAT into
corresponding fields of table int_SKAT
where KTOPL = 'company name'.
*and SAKNR = INT_BSEG-HKONT.
APPEND INT_SKAT.
*--------------END OF SSELECTION FOR SKAT--------------------------- *
*-----------------POPULATING EMAIL SUBJECT ----------------------------*
perform populate_email_message_body.
perform send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Maturity after 2 days'
'XLS'
'filename'
changing gd_error
gd_reciever.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*endif.
end-of-selection.
*------------END OF POPULATING EMAIL SUBJECT --------------------------*
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
form send_file_as_email_attachment tables pit_message
pit_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.
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[] = pit_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.
* 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
object_header = t_object_header
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. "send_file_as_email_attachment
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
* Populate message body text
form populate_email_message_body.
refresh it_message.
refresh it_message1.
refresh it_message3.
refresh it_message4.
*--------------- LOOP FOR BSEG -----------------------------------------
loop at int_BSEG.
read table int_bKPF WITH KEY BELNR = INT_BSEG-BELNR
GJAHR = INT_BSEG-GJAHR.
read table int_SKAT WITH KEY SAKNR = INT_BSEG-HKONT.
*---CHANGING DATE FORMAT FOR BKPF---------------------------------------
lv_date1 = int_bkpf-budat.
var4 = lv_date1+(4).
var5 = lv_date1+4(2).
var6 = lv_date1+6(2).
concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.
*---END OF CHANGING DATE FORMAT FOR BKPF-------------------------
it_message = int_bseg-belnr.
it_message1 = lv_formatdate1.
it_message2 = int_bseg-dmbtr.
it_message3 = int_bseg-hkont.
IT_MESSAGE4 = INT_SKAT-TXT50.
SHIFT IT_MESSAGE2 LEFT DELETING LEADING '0'.
*-------------POPULATING EMAIL BODY WITH DATA -------------------------
concatenate 'Maturity After 2Days' 'for' 'G/L account-' it_message3
'--' IT_MESSAGE4 ',' 'Amount-' it_message2
into it_message separated by space.
append it_message.
append it_message1.
append it_message3.
clear it_message.
clear it_message1.
clear it_message2.
clear it_message3.
endloop.
*------------END OF LOOP FOR BSEG --------------------------------------
endform. " POPULATE_EMAIL_MESSAGE_BODY
<b><i>
To send an mail with external attachment check this one
</b></i>
<i>first create a Include report with the following coding</i>
*& Include ZPA1_INCLFOR_MAIL *
* Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
* FORM
FORM ml_customize USING objname objdesc.
*----------- Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
*--------- Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
* FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
* FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
* FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
*--------- Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
* COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
* Header Data
* Already Done Thru FM
* Main Text
* Already Done Thru FM
* Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
* Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
* Receiver List
* Already done thru fm
ENDFORM. "ml_prepare
* FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX = objhex
* OBJECT_PARA =
* object_parb =
receivers = reclist
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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
* FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
*-------------- Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
*------------- Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
* FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
*-------- Data
DATA : pos TYPE i.
DATA : len TYPE i.
*------------ Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
<b>
Then include that report in the following report and copy the same code and paste it there
</b>
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_inclfor_mail.
* DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
* SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
* AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
* START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
* FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
* CHECK_DOS_FORMAT =
IMPORTING
* DRIVE =
EXTENSION = extension
NAME = name
* NAME_WITH_EXT =
* PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
<b>These are the FM for sending external email :-</b>
SO_DOCUMENT_SEND_API1
SAPoffice: Send new document with attachments via RFC
SO_NEW_DOCUMENT_ATT_SEND_API1
(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
SAPoffice: Send new document with attachments via RFC
Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
SO_NEW_DOCUMENT_SEND_API1
SAPoffice: Send new document
<b>Check this sample report</b>
DATA : BEGIN OF ITAB OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
END OF ITAB.
DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.
START-OF-SELECTION.
SELECT PERNR ENAME
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0001
WHERE PERNR < 50.
LOOP AT ITAB.
WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
SY-VLINE.
ENDLOOP.
* Receivers
receiver_list-recextnam = '[email protected]'. "-->
* EMAIL ADDRESS
RECEIVER_list-RECESC = 'E'. "<-
RECEIVER_list-SNDART = 'INT'."<-
RECEIVER_list-SNDPRI = '1'."<-
APPEND receiver_list.
* General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
* Mail subject
w_object_hd_change-objdes = 'Message subject'.
* Mail body
APPEND 'Message content' TO message_content.
* Attachment
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = '0'
TABLES
listobject = listobject.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.
<b>Settings for sending mail</b>
Configuring SAP 4.6x Internet mail Gateway
SAP can be configured to send and receive emails from different sources.This section explains how to integrate SAPOffice with an external emailsystem. Your Internet email must be configured and running prior to this.Email from SAP is forwarded to the users external email system..
You can configure inbound and outbound forwarding. Outbound flow forwardsa SAP message (eg: update termination) via UNIX sendmail to the intended recepient. Inbound accepts a message from sendmail and places it in the users SAPOffice inbox. Many companies prefer to configure outbound only.
Configuring outbound forwarding
SAP configuration
1. Create your RFC destination for outbound email using transaction SM59
RFC Destination : SAP_INTERNET_GATEWAY
Connection Type : T
Description : SAP internet mail gateway
Click on 'Explicit Host' if you wanton demand gateway dameon invocation.
Program : /sapmnt/SID/exe/mlunxsnd
Target Host : Enter hostname that runs your central instance.
Click 'Test Connection' and you should seea successfull message.
2. Shared Office Settings transaction SO16-> Send -> Settings or
directly via transaction SCOT- SAPconnect Administation
Nodes - Create
Node : IMAIL
Description : SAP internet mail gateway
RFC Destination : SAP_INTERNET_GATEWAY
Tick : Internet
Address Area : *
Tick : All formats
Dev. type : Choose an approciate Printer Device
Set further addresstype : N
Maximum waiting timefor repeat send attempt procedure : Blank or decide for yourself
Tick : Node is ready for use
Setting
- DefaultDomain : <your company domain>.com
- Conversionrule : require if your communication device only support one format.
e.g. if you email system only support the format RAW (ASCII text format)
Format To Format Ranking Function module
ALI RAW 1 SX_OBJECT_CONVERT_ALI_RAW (convert APAP List)
Referto note 171698 - SAPconnect: Formats, conversion, device type
UNIX configuration
1 .. cd /sapmnt/SID/exe
2 ..csh
..mlsomadm mailgw.ini
System Name [C11] :
Client [000] :
Username : MAILADM
Password : MAILADM
Language : E
Load Balancing :
Hostname : <hostname>
System number : <instance_number>
Gateway hostname: <central_instance_hostname>
Gateway Service : <instance number>
Use SAP Router :
Trace level :
Sendmail Command [/usr/lib/sendmail -i -f<SENDER_ADDRESS>]:
Codepage [ISO-8859-1] :
Trace Level (Outbound) [0] :
Update file sapmailsid.cfg? [Y]
Testing whether your configuration is successful
1. Logon to SAP
2. Execute transaction SO01
3. Write a message and send it to <your_internet_email_address>
4. If you don't see the mail in your internet mailbox, go back and review steps 1-12
Schedule the SAP Internet Mail Gateway Jobs to start every 5 minutes
1. Create
2. Position your cursor at INT
3. Click Schedule and supply the date and time
4. Click Schedule periodically and tick Minutes and type in 5
5. Click Create and you are done
6. Click Show Scheduling to check
Problems that you might encounter :-
If you have set up a node in SCOT and it tests out well but recieve the reply.
"Cannot process message in node, parameterscannot be converted".
Make sure the RFC connection is working, and that SapConnect has been installed on the Unix Server or the Microsoft Exchange Server. Originally, I had the same error, and found that nothing had been installed on Unixor Exchange, to support SapConnect.
In SCOT (View -> System Status), your mail remains at the Intransit column.
Check you sendmail.cf files (e.g.Sun Solaris /etc/mail/sendmail.cf). Try using the sendmail command to send a test file at the Unix level. You must be able to send mail at theUnix level before you can send mail at the SAP level.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/700b405bacdd5fe10000000a155106/content.htm
http://www.tamboly.com/SAPEmailConfiguration.html
Check my previous links
Mail Send
sending mails from abap program
Mail Sending to external email id's
settings needed for sending emails
Regards
Pavan
Maybe you are looking for
-
How is that even possible? I am trensferring the files using a tunderbolt cable and the wifi on the source computer is switched off to avoid trying to transfer the files over wifi. At first I thought the estimation was inaccurate and hope that when I
-
I cannot open itunes on my windows 7 system. I get an error message error 7 windows 1114
I cannot open i tunes on my windows 7 system. i get an error message error 7 windows 1114. I cloud opens. quick times works as well. But despite reinstalling several times it doesn't open
-
How to set the Model Class for a newly created Model Node ?
Hello All, I am trying to map a Model node from SourceA to DestinationB. To do so, I created a model node for Destination B in the interface controller (set the isInputElement to true). However why I try to map the node, I get an error saying tha
-
Error FI899 , FM_WRITE_CASH_FLOW_PR
Hi While creating PO from a PR having 3000+ lines . I am getting the error as below, I will appreciate if some one can help me out to get rid of this error. FM_WRITE_CASH_FLOW_PR TOO MANY PO-LINES in MM document ********* Message no. FI899 Thanks Gan
-
Black edge around canvas footage
A friend of mine has been editing together his showreel on my system. when i came home he asked me why the footage in the canvas viewer was surrounded by a black edge...and I had to tell him: i don't know... my first inclination was to check all the