Send text file to spool
Hello Gurus,
I like to send a text file from the aplication server to spool or send this file to a specific printer.
What instructions do you know?
Thanks.
Joseph.
Hi,
I think the best way to send a text file from application server to the spool printer.
1. Download the file into a internal table
2. Use standard function modules to send the table to the spool printer
Regards
Similar Messages
-
Problem to send text file to mail from ALV report
Hi Friends,
I have a problem in my ALV report with text file. As per the requirment, when we execute the program then text attachment should go to the particual email.
When i am using file type as XLS i am getting attachment with all 4 recoreds( input for 4 records) in mail. But all 4 records are coming in SAME ROW. It should come 4 records in 4 rows. when I use file type as TXT and separated by pipe symble in code, it is showing only one recored for same above input.
When i use file type as XLS and click the attachment in email, it will triggire one popul with three options like SAVE, OPEN, CANCEL.
But when i click on text file attachment, it is directly showing ony one recored.
Please correct me on this.
my code is
PERFORM send_file_as_email_attachment
tables i_message
i_attach
using v_email
'User last log on details'
'XLS'
'User log on list'
changing v_error
v_reciever.
FORM send_file_as_email_attachment tables pi_message
pi_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: l_error TYPE sy-subrc,
l_reciever TYPE sy-subrc,
l_mtitle LIKE sodocchgi1-obj_descr,
l_email LIKE somlreci1-receiver,
l_format TYPE so_obj_tp ,
l_attdescription TYPE so_obj_nam ,
l_attfilename TYPE so_obj_des ,
l_sender_address LIKE soextreci1-receiver,
l_sender_address_type LIKE soextreci1-adr_typ,
l_receiver LIKE sy-subrc.
l_email = p_email.
l_mtitle = p_mtitle.
l_format = p_format.
l_attdescription = p_attdescription.
l_attfilename = p_filename.
l_sender_address = p_sender_address.
l_sender_address_type = p_sender_addres_type.
Fill the document data.
v_doc_data-doc_size = 1.
Populate the subject/generic message attributes
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle .
v_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR v_doc_data.
READ TABLE i_attach INDEX v_cnt.
v_doc_data-doc_size =
( v_cnt - 1 ) * 255 + STRLEN( i_attach ).
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle.
v_doc_data-sensitivty = 'F'.
CLEAR i_attachment.
REFRESH i_attachment.
i_attachment[] = pi_attach[].
Describe the body of the message
CLEAR i_packing_list.
REFRESH i_packing_list.
i_packing_list-transf_bin = space.
i_packing_list-head_start = 1.
i_packing_list-head_num = 0.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_message LINES i_packing_list-body_num.
i_packing_list-doc_type = 'RAW'.
APPEND i_packing_list.
Create attachment notification
i_packing_list-transf_bin = 'X'.
i_packing_list-head_start = 1.
i_packing_list-head_num = 1.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_attachment LINES i_packing_list-body_num.
i_packing_list-doc_type = l_format.
i_packing_list-obj_descr = l_attdescription.
i_packing_list-obj_name = l_attfilename.
i_packing_list-doc_size = i_packing_list-body_num * 255.
APPEND i_packing_list.
Add the recipients email address
CLEAR i_receivers.
REFRESH i_receivers.
i_receivers-receiver = l_email.
i_receivers-rec_type = 'U'.
i_receivers-com_type = 'INT'.
i_receivers-notif_del = 'X'.
i_receivers-notif_ndel = 'X'.
APPEND i_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = v_doc_data
put_in_outbox = 'X'
sender_address = l_sender_address
sender_address_type = l_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = v_sent_all
TABLES
packing_list = i_packing_list
contents_bin = i_attachment[]
contents_txt = i_message
receivers = i_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
l_error = sy-subrc.Hi,
declare the following constant in u r program and concatenate at the end of each and every record in your internal table.
CONSTANTS : LV_CRLF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
for eg.
if u internal table has values like
row1
row2
row3
concatenate the 1st record lv_crlf into first record.
conactenate second record lv_crlf into second record.
concatenate third record lv_crlf into third record.
now attach the internal table to the FM which u use for sending email. Each and every row will come in new line. The LV_CRLF will hold nothing but a line feed character (#).
Hope it will solve u r problem
Regards,
Rose. -
How to send text file as an email attachment havin more than 255 characters
My requirement is to generate a text file and to send this text file as E-mail attachment. I am using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send the E-mail. but here the limitation is the number of characters per line must not be more than 255 characters whereas in my case it is exceeding 1000 characters per line. could anyone please suggest me what should i do now ? Each field in the text file has to be tab delimited.
Simplest might well be to use javamail API instead of the two tags that Sites provides, e.g. see email - Sending mail attachment using Java - Stack Overflow for a full example.
Phil -
Use FTP Transport Protocol (XI) to send text file created from R3
I've configured a Port in IDoc Processing (WE21) to create an output file from a Bank Partner Profile (WE20) where my Message Type is PAYEXT and IDoc Type PEXR2002.
I need to take this Text File and send it to the Bank;s FTP site using the Integration Server (XI).
How can I take this text file and simply send it to the Bank without going through File Content Conversion in order to convert it to XML as the Sender and then uncovert it during the Receiver to FTP the file to the Bank?
If that is not possible, would anyone know how to configure the RecordSet Structure and parameters for both the Sender and Receiver?Hi,
Let me re-phrase your scenario:
ECC is required to send PAYEXT IDOC to XI which needs to be send to the bank in IDOC text file format to the bank. If this is the case we can achieve this by doing the following:
1.Rather than using TRFC port used by the IDOC as the method of communication, you can leverage using file port. The configurations to the file port are simple. You need to select a place where you can drop the IDOC file created by the ECC system and XI would pick up the file.
2. Poll for the file using NFS from that particular location where ECC drops the file. (If it is being staged on the ECC system, then XI service user SAPservice<SID> must have access permission on that folder like \usr\sap\put\interfaces.
3. Configure receiver FTP adapter to send the file to the bank.
Hope this helps.
Indranil
Award points if helpful -
How to copy/send text file from FTPS to SAP ECC File Port
Hi Frdns,
I am working on one design, actually my requirement as follows
I am receiving financial information document from Banks, which is in the form of BIA2 message format, it looks like text file. This information needs to be sending to SAP ECC system.
I identified some approaches to full fill the requirement
1)Using Conversion agent/or third party tools to convert BIA2 message in to XML, then using PI I will pick up the XML message, convert it in to IDoc.
2)Without any conversion I will copy the same file (original BIA2 message) in to SAP ECC file port, in this case no conversion required, calling some program I will schedule it.
I am looking forward t implement the second approach because it saves lot of money to my client.
Now I am wondering using File adapter can i copy to SAP ECC File Port or I required ABAP proxy?
What is the best approach to copy the BIA message text file from FTPS to SAP ECC File Port.??
Regards,
RajHi Raja,
>>Now I am wondering using File adapter can i copy to SAP ECC File Port or I required ABAP proxy?
Yes you can do this copy, the only restriction that can happen is the file size.. If you are sure that the fiel will be of few MB at the max then you can use the Configuration part alone and copy it to ECC folder. For doing this you need the following:
1. Sender agreement (mention the sender interface as anything XYZ)
2. Sender communication channel. Pick the file in binary mode
3. Receiver determination (keep both the sender and receiver service as same)
4. Interface Detemiantion (dont specify any mapping and keep the receiver interface name as XYZ)
5. Create receiver agreement (with same service and interface)
6. Use file adapter here
Regards
Suraj -
Sending text files as attachments in mails
Hi Experts,
I want to send some content in a text file as an attachment in the mail. Can anybody provide me the sample code for this.
points guaranteed.
thanks
sanakrHI
Check this one
first create a Include report with the following coding
*& Include ZPA1_INCLFOR_MAIL *
* Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
* FORM
FORM ml_customize USING objname objdesc.
*----------- Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
*--------- Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
* FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
* FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
* FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
*--------- Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
* COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
* Header Data
* Already Done Thru FM
* Main Text
* Already Done Thru FM
* Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
* Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
* Receiver List
* Already done thru fm
ENDFORM. "ml_prepare
* FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX = objhex
* OBJECT_PARA =
* object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
* FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
*-------------- Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
*------------- Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
* FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
*-------- Data
DATA : pos TYPE i.
DATA : len TYPE i.
*------------ Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
Then include that report in the following report and copy the same code and paste it there
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_inclfor_mail.
* DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
* SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
* AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
* START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
* FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
* CHECK_DOS_FORMAT =
IMPORTING
* DRIVE =
EXTENSION = extension
NAME = name
* NAME_WITH_EXT =
* PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
Regards
Pavan -
Hi All
I have this requirement
I have to read vendor data in sap , create a text file of this data in the daily basis and send the text file to a third party system.
I know how to read data and create the file , but how can I send this file to other third party system , actually it is an SQL server, which uses this file to update the vendor table.
Thank you.hi Malu,
If you want o put the File in Unix server..
us the commands FTP_COMMAND , FTP_CONNECT and place the file in the unix server.
of you want to place file in the Application server use open data set and close data set..
if you want to place file manually..
use t-code CZ3Y.
regards,
Prabhudas -
SENDING TEXT FILE AS AN ATTACHMENT
Hi,
I want to send an email as a TEXT file attachment.
Thanks
Vikranth Khimavathhi,
Use the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with an attachment. Here is the sample code.
FUNCTION Z_SEND_MAIL.
""Local interface:
*" IMPORTING
*" VALUE(MESSAGE) TYPE STRING OPTIONAL
*" VALUE(RECEIVER_MAIL) TYPE STRING OPTIONAL
*" VALUE(TO) TYPE STRING OPTIONAL
data for send function
DATA doc_data TYPE sodocchgi1.
DATA object_id TYPE soodk.
DATA objcont TYPE TABLE OF soli INITIAL SIZE 10.
DATA wa_objcont LIKE LINE OF objcont.
DATA receiver TYPE TABLE OF somlreci1 INITIAL SIZE 1.
DATA wa_receiver LIKE LINE OF receiver.
move message
TO doc_data-obj_descr .
This is the subject for your mail.
WRITE 'Sub:test Mail' TO doc_data-obj_descr.
This is the body of your mail.
concatenate ' Hi ' to into wa_objcont-line separated by space.
append wa_objcont to objcont.
wa_objcont-line = message.
append wa_objcont to objcont.
Specify receipent id.
MOVE: RECEIVER_MAIL TO wa_receiver-receiver,
'X' TO wa_receiver-express,
'U' TO wa_receiver-rec_type.
APPEND wa_receiver TO receiver.
Finally call the function module.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = doc_data
put_in_outbox = 'X' "Save Document in Outbox
COMMIT_WORK = 'X'
IMPORTING
new_object_id = object_id
TABLES
object_content = objcont
receivers = receiver
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.
SUBMIT rsconn01 USING SELECTION-SET 'SAP&CONNECTINT' AND RETURN.
ENDFUNCTION.
REPORT RSCONN01 MESSAGE-ID XS NO STANDARD PAGE HEADING.
INCLUDE <SYMBOL>. " 11.11.96
TYPE-POOLS: SX.
TYPE-POOLS: KKBLO.
PARAMETERS: MODE(3) TYPE C DEFAULT '*',
OUTPUT TYPE C DEFAULT ' '. "B20K072036 new parameter
selection-screen skip.
parameters maxjobs type sx_maxjobs default 1.
parameters rfcgroup type bdfields-rfcgr.
selection-screen skip.
parameters maxpsize type sx_maxpsize default 1000.
parameters minpsize type sx_minpsize default 20.
parameters maxsel type sx_maxqrows default 20000.
parameters timepo type sx_timepo default 2.
parameters timeout type sx_arfctimeout default 100.
parameters commit type sx_commit default 1.
data address_types type sx_addrtab.
data job_params type sxjobs.
data jobdata type sxjobdata.
--- initialization -
initialization.
get default parameters
call function 'SX_JOBDATA_GET'
changing
jobdata = jobdata.
give defaults to parameters
maxjobs = jobdata-maxjobs.
maxpsize = jobdata-maxpsize.
minpsize = jobdata-minpsize.
maxsel = jobdata-maxsel.
timepo = jobdata-timepo.
timeout = jobdata-arfc_timeout.
commit = jobdata-commit_after.
--- start-of-selection -
start-of-selection.
perform addr_type_to_table using mode
changing address_types.
job_params-maxjobs = maxjobs.
job_params-rfcgroup = rfcgroup.
job_params-maxpsize = maxpsize.
job_params-minpsize = minpsize.
job_params-maxsel = maxsel.
job_params-timepo = timepo.
job_params-arfc_timeout = timeout.
job_params-commit_after = commit.
call function 'SX_OBJECTS_SEND'
exporting
address_types = address_types
output = output
job_params = job_params
exceptions
others = 1.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
exit.
TABLES: SXADDRTYPE.
DATA: selection type SX_ADDRTAB,
NR_SO_OBJECTS TYPE I,
OBJ_CAT TYPE SX_OBJ_CAT OCCURS 20 WITH HEADER LINE.
if sy-batch = 'X'.
message I078 with 'RSCONN01' SY-HOST SY-MANDT.
endif.
*fill selection table
refresh selection.
if mode = '*'.
clear mode.
endif.
IF NOT ( MODE IS INITIAL ).
SELECT SINGLE * FROM SXADDRTYPE WHERE ADDR_TYPE EQ MODE.
IF SY-SUBRC NE 0.
IF OUTPUT EQ 'X'.
WRITE: MODE, TEXT-001, TEXT-002.
ENDIF.
EXIT.
ENDIF.
IF SXADDRTYPE-METHOD NE 'SAPCONNECT'.
IF OUTPUT EQ 'X'.
WRITE: MODE, TEXT-003, TEXT-004, TEXT-005.
ENDIF.
EXIT.
ENDIF.
append sxaddrtype-addr_type to selection.
ELSE.
select * from sxaddrtype
where method = 'SAPCONNECT'
and extern = sx_true.
case sxaddrtype-addr_type.
when 'INT' or 'FAX' or 'PAG' or
'PRT' or 'RML' or 'X40'.
append sxaddrtype-addr_type to selection.
endcase.
endselect.
ENDIF.
CALL FUNCTION 'SX_OBJECTS_SEND'
EXPORTING
ADDRESS_TYPES = SELECTION
IMPORTING
NR_SO_OBJECTS = NR_SO_OBJECTS
TABLES
OBJ_CAT = OBJ_CAT
EXCEPTIONS
INTERNAL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
IF OUTPUT EQ 'X'.
Always write out this error message:
WRITE: TEXT-006, SY-SUBRC.
ENDIF.
EXIT.
ENDIF.
IF NR_SO_OBJECTS = 0.
IF OUTPUT EQ 'X'.
WRITE: TEXT-007.
ENDIF.
EXIT.
ENDIF.
IF OUTPUT EQ 'X'.
PERFORM DISPLAY_OBJECT_CATALOGUE.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MODE.
PERFORM F_SHOW_ADDR_TYPES CHANGING MODE.
AT SELECTION-SCREEN ON HELP-REQUEST FOR OUTPUT.
PERFORM F_HELP_OUTPUT.
*& Form addr_type_to_table
text
form addr_type_to_table using address_type type sx_addrtyp
changing address_types type sx_addrtab.
data adrtp_wa type sxaddrtype.
data adrtp type sx_addrtyp.
if address_type <> '*'.
adrtp = address_type.
endif.
if not adrtp is initial.
select single * from sxaddrtype into adrtp_wa
where addr_type = adrtp.
if sy-subrc <> 0.
message i009 with adrtp.
exit.
endif.
if adrtp_wa-method ne 'SAPCONNECT'.
message i027 with adrtp.
exit.
endif.
append adrtp_wa-addr_type to address_types.
else.
select * from sxaddrtype into adrtp_wa
where method = 'SAPCONNECT'
and extern = sx_true.
case adrtp_wa-addr_type.
when 'INT' or 'FAX' or 'PAG' or
'PRT' or 'RML' or 'X40'.
append adrtp_wa-addr_type to address_types.
endcase.
endselect.
endif.
endform. " addr_type_to_table
*& Form DISPLAY_OBJECT_CATALOGUE
Anzeige der Liste der zum Versenden selektierten Objekte
--> p1 text
<-- p2 text
FORM DISPLAY_OBJECT_CATALOGUE.
DATA: FIELD_LST TYPE KKBLO_T_FIELDCAT.
DATA: FIELD_CAT TYPE KKBLO_FIELDCAT.
DATA: IS_LAYOUT TYPE KKBLO_LAYOUT.
IS_LAYOUT-NO_ZEBRA = 'X'.
FIELD_CAT-REF_TABNAME = 'SXOBJCAT'.
FIELD_CAT-NO_SUM = 'X'.
FIELD_CAT-JUST = 'L'.
FIELD_CAT-OUTPUTLEN = 3.
FIELD_CAT-REPTEXT = 'Trc'.
FIELD_CAT-FIELDNAME = 'DISPL_TRC'.
FIELD_CAT-HOTSPOT = 'X'.
FIELD_CAT-SYMBOL = 'X'.
APPEND FIELD_CAT TO FIELD_LST.
FIELD_CAT-SYMBOL = ' '.
FIELD_CAT-OUTPUTLEN = 0.
FIELD_CAT-HOTSPOT = ' '.
FIELD_CAT-REPTEXT = ' '.
CLEAR: FIELD_CAT-NO_ZERO, FIELD_CAT-KEY .
FIELD_CAT-FIELDNAME = 'ID'. APPEND FIELD_CAT TO FIELD_LST.
FIELD_CAT-FIELDNAME = 'TITLE'. APPEND FIELD_CAT TO FIELD_LST.
FIELD_CAT-FIELDNAME = 'TYPE'. APPEND FIELD_CAT TO FIELD_LST.
FIELD_CAT-FIELDNAME = 'NR_RECIP'. APPEND FIELD_CAT TO FIELD_LST.
LOOP AT FIELD_LST INTO FIELD_CAT.
FIELD_CAT-COL_POS = SY-TABIX.
MODIFY FIELD_LST FROM FIELD_CAT.
ENDLOOP.
LOOP AT OBJ_CAT.
OBJ_CAT-DISPL_TRC = SYM_PENCIL.
MODIFY OBJ_CAT.
ENDLOOP.
CALL FUNCTION 'K_KKB_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'RSCONN01'
I_CALLBACK_USER_COMMAND = 'CB_OL_UCOMM'
I_CALLBACK_TOP_OF_PAGE = 'CB_OL_TOP'
I_CALLBACK_PF_STATUS_SET = 'CB_OL_PFSTATUS'
I_TABNAME = 'OBJ_CAT'
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = FIELD_LST
TABLES
T_OUTTAB = OBJ_CAT
EXCEPTIONS
OTHERS = 1.
ENDFORM. " DISPLAY_OBJECT_CATALOGUE
*& Form CB_OL_PFSTATUS
Callback Funktion (wird aus Listtool heraus gerufen) *
--> p1 text
<-- p2 text
FORM CB_OL_PFSTATUS
USING EXTAB TYPE KKBLO_T_EXTAB.
SET PF-STATUS 'CATALOG' EXCLUDING EXTAB.
SET TITLEBAR 'CAT'.
ENDFORM. " CB_OL_PFSTATUS
*& Form CB_OL_TOP
Callback Funktion (wird aus Listtool heraus gerufen) *
--> p1 text
<-- p2 text
FORM CB_OL_TOP.
ENDFORM. " CB_OL_TOP
*& Form CB_OL_UCOMM
text *
--> p1 text
<-- p2 text
FORM CB_OL_UCOMM
USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE KKBLO_SELFIELD.
DATA: NUMC5(5) TYPE N.
NUMC5 = SELFIELD-TABINDEX.
CASE UCOMM.
WHEN 'PIC1'.
CASE SELFIELD-SEL_TAB_FIELD.
WHEN 'OBJ_CAT-DISPL_TRC' OR 'OBJ_CAT-TITLE' OR 'OBJ_CAT-ID'.
READ TABLE OBJ_CAT INDEX SELFIELD-TABINDEX.
IF SY-SUBRC NE 0.
MESSAGE E042.
ENDIF.
SUBMIT RSWTTR01
WITH P_TYPE = 'D'
WITH P_UNAME = SPACE
WITH P_OBJ = OBJ_CAT-ID AND RETURN.
WHEN OTHERS.
MESSAGE I041 WITH NUMC5 SELFIELD-SEL_TAB_FIELD UCOMM.
ENDCASE.
WHEN OTHERS.
MESSAGE I041 WITH NUMC5 SELFIELD-SEL_TAB_FIELD UCOMM.
ENDCASE.
ENDFORM. " CB_OL_UCOMM
*& Form F_SHOW_ADDR_TYPES
text
<--P_MODE text *
FORM F_SHOW_ADDR_TYPES CHANGING A_TYPE.
DATA: HELP_INFO LIKE HELP_INFO
, sel_value like help_info-fldvalue
, CUCOL LIKE SY-CUCOL
, CUROW LIKE SY-CUROW
, value like help_info-fldvalue value 'SE38'
, IND LIKE SY-INDEX
, C_SY_SUBRC(3) TYPE C
DATA: BEGIN OF FIELDS OCCURS 5.
INCLUDE STRUCTURE HELP_VALUE.
DATA: END OF FIELDS.
DATA: BEGIN OF LIST_OF_FIELDS OCCURS 5,
NAME(21) TYPE C.
DATA: END OF LIST_OF_FIELDS.
DATA: BEGIN OF FULL_LIST OCCURS 5,
ADDRESS_TYPE LIKE SXADDRTYPE-ADDR_TYPE,
END OF FULL_LIST.
REFRESH FIELDS.
REFRESH LIST_OF_FIELDS.
REFRESH FULL_LIST.
HELP_INFO-TABNAME = 'SXADDRTYPE'.
HELP_INFO-FIELDNAME = 'ADDR_TYPE'.
SELECT * FROM SXADDRTYPE.
IF SXADDRTYPE-METHOD NE 'SAPCONNECT'
OR SXADDRTYPE-EXTERN NE SX_TRUE.
CONTINUE.
ENDIF.
MOVE SXADDRTYPE-ADDR_TYPE TO FULL_LIST-ADDRESS_TYPE.
APPEND FULL_LIST.
ENDSELECT.
MOVE '*' TO FULL_LIST-ADDRESS_TYPE.
APPEND FULL_LIST.
LIST_OF_FIELDS-NAME = 'SXADDRTYPE-ADDR_TYPE'.
APPEND LIST_OF_FIELDS.
CALL FUNCTION 'TRANSFER_NAMES_TO_FIELDS'
EXPORTING
SELECTFIELD = HELP_INFO-FIELDNAME
TABLES
FIELDS = FIELDS
NAMELIST = LIST_OF_FIELDS
EXCEPTIONS
WRONG_FORMAT_GIVEN = 1
OTHERS = 2.
CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
EXPORTING
DISPLAY = ' '
FIELDNAME = HELP_INFO-FIELDNAME
TABNAME = HELP_INFO-TABNAME
GIVEN_VALUE = HELP_INFO-FLDVALUE
TITEL = TEXT-002
IMPORTING
SELECT_VALUE = HELP_INFO-FLDVALUE
SELECT_INDEX = IND
TABLES
FIELDS = FIELDS
VALUETAB = FULL_LIST
EXCEPTIONS
FIELD_NOT_IN_DDIC = 1
MORE_THEN_ONE_SELECTFIELD = 2
NO_SELECTFIELD = 3
OTHERS = 4.
C_SY_SUBRC = SY-SUBRC.
CASE SY-SUBRC.
WHEN '0'.
READ TABLE FULL_LIST INTO A_TYPE INDEX IND.
WHEN OTHERS.
MESSAGE E022 WITH C_SY_SUBRC.
ENDCASE.
ENDFORM. " F_SHOW_ADDR_TYPES
*& Form F_HELP_OUTPUT
text
--> p1 text
<-- p2 text
FORM F_HELP_OUTPUT.
DATA: CANCELLED TYPE C,
C_SY_SUBRC(8) TYPE C.
CALL FUNCTION 'POPUP_DISPLAY_TEXT'
EXPORTING
LANGUAGE = SY-LANGU
POPUP_TITLE = 'SAPconnect'
TEXT_OBJECT = 'RSCONN01_F1_OUTPUT_40B'
IMPORTING
CANCELLED = CANCELLED
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
C_SY_SUBRC = SY-SUBRC.
IF SY-SUBRC NE 0.
MESSAGE E035 WITH C_SY_SUBRC. leads to dump !
ENDIF.
ENDFORM. " F_HELP_OUTPUT
Regards,
Richa -
Sending Text File through Mail Adapter
Hi Group,
I need to send my Target as Mail attachment in the Text File?Can any body SuggestHi swabap,
You need to use PayloadSwapBean module in the Mail receiver adapter. This module will send the payload as an attchment to the mail server.
Check the following link
<a href="/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure:///people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
Regards,
Akshay -
hi
i've trying to send a text file via rs-232 but no success
The file contains a code for a device im dealing with, when i send the text file with labview to the device, it went ok with no errors, but when i connect the device on hyperterminal and check if the code was loaded it was not.
can you please give some clues to deal with this?
thanks a lot
attached example text file and LV code
Attachments:
Serial.JPG 45 KB
DefineHome.txt 1 KBSome devices are very picky with the End Of Line. You might want to right-click on your FIle Read and deselect the "Convert EOL".
Or if you need to write 1 line at a time, right click on the Read Text File and select "Read Lines". Set the number of line to read to -1 (read all) and then wire the resulting array into a FOR loop where you do the VISA Write.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Hi experts,
I developed a custom program to send a text file using BCS. When I open text file using text pad, some special characters are displaying at the beginning of the sentence.
ÿþ are displayed at the beginning of the sentence. How can I remove this?
Thanks,
MarcHi,
Related BCS class, Check these example programs how attachments are being generated.
BCS_EXAMPLE_1
BCS_EXAMPLE_2
BCS_EXAMPLE_3
BCS_EXAMPLE_4
BCS_EXAMPLE_5 - BCS Use, Example 5 (Winword Attachment)
BCS_EXAMPLE_6 - Send PDF Form by E-Mail
BCS_EXAMPLE_7 - BCS: Send E-Mail with Self-Created Excel Attachment (Example)
Thanks
Venkat.O -
Is it possible to send text file with class cl_bcs
Hi,
i want to send a text file with class
cl_bcs but i dont know it is possible or not?
Thanks.no, it isn´
-
How to generate text file using spool command
How can I use a SPOOL command with DBMS_OUTPUT.PUT_LINE with PL/SQL to produce text file on oracle client machine.
You could try using a REF CURSOR as an alternative. Bare bones example listed below:
--- SQL Script
SET FEEDBACK OFF
COLUMN first_name FORMAT A25
COLUMN last_name FORMAT A25
VARIABLE example_data REFCURSOR
BEGIN
example.get_data(:example_data);
END;
SPOOL example_data.txt
PRINT example_data
SPOOL OFF
-----Output in example_data.txt
FIRST_NAME LAST_NAME
First Name 1 Last Name 1
First Name 2 Last Name 2
First Name 3 Last Name 3
First Name 4 Last Name 4
First Name 5 Last Name 5
First Name 6 Last Name 6
First Name 7 Last Name 7
First Name 8 Last Name 8
First Name 9 Last Name 9
First Name 10 Last Name 10
-----Example package used in SQL Script
CREATE OR REPLACE PACKAGE example
IS
TYPE result_set IS REF CURSOR;
PROCEDURE get_data
p_result_set OUT result_set
END;
SHOW ERRORS
CREATE OR REPLACE PACKAGE BODY example
IS
PROCEDURE get_data
p_result_set OUT result_set
IS
BEGIN
-- replace this with your query
OPEN p_result_set FOR
WITH fake_data AS (
SELECT
'First Name ' || level first_name,
'Last Name ' || level last_name
FROM DUAL
CONNECT BY LEVEL <= 10
SELECT *
FROM fake_data
END;
END;
SHOW ERRORS
SPOOL OFF -
Utility to send text file over GPIB, one line at a time?
We are developing instrumentation that receives data and commmands over GPIB as plain text, and returns them as well. I'd like to create GPIB "batch" files and send them over the bus, one line at a time, so I can debug the instruments' behavior. I'd also like to be able to read back responses, one line at a time.
Is there such a utility? I've got our programmer working on something like this, but I'd hate to have him re-invent an existing wheel.
Thanks!Apart from NI-SPY, I have not heard of such a utility. This may be simple to implement using proper termination. If the instrument is capable of sending line feeds or carriage return, you should be able to easily create a document. Also, using IBWRTF, you could write the ASCII file (containing the termination characters) to the bus. Depending on how you have your timeouts specified, this may be ideal.
Alternately, if you read a static amount of data, you could IBRD chunks of data. the result may need editing for broken words at the end of a line but would achieve such a result.
Ryan Mosley
National Instruments, Applications Engineer
http://www.ni.com/exchange -
Send text file as an attachment
Hi All,
We have a requirement wherein we need to send the contents of an
internal table in a text pipe delimited file as an attachment in to an
external mail id.
The problem is that the total record length of the internal table is
around 450 char while the structure SOLI accepts only 255 char.
This causes the record to be split into 2 lines.
Is it possible to send the entire 450 char in one line? If yes, how can
this be done?
Thanks,
fractalI think u shd use this FM for line width change:-
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
LINE_WIDTH_SRC = 134 "ur source width
LINE_WIDTH_DST = 255
TRANSFER_BIN = ' '
TABLES
CONTENT_IN = GT_PDF "ur itab name
CONTENT_OUT = LT_ATT
EXCEPTIONS
ERR_LINE_WIDTH_SRC_TOO_LONG = 1
ERR_LINE_WIDTH_DST_TOO_LONG = 2
ERR_CONV_FAILED = 3
OTHERS = 4
Maybe you are looking for
-
Use of a stored procedure in a select statement submitted to cx_oracle
Hi, I am developping under python and I'm using the cx_oracle interface. I've written a stored procedure that I've tested directly under sqlplus session : it's ok. I've also tested this stored procedure from python by using callproc routine : its als
-
Error while creating PO from bid inviation?
Hello Experts, 1) We are using SRM 5.0 version. I accepted the bid after that i have clicked on "Generate Pucrchase order". we are getting error " 3700000340 E MEPO 028 No movement type can be usd for this item 4643513A094741B6000000000A402D38R1232
-
Why is my ipod touch saying "backup corrupt or not compatible" error message?
My iPod touch has been fine for years and I only really add new music sporadically. Now I am getting an error message saying that it cannot back up my iPod because it is corrupt or not compatible with the iPod. I have already done a factory reset and
-
ITunes opens with a dialog about registry settings
Every time I open iTunes, I get a dialog saying that the CD registry settings have been modified, and that a reinstall is needed. After reinstalling, I still get the same popup box at startup. XP SP3 Core 2 Duo (2 @ 1.86 GHz) 2GB RAM
-
How can I resolve error code U44M1P2003
When attempting to update to PS Elements 12.1, it downloads but upon installation I get error code U44M1P2003 and asked that I contact Customer Support. But have you tried contacting Customer Support? What a joke. All I get directed to us this for