In scripts using ADDR_GET_NEXT_COMM_TYPE function module
hi,
in my program these two function modules are used to send email.
ADDR_GET_NEXT_COMM_TYPE
CONVERT_COMM_TYPE_DATA
i want to know in format the email will be ,
in otf or in pdf, where we can find it.
using this function module can we able to send e-mail for multiple receipts ?
Try this sample code...
I guess it will help you..
Sample Code
Internal Table declarations
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.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
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
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
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.
Fehlerhandling
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 = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
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.
Länge des Attachment ermitteln
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 = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = '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.
Regards,
SaiRam
Similar Messages
-
Hi Gurus,
can any one inform me,how to use SX_OBJECT_CONVERT_OTF_INTO_PDF function module in script..
how can we convert the script output into pdf file format....
i need your help......plz
my mail id : [email protected]
Thanks,
Rajkumar.A
Edited by: rajkumar annadurai on Feb 19, 2008 10:25 AMHi, Dear
In XI 3.0 we are tyring to setup SAPconnect;
1 Step; Create RFC connection for Mlunxsnd file, anyway!!! we download thease file and create RFC connection; fine working no error
2 Step: Create Nodes T-code SCOT => connection INT => and support address type like Internet its just show only "PDF, HTM, TXT" thats it its not show some others format
3. Step; When check email T-code SOST Getting an error messages: "Connot process message in node, parameters cannot be converted"
4. In R3 RPD and Others system when I check format its ok its show some others format which is support to be such as "ALI, OBJ, OTF, SCR, URL" ...
How may install these format in XI 3.0
Please Advice I will be really appriciated
Thanks a lot
Travis -
Regarding how to use the function module *control_form* in scripts
HI friends,
Can any one tell why and where do we use the function module control_form in scripts. Can you give me a small scenario how to use in scripts.hi satish,
by using this function module we can pass the control
commands to FORM THROUGH ABAP/4 PROGRAM.
see the following example:
TABLES: kna1.
DATA: BEGIN OF it_kna1 OCCURS 0,
kunnr LIKE kna1-kunnr,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
land1 LIKE kna1-land1,
END OF it_kna1.
DATA:records TYPE i,
window TYPE i value 1.
select-options:s_kunnr for kna1-kunnr.
SELECT kunnr name1 ort01 land1 FROM kna1 INTO TABLE it_kna1
where kunnr in s_kunnr.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZSCRIPT4'
language = sy-langu.
LOOP AT it_kna1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ELE1'
function = 'SET'
type = 'BODY'
window = 'MAIN'.
DESCRIBE TABLE it_kna1 LINES records.
IF window lt records.
window = window + 1.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-WINDOW'
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
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.
thanks,
raji -
How to use read_text function module
Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
thanks,
MaheDear,
Use below code.
DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
V_TDNAME LIKE THEAD-TDNAME.
V_TDNAME = PO_NUMBER.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = 'EN'
NAME = V_TDNAME
OBJECT = 'EKKO'
TABLES
LINES = IT_LINE.
Thanks and Regards, -
How to avoid use of function module in case of background jobs?
Hi ,
I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file through bapi , send the result in their respective server. This program should run through batch jobs in background mode.
I am using following function module :
SUBST_GET_FILE_LIS : Get the file list from application server
TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
GUI_UPLOad : to extract file data from presentation server
GUI_downLOAD : to download data to presentation server
in case of background job these function modules will not work.... so how to resolve this issue...
what are the methods we can apply?
Thanks & Regards
SandeepHi,
This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server. There is no way , by which you can process presentation server files in background mode.
Regards
Vinod -
How can i use reuse_alv_fieldcatalog_merge function module
I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
FORM BUILD_FIELDCATALOG .
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'KUNNR'.
FIELDCAT-SELTEXT_M = 'Customer Name'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VBELN'.
FIELDCAT-SELTEXT_M = 'Invoice Reference'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKBUR'.
FIELDCAT-SELTEXT_M = 'Sales Office'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKGRP'.
FIELDCAT-SELTEXT_M = 'Sales Person'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'POSNR'.
FIELDCAT-SELTEXT_M = 'Item No'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FIANL'.
FIELDCAT-FIELDNAME = 'ARKTX'.
FIELDCAT-SELTEXT_M = 'Item Description'.
FIELDCAT-JUST = 'L'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.Hello,
It is very easy to use reuse_alv_fieldcatalog_merge.
You try this it will work.
example
data:
DATA : gv_repid TYPE syrepid VALUE sy-repid . " Report id
PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
FORM set_field_catalog USING uv_tab TYPE slis_tabname
CHANGING xt_fieldcatalog TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gv_repid
i_internal_tabname = uv_tab
i_inclname = gv_repid
CHANGING
ct_fieldcat = xt_fieldcatalog
EXCEPTIONS
inconsistent_interface = 1
program_error = 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.
ENDFORM. " set_field_catalog_spec -
Hi all,
is it possible to view mails send using SO_NEW_DOCUMENT_ATT_SEND_API1 function module to UWL?
I am receving emails in my SAP Inbox.
Please guide.
thanks.Hi,
You can only get the SAP mails into UWL notification tab with the Sonic connector (well of course with some custom development everything is possible).
One trick to get the workflow for sending "mails" to UWL is to NOT use email sending step, but instead use a decision step in the workflow and send this work item to the user. The decision step can include the same message as the email, and have onl one option "Confirm" (or whatever). These you can easily display in UWL since they are normal work items.
Regards,
Karri -
How to keep long text in bdc using create_text function module
hi,
ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
i need some other information like how can i pass this to BDC i got like this .
can u plz check it.
its a length of 255 chaters
perform bdc_field using 'RSTXT-TXLINE(02)'
'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
& 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
perform bdc_field using 'RSTXT-TXLINE(03)'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
& 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
perform bdc_field using 'RSTXT-TXLINE(04)'
'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
& 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
perform bdc_field using 'RSTXT-TXLINE(05)'
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
& 'hhhhhhhhhhhhhhhhhhhhhh'.Hi,
Use this coding where do u want,
data: begin of textline occurs 10.
include structure tline.
data: end of textline.
start-of-selection.
textline-tdformat = '*'.
textline-tdline = 'TESTING FOR CREATION OF TEXT'.
append textline.
clear textline.
call function 'CREATE_TEXT'
exporting
fid = '0013'
flanguage = sy-langu
fname = '0095000501'
fobject = 'VBBK'
tables
flines = textline
exceptions
no_init = 01
no_save = 02.
end-of-selection. -
Hi experts..
i got one requirement like i need to edit some rows particularly in alv....
Edit in alv output....is it possible to get that .....using normal function module with out using oops concept...
could any one pls help me...Hi Pendurti ,
If you want a particular field to be editable , simply define the fieldcatalog as
wa_fieldcatalog-edit = 'X'.
wa_fieldcatalog-input = 'X'.
for that field.
and
Now when you use FM ' Reuse alv grid display '
define USER_COMMAND
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = int_fieldcatalog
is_layout = wa_layout
TABLES
t_outtab = t_disp.
and now in form USER_COMMAND ; code as per following
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
endform.
Regards,
Yogendra Bhaskar -
Error while using the function module..pack_handling_unit_dlvry
Hi all...
while using the function module pack_handling_unit_dlvry,
we need to pass the handling unit number as per the functionality we require.
but the mandatory field for the function module is the handling unit number in the form of bar code..
so how to use this function module..
All the useful answers will be regarded..
Regards,
Saroja.Have you tried using BAPI BAPI_HU_CREATE. Also view Function Module Documentation on its usage.
-
Issue with use of Function Module GUI_UPLOAD
Hi Experts,
I have an issue in using the Function Module GUI_UPLOAD for uploading the contents of an Excel file on the Presentation Server to an internal table in an ABAP Program.
My file consists of around 300 records but the FM succeeds in uploading only the first 6 lines to the Internal Table specified while calling the FM.
I dont have any idea why this happens. Any pointers in this direction will be helpful.
Thanks in advance.
Regards,
KeerthiHi,
Kindly go through this link below:
https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=60655105
Hope it helps you
Regards
Mansi -
How to use these function modules
Hi all,
can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
1. FC_USER_AUTHORITY_CHECK
<b>2. FC_USER_STATUS_CHECK
3. FC_USER_STATUS_UPDATE</b>
4. FC_USER_GET_CACTI
5. FC_USER_CHECK_FOR_OUTPUT
Thanks in Advance
GaneshHi Rob,
thanks for ur reply,
but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
but how do i populate them.. i am not getting that..
thanks
ganesh -
How can i use this function module
Hai
How can i use this function module /SAPHT/SALES_ORDER_READ, already apply the some parameters in this function module, but it shows the error , please tell me, how to declare the parameters in this function module ,
thanks
neelimaHi
For a particular sales order,you have to pass the order number and the item number in the sales order.
It will display the rest of the values which u can capture them using internal tables.
Regards,
Vishwa. -
URGENT ---- How to use BAPI_REQUIREMENT_CHANGE Function Module
I want to change the Materail requirements through Txn MD62.
Instead i am using BAPI_REQUIREMENTS_GETDETAILS Function Module.
Using this I should use BAPI_REQUIREMENT_CHANGE Function Module.
But the requirements are not getting changed.what kind of messages u are gettiing into the table RETURN ? u have to cross check this internal table .
flow will be like this
call ' BAPI'
if return[] is initial.
commit work.
else.
do nothing.
endif.
Regards
Peram -
How to use BAPI_MATERIAL_AVAILABILITY Function Module at batch level?
How to use BAPI_MATERIAL_AVAILABILITY FM to check material available at batch level?
And another question is what's the meaning of 'CHECK_RULE' in this FM. Thanks!Field name : PRREG
fcheck more details on f1 help...
check_group defines the checking procedure to be used for availability check in individual applications.
along with the checkg group, checking rule specifies the final procedure for chkg..
eg:
ST for stock transport order
AQ for SD order project srock
also chk this help doc.
http://help.sap.com/saphelp_470/helpdata/en/cf/70124adf2d11d1b55e0000e82de178/content.htm
search the forum for sample code..
How to use BAPI_MATERIAL_AVAILABILITY Function Module....
Maybe you are looking for
-
Can an external HD be partitioned into 2: one for OSX and the other for XP?
As the topic says, i got an external HD to backup all the stuff. But since I use a desktop PC as well as my macbook everyday, it would be nice to use the HD for both of them. If the answer is yes, what program should i use? Thanks in advance.
-
How can I upgrade from Adobe Acrobat v4.0?
After reinstalling all the software on my pc I found a problem with Adobe Acrobat which had worked perfectly well for years. When i open Outlook, I now get a message: "Microsoft Word has detected that your computer has a version of Adobe Acrobat PDFM
-
IPhone contacts, calendar etc
My wife received a new iPhone for Christmas, which makes us a two iPhone family now. How can I set up separate contacts and calendars in iTunes for my wife's new phone. Thank you
-
I am trying to install an update for Java. The system won't allow it, saying I have specified "in Security" not to install any download not from the App Store. The only preferences pane I know of is the one on Safari, and it doesn't have anything abo
-
How to change the nodes open hub destination objects?
Hi, How one can change the nodes of open hub destination objects? As there was a need to change the nodes for certain open hubs i wonder how this could be acheived?