How to set attched file name while sending email through ABAP
Hi All- tell me how to set attched file name while sending email through ABAP.
regards...
Abhay
Sure, when you are adding your entry to the packing list, give the name in the obj_name field.
*File 2
mailbin = 'This is file 2'.
append mailbin.
data: start type i.
data: end type i.
start = tab_lines + 1.
describe table mailbin lines end.
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = start.
mailpack-body_num = end.
mailpack-doc_type = 'TXT'.
mailpack-obj_name = 'TEST2'. "<- RIGHT HERE
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
append mailpack.
Regards,
RIch Heilman
Similar Messages
-
How to set default file path while downloading alv output
Hi,
Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
Please look below screenshots:
Kindly help me resolve it.
Thanks in advance.
Regards,
Ashutosh KataraThis information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
Regards,
Raymond -
Uncaught Exception occured while sending mail through abap code.
Hi,
Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.HI,
Runtime Error: UNCAUGHT_EXCEPTION details.
Runtime Errors UNCAUGHT_EXCEPTION
Exception CX_ADDRESS_BCS
Short text
An exception occurred that was not caught.
What happened?
The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
the call hierarchy.
Since exceptions represent error situations and this error was not
adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
terminated.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
An exception occurred
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
"SAPLZSEND_MAIL" or "LZSEND_MAILU01"
"ZSEND_EMAIL"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
The exception must either be prevented, caught within proedure
"SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
Please help me to resolve this issue. -
How to read a file name and send it a particular reciever
Hi,
I have a scenario, where i am receiving a a file and based on the file name i have to decide who is the receiver and send it to that particular receiver.I do not have to do any mapping.
can someone suggest me how can I achieve this.
Thanks in advance.HI This may help you.Let me know if not.
Step by Step Guide: XML File 2 XML File Scenario: Part I
Step by Step Guide: XML File 2 XML File Scenario: Part II
Converting XML to PDF using XI
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
"JAVA MAPPING", an alternate way of reading a CSV file
Dynamic File Name using XI 3.0 SP12 Part - I
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
Push Data to MVC Architectured application using XI
How to send any data (even binary) through XI, without using the Integration Repository
XI in the role of a FTP
The specified item was not found.
The specified item was not found.
The specified item was not found.
The specified item was not found. -
Dynamic file name while sending to target FTP
Hi Experts,
we have a scenario wherein we are trying to implement dynamic file names.
The scenario is IDOC to file, and we need to append the data corresponding to all the IDOC triggered n a daily basis.
Its like the file abc_01will contain data for day 1(data of oll the IDOC in that day).For day to we need to dynamically name the file as abc_02 and so on.
But before naming the file as abc_02 we need to check if abc01 is present or not .If abc_01 is not present then for day 2 file we need to give the name as abc_01 and so on_.This condition is need to be checked becasue there may be the case that a file may not be picked by the script running at the target system.
can anyone let me know how to check whether file are correctly picked at target.
Regards,
srinivas.Hi Srinivas,
I think you can achieve this with the next scenario:
- For getting all the Idocs info, you need a ccBPM to collect them, and then, download them to a file.
- To dynamically put the filename, you need to use Dynamic Configuration at the File Receiver Adapter (in the Message Mapping, you can write a UDF.)
- And to check if the daily file exists, you can also write an UDF and then decide the name of the output file.
Hope this helps,
Regards,
Juan -
How to remove ":" in file name while using Variable substution
Hi ALL
I am using file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
2) Dynamic Configuration code is also not use full as I am using 1:n file creation>
Prasanna Kumar wrote:
> Hi ALL
>
> I am using file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
> But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
> So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
>
> Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
> 2) Dynamic Configuration code is also not use full as I am using 1:n file creation
does the time stamp with the ":" a part of your output file?
else use a replaceAll function in your mapping and replace the : with empty string then use the value in the variable substitution
Another option is use the normal BPM for 1: N message flow. The use a simple java mapping that will introduce a dynamic configuration and you can create the file name as you want. the java mapping will be used in the flow of messages from BPM to target system.
ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name -
How to put mail ids in CC and BCC while sending mail through ABAP?
Hi all,
i have created a report which sends the output of the report to external mail ids. I want to put some email ids in CC or BCC.
Please do guide me so that i can proceed with the development.
Thanks and Regards,
Syedjust go through below code and
*& Report Z_TTTT
REPORT Z_TTTT1.
*TABLE DECLARATIONS
TABLES: SOLI.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT_B1 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE .
PARAMETERS: SAPID RADIOBUTTON GROUP ADDR.
SELECTION-SCREEN COMMENT 5(20) T_SAPID.
PARAMETERS: EMAIL_ID RADIOBUTTON GROUP ADDR.
SELECTION-SCREEN COMMENT 30(20) T_EMAIL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT_B2 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_ID.
SELECT-OPTIONS: ID FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_CC.
SELECT-OPTIONS: CC FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_BCC.
SELECT-OPTIONS: BCC FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN BEGIN OF LINE .
*SELECTION-SCREEN COMMENT 5(20) TXT_SEND.
*PARAMETERS: SENDER LIKE SOUD-USRNAM.
*SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
*SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-009.
*PARAMETERS: SUB_LINE(60) TYPE C.
*SELECTION-SCREEN END OF BLOCK B3.
*SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-008.
*SELECT-OPTIONS: TEXT1 FOR SOLI-LINE NO INTERVALS.
*SELECTION-SCREEN END OF BLOCK B4.
SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT_B5.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: P_ATTACH AS CHECKBOX USER-COMMAND RAD1.
SELECTION-SCREEN COMMENT 5(20) T_ATTACH.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(20) T_FLNAME.
PARAMETERS: P_FLNAME TYPE RLGRAP-FILENAME MODIF ID M1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B5.
*Data Declarations
DATA: MAIL_CONTENT LIKE SOLI OCCURS 0 WITH HEADER LINE,
SUBJECT_LINE LIKE SOOD1-OBJDES.
DATA : SENDER TYPE SY-UNAME.
DATA : IT_REC type SOLI OCCURS 0 WITH HEADER LINE.
*INITIALIZATION Block
INITIALIZATION.
TEXT_B1 = 'Output Specification'.
T_SAPID = 'SAP User ID'.
T_EMAIL = 'Email ID'.
TXT_ID = 'Receipient Id'.
TXT_CC = 'CC'.
TXT_BCC = 'BCC'.
TEXT_B2 = 'Receipient'.
TEXT_B5 = 'Attachment'.
T_ATTACH = 'Attachment'.
T_FLNAME = 'File name'.
* TXT_SEND = 'Sender Name'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_ATTACH <> 'X'.
IF SCREEN-GROUP1 = 'M1'.
SCREEN-INPUT = 0. " Disable for input.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FLNAME.
PERFORM GET_FILENAME.
*start of selection Block
START-OF-SELECTION.
* LOOP AT TEXT1.
* MOVE TEXT1-LOW TO MAIL_CONTENT-LINE.
* APPEND MAIL_CONTENT.
* ENDLOOP.
**** Mail Body
MOVE 'Hi' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
MOVE 'This is Test mail' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
MOVE 'Thanxs' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
**** Mail Heading
MOVE 'Test Mail' TO SUBJECT_LINE.
PERFORM SEND_EMAIL TABLES MAIL_CONTENT USING SUBJECT_LINE.
*& Form SEND_EMAIL
FORM SEND_EMAIL TABLES OBJCONT STRUCTURE MAIL_CONTENT
USING TITLE LIKE SOOD-OBJDES.
DATA: RECEIVERS TYPE SOOS1 OCCURS 0 WITH HEADER LINE,
TSOOD1 TYPE SOOD1,
PACKING_LIST TYPE SOXPL OCCURS 0 WITH HEADER LINE,
OBJCONT1 type SOLI OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF AT_HEADER OCCURS 1.
INCLUDE STRUCTURE SOLI.
DATA: END OF AT_HEADER.
CLEAR: TSOOD1,
RECEIVERS.
REFRESH RECEIVERS.
MOVE: SY-LANGU TO TSOOD1-OBJLA,
'Email Notice' TO TSOOD1-OBJNAM,
'C' TO TSOOD1-OBJSNS,
TITLE TO TSOOD1-OBJDES, " rajan
'Rajan' TO TSOOD1-OWNNAM.
*loop through each ID and move them to recipient table
LOOP AT ID.
* TRANSLATE ID-LOW TO UPPER CASE.
IF SAPID = 'X'.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
ID-LOW TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX.
ELSE.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
'U' TO RECEIVERS-RECESC,
'U-' TO RECEIVERS-RECNAM,
ID-LOW TO RECEIVERS-RECEXTNAM.
ENDIF.
APPEND RECEIVERS.
CLEAR RECEIVERS.
ENDLOOP.
*loop through each CC and move them to recipient table
LOOP AT CC.
TRANSLATE CC-LOW TO UPPER CASE.
IF SAPID = 'X'.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
CC-LOW TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX,
'X' TO RECEIVERS-SNDCP.
ELSE.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
'U' TO RECEIVERS-RECESC,
'U-' TO RECEIVERS-RECNAM,
CC-LOW TO RECEIVERS-RECEXTNAM,
'X' TO RECEIVERS-SNDCP.
ENDIF.
APPEND RECEIVERS.
CLEAR RECEIVERS.
ENDLOOP.
*loop through each BCC and move them to recipient table
LOOP AT BCC.
TRANSLATE BCC-LOW TO UPPER CASE.
IF SAPID = 'X'.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
BCC-LOW TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX,
'X' TO RECEIVERS-SNDBC.
ELSE.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
'U' TO RECEIVERS-RECESC,
'U-' TO RECEIVERS-RECNAM,
BCC-LOW TO RECEIVERS-RECEXTNAM,
'X' TO RECEIVERS-SNDBC.
ENDIF.
APPEND RECEIVERS.
CLEAR RECEIVERS.
ENDLOOP.
AT_HEADER = SY-DATUM.
APPEND AT_HEADER.
AT_HEADER = SY-UZEIT.
APPEND AT_HEADER.
IF SENDER EQ SPACE.
SENDER = SY-UNAME.
ENDIF.
IF P_ATTACH EQ 'X'.
PACKING_LIST-HEAD_START = 1.
PACKING_LIST-HEAD_NUM = 2.
PACKING_LIST-BODY_START = 1.
PACKING_LIST-BODY_NUM = 9999.
PACKING_LIST-FILE_EXT = 'PDF'.
APPEND PACKING_LIST.
CLEAR PACKING_LIST.
* APPEND LINES OF OBJCONT TO OBJCONT1.
* REFRESH OBJCONT.
DATA : FLNAME TYPE STRING.
FLNAME = P_FLNAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FLNAME
FILETYPE = 'BIN'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_REC
* 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
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND LINES OF IT_REC TO OBJCONT1.
* APPEND P_FLNAME TO OBJCONT1.
ENDIF.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
SENDER = 'AAB_ABAP5'
OBJECT_HD_CHANGE = TSOOD1
OBJECT_TYPE = 'RAW'
TABLES
OBJCONT = OBJCONT
RECEIVERS = RECEIVERS
ATT_HEAD = AT_HEADER
ATT_CONT = OBJCONT1
PACKING_LIST = PACKING_LIST
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.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE .
MESSAGE 'sent successfully' TYPE 'I'.
ENDIF.
* CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
** BIN_FILESIZE = GV_BIN_FILESIZE
* FILENAME = 'C:\Documents and Settings\Administrator\Desktop\file'"W_FULL_PATH
* FILETYPE = 'BIN'
** APPEND = ' '
** WRITE_FIELD_SEPARATOR = ' '
** HEADER = '00'
** TRUNC_TRAILING_BLANKS = ' '
** WRITE_LF = 'X'
** COL_SELECT = ' '
** COL_SELECT_MASK = ' '
** DAT_MODE = ' '
** CONFIRM_OVERWRITE = ' '
** NO_AUTH_CHECK = ' '
** CODEPAGE = ' '
** IGNORE_CERR = ABAP_TRUE
** REPLACEMENT = '#'
** WRITE_BOM = ' '
** TRUNC_TRAILING_BLANKS_EOL = 'X'
** WK1_N_FORMAT = ' '
** WK1_N_SIZE = ' '
** WK1_T_FORMAT = ' '
** WK1_T_SIZE = ' '
** IMPORTING
** FILELENGTH =
* TABLES
* DATA_TAB = IT_REC
** FIELDNAMES =
** EXCEPTIONS
** FILE_WRITE_ERROR = 1
** NO_BATCH = 2
** GUI_REFUSE_FILETRANSFER = 3
** INVALID_TYPE = 4
** NO_AUTHORITY = 5
** UNKNOWN_ERROR = 6
** HEADER_NOT_ALLOWED = 7
** SEPARATOR_NOT_ALLOWED = 8
** FILESIZE_NOT_ALLOWED = 9
** HEADER_TOO_LONG = 10
** DP_ERROR_CREATE = 11
** DP_ERROR_SEND = 12
** DP_ERROR_WRITE = 13
** UNKNOWN_DP_ERROR = 14
** ACCESS_DENIED = 15
** DP_OUT_OF_MEMORY = 16
** DISK_FULL = 17
** DP_TIMEOUT = 18
** FILE_NOT_FOUND = 19
** DATAPROVIDER_EXCEPTION = 20
** CONTROL_FLUSH_ERROR = 21
** OTHERS = 22
* IF SY-SUBRC <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM. " SEND_EMAIL
*& Form GET_FILENAME
FORM GET_FILENAME .
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_FLNAME.
ENDFORM. " GET_FILENAME -
Change file name when sending form through email
Hi all,
I created a form that can be downloaded, viewed and completed by the user in Acrobat reader, and then sent by email as a pdf-attachment by pushing a submit-button. As the form will be sent by several different users to the same address, in order to avoid confusion it would be good when the filename would not be the original form name, but someting based on the individal data entered by the user.
Is there a way of between having filled in the form and actually sending it, automatically change the file name? I know users could save the file first and thén send it, but I would like to spare them the hassle.
Thank! MateoTo do that you woudl have to certify the form which brings into play a whole other series of issues.
-
To avoid the attachment for the body content while sending email from ABAP
SAP Version : 4.7
When i tried to send an external email from the abap report program, the body content of the mail is coming as an attachment for the same. I need to avoid this. Please give the suggestion. Am attaching the code.
DECLARATION PART *
TYPE-POOLS : SLIS.
TABLES : VBAK.
DECLARATION FOR ALV.
DATA : F_FIELD TYPE SLIS_T_FIELDCAT_ALV,
W_FIELD TYPE SLIS_FIELDCAT_ALV,
L_HEADER TYPE SLIS_T_LISTHEADER,
W_HEADER TYPE SLIS_LISTHEADER,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv.
TYPES : BEGIN OF T_VBAK,
VBELN LIKE VBAK-VBELN,
VKGRP LIKE VBAK-VKGRP,
KUNNR LIKE VBAK-KUNNR,
ERDAT LIKE VBAK-ERDAT,
VTWEG LIKE VBAK-VTWEG,
LIFSK LIKE VBAK-LIFSK,
VKBUR LIKE VBAK-VKBUR,
END OF T_VBAK.
TYPES : BEGIN OF T_VBAP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
WERKS LIKE VBAP-WERKS,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
CUOBJ LIKE VBAP-CUOBJ,
NETWR LIKE VBAP-NETWR,
ZSCHL_K LIKE VBAP-ZSCHL_K,
KONDM LIKE VBAP-KONDM,
ZZURWN LIKE VBAP-ZZURWN,
END OF T_VBAP.
TYPES : BEGIN OF T_LIPS,
VBELN LIKE LIPS-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF T_LIPS.
TYPES : BEGIN OF T_KNA1,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
ADRNR LIKE KNA1-ADRNR,
END OF T_KNA1.
TYPES : BEGIN OF T_VBKD,
VBELN LIKE VBKD-VBELN,
POSNR LIKE VBKD-POSNR,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
KURSK LIKE VBKD-KURSK, " CURRENCY CHECK
BZIRK LIKE VBKD-BZIRK, " SALES DISTRICT
KDGRP LIKE VBKD-KDGRP,
IHREZ LIKE VBKD-IHREZ,
END OF T_VBKD.
TYPES : BEGIN OF T_LIKP,
VBELN LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
END OF T_LIKP.
TYPES : BEGIN OF T_ADR6,
ADDRNUMBER LIKE ADR6-ADDRNUMBER,
SMTP_ADDR LIKE ADR6-SMTP_ADDR,
END OF T_ADR6.
DATA : BEGIN OF IT_CUST OCCURS 0,
KUNNR LIKE VBAK-KUNNR,
END OF IT_CUST.
TYPES : BEGIN OF T_VBUP,
VBELN LIKE VBUP-VBELN,
POSNR LIKE VBUP-POSNR,
KOSTA LIKE VBUP-KOSTA,
WBSTA LIKE VBUP-WBSTA,
END OF T_VBUP.
TYPES : BEGIN OF T_TVLST,
LIFSP LIKE TVLST-LIFSP,
VTEXT LIKE TVLST-VTEXT,
END OF T_TVLST.
TYPES : BEGIN OF T_CONFIG.
INCLUDE STRUCTURE CONF_OUT.
TYPES : END OF T_CONFIG.
DATA : TMP LIKE VBAK-KUNNR.
DATA : NAME_TEXT LIKE THEAD-TDNAME.
DATA : TLINE1 LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA : TMP_BRAKET LIKE CONF_OUT-ATWRT,
TMP_BRAKET1 LIKE CONF_OUT-ATWRT.
DATA : BEGIN OF IT_FINAL OCCURS 0,
WERKS LIKE VBAP-WERKS,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
KUNNR LIKE VBAK-KUNNR,
NAME1 LIKE KNA1-NAME1,
VBELN1 LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
LIFSK LIKE VBAK-LIFSK,
ZZURWN LIKE VBAP-ZZURWN,
IHREZ LIKE VBKD-IHREZ,
ERDAT1 LIKE VBAK-ERDAT,
NETWR(25) type C,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
SALORD(17) TYPE C,
PUMP_TYPE LIKE CONF_OUT-ATWRT,
PUMP_SIZE LIKE CONF_OUT-ATWRT,
VTEXT LIKE TVLST-VTEXT,
KWMENG(25) TYPE C,
FOOTER(330) TYPE C,
ITMTXT(330) TYPE C,
END OF IT_FINAL.
DATA : IT_VBAK TYPE STANDARD TABLE OF T_VBAK,
IT_VBAP TYPE STANDARD TABLE OF T_VBAP,
IT_VBKD TYPE STANDARD TABLE OF T_VBKD,
IT_LIKP TYPE STANDARD TABLE OF T_LIKP,
IT_LIPS TYPE STANDARD TABLE OF T_LIPS,
IT_VBUP TYPE STANDARD TABLE OF T_VBUP,
IT_KNA1 TYPE STANDARD TABLE OF T_KNA1,
IT_ADR6 TYPE STANDARD TABLE OF T_ADR6,
IT_FINAL1 LIKE IT_FINAL OCCURS 0 with header line,
IT_TVLST TYPE STANDARD TABLE OF T_TVLST,
IT_CONFIG TYPE STANDARD TABLE OF T_CONFIG,
W_VBAK TYPE T_VBAK,
W_VBAP TYPE T_VBAP,
W_VBKD TYPE T_VBKD,
W_LIKP TYPE T_LIKP,
W_ADR6 TYPE T_ADR6,
W_LIPS TYPE T_LIPS,
W_VBUP TYPE T_VBUP,
W_KNA1 TYPE T_KNA1,
W_TVLST TYPE T_TVLST,
W_CONFIG TYPE T_CONFIG.
DATA: it_message 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: 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.
SELECTION-CRITERIA *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : R2 RADIOBUTTON GROUP G1 USER-COMMAND radio DEFAULT 'X',
R1 RADIOBUTTON GROUP G1 .
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
PARAMETERS : P_VTWEG LIKE W_VBAK-VTWEG ,
P_WERKS LIKE W_VBAP-WERKS.
select-options : s_vkgrp for w_vbak-vkgrp,
s_ERDAT for w_LIKP-ERDAT.
selection-screen end of block b2.
Initialization
INITIALIZATION.
s_vkgrp-sign = 'I'.
s_vkgrp-option = 'BT'.
s_vkgrp-low = '313'.
s_vkgrp-high = '324'.
APPEND s_vkgrp.
s_erdat-sign = 'I'.
s_erdat-option = 'BT'.
s_erdat-low = '20080108'.
s_erdat-high = '20080108'.
s_erdat-low = '20070101'.
s_erdat-high = sy-datum.
APPEND s_erdat.
selection-screen validations
AT SELECTION-SCREEN.
Validation for Plant.
IF p_werks NE '7210'.
MESSAGE : 'Plant entered should be 7210' TYPE 'E'.
ENDIF.
START OF SELECTION *
start-of-selection.
GETTING THE DATA FROM THE DATABASE TABLE
PERFORM DATA_FETCH.
FILLING THE FINAL INTERNAL TABLE
PERFORM FILL_FINAL.
GETTING THE LIST FOR SENDING MAIL OR DISPLAY.
IF R1 = 'X'.
Populate table with details to be entered into .xls file
LOOP AT IT_CUST.
PERFORM build_xls_data_table using it_cust-kunnr.
ENDLOOP.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
ELSEIF R2 = 'X'.
PERFORM LIST_DISPLAY.
ENDIF.
END OF SELECTION *
end-of-selection.
*& Form DATA_FETCH
text
--> p1 text
<-- p2 text
FORM DATA_FETCH .
SELECT VBELN
VKGRP
KUNNR
ERDAT
VTWEG
LIFSK
VKBUR
INTO TABLE IT_VBAK
FROM VBAK
WHERE VTWEG = P_VTWEG
AND VKGRP IN S_VKGRP
AND LIFSK NE ''.
IF IT_VBAK[] IS NOT INITIAL.
SELECT LIFSP
VTEXT
INTO TABLE IT_TVLST
FROM TVLST
FOR ALL ENTRIES IN IT_VBAK
WHERE LIFSP = IT_VBAK-LIFSK
AND SPRAS = 'EN'.
SELECT VBELN
POSNR
MATNR
WERKS
ARKTX
KWMENG
CUOBJ
NETWR
ZSCHL_K
KONDM
ZZURWN
INTO TABLE IT_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND WERKS = P_WERKS.
SELECT KUNNR
NAME1
ADRNR
INTO TABLE IT_KNA1
FROM KNA1
FOR ALL ENTRIES IN IT_VBAK
WHERE KUNNR = IT_VBAK-KUNNR.
SELECT VBELN
POSNR
BSTKD
BSTDK
KURSK
BZIRK
KDGRP
INTO TABLE IT_VBKD
FROM VBKD
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAP[] IS NOT INITIAL.
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE IT_LIPS
FROM LIPS
FOR ALL ENTRIES IN IT_VBAP
WHERE VGBEL = IT_VBAP-VBELN
AND VGPOS = IT_VBAP-POSNR.
ENDIF.
IF IT_LIPS[] IS NOT INITIAL.
SELECT VBELN
ERDAT
INTO TABLE IT_LIKP
FROM LIKP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND ERDAT IN S_ERDAT.
SELECT VBELN
POSNR
KOSTA
WBSTA
INTO TABLE IT_VBUP
FROM VBUP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND POSNR = IT_LIPS-POSNR
AND KOSTA EQ 'C'
AND WBSTA NE 'C'.
ENDIF.
IF IT_KNA1[] IS NOT INITIAL.
SELECT ADDRNUMBER
SMTP_ADDR
INTO TABLE IT_ADR6
FROM ADR6
FOR ALL ENTRIES IN IT_KNA1
WHERE ADDRNUMBER = IT_KNA1-ADRNR.
ENDIF.
ENDFORM. " DATA_FETCH
*& Form LIST_DISPLAY
text
--> p1 text
<-- p2 text
FORM LIST_DISPLAY .
REFRESH F_FIELD.
IF R2 = 'X'.
W_FIELD-col_pos = 1.
W_FIELD-fieldname = 'WERKS'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Plant'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 2.
W_FIELD-fieldname = 'VBELN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 3.
W_FIELD-fieldname = 'KUNNR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Code'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 4.
W_FIELD-fieldname = 'NAME1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Name'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 5.
W_FIELD-fieldname = 'VBELN1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Number'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 6.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Date'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 7.
W_FIELD-fieldname = 'LIFSK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 8.
W_FIELD-fieldname = 'PUMP_TYPE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Type'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 9.
W_FIELD-fieldname = 'PUMP_SIZE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_l = 'Pump Size'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 10.
W_FIELD-fieldname = 'ZZURWN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Srno'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 11.
W_FIELD-fieldname = 'IHREZ'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Indent No.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 12.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Order Booking Dt'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 13.
W_FIELD-fieldname = 'NETWR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Net Value'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 14.
W_FIELD-fieldname = 'KWMENG'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Qty'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 15.
W_FIELD-fieldname = 'BSTKD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PONO'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 16.
W_FIELD-fieldname = 'BSTDK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PODT'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 17.
W_FIELD-fieldname = 'SALORD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order/Item'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 18.
W_FIELD-fieldname = 'VTEXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block Desc.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 19.
W_FIELD-fieldname = 'FOOTER'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Footer Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 20.
W_FIELD-fieldname = 'ITMTXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Item Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
PERFORM SORT_FIELD.
PERFORM LAYOUT_DISPLAY.
PERFORM GRID_DISPLAY.
ENDIF.
ENDFORM. " LIST_DISPLAY
*& Form FILL_FINAL
text
--> p1 text
<-- p2 text
FORM FILL_FINAL .
REFRESH IT_FINAL.
LOOP AT IT_VBUP INTO W_VBUP.
READ TABLE IT_LIPS INTO W_LIPS WITH KEY VBELN = W_VBUP-VBELN POSNR = W_VBUP-POSNR.
READ TABLE IT_LIKP INTO W_LIKP WITH KEY VBELN = W_LIPS-VBELN.
IF SY-SUBRC EQ 0.
READ TABLE IT_VBAP INTO W_VBAP WITH KEY VBELN = W_LIPS-VGBEL POSNR = W_LIPS-VGPOS.
READ TABLE IT_VBAK INTO W_VBAK WITH KEY VBELN = W_VBAP-VBELN.
READ TABLE IT_VBKD INTO W_VBKD WITH KEY VBELN = W_VBAK-VBELN.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = W_VBAK-KUNNR.
READ TABLE IT_TVLST INTO W_TVLST WITH KEY LIFSP = W_VBAK-LIFSK.
IT_FINAL-WERKS = W_VBAP-WERKS.
IT_FINAL-VBELN = W_VBAP-VBELN.
IT_FINAL-KUNNR = W_VBAK-KUNNR.
IT_FINAL-NAME1 = W_KNA1-NAME1.
IT_FINAL-VBELN1 = W_LIKP-VBELN.
IT_FINAL-ERDAT = W_LIKP-ERDAT.
IT_FINAL-LIFSK = W_VBAK-LIFSK.
IT_FINAL-ZZURWN = W_VBAP-ZZURWN.
IT_FINAL-IHREZ = W_VBKD-IHREZ.
IT_FINAL-ERDAT1 = W_VBAK-ERDAT.
IT_FINAL-NETWR = W_VBAP-NETWR.
IT_FINAL-BSTKD = W_VBKD-BSTKD.
IT_FINAL-BSTDK = W_VBKD-BSTDK.
IT_FINAL-POSNR = W_VBAP-POSNR.
IT_FINAL-VTEXT = W_TVLST-VTEXT.
IT_FINAL-KWMENG = W_VBAP-KWMENG.
CONCATENATE W_VBAP-VBELN W_VBAP-POSNR INTO IT_FINAL-SALORD SEPARATED BY '/'.
IF W_VBAP-CUOBJ NE '000000000000000000'.
REFRESH IT_CONFIG.
CALL FUNCTION 'VC_I_GET_CONFIGURATION'
EXPORTING
INSTANCE = W_VBAP-CUOBJ
LANGUAGE = SY-LANGU
TABLES
CONFIGURATION = IT_CONFIG
EXCEPTIONS
INSTANCE_NOT_FOUND = 1
INTERNAL_ERROR = 2
NO_CLASS_ALLOCATION = 3
INSTANCE_NOT_VALID = 4
OTHERS = 5.
IF SY-SUBRC = 0.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_TYPE'.
IT_FINAL-PUMP_TYPE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_SIZE' .
IT_FINAL-PUMP_SIZE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
ENDIF.
ENDIF.
move w_vbap-vbeln to name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT1'
language = 'E'
name = name_text
object = 'VBBK'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-FOOTER TLINE1-TDLINE+0(65) INTO IT_FINAL-FOOTER.
CLEAR : TLINE1.
ENDLOOP.
clear : name_text,tline1[].
concatenate w_vbap-vbeln w_vbap-posnr into name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT3'
language = 'E'
name = name_text
object = 'VBBP'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-ITMTXT TLINE1-TDLINE+0(65) INTO IT_FINAL-ITMTXT.
CLEAR : TLINE1.
ENDLOOP.
APPEND IT_FINAL.
ENDIF.
CLEAR : IT_FINAL,W_VBAP,W_VBKD,W_VBUP,W_LIPS,W_LIKP,W_KNA1,W_VBAK,W_TVLST,name_text,tline1[].
ENDLOOP.
IT_FINAL1[] = IT_FINAL[].
SORT IT_FINAL1 BY KUNNR.
LOOP AT IT_FINAL1.
IF TMP NE IT_FINAL1-KUNNR.
IT_CUST-KUNNR = IT_FINAL1-KUNNR.
APPEND IT_CUST.
clear : tmp,it_cust.
TMP = IT_FINAL1-KUNNR.
ENDIF.
CLEAR : IT_FINAL1.
ENDLOOP.
ENDFORM. " FILL_FINAL
*& Form LAYOUT_DISPLAY
text
--> p1 text
<-- p2 text
FORM LAYOUT_DISPLAY .
W_LAYOUT-colwidth_optimize = 'X'.
ENDFORM. " LAYOUT_DISPLAY
*& Form GRID_DISPLAY
text
--> p1 text
<-- p2 text
FORM GRID_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = F_FIELD
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = T_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " GRID_DISPLAY
*& Form SORT_FIELD
text
--> p1 text
<-- p2 text
FORM SORT_FIELD .
w_sort-spos = 1.
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
w_sort-spos = 2.
w_sort-fieldname = 'VBELN'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
ENDFORM. " SORT_FIELD
*& Form TOP_OF_PAGE
text
FORM top_of_page.
IF R2 = 'X'.
REFRESH l_header.
w_header-typ = 'S'.
w_header-key = 'Delivery Block : '.
w_header-info = 'Outbound delivery created but not despatched'.
APPEND w_header TO l_header.
CLEAR w_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = l_header.
ENDIF.
ENDFORM. "TOP_OF_PAGE
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table using custcode.
CONSTANTS: con_cret TYPE X VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
data : it_custcode like vbak-kunnr.
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
clear : it_attach,it_attach[].
CONCATENATE 'Customer PONO' 'Customer PODT' 'Sales Order No' 'Item No'
'Pump Type' 'Pump Size' 'Order Value Rs' 'Delivery No.' 'Delivery Dt.'
'Quantity' 'Reasons for not getting Despatch'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
it_custcode = custcode.
CLEAR : W_KNA1,W_ADR6. "Code need to be added once testing is over.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = IT_CUSTCODE.
READ TABLE IT_ADR6 INTO W_ADR6 WITH KEY ADDRNUMBER = W_KNA1-ADRNR.
P_EMAIL = W_ADR6-SMTP_ADDR.
LOOP AT it_final where kunnr = it_custcode.
CONCATENATE
IT_FINAL-BSTKD
IT_FINAL-BSTDK
IT_FINAL-VBELN
IT_FINAL-POSNR
IT_FINAL-PUMP_TYPE
IT_FINAL-PUMP_SIZE
IT_FINAL-NETWR
IT_FINAL-VBELN1
IT_FINAL-ERDAT
IT_FINAL-KWMENG
IT_FINAL-VTEXT
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
clear it_final.
ENDLOOP.
if R1 = 'X'.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'AWAITING DESPATCH CLEARANCE'
'XLS'
'Delivery_Block'
'Delivery_Blk'
'[email protected]'
'INT'
changing gd_error
gd_reciever.
endif.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& 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: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
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,w_cnt.
DESCRIBE TABLE it_attach LINES w_cnt.
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.
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
object_header = objhead
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.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'We have manufactured the pump/s against your purchase order and regret to inform'.
APPEND it_message.
it_message = 'you that same cannot be despatched for the reason/s indicated below.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Please find the below attachment "Delivery_Blk.xls" for the details.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'We now request you to send the required detail/s by return mail/post to enable us '.
APPEND it_message.
it_message = 'to despatch the pump/s at the earliest.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Best Regards'.
APPEND it_message.
it_message = 'O.E. ENGINEER'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODYHi,
Refer to the following piece of code. This is the simple code to send email with content and attachment.
Declaration
DATA: lwa_hd_change TYPE sood1,
lt_objcont TYPE STANDARD TABLE OF soli,
lwa_objcont TYPE soli,
lt_receivers TYPE STANDARD TABLE OF soos1,
lwa_receivers TYPE soos1 ,
lt_att_cont TYPE STANDARD TABLE OF soli,
lwa_att_cont TYPE soli,
lt_packing TYPE STANDARD TABLE OF soxpl,
lwa_packing TYPE soxpl,
lf_sent TYPE sonv-flag,
lf_size TYPE i.
CONSTANTS: lc_obj(11) TYPE c VALUE 'BOMSouthco',
lc_desc(20) TYPE c VALUE 'BOM Download',
lc_lang(1) TYPE c VALUE 'E',
lc_raw(3) TYPE c VALUE 'RAW',
lc_net(1) TYPE c VALUE 'U',
lc_mail(4) TYPE c VALUE 'MAIL',
lc_xls(3) TYPE c VALUE 'XLS',
lc_ext(3) TYPE c VALUE 'EXT'.
Passing values to the strutures used in SO_OBJECT_SEND function module
lwa_hd_change-objla = lc_lang.
lwa_hd_change-objnam = lc_obj.
lwa_hd_change-objdes = lc_desc.
lwa_hd_change-objlen = 255.
lwa_objcont-line = text-t29.
APPEND lwa_objcont TO lt_objcont.
CLEAR lwa_objcont.
lwa_receivers-recextnam = text-t31.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
lwa_receivers-recextnam = text-t30.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
Passing values for the attachment file
LOOP AT gt_output INTO gwa_output.
CONCATENATE gf_lf gwa_output-matnr gf_etb gwa_output-idnrk gf_etb
gwa_output-type gf_etb gwa_output-menge gf_etb
gwa_output-meins gf_etb gwa_output-comp gf_etb
INTO lwa_att_cont-line.
APPEND lwa_att_cont TO lt_att_cont.
CLEAR lwa_att_cont.
ENDLOOP.
CHECK lt_att_cont IS NOT INITIAL.
DESCRIBE TABLE lt_att_cont LINES lf_size.
lwa_packing-transf_bin = ' '.
lwa_packing-head_start = 1.
lwa_packing-head_num = 0.
lwa_packing-body_start = 1.
lwa_packing-body_num = lf_size.
lwa_packing-file_ext = lc_xls.
lwa_packing-objlen = lf_size * 255.
lwa_packing-objtp = lc_ext.
lwa_packing-objdes = lc_desc.
lwa_packing-objnam = lc_obj.
APPEND lwa_packing TO lt_packing.
CLEAR lwa_packing.
CHECK gf_error IS NOT INITIAL. "Check if unix file is written
FM to send email to the intended recipients
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = lwa_hd_change
object_type = lc_raw
IMPORTING
sent_to_all = lf_sent
TABLES
objcont = lt_objcont
receivers = lt_receivers
packing_list = lt_packing
att_cont = lt_att_cont
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
originator_not_exist = 20
x_error = 21
OTHERS = 22.
IF sy-subrc = 0.
MESSAGE s004 WITH text-t34.
ENDIF.
COMMIT WORK.
Reward if helpful.
Regards,
Ramya -
Default the sender name while sending email from discoverer 11g viewer
Hi,
Can we put a default value of a sender in the email which are sent from discoverer 11g viewer.??Hello
Yes, you can do this but you have to edit one of the UIX files to do it. The following is taken from my new Discoverer 11h Handbook which will be out later in the year.
If you want to force users to send Discoverer reports from a prespecified e-mail account, use the following workflow:
Locate this file: $MIDDLEWARE_HOME/user_projects/domains/ClassicDomain/servers/WLS_DISCO/tmp/_WL_user/discoverer_11.1.1.2.0/<tmpfolder>/war/Email.uix
NOTE: In my system the name of the tmpfolder was 51oeh7. You may have a different name for <tmpfile> on your system and so may need to do a search for Email.uix.
Make a safe backup of Email.uix.
Find the following line and add the information in bold, changing [email protected] with your default email address:
<contents>
<messageTextInput required="yes" name="sender" disabled="true"
tip="[email protected]" columns="40"
prompt="${uix.data.nls['email.text.sender']}" text="[email protected]"/>
NOTE: In the above, you will be replacing text="${uix.eventResult.sender}" with your default email address like: text="myemail.mycompany.com"
Find the following line and add the line in bold below it:
<formValue name="event" value="sendEmail" />
<formValue name="sender" [email protected] />
NOTE: Make sure the domain name you provide is the same domain you are using for the SMTP server; otherwise, your Discoverer Viewer users will not be able to send e-mail.
Take a backup of the modified file and place it somewhere safe.
Stop and restart the WLS_DISCO server in the WebLogic Server Administration Console.
Notes concerning editing of UIX files:
Never make any changes without first backing up the UIX file you intend to work on. You need to go slowly and carefully, making backups as you go and trying your modifications on a test system first.
Any changes you make to a UIX file will not be supported by Oracle, and if you run into any problems with changes you make to a UIX file, you will be on your own, which is why you need a backup.
If you need future support, you will need to be able to prove that the issue you are encountering is not because of any changes you have made. You will basically need to have a clean instance to prove that the issue is still there.
Any upgrades or patches that you subsequently apply may overwrite any custom changes that you have made to the UIX files. It will be your responsibility to keep copies of any changes you have made, and it will be your responsibility to make sure these changes are still valid after any upgrade or patch.
NOTE: I cannot be held responsible if you tamper with your UIX files and mess up your system. You have been warned! That said, there are many examples for editing UIX files on Oracle’s Support site. So long as you are careful and heed the warnings mentioned, you should be fine
Best wishes
Michael -
Error while sending Email through Java Code in OIM
Hi All,
I have created a java code using tcEmailNotificationUtil, and integrated the same with the adapter.
I am triggering this adapter when an approval process gets completed.
As soon as the approval process gets completed my email task is triggering but the task is getting rejected.
I have checked my system configuration for mail server settings.Everything seems working fine.
Can you please help me in this issue how to debug?
Thanks in advance.Hi,
Here is my log file:
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/insertTaskHistory left.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/run entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: ReIssueAuditMessage/execute entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: ReIssueAuditMessage/initialize entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/getAttribute entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/getAttribute left.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/getUtility entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/getUtility left.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.ACCOUNTMANAGEMENT] - Class/Method: tcUtilityFactory/getRemoteUtility - Data: moUtil - Value: Thor.API.Operations.tcAuditOperationsClient
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: ReIssueAuditMessage/initialize left.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: ReIssueAuditMessage/processAllByIdentifier entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped entered.
DEBUG,25 Apr 2011 10:40:00,099,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped left.
DEBUG,25 Apr 2011 10:40:00,100,[XELLERATE.DATABASE] - select A.* from (select aud_jms_key, aud_class, identifier from aud_jms order by aud_jms_key) A where rownum <= ?
INFO,25 Apr 2011 10:40:00,101,[XELLERATE.PERFORMANCE] - Query: DB: 1, LOAD: 0, TOTAL: 1
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped entered.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped entered.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isStopped left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: ReIssueAuditMessage/execute left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/run left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isSuccess entered.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SCHEDULER.TASK] - Class/Method: SchedulerBaseTask/isSuccess left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SERVER] - Class/Method: SchedulerTaskLocater /removeLocalTask entered.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SERVER] - Class/Method: SchedulerTaskLocater /removeLocalTask left.
DEBUG,25 Apr 2011 10:40:00,102,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/updateStatusToInactive entered.
DEBUG,25 Apr 2011 10:40:00,104,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/updateStatusToInactive left.
DEBUG,25 Apr 2011 10:40:00,104,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/updateTaskHistory entered.
DEBUG,25 Apr 2011 10:40:00,106,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/updateTaskHistory left.
DEBUG,25 Apr 2011 10:40:00,106,[XELLERATE.SERVER] - Clearing Security Associations with thread executing Scheduled task
DEBUG,25 Apr 2011 10:40:00,106,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/run left.
DEBUG,25 Apr 2011 10:40:00,106,[XELLERATE.SERVER] - Class/Method: QuartzWrapper/execute left.
and I just wanted to ensure that my coding part is also fine.
Posting the code even:
tcDataProvider ioDatabase = new tcDataBaseClient();
tcEmailNotificationUtil sendMail = new tcEmailNotificationUtil(ioDatabase);
sendMail.setBody("Sample Message");
sendMail.setSubject("subject");
sendMail.setFromAddress("fromemailaddress");
sendMail.sendEmail("recepient");
Thanks in Advance. -
Error while sending email from ABAP
Hi
I am using function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send the email to an external id.
In the debugging mode i can see the function module is getting executed successfully i.e sy-surc value is 0.
But i am getting a sucess message i.e "No message sent".
Has anybody faced this kind of problem.Please let me know how to rectify this error
Thanks
DebrajHi Deb,
Have you done the relevant configuration in SCOT transaction to connect to a SMTP server and also as per note 455140???
Also this blog from Thomas Jung could help you...
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Cheers
JK -
Setting dynamic file name in Receiver file adapter - not from payload
Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
Please let me know if you remember this.
Thanks a lot,
Viktor Vargaalso u can check in
<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a> -
Setting Date value in File Name while scheduling report to File System
I am trying to set the file name as %SI_Name% Current Date.extension in Destination section while scheduling a crystal report to File system.
So in Use Specific Name section i have added %SI_NAME% %SI_STARTTIME%.%EXT%.
Schedule works fine for me and I get the document in the file location with name 'Title 2009-06-26-12-53-17.pdf".
But I dont want time to be printed in the title, so the title should be "Title 2009-06-26.pdf". How i can achieve this.
-RaghuIs there any way to achieve this?
-Raghu
Edited by: Raghavendra Barekere on Jul 5, 2009 3:09 PM -
How to retain file name while saving file on archive servers
Hi Experts,
I am using function modules:
ARCHIVOBJECT_CREATE_TABLE and ARCHIV_CONNECTION_INSERT for inserting a file to archive server and for linking it with a document.
Then I am reading the URL using FM: SCMS_AO_URL_READ. When I get this URL and download that file, the file name will be always defaulted to 'pclHTTP.dll'. I debugged these FMs to a certain extent and found that this name comes from CREP_HTTP-HTTP_SCRPT table.
Is there any way I can retain the file name while saving it so that when I read the URL it has correct file name in it?
Please help.
Regards,
Anand KolteHi Max,
In case when downloading one file it is fine. But if I want to download 10 files at once and later if I go to my downloads, every file will be having similar name. Unless we open the file, we cannot know what file it is.
Regards,
Anand
Maybe you are looking for
-
The screen shots include the web address for both shots. One is for script error messages that keep interrupting EVERY game. Then after I stop the scrip, Adobe Flash crashes, and I have no control. I have to use the Windows Task Manager to gain acces
-
Find Tax conditions and amounts while creating a PO from reference.
Hi friends, I am creating a PO from another reference PO. When I create the PO the Tax conditions and amounts come from Sabrix 3rd party system. This data gets saved into SAP internal memory and is visible when we follow PO item-> Invoice Tab->Taxes-
-
Any way to transfer songs from iPhone TO iTunes on MacBook Pro?
I'm an idiot. I'm just going to say that up front. I feel that's fair for all who venture here. I've had a terrible time with an update..and I wasn't able to get iTunes to acknowledge/recognize my iPhone or iPod once I ran and installed the current
-
Unable to create an instance of the Calendar Server after installation
After installing Calendar Server, I am unable to create an instance of the Calendar Server. Instead, I receive the following error: <P> Error: "Authentication Credentials could not be obtained from the Admin Server" Check the /users/unison/misc/uniso
-
G550 External Display VGA to TV HDMI?
My G550 only has a VGA out and no HDMI out. I want to play a movie on my laptop and be able to watch this on my TV. I have bought a VGA to HDMI cable but cant seem to get it to work. I set the TV to HDMI and press Fn + F3 to try and play via external