ABAP code to connect 2 systems.
Hi,
My requirement is such that I need to read the data from a cube of one BI system and write it into the cube of another BI system.
I am able to read the cube data through "RSDRI_INFOPROV_READ" function module.
2 questions:
1) Is the above solution possible?
2) Is there ABAP code to connect 2 systems?
Please help with some suggestions.
Thanks,
Pankaj
You can call function modules in other systems using RFC - so you probably need to create a RFC wrapper function module for your 'RSDRI_INFOPROV_READ'. Then you can create/look up a RFC destination for the other system using SM59.
All you have to do to call a RFC function in another system, is to add the destination to the function call (if the destination is setup up right):
CALL FUNCTION 'ZRSDRI_INFOPROV_READ'
DESTINATION 'DEST_NAME'
Similar Messages
-
Distributing common ABAP code among distributed systems
We are implementing a second SAP instance for a subsidiary and plan to implement other instances for other subsidiaries.
Is there any good practices or methods for keeping common ABAP source code we develop synchronized across all the SAP systems? Systems are 4.6c and 5.0 (ERP)
ThanksMy idea would be with transport request. Keeping one golden client and transporting common programs across the systems.
Regds
Manohar -
ABAP source code to connect to third party systems using web service calls?
Hi all,
can any one provide an example ABAP source code to connect to third party systems using web service calls? The base system is CRM.Do you want to call a web service in a remote system, or do you want to provide a web service?
If you want to call a web service you should create a proxy object via SE80. Open your development package, right click on the tree entry and choose: Create -> Enterprise Service / Web Service -> Proxy Object and provide the needed information (including the WSDL description file). You may then use the proxy object to call the web service (if the connection and everything else works right).
See [http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/content.htm] -
ABAP CODE TO POPULATE LOGICAL SOURCE SYSTEM
Hi Friends please help me with the below
1. Requirement : to Populate The system Date , Source System
in BI for Each load request.
1 Solution: I thought of writing the Start Routine for this but it is giving me error
syntax Error: END METHOD MISSING?????
2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
Thanks
Poonam Roy
ABAP Code.
I have the End Method. what more to do.
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE tys_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
$$ begin of routine - insert your code only below this line -
... "insert your code here
FORM STARTROUTINE
USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TRANSTRU
ABORT LIKE SY-SUBRC.
DATA: ZLOAD_DAT LIKE SY-DATUM
ZZSOURSYS TYPE RSLOGSYS
IF G_S_MINFO-DATAPAKID=1
SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
ENDIF.
ABORT = 0.
ENDFORM.
ENDMETHOD.
ENDCLASS.
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
raise exception type CX_RSROUT_ABORT.
$$ end of routine - insert your code only before this line -
ENDMETHOD.You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
There the FORM begin with
[code]USING RECORD_NO LIKE SY-TABIX
TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
G_S_MINFO TYPE RSSM_S_MINFO
CHANGING RESULT TYPE /BI0/OIPERSON
G_T_ERRORLOG TYPE rssm_t_errorlog_int
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. set ABORT <> 0 to cancel datapackag[/code]
GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
<i>G_S_MINFO. This passes technical information about the data load request,
such as requesting user, request date and time, update mode, the handling of
duplicate records, error handling flags, parallel processing flags, and what data
targets to update.</i>
If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
[code]USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
G_T_ERRORLOG TYPE rssm_t_errorlog_int
ABORT LIKE SY-SUBRC. set ABORT <> 0 to cancel datapackage[/code]
And stay in FORM between limits :
[code]$$ begin of routine
$$ end of routine[/code]
Update RESULT in first case, and field(s) of DATAPAK in second case.
[code]RESULT = G_S_MINFO-LOGSYS.[/code] or
[code]LOOP AT DATAPAK INTO l_s_datapak_line.
l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.[/code]
Regards -
Abap Code to populate source system id
Hi , so kind of All of you,
please help me, i have written the code in one to one mapping in transformation routine in BI 7,0 right click on zzsourcsys and go tp rule details. No syntax errors in the code but when i load there is no value populating to zzsourcsys . i have defined zzsourcsys as 12 char. can u suggest where it is going wrong, i checked in tools assignment of sourcesystem id is there in my system.
Abap Code
TYPE-POOLS: RSSM.
Data: G_S_MINFO TYPE RSSM_S_MINFO.
RESULT = G_S_MINFO-LOGSYS.
Thanks
Poonam RoyYou have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
There the FORM begin with
[code]USING RECORD_NO LIKE SY-TABIX
TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
G_S_MINFO TYPE RSSM_S_MINFO
CHANGING RESULT TYPE /BI0/OIPERSON
G_T_ERRORLOG TYPE rssm_t_errorlog_int
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. set ABORT <> 0 to cancel datapackag[/code]
GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
<i>G_S_MINFO. This passes technical information about the data load request,
such as requesting user, request date and time, update mode, the handling of
duplicate records, error handling flags, parallel processing flags, and what data
targets to update.</i>
If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
[code]USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
G_T_ERRORLOG TYPE rssm_t_errorlog_int
ABORT LIKE SY-SUBRC. set ABORT <> 0 to cancel datapackage[/code]
And stay in FORM between limits :
[code]$$ begin of routine
$$ end of routine[/code]
Update RESULT in first case, and field(s) of DATAPAK in second case.
[code]RESULT = G_S_MINFO-LOGSYS.[/code] or
[code]LOOP AT DATAPAK INTO l_s_datapak_line.
l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.[/code]
Regards -
How to Stop at Source System's Abap Code from BI Infopackage Trigger
Hi Experts,
I have enahanced 2 fields to some standard data source, that fields data is comiong fine to RSA3 in Source system.
i am not getting 2 fields data to BI PSA, but that 2 fields data i am getting at in RSA3 Tcode source system.
i have tried all the ways to get data to BI PSA, but no luck.
so, while running infopacke from BI i need to stop at Source System's Abap code where i have wriiten the code for those 2 fields.
so, please any one can explain, how to stop at source system's Abap Code once i trigger infopackage from BI.
Regards,
Nagaraju K.Hi,
which data source on your working?
master data or transaction data
enter the TCODE- CMOD
choose the project
select the funciton exit - EXIT_SAPLRSAP_001 - Transaction data
EXIT_SAPLRSAP_002 - master data attr
EXIT_SAPLRSAP_003 - mster data text
EXIT_SAPLRSAP_004 - master data hier.
choose the include program - ZXRSAU01.
go to source code tab -> go to change mode -> find the code will start form here
EX- : when " ZLIS_13_VDITM
if not required don't put break-point .
just comment it code.
Thanks,
Phani. -
ABAP code are cut by the system
Hello
I created ABAP code in start of update rules. After saving and re-opening, 10-12 right symbols of the code are cut by the system (see example) :
ABAP mmmmmmmmmmmmmmmmmmmm (before saving)
ABAP mmmmmm (after saving)
Can somebody knows how I can correct it?
ThanksIn alternative write code like this:
mmmmmm mmmmm mmmmm mmmmm
mmmmm mmmm.
Hope it helps.
Regards -
How can i export my custom abap code from one SAP system to another
is there a way to export my custom code to any other SAP system.
not the same client or server. say for ex: i develop a code in my system remotely and want to provide the same for my client to export into their system.
maybe same versions but diff systems.
is there a way to save as binary file or something?
pls advice.
thanksHello,
Yes u can do it.
In SE38 give ur report name and click display.
Now u will see ur code.
In the MENU follow the path:
Utilities-->More Utilities --> Upload/Download --> Download.
Now ur report can downloaded to any format of file.
Ask ur client to upload ur report in the similar fashion..
Cheers,
Vasanth -
LKM SAP BW to Oracle (SQLLDR) generates sintax error in ABAP code.
Hi Experts,
We are installing a SAP BW KM's in ODI 11g.
Actually, we are able to make reverse ingeneering succesfully.
Now we want to use the LKM in order to extract SAP data.
The KM fails, in step Generate ABAP Code. The code is uploaded to SAP system but with sintaxis errors.
That's the beginning of the SAPAbapExecuteOpenTool_8001_7001.log.
+##################################################+
+############ Open Tool Logger ####################+
+##################################################+
+############ Upload value: 1+
+############ Execute value: 1+
+############ BASE RKM FLAG: 0+
+############ ZRFC_RUN_INSTALL: 1+
+############ Abap Function Name: ZODI_8001_7001+
+############ Sap Host Name: XXXXXXXX+
+############ Sap User Name: XXXX+
+############ Sap password: ********+
+############ Sap Client: 100+
+############ Sap language: ES+
+############ Sap system no: 00+
+############ Sap Connection Pool Name: SAP_ODI_LKM_POOL_GLOBAL+
+############ Sap Connection Pool Size: 10+
+############ Sap Function group name: ZODIBW_LKM_FGRP+
+############ File Delimiter:+
+############ File Name: ZODI_8001_7001.txt+
+############ FTP Host: XXXXXXXXX+
+############ FTP User: ftpbi+
+############ FTP Password: ********+
+############ FTP Passive Mode: 1+
+############ FTP Transfer Time out: 100000+
+############ User abap parameter names: IV_DELIMITER,CHAR1;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_REQUID_L,RSSID;IV_REQUID_H,RSSID+
+############ Abap rfc table parameters: RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2+
+############ Log File Name: /tmp/SAPAbapExecuteOpenTool_8001_7001.log+
+############ OpenHub Path: /tmp/+
+############ Delta Extraction First Request ID : 0+
+############ Delta Extraction Last Request ID : 0+
+############ SAP Development Class : ZODIBW_PCKG+
+############ Max Row Count :+
+############ Fetch Batch Size :+
+############ Hash Value Marker: HVM+
+############ Generated Program:+
*** ODS DSO extraction
TYPES: BEGIN OF ty_final,
+/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR+
TYPE
+/BIC/AZOFI_UTE00-/BIC/ZFI_SOCOR,+
+/BIC/AZOFI_UTE00_SOURSYSTEM+
TYPE
+/BIC/AZOFI_UTE00-SOURSYSTEM,+
END OF ty_final.
In the SAP GUI shows a sintaxis error.
Functions Module ZODI_8001_7001. line 25
The name "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" is longer that allowed.
+30 characters.+
Really the TYPE "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" has 31 characters.
The sufix "/BIC/" is the "NAMESPACE", a SAP grouping concept.
AZOFI_UTE00 is a table name.
ZFI_SOCOR is a column name.
Are this sufix correct in the APAP code?
Has anyone had that problem?
Any comment will be wellcome.
Thank's in advance.Hi Somchai,
r U able to resolve ur issue ..........i'm also struck there at the same point.
I am using shared folder for file transfer and my error message is
java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset\\<hostname>\bi-interface$\ZODI_11001_12001_GLOBAL.txt
Thanks.
Edited by: Drona on Mar 26, 2012 7:25 AM -
Trouble with SAPconnect / sending email in ABAP-code
Hi,
with the code below I try to send an email from ABAP outside
to an mail-account in the internet.
I'll get no error/exceptions but the mail will be not send
to the internet-mail-account.
In Transaktion SCOT I checked the SAPconnect-Node "INT"-"SMTP".
There is a mailserver with the right IP und the right Port. So I don't understand
what could be the problem!?
Can anybody help me and say me why the code below doesn't works?
Best wishes!
* For API
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* Start the send process using the following statement
submit rsconn01 with mode = 'int' and return.
Message was edited by:
sebastian eckesSAP is a robust system, which gives many facilities in the form of Function Modules (FMs) for connecting to external systems or for use within the system. With a clever use of these FMs we can achieve a lot of things through ABAP code.
This article focuses on ways to send E-mails and SAP Mails using ABAP code.
Firstly SAP Mail
A SAP mail is a mail internal to the SAP system. It is a very good forum to exchange information with other users. Using a SAP mail in ABAP code facilitates exchange of automatic messages at various stages of the business process. It is easy to use and saves many hassles involved in using workflows for exchanging messages.
The ABAP code to send a sap mail is built around the FM SO_OBJECT_SEND which has the following pattern.
call function 'SO_OBJECT_SEND'
exporting
EXTERN_ADDRESS = ' '
FOLDER_ID = ' '
FORWARDER = ' '
OBJECT_FL_CHANGE = ' '
OBJECT_HD_CHANGE = ' '
OBJECT_ID = ' '
OBJECT_TYPE = ' '
OUTBOX_FLAG = ' '
OWNER = ' '
STORE_FLAG = ' '
DELETE_FLAG = ' '
SENDER = ' '
CHECK_ALREADY_SENT = ' '
importing
object_id_new =
sent_to_all =
tables
OBJCONT =
OBJHEAD =
OBJPARA =
OBJPARB =
receivers =
PACKING_LIST =
ATT_CONT =
ATT_HEAD =
NOTE_TEXT =
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.
In the next article we will understand the main parameters and table interfaces of the FM.
Import Parameters Name and Description Field name Field function
Object_hd_change (structure) Contains the process to be done when SAP mail is marked for execution.When the Execute Icon in the SAP mail is clicked the corresponding object is executed vmtyp D for dialog module F for function moduleR for reportT for transactionU for transaction with export
Acnam Name of the object which is to be executed, like name of transaction/report
Skips X to execute first screen in background
Objsns Indicates sensitivity of the object. P for private objectF for functional objectO for confidential objectC for company confidential objectSensitivity level is restricted to O for documents in shared folders
Objla Language of the document E for Englishsy-langu for system language
Objnam Name of the document
Objdes Short description (Title) of the document
Objsrt Name of the sort field. This is used to group documents based on certain criteria
Object_type Type of document to be sent with mail RAW for raw text (default) DOC for word file XLS for excel fileAll classes can be used except for folders (FOL) and distribution lists (DLI)
Outbox_flag X to indicate that mail should also be stored in outbox of the user after sending (default )
Owner Sap login of the user responsible for transmission
Table Parameters Name and Description Field Name Field function
Objcont Table to hold the body of the mail Line Text lines up to 255 characters
Objhead Table to hold number of lines in the body of the mail, i.e size of the table in lines Line Text lines up to 255 characters
Objpara Table to hold the set/get parameters to be transferred to the processing element Name Name of the parameter. Only first three characters are used
Option Not used
Low Value of the parameter in name
High Not used
Objparb Table to hold information for mails to which a certain processing type is assigned. For a report or transaction with transfer of values to global memory, the table has to contain the parameters with relevant values. The memory id is taken from the first row. For a FM or dialog module, data in table will be transferred as table parameter msgdial Name For report or transaction with transfer of values to global memory, the field for first row should hold the name of the memory id used for export and the other rows should hold the parameter names. For FM or dialog module this field should hold the values as per the usage of the module
Value For report or transaction with transfer of values to global memory, the field for first row should remain empty and the other rows should hold values of the parameters. For FM or dialog module this field should hold the values as per the usage of the module
Receivers Table to hold recipient details Recnam SAP login of the recipient. Append all the recipients to this table
Sndcp X for sending mail as a copy
Sndex X for sending as express document. This will prompt a logged on recipient saying that he or she has received an express mail
Recesc B for SAP user E for external email addressU for unix address
Export Parameters Name and Description Field name Field function
Object_id_new Contains object id of document created during send process
Sent_to_all X indicates that document was sent to all recipients. Flag is not activated if sending fails in one or more cases
Main Exceptions Name and Description Description
Too_much_receivers Number of recipients is greater than number for which sender is authorised to send
Object_not_sent Document was not delivered to any of the recipients
Object_not_exist Document class specified does not exist or cannot be sent
Object_no_authorisation Document could not be sent as one of the required authorisations does not exist
Parameter_error Invalid combination of parameter values transferred to FM
X_error Internal error occurred
Once all the parameters and table interfaces are properly filled, call the function module to send the SAP mail to the recipient inbox.
Care should be taken to report the status of execution of the function module to the user using one of the exceptions defined (refer function module pattern above)
Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly. The next article covers sending E-mails using ABAP.
Sending Email to a non-SAP system:
Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly.
Sending an email to the Microsoft Inbox is a way of interacting with a non SAP system through ABAP code and hence is very interesting. A fair knowledge of UNIX shell scripting is assumed here.
The ABAP code to send an email to Microsoft inbox revolves around following UNIX script
Echo "From:" "<"$1">" > <unix file path name>
Echo "To:" "<"$2">" >> <unix file path name>
Echo "Subject:" "<"$3">" >> <unix file path name>
Cat $4 >> <unix file path name>
Uuencode $5 $6 >> <unix file path name>
Cat <unix file path name> | /usr/sbin/sendmail f $fraddr $toaddr
(Note : the commands in the above script can be case sensitive. Check the actual case on the unix installation in question)
Let us understand the various parts of the above script.
$1 = Sender email address
$2 = Recipient email address
$3 = Subject of the email
$4 = Path of unix server file having email body
Form email body as an internal table in ABAP program, download it to a unix server file
$5 = Path of unix server file to be sent as email attachment
$6 = Name to be given to the attachment (like test1.doc, test1.xls). The corresponding Microsoft icon
will be shown in the email for the type of file attached ( Word document, excel document etc)
The script builds a temporary file and pipes the file to the sendmail command to achieve the mission.
This script can be invoked from SAP to send the mail to the intended recipient. Store this small script on the unix server. (Assume script name is sndmail )
To do this we should define a link in the SAP system between a customized command and this unix script.
The FM to define a customized command in SAP system has the following pattern.
call function 'SXPG_CALL_SYSTEM'
exporting
commandname =
PARAMETERS = ' '
importing
status =
tables
exec_protocol =
exceptions
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
others = 12.
In the next article we will understand the main parameters and table interfaces of the FM.
Import Parameters Name and Description Field name Field function
Commandname Name of unix shell script or command to be executed by SAP Name of unix shell script to be invoked
Parameters The parameters to be sent to unix shell script ($1, $2 etc). Send parameters as a concatenated string separated by space and length not exceeding 128 characters For eg in UNIX environment the above shell script would be executed as Sndmail [email protected] [email protected] Trial /home/test.doc testmail.We will be simulating this command using the FM from SAP system
Table Parameters Name and Description Field Name Field function
Exec_protocol (structure) Table to get messages from unix server after shell script is executed Length Length of the message from external program i.e unix
Message Log message from external program i.e unix
Export Parameters Name and Description Field name Field function
Status Contains the status of execution of external program Scheduling status of external program i.e unix
Once the above FM is invoked with the necessary parameters the unix program sendmail will send a mail to the inbox of the recipient in Microsoft.
The restriction on the parameter string length of 128 characters can be removed to make way for very long email addresses and subjects. Build the parameters into an internal table and download it as a file on the unix server. Instead of passing each parameter individually, pass the unix server path of this file as the parameter to the unix shell script (sndmail mentioned above). Modify the shell script to read every line of this parameter file as variables to be used in the shell script.
In the next article we will see an example of the ABAP code you can use to send SAP Mails.
REPORT ZTSAPMAIL.
DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
DATA: BEGIN OF X_OBJECT_HD_CHANGE.
INCLUDE STRUCTURE SOOD1.
DATA: END OF X_OBJECT_HD_CHANGE.
DATA: BEGIN OF X_OBJCONT OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJCONT.
DATA: BEGIN OF X_OBJHEAD OCCURS 0.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJHEAD.
DATA: BEGIN OF RAW_HEAD.
INCLUDE STRUCTURE SORH.
DATA: END OF RAW_HEAD.
DATA: BEGIN OF X_RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF X_RECEIVERS.
PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
*BUILD MESSAGE HEADER
MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
Object type of the new document
MOVE 'RAW' TO X_OBJECT_TYPE.
CLEAR X_OBJCONT.
MOVE 'Contents of mail' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
MOVE 'More contents' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
MOVE 'Still more contents'
to x_objcont-line.
APPEND X_OBJCONT.
MOVE ' ' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
Specific header (Dependent on the object type, here RAW)
REFRESH X_OBJHEAD.
DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
MOVE RAW_HEAD TO X_OBJHEAD.
APPEND X_OBJHEAD.
*RECEIVERS table
CLEAR X_RECEIVERS.
REFRESH X_RECEIVERS.
MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
APPEND X_RECEIVERS.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = 'OUTBOX'
forwarder = x_forwarder
object_fl_change = x_object_fl_change
OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
object_id = x_object_id
OBJECT_TYPE = X_OBJECT_TYPE
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
store_flag = x_store_flag
importing
object_id_new = x_object_id_new
sent_to_all = x_sent_to_all "May need to use
TABLES
OBJCONT = X_OBJCONT
OBJHEAD = X_OBJHEAD
objpara = x_objpara
objparb = x_objparb
RECEIVERS = X_RECEIVERS.
REPORT ZTUNIXMAIL.
DATA : TO_ADDRESS LIKE SY_LISEL,
FROM_ADDRESS LIKE SY-LISEL,
SUBJECT LIKE SY-LISEL,
ATTACHMENT_NAME LIKE SY_LISEL,
DATA_FILE_PATH LIKE SXPGCOLIST-PARAMETERS,
BODY_FILE_PATH LIKE SXPGCOLIST-PARAMETERS.
DATA : BEGIN OF INT_EMAIL_ATTACH OCCURS 0,
TXTLINE CHAR(255),
END OF INT_EMAIL_ATTACH.
DATA : BEGIN OF INT_EMAIL_BODY OCCURS 0,
TXTLINE CHAR(255),
END OF INT_EMAIL_BODY.
CLEAR : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
REFRESH : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
INT_EMAIL_ATTACH-TXTLINE = 'Put all attachment text in this table'.
APPEND INT_EMAIL_ATTACH. CLEAR INT_EMAIL_ATTACH.
INT_EMAIL_BODY-TXTLINE = 'Put all attachment text in this table'.
APPEND INT_EMAIL_BODY. CLEAR INT_EMAIL_BODY.
CONCATENATE TO_ADDRESS
FROM_ADDRESS
SUBJECT
BODY_FILE_PATH
DATA_FILE_PATH
ATTACHMENT_NAME
INTO V_PARAMETERS.
IF NOT INT_EMAIL_ATTACH[] IS INITIAL.
OPEN DATASET DATA_FILE_PATH FOR OUTPUT IN TEXT MODE.
LOOP AT INT_EMAIL_ATTACH.
TRANSFER INT_EMAIL_ATTACH-TXTLINE TO DATA_FILE_PATH.
ENDLOOP.
CLOSE DATASET DATA_FILE_PATH.
ENDIF.
IF NOT INT_EMAIL_BODY[] IS INITIAL.
OPEN DATASET BODY_FILE_PATH FOR OUTPUT IN TEXT MODE.
LOOP AT INT_EMAIL_BODY.
TRANSFER INT_EMAIL_BODY-TXTLINE TO BODY_FILE_PATH.
ENDLOOP.
CLOSE DATASET BODY_FILE_PATH.
ENDIF.
CALL FUNCTION 'SXPG_CALL_SYSTEM'
EXPORTING
COMMANDNAME = 'Z_EMAIL' - Command calling unix script
PARAMETERS = V_PARAMETERS
importing
status = ''
TABLES
EXEC_PROTOCOL = INT_EXEC_PROTOCOL
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
OTHERS = 12.
regards,
srinivas
<b>*Reward points for useful answers*</b> -
Debugging ABAP Code From Within WebDynpro
Hi experts,
I would like to check whether i can debug ABAP code from within webdynpro if i m using a remote J2EE server.
So netweaver development studio is on my machine
J2ee server is on a remote machine
R/3 is also on another remote machine
Thanks.
Rgds,
DanielHi Daniel,
One thing note here is
"You have debugging authorization in the ABAP Workbench in the relevant system.
Since debugging in the ABAP system via load balancing is not supported, you must reconfigure your JCO destinations so that the calls take place on a dedicated ABAP application server. For Web Dynpro, this is done in the Web Dynpro Content Administrator. In the destination maintenance, specify Single Server Connection as the Destination Type ".
Other than that ideally it works with j2ee and abap on diff systems.
Regards
Ayyapparaj -
Debugging ABAP Code From Within Webdynpro Application
Hello Experts,
We use ABAP RFC Function in Our Java Webdynpro application, We need to debug the parameters pass from the webdynpro application to the ABAP Function.
In order to do that we:
1. Defined a JCO connection with "Single Server Connection" as the Destination Type.
2. We have loged on to the relevant system and client using SAP GUI with the same user that run the webdynpro application.
3. We have activate the external debugging in se80 Utilities -> Settings
4. We have set an HTTP (external) breakpoint in the ABAP code,
As mentioned in the article:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0e9a9d90-0201-0010-478e-991dbea73a30
However, we recieve a dump in the R3 system:
RFC_DEBUGGING_NO_DIALOG_USER
ShrtText
RFC debugging is only possible with dialog user
What happened?
You attempted to debug a program by RFC. However, in this destination
there is a user whose user type permits communication without dialog.
This means, for example, that debugging with a system user is not
possible.
What can you do?
Restart the program and take note of the following:
You can do one of the following:
1. You can change the user listed in the RFC destination and enter a
dialog user.
2. In the target system of RFC you can change the user type of the user
listed in the RFC destination to 'dialog'.
3. You can avoid this runtime error by omitting the RFC debugging.
If in the ABAP debugger the statement cursor points to the statement
(CALL FUNCTION ... DESTINATION), you must choose the function
'Execute'.
We checked and the user we use is defined as dialog in SU01 and the user that the webdynpro use to call the functio is the same user as was logged in.
What else should we do?
Thanks,
EyalHello Eyal,
You mentioned the following..
1. Defined a JCO connection with "Single Server Connection" as the Destination Type. 2. We have loged on to the relevant system and client using SAP GUI with the same user that run the webdynpro application.*<---The system that you logged into is your source system*
3. We have activate the external debugging in se80 Utilities -> Settings
4. We have set an HTTP (external) breakpoint in the ABAP code,
and the name of the system defined in the RFC connection will be your target system.
As per the response (dump error message) in this target system you need to have a dialog user.
And this dialog user needs to be defined in the RFC destination that is being used to connect to the target system.
Regards,
Siddhesh -
Hey SAP Gurus,
We have around 30 systems on AIX which need to monitored remotely via TELNET service.
Is there a way where in a TELNET session can be called from an ABAP code.
Please let me know .
Regards,
Ashish .A. Poojaryhi,
telnet is nothing but connecting the system using the FTP command..
first know the port number to ..and use the below command in abap program to connect FTP.
FTP_CONNECT - Open a connection (and log in) to an FTP server
FTP_COMMAND - Execute a command on the FTP server
FTP_DISCONNECT - Close the connection (and log off) the FTP server
regards,
Prabhudas -
For RFC Sender " Is it must i need to write ABAP code " ?
Hi All
I am learning XI but i have problem while creating RFC sender ?
How to configure RFC sender? I must write ABAP code in R/3 side ?
Can any one expalin me indetail on this?
I see many links in SDN but i was not able to find the exact one
Adv..thanks and points
RakeshHi ,
Go thru this data...
<b>Configuring the Sender RFC Adapter </b>
<b>Use</b>
You configure the sender RFC adapter so that you can use it to convert RFC calls from a sender to XML messages and send these messages to the Integration Server.
<b>Integration</b>
You configure the adapter on the Parameters tab page during the definition of a communication channel. In addition to the adapter configuration, on the Module tab page in the module processor, you can specify generic modules, which give the adapter additional functions.
<b>Prerequisites</b>
1. You have created a new communication channel or have opened an existing one.
2. On the Parameter tab page you have selected the adapter type RFC.
3. You have selected the Sender radio button to define the adapter as a sender adapter.
4. The communication channel in which the RFC adapter is defined must be defined for a service of type Business System in the area Service Without Party.
5. The specifications in the communication channel must match the specifications for the adapter-specific identifiers for the business system. For more information on adapter-specific identifiers, see: Service
<b>Activities</b>
<b>Transport Protocol</b>
The transport protocol is RFC.
<b>Message Protocol</b>
The message protocol is RFC (RFC XML).
<b>Adapter Engine</b>
Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine.
<b>Adapter Status</b>
Set the adapter to Active to enable messages to be exchanged.
RFC Server Parameters
The RFC server parameters identify the sender system.
<b>Specify the following parameters:</b>
Parameter Entry
Application server (Gateway) Gateway host of the sender system
Application server service (Gateway) Gateway service of the sender system
Program ID Program ID of the registered server program
Unicode Select this check box if the sender system is a Unicode system
Initial connections Number of initial connections required between sender system and adapter
Maximum connections Maximum possible number of initial connections required between sender system and adapter
Advanced mode Select this check box if you want to specify additional parameters of the class JCO.Server for the adapter configuration
Enter the name and values of the parameters in the table displayed
<b>RFC Metadata Repository Parameters</b>
The RFC metadata repository parameters identify the SAP system containing the repository for the RFC metadata. This does not necessarily have to be the sender system.
<b>Specify the following parameters:</b>
<b>Parameter Entry</b>
Load balancing Select this check box if your SAP system works with load balancing
Application server Host name of the SAP system (without load balancing)
System number System number of the SAP system (without load balancing)
Message server Host name of the message server (with load balancing)
Message server service Operating system service of the message server or message server port (with load balancing)
System ID System ID of the SAP system (with load balancing)
Logon group Logon group for the dynamic logon load (with load balancing)
Authentication Type Logon data for the SAP system
User Name SAP user name
User Password SAP user password
Logon language SAP logon language
Client SAP client
Advanced mode Select this check box if you want to specify additional parameters of the class JCO.Client for the adapter configuration
Enter the name and values of the parameters in the table displayed
Depending on the SAP system version, the following authorizations are required to read the metadata (authorization object: S_RFC, ACTVT: 16, FUGR):
Function Groups by R/3 Release
R/3 Release Function Groups (FUGRs)
As of 3.1H RFC1, SG00, SRFC, SUNI, SYST
As of 4.0A RFC1, SDIF, SG00, SRFC, SYST, SYSU, SUNI
As of 4.6A RFC1, SDIF, SG00, SRFC, SYST, SYSU
As of 4.6D RFC1, SDIFRUNTIME, SG00, SRFC, SYST, SYSU
As of SAP Web Application Server 6.20, the role SAP_BC_JSF_COMMUNICATION_RO is available, which is used for the user SAPJSF and contains all the required authorizations.
Regards,
Jayaram... -
Hi All,
I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
Can any one help with how to used unix commands in ABAP?
Thanks in advance.
Regards,
HemendraThe recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc. For example:
Command name OS Type OS command Parameters for operating system command
Z_FILE_MOVE SunOS Customer mv ? ?
You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
Jonathan
Maybe you are looking for
-
How to delete the structure created from Tx: EEWB ?
Hi SAP Gurus I have an issue at hand. I have added three components in the structure <b>BUS000___I</b> and the components are <b>ZZ1, ZZ2, ZZ3</b>, I was following the <b>EEWB</b> wizard and from there these three components were made, now I cannot
-
How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.
-
Hello, The procedure above doesn't work. Regardless the options I choose, it doesn't allow to proceed without a credit card number. The option not to select a credit card is not there. Can you please help?
-
Hi all, just signed up for broadband and phone and requested to keep my current number. On finishing the order the online confirmation confirmed my number would be my existing, however I've no received an email which shows a new number as does the on
-
Advice needed with Audio Punchin-in workflows for News
I'm testing a new FCP installation for a News Broadcaster and reached a major stumbling block with the recording of Voice Over in tight turnaround situations. Previously the broadcaster fully utilized the 'Audio Punch-in' functionality of Avid Media