Data alignment issue with function module SO_DOCUMENT_SEND_API1
Hi All,
I am using function SO_DOCUMENT_SEND_API1 to send email from SAP. What is happening is the internal table which contains the data of the email(Content of the email) is ok. That is data in internal table is in proper format as required. This table is passed to FM SO_DOCUMENT_SEND_API1. After execution of this FM, mail is sent but the format of the email content is not the same as the format of the data in internal table.
Can anyone guide me regarding this discrepancy in the data alignment or format in the actual email ?
Thanks in advance.
Regards,
Chetan
Hi,
Pass the values like the following format,
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_content = objcont
receivers = intrcvers[].
CASE int_error.
WHEN 0.
MESSAGE s888(sabapdocu) with "Mail Sent Successfully...".
WHEN OTHERS.
MESSAGE s888(sabapdocu) with "Mail Not Sent...".
ENDCASE
I hope this will solve your problem.
Gothrough the following link,
https://forums.sdn.sap.com/click.jspa?searchID=14853082&messageID=5409233
Regards,
Harish
Similar Messages
-
Issue with Function Module...
Hi Frnzs,
Here is my issue..Plz go thru it..
I have a function module (YFSF_ICR_GET_EXCHG_RATE_ODS).
the function performs the current logic without any changes,
that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
for forecasts based on the planning cycle. Nothing needs to be changed here
concultion : Based on flag I_ICR ni , we have to read new exchange rates ( From ODS)
the fucntion module code is here
FUNCTION yfsf_icr_get_exchg_rate_ods.
""Local interface:
*" IMPORTING
*" REFERENCE(I_PLANCYC) TYPE /BIC/OIYPLANCYC OPTIONAL
*" REFERENCE(I_SALESORG) TYPE /BI0/OISALESORG OPTIONAL
*" REFERENCE(I_IC) TYPE /BIC/OIYINVCURR
*" REFERENCE(I_RC) TYPE /BIC/OIYREPCURR
*" REFERENCE(I_FISCPER) TYPE /BI0/OIFISCPER
*" EXPORTING
*" REFERENCE(E_EXG) TYPE /BI0/OIEXCHG_RATE
*" EXCEPTIONS
*" NO_RATE_FOUND
DATA: l_s_exg TYPE /bic/ayfsfexg00,
l_t_exg TYPE /bic/ayfsfexg00 OCCURS 0,
l_year TYPE /bi0/oifiscyear.
IF i_plancyc IS INITIAL.
Actuals
FREE l_t_exg.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE l_t_exg
FROM /bic/ayfsfexg00
WHERE fiscper <= i_fiscper
AND fiscvarnt = 'JJ'
AND /bic/yrepcurr = i_rc
AND /bic/yinvcurr = i_ic
AND /bic/yplancyc = ''
AND /bic/yexchtype = 'SPOT'
ORDER BY fiscper DESCENDING.
IF sy-subrc <> 0.
RAISE no_rate_found.
ELSE.
READ TABLE l_t_exg INTO l_s_exg INDEX 1.
e_exg = l_s_exg-exchg_rate.
ENDIF.
ELSE.
Forecasts
l_year = i_fiscper+0(4).
SELECT SINGLE *
INTO l_s_exg
FROM /bic/ayfsfexg00
WHERE fiscvarnt = 'JJ'
AND fiscyear = l_year
AND salesorg = i_salesorg
AND /bic/yrepcurr = i_rc
AND /bic/yinvcurr = i_ic
AND /bic/yplancyc = i_plancyc
AND /bic/yplancyc = ''
AND /bic/yexchtype = 'S'
AND exchg_rate GE '0.0000001'.
IF sy-subrc <> 0.
RAISE no_rate_found.
ELSE.
e_exg = l_s_exg-exchg_rate.
ENDIF.
ENDIF.
ENDFUNCTION.
ok
now my requirement is that I need to enhance the Function module for reading exchange rates.
for this i got the following information:
- It requires an additional flag I_ICR for instance that can be empty or 'X'
for instance
- If the flag is empty, the function performs the current logic without any changes,
that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
for forecasts based on the planning cycle. Nothing needs to be changed here
- If the flag is 'X', the function reads a new exchange rate type, let's call
it "ICR". As stated in the requirements and functional specs, these exchange rates
are the Reuter rates valid for a complete year. These are fixed rates so no planning
cycle. The users will enter records in the format (year, reporting currency, invoicing
currency, exchange rate). If the input flag I_ICR is X, the function determines
the year based on the input period, then, based on the year it selects on the same
table as for the other exchange rates with a restriction on exchange rate type "ICR",
year, from and to currency and return the exchange rate
Update rules. There are two:
- To the consolidation ODS. No changes are required there; the function has to
read either S or SPOT rates (I_ICR flag is empty)
- From the consolidation ODS to the cube. As stated in my previous email, the
from currency is the one available in the data package. The to currency is determined by reading the sales organization master data (reporting currency attribute) based on the inter-company sales organization (also available in the incoming record). It then calls the function module above with the parameter I_ICR set to 'X' so it reads the Reuter rates.
I guess i need to create another function module and can be used.
Observation
ODS table fields.
- FISCPER
- FISCVARNT JJ
- FISCYEAR 2006
- /BIC/YREPCURR EUR
- /BIC/YINVCURR JPY
- SALESORG 0010
- /BIC/YMRC 3090
- /BIC/YPLANCYC
- /BIC/YEXCHTYPE S
- - RECORDMODE
Thanx in advance..Hi Badrinath,
Welcome to SDN,
If i guess right then you are asking the question that whether to include the new functionality in existing function module or not.
You can edit the same function module.
but prefrably u can create a new function module.
you have all the details with you u need to check the condition of I_ICR in calling program and then call the new FM or the old one.
creating new function module will also keep the modularisation and clean code.
Hope this helps -
Issue with function module exits
Hi,
execute the T.Code MK01, enter the language 'English' and country 'de'. it's allowing to save the data. I want to raise one pop-up message as 'country and language are not the valid combination please choose right one'. I enhanced in the function module exit. it's raising the message , but it's executing the next screen. how to stop it's first screen and I have to choose the right combination even though I raised message as Error, it's repeating same thing. Please give me any suggestion on this issue.
Thanks & Regards,
Seshu.I have executed CMOD T.Code, we can find the 'include zxf05u01' program . I wrote the code in this include program. select statement is like this. check the code here.
" select single land1
spras
into wa_t005
from t005
where land1 = i_lfa1-land1
and spras = I_lfa1-spras.
if sy-subrc <>0.
country &1 and language &2 are not the valid combination.
message e015(zall) with I_lfa1-land1 I_lfa1-spras.
endif." -
Issue with function module updated values
Hi Experts,
We have an issue with customized program. In this program function module 'BBP_PD_SC_GETDETAIL' not picking
the updated values when the UI was opened. But when we were executing the same function module directly by providing the values manually it is picking up the correct data.
We thought it was a problem with session killing or buffer refresh ? We dont know how to handle this issue.
If you have any suggestions that would be great help full for me . Please reply asap.
Regards,
ChanduHi,
Thanks for your quick reply.
I have passed the values to the function module in the program and also used the same values for manually testing of the function module. Getting the correct values when I was testing manually.
We thought it was a session killing problem as we developed the customized code. So any idea how to refresh the session even
though the UI(User Interface) was opened.
This issue was solved when the UI was closed and opened again.
Any other ideas on this issue ?
Regards,
Chandu -
Issue with function module HR_INFOTYPE_OPERATION in badi HRPAD00INFTY
Hello All,
I have a business scenario wherein, when user saves data for infotype 0002 from tcode PA30, i have create a new record for infotype 0105 by copying existing record and just changing the date.
For the same I am using funtion module HR_INFOTYPE_OPERATION inside badi HRPAD00INFTY method AFTER_INPUT.
When I am running the same function module in a independent program, its running fine. But when I run it inside the badi method, it runs with sy-subrc = 0 and no error, but later in the standard program MP000200,in pai module PRE_INPUT_CHECK, it tries to execute this statement MOVE <namst> TO <subty> and gives dump, with runtime error MOVE_TO_LIT_NOTALLOWED_NODATA and saying that "Error at assignment: Overwritten protected field.".
Have tried all the options of function module HR_INFOTYPE_OPERATION, but nothing is helping.
Kindly let me know if any information on the same.
Best Regards,
Rahul MalaniHave you checked what's in the Subtype field of table T777D for infotype 0002?
IF t777d-namst ne space. "QNOK025939
MOVE <namst> TO <subty>.
ENDIF.
Usually this sentence won't be executed unless there is something in that field. Usually we don't have subtypes for IT0002.
Also make sure that the infotype that gives the dump is 0002 and not 0105.
Regards. -
Data source Enhancement with Function Module
Hi all!
I have a requirement like I have to enhance my Generic Data source.
Let me make it clear!
I have 10 field in R/3 which I am able to get into extract structure using Generic Data Source on the corresponding Table.
I have another field on my extract structure, say ZEXMFLD1 which is updated by a function module ZZ_FUNC_MODULE_SAMPLE.
I came to know that Data source Enhancement can be done, but don't know how.
Request your guidance in this. Can u please let me know how I can achieve this?
Thanks,
SriHi Sri,
You can enhance generic datasources also.
For that you have to use below function modules based on your datasource type.
EXIT_SAPLRSAP_001 - Transactiona data
EXIT_SAPLRSAP_002 - Master
EXIT_SAPLRSAP_003 - text
EXIT_SAPLRSAP_004 - Hier
First check in CMOD(TCODE) whether component RSAP0001 is assigned to any project. If it is not assigned to any project(fresh system), assign it to a project by creating it.
Ex. ZBW. If it is already assigned, go SE37.
For transaction data go to function module EXIT_SAPLRSAP_001(Trans data) and start your logic.
CASE i_datasource.
WHEN 'your data source name'.
call you Function module - CALL 'ZZ_FUNC_MODULE_SAMPLE'.
pass the imported value from above FM to c_t_data.
close case with ENDCASE.
Let me know if you need more info.
- Kalyan. -
Flex2.0 issue with function modul
Hi Experts,
I have a problem within the Visual Composer. When I enter a value for a variable and we push the button to run the function module rsr_var_pers_var_set the paramter for the variable is not transferred to the DSO Personalisierungs Daten für Variablen Ersetzung. We have compiled our model with the flex2.0. When we compile the model with the flex1.5 it works. Is this a bug. Is there any workaround for the flex 2.0?
Thanks
MatthiasHi Amiya,
I have more than 10 variables in the selection screen and I would like to personalize all of them when the user has select or enter his values. Therefore I use the function module RSR_VAR_PERS_VAR_SET. But in the VC model I have to connect for each variable the selection screen with the function module, because I didn`t know if it is possible to call the function module one time for all variables. (When you add the function module to the VC model it`s not possible to enter the parameters for more than one variable.)
Matthias -
Issue with function module SO_NEW_DOCUMENT_ATT_SEND_API1
Hi,
I am new to web dynpro abap.In my application ,im using 'SO_NEW_DOCUMENT_ATT_SEND_API1 function module to send mail.
Application is working fine ,but in code inspector im get error like
Undesirable statement SUBMIT !
Plz help me to solve
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lt_mailsubject
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = lt_packing_list
contents_bin = lt_attachment
contents_txt = lt_mailtxt
receivers = lt_mailrecipients
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 EQ 0.
SUBMIT rsconn01 WITH MODE = 'INT' AND RETURN.
ENDIF.
Edited by: amrutha_prabhu2000 on Mar 29, 2011 6:32 AMHi Amrutha and roopa,
Please go through this.. it might solve your problem.
WebDynpro ABAP
Re: how to send an email with an attachment using webdynpros
Cheers,
Kris. -
Hi Gurus
I have an issue with function module, i am passing a filepath to the function module which is like this /temp/folder/AFILE.csv.
to pull the data from application server. When ever it enters to the function module it is changing the file name as /TEMP/FOLDER/AFILE.CSV( it is changing the entire thing to capitol letters), I just want to know that there is any way where i can pass the file path as it is.
Regards
Kumar.If it is a custom Function module then goto the domain of the file parameter of the FM (if u r using std. domain then change it to a custom domain) and set the lowercase checkbox under Definition tab.
Regards,
Joy. -
Problem with the function module SO_DOCUMENT_SEND_API1
Hi Friends,
I am facing the problem wiht the function module SO_DOCUMENT_SEND_API1,
My actull requirement is : - i need to send the sap data to my externa mail id (Like as XYZ@) with out the any attachment , So i have implemented the code with the function module SO_DOCUMENT_SEND_API1.
The mail has successfully sent the sap inbox (SOST) but the mail are not reached to the external mail ID'S( XYZ@GMAIL)
i Have maintained my code lines same as below.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc_data
put_in_outbox = ca_x
commit_work = ca_x
TABLES
packing_list = tb_packing_list
contents_txt = tb_mailbody
receivers = tb_receiver.
Can you please tell me soultion ,
Thanks
charan.Hi charan,
If u r able to see the mail in sost, then i think ur code has worked fine. if the mail is not going to outside domains from sost u need to do some configurations for that, u can find lots of configuration docs regarding mail setup in sap.
once try to pass below parameter also.
t_receivers1-rec_type = 'U'.
For configuring mail setup u need to sit with ur basis guy.
Moderator message: please do not use SMS speak.
Edited by: Thomas Zloch on Nov 23, 2010 5:51 PM -
Generic Data Source with Function Module data mismatch in BI
Hi All,
I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
when I run the InfoPackage in BI im Getting more no. of records than what i got executing the function module..
and single record is divided into 2 records in BI side(not all the records), how can it be possible???
is there anything Im missing to explain you my issue???
if understood please help me out.
Thanks n Regards,
ravi.the datasource frame work starts the function module several times.
1. the initialization
2. the serval times, until you "raise no_more_data".
check you coding: have you refreshed necessary internal tables.
Sven -
Generic Data Source with Function Module data mismatch
Hi All,
I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
when I run the InfoPackage in BI im Getting more no. of records than what i got executing the function module..
and single record is divided into 2 records in BI side(not all the records), how can it be possible???
is there anything Im missing to explain you my issue???
if understood please help me out.
Thanks n Regards,
ravi.HI rkiranbi,
1. FIrst you excute function module according to your paramers, you will get some records. then goto tcode RSA3 --> excute
Provide your Data source name and under setting we have options like Data records/calls, Display extractor calls and selections --> fields .
in that options you have to increase the values. and then you have to pass paramers in RSA3 according to your function module
selections in SE37. Now you will get equal values in both functin module selection and RSA3 Selection. if it fail means you need to
check coding logic in function module.
2. if your are getting wrong values in BI System then check with
1. compare with PSA data and data target data (here you need to check with characterstic as well as keyfigures)
if you find any mistake you need change the coding in function module according to client requirement.
2. compare data with RSA3 and bi report data or data target data.
check it properly above steps, you will get solution.
thanks and regards,
malli -
Problem with R/3 Data Source based on Function module in SAP BI
Hi,
We have a data source based on functional module. When we load data from R/3 to BI we face the following error.
" No end-confirmation arrived in the Warehouse from the source system."
We are getting data but due to no end confirmation from the source system, the load become timed-out and status becomes "RED". When we change the status to be "GREEN" and proceed tha load further, load is fine.
Please suggest us a suitable solution.
Thanks in Advance,
GeethaHi Geetha Devi Ramalingam.
I faced the same problem since yesterday. I just resolve the issue.
So here is my solution :
try this code :
FETCH NEXT CURSOR s_cursor
APPENDING CORRESPONDING FIELDS
OF TABLE e_t_data
PACKAGE SIZE s_s_if-maxsize.
IF sy-subrc <> 0.
CLOSE CURSOR s_cursor.
RAISE no_more_data.
ENDIF.
if you add your
bold
IF sy-subrc <> 0.
CLOSE CURSOR s_cursor.
RAISE no_more_data.
ENDIF.
bold
than the sy-subrc may be equal and than your CLOSE CURSOR s_cursor. will have no effect
it work for me hope it will for u
Hard luck!
Salah
Edited by: idrissi salaheddine on Jan 19, 2012 12:24 PM -
To update Employee Data with Function module
Hi
CRM employee master and HR employee master need to be mapped
for the labor cost posting function to work.
In BP transaction (Change in BP role : Employee),
I could update "Personnel number" and "User Name"
under Identification Tab
now I need to do same job with Function module in report program.
Anybody knows that what Function module should I use ?
I tryed to do it with Function "CRMXIF_PARTNER_SAVE"
but I only succesed to update imformations under Adress tab in BP transaction.
thank you.Use FM BAPI_BUPA_CREATE_FROM_DATA.
Rg,
Harshit -
Attachment using function module SO_DOCUMENT_SEND_API1
I am using the function module "SO_DOCUMENT_SEND_API1" to send a mail with a pdf attachment. My e-mail contains some text also.
The problem is along with the PDF I am also getting a TXT file as an attachment, which contains the same text data as the e-mail content. How can I delete the TXT attachment?
AnjuCALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
sender_address = w_sender
sender_address_type = w_sender_add_type
TABLES
packing_list = it_packing_list_mail
contents_bin = it_attachment
contents_txt = it_mess_body_mail
receivers = it_receivers_mail
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DESCRIBE TABLE it_mess_body_mail LINES w_cnt.
w_doc_data-doc_size = ( w_cnt - 1 ) * 255 +
STRLEN( it_mess_body_mail ).
w_mtitle = text1222.
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = w_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR it_packing_list_mail.
it_packing_list_mail-transf_bin = space.
it_packing_list_mail-head_start = 1.
it_packing_list_mail-head_num = 0.
it_packing_list_mail-body_start = 1.
DESCRIBE TABLE it_mess_body_mail LINES it_packing_list_mail-body_num.
it_packing_list_mail-doc_type = 'RAW'.
APPEND it_packing_list_mail.
DESCRIBE TABLE it_attachment LINES it_packing_list_mail-body_num.
it_packing_list_mail-transf_bin = 'X'.
it_packing_list_mail-head_start = 1.
it_packing_list_mail-head_num = 1.
it_packing_list_mail-body_start = 1.
it_packing_list_mail-doc_type = 'XLS'.
it_packing_list_mail-obj_name = 'ATTACHMENT'.
it_packing_list_mail-obj_descr = 'Attached Document'.
it_packing_list_mail-doc_size = it_packing_list_mail-body_num * 255.
APPEND it_packing_list_mail.
Thanks,
Anju
Maybe you are looking for
-
Missing fonts warning when adding pages to a book
I have a book with 13 documents added and 105 total pages. I have 10 master pages set up, and each time I add (or delete) pages to a document, I get warning: "The document <doc>.indd needs to be updated but has missing fonts. It may recompose with a
-
Which include i can use instead of PNP LDB
Hi Friends - Which standard include i can use for PNP LDB ? am working in abap webdynpro and need to use some macro like rp_provide_from_last but for them we have to use pnp ldb and in abap webdynpro we can't define LDBs so i need the standar
-
Issues connecting to FTP sites from OS/X Computers
Hello, I have a network that is mixed with Windows and OS/X Lion, Snow Leopard machines. We access external FTP servers to download files that are needed. None of my OS/X machines are able to connect to the FTP servers while all of my Windows machine
-
How to import photos from another program on computer eg. Adobe Photoshop
Can photos be imported to IPhotos from another program on the same computer eg. Adobe Photoshop?
-
How to create graph by JSP