PO Output - Simple Mail.
Hi,
I configured new PO output type for simple mail. I cannot get the output type to default onto the PO. In the determination analysis screen within the PO messages screen, it finds the condition record, but also has another error:
Message 539: No partner was found for Partner function MP
I assume this is the reason why the output is not defaulting. How do i resolve this such that the output type defaults?
Cheers,
Hi,
Please check customising, Check your setting for partner role MP
in partner schema
IMG .> MM > Purchasing > Partner Determination
> Partner Settings in Purchasing documents
> Define Partner Schemas
Check your settings for partner role MP in partner schema XXXX:
- no change
- mandatory
- end
- higherLvl
The recommended settings for these four parameters are yes/yes/no/yes.
Kind regards,
Lorraine
Similar Messages
-
PO Output: Medim 7 (Simple Mail)
Hi all,
Has anyone come across with PO output with medium 7 (Simple Mail)?
Any idea of how to configure it in the system?
Thanks.
TomHi Tom,
Basically there are two mail types: Internet mail (external mail) and
SAPOffice mail.
Mail is sent via the output determination in both cases.
If you use the external mail, the message for the purchasing document is
converted into a corresponding text file which is sent to the vendor via
the Internet.
SAPOffice mail is sent only within the R/3 System and has mainly the
function of providing information.
In particular, it is not possible to attach a message (form) for a
purchasing document to a SAPOffice mail.
When using external mail, the following basic settings are required:
1. You must maintain an e-mail address in the address in the vendor
master.
2. The same applies to your own user master. You also have to specify
an e-mail address there in order to identify the sender.
o Note that it is not possible to change the e-mail address of the
vendor via the SAP purchase order transaction (ME21N, ME22N, and
so on).
o You can only make a permanent change using the vendor master
transactions XK02 or MK02.
o You can use a temporary email address in Transaction ME21N.
3. For the output type for default values, a communication strategy
needs to be maintained in the Customizing that supports the e-mail.
You can find the definition of the communication strategy in the
Customizing via the following path: (SPRO -> IMG -> SAP Web
Application Server -> Basic Services -> Message Control -> Define
Communication Strategy). As a default, communication strategy CS01
is delivered. This already contains the necessary entry for the
external communication. Bear in mind that without a suitable
communication strategy it is not possible to communicate with a
partner via Medium 5 (external sending).
4. Use the standard SAP environment (program 'SAPFM06P', FORM routine
'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
5. In the condition records for the output type (for example,
Transaction MN04), use medium '5' (External send).
6. You can use Transaction SCOT to trigger the output manually. The
prerequisite for a correct sending is that the node is set
correctly. This is not described here, but it must have already been
carried out.
7. To be able to display, for example, the e-mail in Outlook, enter PDF
as the format in the node.
To use the SAPOffice mail, the following basic settings are required:
1. For the output type for default values, a communication strategy
needs to be maintained in the Customizing that supports the e-mail.
You can branch to the maintenance of the communication strategy via
the input help.
2. Use the SAP standard environment (program "RSNASTSO" and FORM
routine "SAPOFFICE_AUFRUF") as the processing routines.
3. In the condition records for the output type (for example,
Transaction MN04), use medium '7' (SAPOffice) and also partner role
'MP' (mail partner).
- Sanjeev -
Output thro simple mail concept
Hi
My requirement is sending invoice output to customer. I have option of sending thro' external send(5). But i am looking to use simple mail(5) concept. Can i use this. If i can use what is the program i need mentioned in the nace and also can i use smart form.
i had checked with my programmer, he had stdprogram RSNASTSO and form routine SAPOFFICE_AUFRUF_VX which is used to mail to SAP inbox , he tried to modify this program based on our requirement and add the smartform to it. we got the mail but the information in smartform did not come in the mail i.e program is not accessing the information.
Please let me know your input.
Thanks
sriramHi,
Try the below code.
REPORT z_sd_multi_cust_mail.
TABLES:nast,kna1,vbak.
DATA : v_vbeln LIKE vbak-vbeln,
v_ucomm LIKE sy-ucomm,
v_form_name TYPE rs38l_fnam.
START-OF-SELECTION.
*& Form entry
text
-->RETURN_CODE text
-->US_SCREEN text
FORM entry USING return_code us_screen.
CLEAR return_code.
CLEAR:v_vbeln,v_form_name.
v_vbeln = nast-objky.
v_ucomm = 'PRNT'.
IF v_ucomm = 'PRNT' ."For Mail sending
CALL FUNCTION 'Z_QUOTATION_MAIL_SEND'
EXPORTING
vbeln = nast-objky.
ENDIF.
CLEAR:v_ucomm.
ENDFORM. "entry
In FM 'Z_QUOTATION_MAIL_SEND'
FUNCTION Z_QUOTATION_MAIL_SEND.
""Local Interface:
*" IMPORTING
*" REFERENCE(VBELN) TYPE NAST-OBJKY
Importing Parameter is
VBELN TYPE NAST-OBJKY
TABLES: nast,
kna1,
vbak.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*---Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
*---Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string, "To convert from 132 to 255
*--- Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i,
v_vbeln TYPE vbak-vbeln.
DATA:BEGIN OF i_adr6 OCCURS 0,
addrnumber LIKE adr6-addrnumber,
consnumber LIKE adr6-consnumber,
smtp_addr LIKE adr6-smtp_addr,
END OF i_adr6.
v_vbeln = vbeln.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SD_SSF_QUOTATION'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name "'/1BCDWB/SF00000093'
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
p_vbeln = v_vbeln
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
LOOP AT i_tline.
TRANSLATE i_tline USING '~'.
CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
*---Attachment
REFRESH:i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = i_record[].
*---Create Message Body Title and Description
i_objtxt = 'PDF-Attachment Of Quotation!'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
DATA: v_str1 TYPE char12,
v_str2 TYPE char50.
CONCATENATE 'Quotation' '-' v_vbeln INTO v_str2 SEPARATED BY space.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = v_str2.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
*---Main Text
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
*---Attachment (pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'Quotation'.
APPEND i_objpack.
SELECT SINGLE * FROM vbak WHERE vbeln = v_vbeln.
SELECT SINGLE * FROM kna1 WHERE kunnr = vbak-kunnr.
*---Getting the Multiple MAIL ID'S in this Vendor
SELECT addrnumber
consnumber
smtp_addr
FROM adr6 INTO TABLE i_adr6
WHERE addrnumber = kna1-adrnr
AND flg_nouse = space.
*---Adding the Multiple mail id into Receiptant list
LOOP AT i_adr6.
i_reclist-receiver = i_adr6-smtp_addr.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
CLEAR: i_reclist,i_adr6.
ENDLOOP.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_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.
ENDFUNCTION. -
I have to send the sales order output via mail to a customer
have to send the sales order output via mail to a customer, what steps i have to follow
kindly guide me.
regards
satyaHello,
You need to carru out your output configuration for this.
Use tcode, NACE where you can do this centrally.
Select V1 & click on output types above
Select output type MAIL for your requirement & use tranmission medium as simple mail.
After configuring your MP mail partner functions & use of proper output program you will be able to send mail to your party.
Hope this is helpful to you.
Regards,
Dhananjay -
Hi,
I am testing the simple mail functionality in transaction VA01.
In customizing (output determination processing routines) for simple mail is being used a program and a smartform. It was not me who developed them.
The problem is that when I try to test this through VA01 (I choose simple mail, etc), I get a dump saying: Invalid commit work in an update function module. Termination occurred in the ABAP program SAPLSOI1 in SO_DOCUMENT_SEND_API1. The main program was RSM13000.
My problem now is how can I try to debug this when I am in transaction VA02? I am not able to execute the program I have in customizing
How can I found more information about this?
Thanks a lotWeird..
I am working with SAP ECC 6.0 - release 700
In version history no one has modified the program...
function so_document_send_api1.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(DOCUMENT_DATA) LIKE SODOCCHGI1 STRUCTURE SODOCCHGI1
*" VALUE(PUT_IN_OUTBOX) LIKE SONV-FLAG DEFAULT SPACE
*" VALUE(SENDER_ADDRESS) LIKE SOEXTRECI1-RECEIVER DEFAULT SY-UNAME
*" VALUE(SENDER_ADDRESS_TYPE) LIKE SOEXTRECI1-ADR_TYP DEFAULT 'B'
*" VALUE(COMMIT_WORK) LIKE SONV-FLAG DEFAULT SPACE
*" EXPORTING
*" VALUE(SENT_TO_ALL) LIKE SONV-FLAG
*" VALUE(NEW_OBJECT_ID) LIKE SOFOLENTI1-OBJECT_ID
*" VALUE(SENDER_ID) LIKE SOUDK STRUCTURE SOUDK
*" TABLES
*" PACKING_LIST STRUCTURE SOPCKLSTI1
*" OBJECT_HEADER STRUCTURE SOLISTI1 OPTIONAL
*" CONTENTS_BIN STRUCTURE SOLISTI1 OPTIONAL
*" CONTENTS_TXT STRUCTURE SOLISTI1 OPTIONAL
*" CONTENTS_HEX STRUCTURE SOLIX OPTIONAL
*" OBJECT_PARA STRUCTURE SOPARAI1 OPTIONAL
*" OBJECT_PARB STRUCTURE SOPARBI1 OPTIONAL
*" RECEIVERS STRUCTURE SOMLRECI1
*" EXCEPTIONS
*" TOO_MANY_RECEIVERS
*" DOCUMENT_NOT_SENT
*" DOCUMENT_TYPE_NOT_EXIST
*" OPERATION_NO_AUTHORIZATION
*" PARAMETER_ERROR
*" X_ERROR
*" ENQUEUE_ERROR
data begin of object_hd_change.
include structure sood1.
data end of object_hd_change.
data begin of attach_hd_change.
include structure sood1.
data end of attach_hd_change.
data begin of object_data.
include structure soodd.
data end of object_data.
data begin of objhead occurs 1.
include structure soli.
data end of objhead.
data begin of objcont occurs 100.
include structure soli.
data end of objcont.
data begin of atthead_tab occurs 1.
include structure soli.
data end of atthead_tab.
data begin of attcont_tab occurs 10.
include structure soli.
data end of attcont_tab.
data begin of atthead occurs 1.
include structure soli.
data end of atthead.
data begin of attcont occurs 10.
include structure soli.
data end of attcont.
data begin of new_pack_list occurs 10.
include structure soxpl.
data end of new_pack_list.
data begin of rec_table occurs 10.
include structure soos1.
data end of rec_table.
data begin of object_fl_change.
include structure sofm1.
data end of object_fl_change.
data rcode like sonv-rcode.
data object_type like sood-objtp.
data object_id_new like soodk.
data file_format(3).
data: originator like soos1-recextnam,
originator_type like soos1-recesc.
data: hex_size like sy-tabix.
data: old_object like swotobjid,
* sh070900 5.0A reconvert R30 into OBJ Docs is possible.
sood_id like soodk.
data: old_folder_id like soodk,
old_object_id like soodk,
old_forwarder like soud-usrnam,
old_object_data like sood2.
data hex_mode type sonv-flag value space.
data dummy_hex type solix_tab.
**data i.
**if sy-uname = ''
while i ne 1.
endwhile.
**endif.
describe table contents_bin lines hex_size.
if hex_size gt 0.
call function 'SO_CONVERT_CONTENTS_BIN'
exporting
it_contents_bin = contents_bin[]
importing
et_contents_bin = contents_bin[].
data l_new_size type i.
data l_line_size type i.
data l_new_doc_size type i.
describe table contents_bin lines l_new_size.
if l_new_size <> hex_size.
describe field contents_bin-line length l_line_size in character mode.
loop at packing_list where transf_bin = on.
packing_list-body_start = packing_list-body_start * 2 - 1.
packing_list-body_num = packing_list-body_num * 2.
l_new_doc_size = packing_list-body_num * l_line_size / 2.
if packing_list-doc_size <= l_new_doc_size.
packing_list-doc_size = l_new_doc_size * 2.
endif.
modify packing_list.
endloop.
endif.
endif.
describe table contents_hex lines hex_size.
if hex_size gt 0.
refresh contents_bin.
MOVE CONTENTS_HEX[] TO CONTENTS_BIN[].
hex_to_cont contents_hex contents_bin.
endif.
* transfer document data
perform transfer_objdat_to_obj using document_data
object_hd_change
object_fl_change.
perform set_default_object_data using object_hd_change.
* read object out of table
* take API1, so no receiver conversion is necessary here
read table packing_list index 1. "first object is document
if sy-subrc ne ok. "no packing list
raise parameter_error.
endif.
perform read_object_out_of_tables tables object_header
contents_txt
contents_bin
objhead
objcont
using packing_list
object_data
rcode.
* parameters for tracing
LOOP AT OBJHEAD.
PERFORM TRACE(RSSOEXTR) USING 'OBJHEAD' OBJHEAD-LINE.
ENDLOOP.
if rcode ne ok. "no object found
raise parameter_error.
endif.
* out of object data use only extern content flag and perhaps the size
move object_data-extct to object_hd_change-extct.
if object_hd_change-objlen = 0 or
object_hd_change-objlen is initial.
move object_data-objlen to object_hd_change-objlen.
endif.
perform format_prepare_for_insert in program sapfssoa "873845
using packing_list-transf_bin
dummy_hex
changing objhead[]
objcont[]
packing_list-doc_type
object_hd_change-file_ext
rcode.
move packing_list-doc_type to object_type.
* for old types move size to header
perform size_to_header tables objhead
using object_type
document_data-doc_size.
get now all attachments, decreibed in packing list
refresh new_pack_list.
refresh atthead_tab.
refresh attcont_tab.
loop at packing_list from 2.
clear new_pack_list.
perform read_object_out_of_tables tables object_header
contents_txt
contents_bin
atthead
attcont
using packing_list
object_data
rcode.
check rcode = ok.
* sh240899 46C check for executable mail attachment (MAPI)
if packing_list-doc_type = 'R3O'.
read table attcont index 21 into old_object.
if old_object-objtype = 'SOFM'.
read table attcont index 22.
if attcont = 'PROCESS'.
* it's an attachment created by MAPI because of an executable
* mail
* read old mail and fill new one with process parameters
move: old_object-objkey(17) to old_folder_id,
old_object-objkey+17(17) to old_object_id,
old_object-objkey+34(12) to old_forwarder.
call function 'SO_OBJECT_READ'
exporting
folder_id = old_folder_id
forwarder = old_forwarder
object_id = old_object_id
importing
object_hd_display = old_object_data
tables
objpara = object_para
objparb = object_parb
exceptions
folder_not_exist = 4
folder_no_authorization = 5
object_not_exist = 6
object_no_authorization = 7
operation_no_authorization = 8
owner_not_exist = 9
parameter_error = 10
others = 15.
if sy-subrc = 0.
move: old_object_data-vmtyp to object_hd_change-vmtyp,
old_object_data-skips to object_hd_change-skips,
old_object_data-acnam to object_hd_change-acnam,
old_object_data-acmem to object_hd_change-acmem.
endif.
continue.
elseif attcont = 'DISPLAYATTACHMENT'.
* sh070900 5.0A reconvert R30 into OBJ Docs is possible.
* get object instance and method into attachment body
refresh: attcont, atthead.
move old_object-objkey+17(17) to sood_id.
perform socx_select(sapfsso0) tables atthead
attcont
object_para
object_parb
using sood_id
hex_mode
rcode.
move atthead[] to attcont[].
* fill new packing list parameter
describe table atthead lines packing_list-head_num.
describe table attcont lines packing_list-body_num.
packing_list-doc_size = '255'.
packing_list-doc_type = obj.
endif.
endif.
endif.
move-corresponding packing_list to new_pack_list.
move: packing_list-obj_descr to new_pack_list-objdes,
packing_list-obj_name to new_pack_list-objnam,
packing_list-doc_size to new_pack_list-objlen,
packing_list-obj_langu to new_pack_list-objla,
packing_list-mess_type to new_pack_list-extct,
packing_list-doc_type to new_pack_list-objtp,
packing_list-transf_bin to new_pack_list-transf_bin."873845
describe table atthead_tab lines new_pack_list-head_start.
add 1 to new_pack_list-head_start.
describe table attcont_tab lines new_pack_list-body_start.
add 1 to new_pack_list-body_start.
perform format_prepare_for_insert in program sapfssoa "873845
using packing_list-transf_bin
dummy_hex
changing atthead[]
attcont[]
new_pack_list-objtp
new_pack_list-file_ext
rcode.
get new sizes (also for attcont, someone forgot this...)
describe table atthead lines new_pack_list-head_num.
describe table attcont lines new_pack_list-body_num.
loop at atthead.
clear atthead_tab.
move atthead to atthead_tab.
append atthead_tab.
endloop.
loop at attcont.
clear attcont_tab.
move attcont to attcont_tab.
append attcont_tab.
endloop.
append new_pack_list.
endloop.
* transfer receiver data
perform transfer_rec_to_tab tables receivers
rec_table.
* sender in right format
move sender_address to originator.
perform convert_sndart_esc using sender_address_type
originator_type.
call function 'SO_OBJECT_SEND'
exporting
EXTERN_ADDRESS = ' '
FOLDER_ID = ' '
FORWARDER = ' '
object_fl_change = object_fl_change
object_hd_change = object_hd_change
OBJECT_ID = ' '
object_type = object_type
outbox_flag = put_in_outbox
originator = originator
originator_type = originator_type
OWNER = ' '
STORE_FLAG = ' '
importing
object_id_new = object_id_new
sent_to_all = sent_to_all
originator_id = sender_id
tables
objcont = objcont
objhead = objhead
objpara = object_para
objparb = object_parb
packing_list = new_pack_list
att_head = atthead_tab
att_cont = attcont_tab
receivers = rec_table
exceptions
object_not_sent = 15
object_type_not_exist = 17
operation_no_authorization = 21
parameter_error = 23
too_much_receivers = 73
others = 1000.
case sy-subrc.
when ok.
move object_id_new to new_object_id.
when object_not_sent.
perform transfer_tab_to_rec tables rec_table
receivers.
raise document_not_sent.
when too_much_receivers.
raise too_many_receivers.
when object_type_not_exist.
raise document_type_not_exist.
when operation_no_authorization.
raise operation_no_authorization.
when parameter_error.
raise parameter_error.
when others.
raise x_error.
endcase.
MOVE OBJECT_ID TO NEW_OBJECT_ID.
perform transfer_tab_to_rec tables rec_table
receivers.
set commit work
if commit_work = on.
commit work.
endif.
endfunction. -
Hi Sd Gurus
i change the output type medium from printout to simple-mail. i got a error( Mail partner not found or empty! Obj
created without partner!). please give the solution.
ThanksHi Hari,
Please Check that you assigned any partner function to the output type.
and that e-mail address is maintained for your required partner.
Thanks
Dasaradha -
Simple Mail Configuration in NACE
Hi Gurus
We have a requirement that system should send out an email to the partner carrier whenever a delivery is ready. However plz guide how to configure simple email in NACE for this requirement. I suppose a program is required with a smartform of the email contents.
Will be waiting for your response.
Regards
WazCopy the output type mail and then check whether it is included in the output determoination procedure of the sales order deliver or billing for that matter if not then include it.
Then set up the condition records and ther in system will ask you to assign a dummy email id.
Next make sure you have maintained the email id in the partner or the customer (SP ,BP ,SH) which you are setting up in the putput records master data and give the option 4 which is output is generated as and when the document is generated.
Next time when you generate the documents the mail will be sent out to the Business partner which can ben set up in the records.
Thanks! -
Using Simple Mail option In VL03n
In VL03N, in the output, there is a option of Simple Mail ( nast-nacha = 7), wherein we can directly specify the email Id of the receiver of the delivery note.
Can anybody guide me so as what coding needs to be done,if any, in the smartfrom print program so as the mail can be sent to the specified email Id.
Any other pointers to solve this issue are also welcome.
Useful Replies will be highly appreciated and rewarded
Thanks in advance
KrishnaHi Krishna,
I am not aware of smartfomrs. it can be done through scripts by using two function module, one is for converting the output into pdf and another is for send mail.
Regards,
Kumar. -
Error while sending PO output through mail in PDF format - Urgent
Dear friends,
Developed program to send sapscript output through mail in pdf format, the program running properly, even function module SO_NEW_DOCUMENT_ATT_SEND_API1 returning sy-subrc 0. But the external mail is not going to user lying in SAP outbox with message <b>"Wait for communications service"</b> . SCOT is properly configured, tested mails sending through SAP office.
Find below the source code:
REPORT zmm_porder_gm
NO STANDARD PAGE HEADING.
TABLES: ekko, ekpa, t161t, t052, komv, j_1imocomp, t001, esll.
Internal Tables
DATA : txt LIKE tline-tdline, "HEADER LINE
your_ref LIKE ekko-ihrez, "your ref
our_ref LIKE ekko-unsez, "our ref
mcompname LIKE t001-butxt,
itemname LIKE ekpo-txz01,
del_text LIKE tline-tdline, "delivery text
mat_po_text LIKE tline-tdline. "material po text
DATA: g_ind TYPE i.
DATA: it_esll LIKE esll OCCURS 0 WITH HEADER LINE.
DATA: sub_packno LIKE esll-sub_packno.
DATA : po_flag(1) TYPE c.
DATA : it_erev LIKE erev OCCURS 0 WITH HEADER LINE.
DATA : nmebeln LIKE thead-tdname,
obj LIKE thead-tdname.
DATA : tline LIKE tline OCCURS 0 WITH HEADER LINE. "HEADER TEXT
DATA : it_ekko LIKE ekko OCCURS 0 WITH HEADER LINE.
DATA : it_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
DATA : it_zmm_porder LIKE zmm_porder OCCURS 0 WITH HEADER LINE.
DATA : it_konv LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_konv_ftr LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_konv_rate LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_komv_tax LIKE komv OCCURS 0 WITH HEADER LINE. " For Tax Calculation
DATA : it_zmm_house_bank LIKE zmm_house_bank OCCURS 0 WITH HEADER LINE.
*DATA : mrate TYPE konv-kbetr VALUE 0, mrate1(15). rmoved by ganes and added following logic
DATA : mrate TYPE p VALUE 0 DECIMALS 2, mrate1(15).
DATA : mrate_gm TYPE p DECIMALS 2.
DATA : BEGIN OF it_konv1 OCCURS 0,
knumv LIKE konv-knumv,
kschl LIKE konv-kschl,
END OF it_konv1.
DATA : BEGIN OF it_t052u OCCURS 0.
INCLUDE STRUCTURE t052u.
DATA : END OF it_t052u.
DATA : mpay_terms LIKE t052u-text1.
DATA : mwaers LIKE konv-waers.
DATA : BEGIN OF xt052 OCCURS 0.
INCLUDE STRUCTURE t052.
DATA : END OF xt052.
DATA : it_t16ct LIKE t16ct OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF ztext OCCURS 0.
INCLUDE STRUCTURE ttext.
DATA : END OF ztext.
DATA : it_t001 LIKE t001 OCCURS 0 WITH HEADER LINE.
DATA : mtext(15) TYPE c.
DATA : it_adrc LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_adrc_ven LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_adrc_plt LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_makt LIKE makt OCCURS 0 WITH HEADER LINE.
DATA : it_eket LIKE eket OCCURS 0 WITH HEADER LINE. " Schedulling
DATA : it_eikp LIKE eikp OCCURS 0 WITH HEADER LINE. " Export
DATA : it_t001w LIKE t001w OCCURS 0 WITH HEADER LINE.
DATA : it_t685t LIKE t685t OCCURS 0 WITH HEADER LINE.
DATA : it_t618t LIKE t618t OCCURS 0 WITH HEADER LINE.
DATA : it_t685t_ftr LIKE t685t OCCURS 0 WITH HEADER LINE.
DATA : it_lfa1 LIKE lfa1 OCCURS 0 WITH HEADER LINE.
DATA : it_bapi_mltx_ga LIKE bapi_mltx_ga OCCURS 0 WITH HEADER LINE. "Material long text
DATA : mfirst TYPE i VALUE 0,
mpay_flag(1) TYPE c VALUE 'X',
mwerks LIKE t001w-werks,
msr TYPE i VALUE 0,
l_rate TYPE p DECIMALS 2 VALUE 0,
l_amt TYPE p DECIMALS 2 VALUE 0,
mflag(1) TYPE c,
mlctr TYPE i VALUE 0,
mfamt TYPE p DECIMALS 2 VALUE 0,
mcfamt(15) TYPE c,
mfword(100) TYPE c,
mkschl LIKE konv-kschl,
mchgamt TYPE p DECIMALS 2 VALUE 0,
mkbetr TYPE p DECIMALS 2 VALUE 0,
mkwert TYPE p DECIMALS 2 VALUE 0.
DATA : j_1iexcd TYPE j_1imocomp-j_1iexcd,
j_1icstno TYPE j_1imocomp-j_1icstno,
j_1ilstno TYPE j_1imocomp-j_1ilstno.
DATA : mjmop_r TYPE p DECIMALS 2 VALUE 0,
mjmoq_r TYPE p DECIMALS 2 VALUE 0,
mjecs_r TYPE p DECIMALS 2 VALUE 0,
mjvcs_r TYPE p DECIMALS 2 VALUE 0,
mjvrd_r TYPE p DECIMALS 2 VALUE 0,
mjsep_r TYPE p DECIMALS 2 VALUE 0.
DATA : mjmop_a TYPE p DECIMALS 2 VALUE 0,
mjmoq_a TYPE p DECIMALS 2 VALUE 0,
mjecs_a TYPE p DECIMALS 2 VALUE 0,
mjvcs_a TYPE p DECIMALS 2 VALUE 0,
mjvrd_a TYPE p DECIMALS 2 VALUE 0,
mjsep_a TYPE p DECIMALS 2 VALUE 0.
DATA : mtitle LIKE t161t-batxt.
DATA : no_ammend(10),request_by(50),ver_txt(100),ver_reason(100),stext(200).
begin of Email data declarations**************
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
DATA: it_docs TYPE STANDARD TABLE OF docs,
v_bin_filesize TYPE i,
it_lines TYPE STANDARD TABLE OF tline,
wa_lines TYPE tline.
DATA : i_pdf LIKE tline OCCURS 1000 WITH HEADER LINE,
v_pdf_bytecount TYPE i,
v_pdf_spoolid TYPE tsp01-rqident,
v_otf_pagecount TYPE i,
v_btc_jobname TYPE tbtcjob-jobname,
v_btc_jobcount TYPE tbtcjob-jobcount.
DATA: objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA: vafilename(100) VALUE 'po_output.pdf'.
DATA: jobdata TYPE sxjobdata.
DATA arc_params TYPE arc_params.
DATA print_params TYPE pri_params.
DATA g_send_prog TYPE syrepid VALUE 'ZVF03_TEST_PROG'.
DATA immediate TYPE btcchar1.
DATA: i_jobname TYPE tbtcp-jobname,
i_jobcount TYPE tbtcp-jobcount,
i_jobstepcount TYPE tbtcp-stepcount.
DATA recipient_obj LIKE swotobjid.
CONSTANTS: sx_true TYPE sx_boolean VALUE 'X'.
TABLES: tbtcp.
end of Email data declarations**************
SELECTION-SCREEN : BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : mebeln FOR ekko-ebeln OBLIGATORY . " 75
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 12.
SELECTION-SCREEN COMMENT (20) text-b01.
PARAMETERS: b1 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : END OF BLOCK block1.
SELECTION-SCREEN: BEGIN OF SCREEN 200 TITLE text-001 AS WINDOW.
PARAMETERS : p_email TYPE ad_smtpadr. "E-Mail Address
SELECTION-SCREEN: END OF SCREEN 200.
INITIALIZATION.
SET PF-STATUS 'ZMMPORD_STAT'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'EMAIL'.
PERFORM zemail.
WHEN '&IC1'.
PERFORM load_data.
PERFORM process.
IF NOT p_email IS INITIAL.
PERFORM send_mail.
ENDIF.
ENDCASE.
*START-OF-SELECTION.
PERFORM load_data.
PERFORM process.
FORM load_data .
DATA : gindex LIKE sy-tabix.
SELECT * FROM t16ct INTO TABLE it_t16ct WHERE spras = 'EN'.
SELECT * FROM ekko INTO TABLE it_ekko WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SELECT * FROM erev INTO CORRESPONDING FIELDS OF TABLE it_erev FOR ALL ENTRIES IN it_ekko
WHERE edokn = it_ekko-ebeln AND rscod <> '' .
SORT it_erev BY edokn revno DESCENDING.
LOOP AT it_ekko.
IF NOT ( it_ekko-frgke EQ 'O' OR it_ekko-frgke EQ '0' ) .
MESSAGE e000(zsd) WITH 'Purchase Order is not Realeased'.
ENDIF.
ENDLOOP.
SELECT * FROM ekpo INTO TABLE it_ekpo WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SELECT * INTO TABLE it_makt
FROM makt
FOR ALL ENTRIES IN it_ekpo
WHERE matnr EQ it_ekpo-matnr.
SELECT * INTO TABLE it_lfa1
FROM lfa1
FOR ALL ENTRIES IN it_ekko
WHERE lifnr EQ it_ekko-lifnr.
ENDIF.
SELECT *
INTO TABLE it_t052u
FROM t052u
FOR ALL ENTRIES IN it_ekko
WHERE zterm EQ it_ekko-zterm
AND spras EQ 'EN'.
IF sy-subrc EQ 0.
SORT it_t052u BY zterm.
ENDIF.
SELECT * FROM eket INTO TABLE it_eket WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SORT it_eket BY ebeln ebelp.
ENDIF.
SELECT *
INTO TABLE it_eikp
FROM eikp
FOR ALL ENTRIES IN it_ekko
WHERE exnum EQ it_ekko-exnum.
IF sy-subrc EQ 0.
SORT it_eikp BY exnum.
SELECT *
INTO TABLE it_t618t
FROM t618t
FOR ALL ENTRIES IN it_eikp
WHERE expvz EQ it_eikp-expvz
AND spras EQ 'E'
AND land1 EQ 'IN'.
IF sy-subrc EQ 0.
SORT it_t618t BY expvz.
ENDIF.
ENDIF.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'L'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
SELECT * FROM konv INTO TABLE it_konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0.
LOOP AT it_konv.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv INDEX gindex.
ENDIF.
ENDLOOP.
IF sy-subrc EQ 0.
SORT it_konv BY knumv kherk kschl.
ENDIF.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'F'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
SELECT * INTO TABLE IT_KONV_FTR FROM KONV
FOR ALL ENTRIES IN IT_EKKO
WHERE KNUMV = IT_EKKO-KNUMV
AND ( KSCHL = 'ZIN1'
OR KSCHL = 'ZIN2'
OR KSCHL = 'ZINS'
OR KSCHL = 'ZPF1'
OR KSCHL = 'ZPF2'
OR KSCHL = 'ZPF3'
OR KSCHL = 'ZPKG'
OR KSCHL = 'ZPKF'
OR KSCHL = 'FRA1'
OR KSCHL = 'FRB1'
OR KSCHL = 'FRC1'
OR KSCHL = 'FRD1'
OR KSCHL = 'FRD2'
OR KSCHL = 'FRD3'
OR KSCHL = 'FRD4'
OR KSCHL = 'FRD5'
*****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
OR KSCHL = 'ZFBC' )
AND KWERT NE 0
AND KPOSN GT '000000'.
AND ( KRECH = 'B' " RTDK906167
OR KRECH = 'A' ).
SELECT * INTO TABLE it_konv_ftr FROM konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0
AND kposn GT '000000'.
LOOP AT it_konv_ftr.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv_ftr-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv_ftr INDEX gindex.
ENDIF.
ENDLOOP.
IF it_konv_ftr[] IS NOT INITIAL.
SORT it_konv_ftr BY knumv kschl.
ENDIF.
SELECT KNUMV KSCHL INTO CORRESPONDING FIELDS OF TABLE IT_KONV1 FROM KONV
FOR ALL ENTRIES IN IT_EKKO
WHERE KNUMV = IT_EKKO-KNUMV
and kherk = 'D'
AND ( KSCHL = 'ZIN1'
OR KSCHL = 'ZIN2'
OR KSCHL = 'ZINS'
OR KSCHL = 'ZPF1'
OR KSCHL = 'ZPF2'
OR KSCHL = 'ZPF3'
OR KSCHL = 'ZPKG'
OR KSCHL = 'ZPKF'
OR KSCHL = 'FRA1'
OR KSCHL = 'FRB1'
OR KSCHL = 'FRC1'
OR KSCHL = 'FRD1'
OR KSCHL = 'FRD2'
OR KSCHL = 'FRD3'
OR KSCHL = 'FRD4'
OR KSCHL = 'FRD5'
*****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
OR KSCHL = 'ZFBC' )
AND KWERT NE 0.
AND ( KRECH = 'B' RTDK906167
OR KRECH = 'A' ).
SELECT knumv kschl INTO CORRESPONDING FIELDS OF TABLE it_konv1 FROM konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0.
DELETE ADJACENT DUPLICATES FROM it_konv1 COMPARING knumv kschl.
LOOP AT it_konv1.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv1-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv1 INDEX gindex.
ENDIF.
ENDLOOP.
IF sy-subrc EQ 0.
SORT it_konv1 BY knumv kschl.
ENDIF.
SELECT * INTO TABLE it_t685t
FROM t685t
FOR ALL ENTRIES IN it_konv
WHERE kschl EQ it_konv-kschl
AND kappl EQ it_konv-kappl
AND spras EQ 'E'.
SELECT * INTO TABLE it_t685t_ftr
FROM t685t
FOR ALL ENTRIES IN it_konv_ftr
WHERE kschl EQ it_konv_ftr-kschl
AND kappl EQ it_konv_ftr-kappl
AND spras EQ 'E'.
it_t685t_ftr-kschl = 'JVCS'.
it_t685t_ftr-vtext = 'IN CST in vat'.
APPEND it_t685t_ftr.
SELECT * INTO TABLE it_zmm_house_bank
FROM zmm_house_bank
WHERE ebeln IN mebeln.
ELSE.
MESSAGE e899(mm) WITH 'Data not found for selection criteria...'.
ENDIF.
ENDFORM. " Load_data
FORM process .
DATA : mctr TYPE i VALUE 1.
DATA : gindex LIKE sy-tabix.
DATA : mline(75) TYPE c.
DATA : mlifn2 LIKE ekpa-lifn2.
DATA : mv_name LIKE lfa1-name1,
madrnr LIKE lfa1-adrnr.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZMM_PORDER'
language = sy-langu
OPTIONS = itcpo
dialog = ' '
EXCEPTIONS
OTHERS = 1.
LOOP AT it_ekko.
CALL FUNCTION 'START_FORM'
EXPORTING
form = 'ZMM_PORDER'.
SELECT SINGLE *
FROM t001
INTO it_t001
WHERE bukrs EQ it_ekko-bukrs.
mcompname = it_t001-butxt.
TRANSLATE mcompname TO UPPER CASE.
Document Type
SELECT SINGLE batxt
INTO mtitle
FROM t161t
WHERE bstyp EQ 'F'
AND spras EQ 'E'
AND bsart EQ it_ekko-bsart.
REFRESH it_adrc.
SELECT SINGLE werks
INTO mwerks
FROM ekpo
WHERE ebeln EQ it_ekko-ebeln.
SELECT SINGLE *
INTO it_t001w
FROM t001w
WHERE werks EQ mwerks.
REFRESH it_adrc.
SELECT SINGLE *
INTO it_adrc_plt
FROM adrc
WHERE addrnumber EQ it_t001w-adrnr.
REFRESH : xt052.
mfamt = 0.
msr = 0.
in 500c this statement failed.
SELECT SINGLE * FROM T052 INTO XT052 WHERE ZTERM = IT_EKKO-ZTERM.
CALL FUNCTION 'FI_TEXT_ZTERM'
EXPORTING
I_T052 = XT052
TABLES
T_ZTEXT = ZTEXT.
As per Preeti... Shipment address should be shown on top as purchase order company address. 27.04.
PERFORM writeform USING 'PLANT' 'PLANT'.
SELECT SINGLE name1 adrnr
INTO (mv_name,madrnr)
FROM lfa1
WHERE lifnr EQ it_ekko-lifnr.
REFRESH it_adrc[].
CLEAR it_adrc[].
FREE it_adrc[].
SELECT SINGLE *
INTO it_adrc_ven
FROM adrc
WHERE addrnumber EQ madrnr.
READ TABLE it_lfa1 WITH KEY lifnr = it_ekko-lifnr.
PERFORM writeform USING 'VENDOR' 'VENDOR'.
Shipment
SELECT SINGLE werks
INTO mwerks
FROM ekpo
WHERE ebeln EQ it_ekko-ebeln.
up to 1 rows.
SELECT SINGLE *
INTO it_t001w
FROM t001w
WHERE werks EQ mwerks.
SELECT SINGLE j_1iexcd j_1icstno j_1ilstno
INTO (j_1iexcd,j_1icstno,j_1ilstno)
FROM j_1imocomp
WHERE werks = mwerks.
REFRESH it_adrc.
SELECT SINGLE *
INTO it_adrc
FROM adrc
WHERE addrnumber EQ it_t001w-adrnr.
PERFORM writeform USING 'SHIPMNT' 'SHIPMNT'.
READ TABLE it_eikp WITH KEY exnum = it_ekko-exnum.
IF sy-subrc EQ 0.
READ TABLE it_t618t WITH KEY expvz = it_eikp-expvz.
ENDIF.
your_ref = it_ekko-ihrez.
our_ref = it_ekko-unsez.
READ TABLE it_erev WITH KEY edokn = it_ekko-ebeln.
IF sy-subrc = 0.
no_ammend = it_erev-revno.
request_by = it_erev-crnam.
ver_txt = it_erev-txz01.
READ TABLE it_t16ct WITH KEY rscod = it_erev-rscod.
IF sy-subrc = 0.
ver_reason = it_t16ct-rstxt.
ELSE.
ver_reason = ''.
ENDIF.
ELSE.
no_ammend = ''.
request_by = ''.
ver_txt = ''.
ver_reason = ''.
ENDIF.
PERFORM writeform USING 'PO_INFO' 'PO_INFO'.
IF it_zmm_house_bank[] IS NOT INITIAL.
READ TABLE it_zmm_house_bank INDEX 1.
PERFORM writeform USING 'BANKDTL' 'BANKDTL'.
ENDIF.
PERFORM writeform USING 'HDR_INFO' 'HDR_INFO'.
PERFORM writeform USING 'BRK_TTL' 'MAIN'.
msr = 1.
mlctr = 1.
*added by ganesh to prevent deleted items to appear in print out
LOOP AT IT_EKPO WHERE EBELN EQ IT_EKKO-EBELN.
LOOP AT it_ekpo WHERE ebeln EQ it_ekko-ebeln AND loekz NE 'L'.
*end of change
CLEAR: mrate, mrate1.
SELECT * FROM konv INTO TABLE it_konv_rate
WHERE knumv EQ it_ekko-knumv
AND kposn EQ it_ekpo-ebelp
AND ( kschl EQ 'PBXX' OR kschl EQ 'PB00' OR kschl EQ 'P001' ).
LOOP AT it_konv_rate.
IF it_konv_rate-kpein > 0. " added by ganesh as per sudhir 12.10.2007
mrate_gm = it_konv_rate-kbetr / it_konv_rate-kpein.
mrate = mrate + mrate_gm. " added by ganesh as per sudhir 12.10.2007
ELSE.
mrate = mrate + it_konv_rate-kbetr.
ENDIF.
IF it_konv_rate-waers IS NOT INITIAL.
mwaers = it_konv_rate-waers.
ENDIF.
ENDLOOP.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mrate = mrate * 100.
ENDIF.
End for japanies Yen
mrate1 = mrate.
End rate
mfirst = 0.
MFAMT = MFAMT + ( IT_EKPO-NETPR * IT_EKPO-MENGE ).
mfamt = mfamt + ( mrate * it_ekpo-menge ).
PERFORM get_mat_long_text.
DATA: lt_ctr TYPE i VALUE 0,lt_ctr1 TYPE i, lt_count TYPE i VALUE 0. " Long text counter
DESCRIBE TABLE it_bapi_mltx_ga LINES lt_count.
CLEAR it_bapi_mltx_ga.
*Added by Rajiv 10.05.2007 Read and if condition RTDK906165
READ TABLE it_konv WITH KEY knumv = it_ekko-knumv
kposn = it_ekpo-ebelp.
mkbetr = 0.
mkwert = 0.
IF sy-subrc EQ 0.
LOOP AT it_konv WHERE knumv EQ it_ekko-knumv
AND kposn EQ it_ekpo-ebelp.
IF it_konv-krech EQ 'A'.
mkbetr = it_konv-kbetr / 10.
ELSE.
mkbetr = it_konv-kbetr.
ENDIF.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mkbetr = mkbetr * 100.
ENDIF.
End for japaies Yen
IF mkbetr LT '0'.
mkbetr = mkbetr * ( -1 ).
ENDIF.
mkwert = it_konv-kwert.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mkwert = mkwert * 100.
ENDIF.
End for japaies Yen
mfamt = mfamt + mkwert.
IF mkwert LT '0'.
mkwert = mkwert * ( -1 ).
ENDIF.
IF it_ekpo-matnr IS INITIAL.
itemname = it_ekpo-txz01.
ELSE.
READ TABLE it_makt WITH KEY matnr = it_ekpo-matnr.
itemname = it_makt-maktx.
ENDIF.
READ TABLE it_t685t WITH KEY kschl = it_konv-kschl BINARY SEARCH.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
IF mfirst EQ 0.
PERFORM writeform USING 'BRK_INFO' 'MAIN'.
mfirst = 1.
ELSE.
ADD 1 TO lt_ctr.
CLEAR it_bapi_mltx_ga.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
IF sy-subrc NE 0.
CLEAR it_bapi_mltx_ga.
ENDIF.
PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
ENDIF.
mlctr = mlctr + 1.
ENDLOOP. " it_konv.
ELSE.
IF it_ekpo-matnr IS INITIAL.
itemname = it_ekpo-txz01.
ELSE.
READ TABLE it_makt WITH KEY matnr = it_ekpo-matnr.
itemname = it_makt-maktx.
ENDIF.
READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
mfirst = 0.
IF mfirst EQ 0.
PERFORM writeform USING 'BRK_INFO' 'MAIN'.
mfirst = 1.
ELSE.
ADD 1 TO lt_ctr.
CLEAR it_bapi_mltx_ga.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
IF sy-subrc NE 0.CLEAR it_bapi_mltx_ga.ENDIF.
PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
ENDIF.
ENDIF.
*Commented by rajiv 10.05.2007 used this code in above condition.
added by ganesh on 260407 to print record
if it_konv is initial.
READ TABLE IT_MAKT WITH KEY MATNR = IT_EKPO-MATNR.
READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
READ TABLE IT_EKET WITH KEY EBELN = IT_EKPO-EBELN
EBELP = IT_EKPO-EBELP BINARY SEARCH.
mFirst = 0.
if mFirst eq 0.
PERFORM WRITEFORM USING 'BRK_INFO' 'MAIN'.
mFirst = 1.
else.
add 1 to lt_ctr.
clear it_bapi_mltx_ga.
read table IT_BAPI_MLTX_GA index lt_ctr. "For long text
if sy-subrc ne 0.clear it_bapi_mltx_ga.endif.
PERFORM WRITEFORM USING 'BRK_INFO1' 'MAIN'.
Endif.
endif.
end of change
REFRESH it_komv_tax.
PERFORM get_tax_cal USING it_ekpo-ebeln
it_ekpo-ebelp.
Changing it_komv_tax.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'T'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
LOOP AT it_komv_tax.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_komv_tax-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_komv_tax INDEX gindex.
ENDIF.
ENDLOOP.
LOOP AT it_komv_tax WHERE kwert IS NOT INITIAL.
IF ( IT_KOMV_TAX-KSCHL EQ 'JMOP' OR
IT_KOMV_TAX-KSCHL EQ 'JECS' OR
IT_KOMV_TAX-KSCHL EQ 'JSEP' OR
IT_KOMV_TAX-KSCHL EQ 'JMOQ' OR
IT_KOMV_TAX-KSCHL EQ 'JVCS' OR
IT_KOMV_TAX-KSCHL EQ 'JVRD' OR
IT_KOMV_TAX-KSCHL EQ 'JMIP' OR
* IT_KOMV_TAX-KSCHL EQ 'JEIP' OR
IT_KOMV_TAX-KSCHL EQ 'JSEI' OR
IT_KOMV_TAX-KSCHL EQ 'JSRT' OR
IT_KOMV_TAX-KSCHL EQ 'JEC3' OR
IT_KOMV_TAX-KSCHL EQ 'JVRN' )
AND IT_KOMV_TAX-KWERT IS NOT INITIAL.
SELECT SINGLE vtext
INTO mtext
FROM t685t
WHERE kschl EQ it_komv_tax-kschl
AND spras EQ 'E'.
l_rate = it_komv_tax-kbetr / 10.
l_amt = it_komv_tax-kwert.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
l_amt = l_amt * 100.
ENDIF.
End for japaies Yen
ADD l_amt TO mfamt.
IF lt_ctr LT lt_count. "Long text
ADD 1 TO lt_ctr.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
ELSE.
CLEAR it_bapi_mltx_ga.
ENDIF.
IF l_rate EQ 0 OR l_amt EQ 0.
l_rate = ''.
l_amt = ''.
ENDIF.
PERFORM writeform USING 'TAX_LINE_ITEM' 'MAIN'.
ENDIF.
ENDLOOP.
IF lt_ctr LT lt_count.
DATA mbal_line TYPE i.
mbal_line = ( lt_count - lt_ctr ).
DO mbal_line TIMES.
ADD 1 TO lt_ctr.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
IF sy-subrc = 0.
PERFORM writeform USING 'LTEXT' 'MAIN'.
ENDIF.
ENDDO.
ENDIF.
CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F04'
language = sy-langu
name = nmebeln
object = 'EKPO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
del_text = tline-tdline.
ENDIF.
CONDENSE del_text.
ENDLOOP.
CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F03'
language = sy-langu
name = nmebeln
object = 'EKPO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 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.
refresh.
CLEAR : po_flag, mat_po_text.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
MOVE tline-tdline TO mat_po_text.
CONDENSE mat_po_text.
PERFORM writeform USING 'MTRL_PO_TEXT' 'MAIN'.
po_flag = 'X'.
CLEAR : mat_po_text.
ENDIF.
ENDLOOP.
*Added lines below for Schedule delivery for line item on 09.05.2007:Rajiv
CLEAR g_ind.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
g_ind = sy-tabix.
LOOP AT it_eket FROM g_ind.
IF it_eket-ebeln EQ it_ekpo-ebeln AND it_eket-ebelp = it_ekpo-ebelp.
PERFORM writeform USING 'SCHEDULE' 'MAIN'.
ELSE.
EXIT.
ENDIF.
ENDLOOP.
*End Addition:Rajiv
PERFORM writeform USING 'REQSLP' 'MAIN'.
mlctr = mlctr + 1.
msr = msr + 1.
CLEAR: lt_ctr, lt_ctr1.
following lines added by ganesh to add service po details as per Mr. sadiq 21.08.2007
IF it_ekpo-packno IS NOT INITIAL.
CLEAR sub_packno.
SELECT SINGLE sub_packno INTO sub_packno FROM esll WHERE packno = it_ekpo-packno.
IF sub_packno IS NOT INITIAL.
CLEAR it_esll.
REFRESH it_esll.
SELECT * FROM esll INTO CORRESPONDING FIELDS OF TABLE it_esll
WHERE packno = sub_packno.
IF sy-subrc = 0.
PERFORM writeform USING 'SERVICE_PO_TEXT' 'MAIN'.
ENDIF.
LOOP AT it_esll.
CONCATENATE sub_packno it_esll-introw INTO obj.
CALL FUNCTION 'READ_TEXT' "4500002446 C300
EXPORTING
id = 'LTXT'
language = sy-langu
name = obj
object = 'ESLL'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
CLEAR stext.
LOOP AT tline.
CONCATENATE stext tline-tdline INTO stext SEPARATED BY space.
ENDLOOP.
FREE tline.
CLEAR tline.
REFRESH tline.
PERFORM writeform USING 'SERVICE_PO' 'MAIN'.
PERFORM writeform USING 'SERVICE_TEXT' 'MAIN'.
ENDLOOP.
ENDIF.
ENDIF.
end of change
ENDLOOP. " it_ekpo.
IF mlctr < 15.
DO 5 TIMES.
PERFORM writeform USING 'LINEFEED' 'MAIN'.
ENDDO.
ENDIF.
added by ganesh for allding line before ECC No.
IF it_ekko-bsart NE 'ZIM'. " IF EXPORT NO NEED TO PRINT ECC.
PERFORM writeform USING 'LIN' 'MAIN'.
PERFORM writeform USING 'WERKS_TAX_DETAIL' 'MAIN'.
ENDIF.
end of change
MFLAG = 'Y'.
PERFORM writeform USING 'TERMS_VAL' 'MAIN'.
LOOP AT it_konv1 WHERE knumv EQ it_ekko-knumv.
mkschl = it_konv1-kschl.
mchgamt = 0.
LOOP AT it_konv_ftr WHERE knumv EQ it_konv1-knumv
AND kschl EQ mkschl.
mchgamt = mchgamt + it_konv_ftr-kwert.
ENDLOOP.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mchgamt = mchgamt * 100.
ENDIF.
End for japaies Yen
mfamt = mfamt + mchgamt.
IF mchgamt LT '0'.
mchgamt = mchgamt * ( -1 ).
ENDIF.
READ TABLE it_t685t_ftr WITH KEY kschl = mkschl.
PERFORM writeform USING 'TERMS_FTR_VAL' 'MAIN'.
mlctr = mlctr + 1.
ENDLOOP.
mflag = 'T'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = mfamt
IMPORTING
amt_in_words = mfword
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
CONDENSE mebeln.
nmebeln = it_ekko-ebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = nmebeln
object = 'EKKO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
*---- CHANGED BY MATHEW BECAUSE THIS STATMENT WORKING FINE IN 300 BUT NOT IN 500C.
LOOP AT ZTEXT.
IF ZTEXT-TEXT1 IS NOT INITIAL.
PERFORM WRITEFORM USING 'TERMS_COND_VAL_PAY' 'MAIN'.
ENDIF.
MPAY_FLAG = 'Y'.
ENDLOOP.
READ TABLE it_t052u WITH KEY zterm = it_ekko-zterm.
LOOP AT it_t052u WHERE zterm EQ it_ekko-zterm.
IF it_t052u-text1 IS NOT INITIAL.
PERFORM writeform USING 'TERMS_COND_VAL_PAY' 'MAIN'.
ENDIF.
mpay_flag = 'Y'.
ENDLOOP.
PERFORM writeform USING 'TERMS_COND_VAL' 'MAIN'.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
PERFORM writeform USING 'TERMS_COND_VAL_HDR' 'MAIN'.
ENDIF.
CONDENSE txt.
ENDLOOP.
PERFORM writeform USING 'FTR' 'FTR_LIN3'.
PERFORM writeform USING 'FTR_LIN1' 'FTR_LIN1'.
CALL FUNCTION 'END_FORM'.
ENDLOOP. " It_ekko.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = itcpp
RDI_RESULT =
TABLES
otfdata = otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
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. " Process
*& Form WRITEFORM
text
-->P_0150 text
-->P_0151 text
FORM writeform USING value(p_0150)
value(p_0151).
CALL FUNCTION 'WRITE_FORM'Hi
I think some basis related configuartions to be done
Try like this and inform me
A cyclic job runs, which processes the messages seen in the SOST queue.
Are you sure it's not the frequency of the cyclic job, rather than the
number of messages in the queue, that you are observing? In messages
that are queued and before the cyclic job runs, "wait for comm. service"
is the normal status.
If you mean that there are always 4 items queued in SOST regardless of
the cyclic send job, then I have no ideas. I would have thought there
was no way to do that.
when the send job runs it just never
picks them up & sends them, while it picks up many others. The send job
is somehow blind to these; no error message occurs. In this case, I
'delete' them from the queue (in SOST) and then 'undelete' (drop down
menu -> /Go to /Deleted Items) them and then re-queue them. THEN they
actually get picked up & sent when the next cyclic send job executes.
Regards
Pavan -
Simple Mail vs. External Send
Dear Experts,
does anybody know what the difference between email sending method 'SIMPLE MAIL' and 'EXTERNAL SEND' is?
Thanks a lot for any suggestion!
Best regards,
Marchi,
Check these links..
[SIMPLE MAIL TRANSFER PROTOCOL|http://help.sap.com/saphelp_nwpi71/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm]
[External Sending in the SAP System |http://help.sap.com/saphelp_nw70/helpdata/en/55/a8b538891b11d2a25a00a0c943858e/frameset.htm] -
Sedn report output to mail in d2k 10g
Hi
i want to send report output to mail .
i set
DESTYPE = mail
DESNAME = i gave mail id in initial values
I put the rdf in server and ran cucurent request from application but i am not getting the mail
any one help me tell what other steps i have to do
Regardshi,
try this..
GOTO SE80 -> write the Package name :- SBCOMS
in this package you find lot of ways to send mail.
hope this helps
Regards
RItesh J -
Email Address not visible for output device MAIL in created batch job
Issue in ECC6.0: Email Address not visible to display/change for output device MAIL in print parameter of each step in the created batch job.
User wants to periodically receive report file via send to his email, so I create the batch job running report and send the report in pdf file to his email.
Detail in the batch job
1) In print parameter screen of the step in the batch job
-Using output device MAIL (output type ZPDF1)
-inputting email address of receiver in the EMAIL ADDRESS field
2) After the batch job was saved, I tried to display/change the field EMAIL ADDRESS via Tx. SM37, but this field is invisible. The field can not be displayed or changed anymore. I also tried in SM36, but it is for creating new batch job, not changing the existing batch job.
4) User receives email with pdf file from the batch job.
How to change/display the email address of the receiver in the created batch job?
Note that we just changed to use SAP ECC6 from SAP 4.6c. In SAP 4.6c, we can change/display the
Email Address Field via Tx. SM37.
Pls kindly suggest, thank you very much in advance.Hi Srirompoti,
After saving the job if the job has not started then you can follow the below steps to change the Email address.
1. View the job from Txn SM37.
2. check the check box for your job that you want to change and goto menu path "Job->change
3. in the next screen goto "Edit->steps." or press "F6" key
4. place the coursor on the job and goto menu path "Step->change->print specifications.
5. here you can change the email address.
If you are not able change the data then you might not have authorization. -
Hi Gurus,
Can somebody help us configure the output medium as mail.
We have a requirement where by the user wants to receive the output via mail and in the PDF format.
Please let us know if there is any standard functionality for this or else
Please send any information including configuration details urgently
Thanks & Regards,
AlokYou will have to use medium 5 i.e. external send. SAPConnect needs to be configured by BASIS guys. There is no ABAP work involved. The same output which you are issuing to printer will now be sent as a mail attachment in PDF form to the mail address which is mentioned in the customer master.
Regards,
GSL. -
Hi.
I wanted to send the pdf output as mail.
My requirement is when i submit a request it should send a mail to users at the same time i should able to view outputHi
Submit a concurrent request with PDF output and while submitting the request, specify the email addresses under options --> Notify the following people.
It sends the output of the concurrent request to user.
Regards
Raji -
Billing output by mail changing the subject line
HI,
i am sending the billing output by email, but the subject of the email getting changed regularly. my requirement is i have to set standard subject for all billing output by mail.
Reagrds
Muthuraman.DGo to Tcode - NACE - Choose V3 - Choose 'output types' on the application toolbar
- select output type - 'double click on mail and texts' at left hand side. See if you can add anything there and checck the mail.
Maybe you are looking for
-
Camera Raw 6.7 won't save developer settings
I'm running Adobe CS 5 with Camera Raw 6.7 on a Windows Vista machine. I have a Canon T3i that I shoot all of my Raw files from. Which Camera Raw 6.7 supports and have not had trouble in the past. Recently everytime I've loaded the Raw files into a n
-
When I turn on the metronome, it's in sync with EVERYTHING except the drum kits. Is anyone else having this problem? When I change the plugin on the these tracks to a LPX drum machine or to a 3rd party drum plugin the problem goes away.
-
Inserting Image into a BLOB column in Oracle9i
Hi, I am unable to insert image into a BLOB column. I am using Forms 6i REL 2 and Oracle 9i. But I could do it on Oracle 8i with same Forms version. Same thing is true for CLOB in 9i. Would you please try with this code? TABLE Create table x (Id numb
-
Packet Loss between ASA and 871
We are running a Cisco ASA 5505 and remote clients are 871's. We currently use a EasyVPN configuration between the single ASA and our 13 871's. Today (1) out of the (13) tunnels is experiencing packet loss. I have power cycles the broadband router on
-
OSX Lion with ALUA support actually broke more than it fixed for us
Hi As you guys know Apple introduced ALUA in to Lion and when they bumped up the specs of Xsan. Most people seems to be really happy about this but in our case it actually broke more than it fixed. With our ATTO Celerity ES41 and LSI quad channel fib