How to change sender's name in  FM SO_NEW_DOCUMENT_ATT_SEND_API1

Hi Friends ,
I am using FM "SO_NEW_DOCUMENT_ATT_SEND_API1"
I want to change sender's name in this Fm. Actully when i am using this FM , in place of sender my name is goign but i want to send system name.
Please help in this.
point will be assign,

Hi,
Have a look on the following code,it sends an email with attachment to the SAP inbox
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
w_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_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 = 'ZCS_FORM6'
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING '~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~'.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Refresh: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear w_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Object with main text of the mail.
i_objtxt = 'Find attached the output of the smart form.'.
APPEND i_objtxt.
i_objtxt = 'Regards,'.
APPEND i_objtxt.
i_objtxt = 'Chandu Valluri'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = v_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Smartform_output' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = sy-uname.
i_reclist-express = 'X'.
i_reclist-rec_type = 'B'. "SAP User
APPEND i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = w_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.
IF sy-subrc = 0.
write:/ 'This is successful'.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward,if useful.
Thanks,
Chandu

Similar Messages

  • How to change Sender`s Name in SOST transaction

    Hi all,
    I`m a newbie to SDN. My requirement compels me to change the sender`s name in SOST Transaction. How can I change this? I mean which table and which field should i be looking for, to do this.
    Thanks & Regards,
    Gnanasambanthan. V
    Edited by: Gnanasambanthan Venkataraman on Aug 19, 2008 8:58 AM

    Thanks Mr.  Dzed Maroz for the answer,
    The issue has been solved.
    The thread is closed
    Regards,
    Gnanasambanthan.V

  • How to Change the Alias name for Internet user in SU01 tr code through cod?

    Hi Guys,
                 My req is we have to change the Alias name(SU01 tr code) for the existing users thru code.So can anybody tell me how to change the Alias name like which we do it in SU01 tr code thru code or FM.?
                Is there any FM for tha changing Alias Name?
    Thanks,
    Gopi.

    Hello Gopi Anne ,
                                 You can use the following FM / BAPI :
    BAPI_USER_CHANGE
    MY_BAPI_USER_CHANGE
    For BAPI_USER_CHANGE :
    You need to make use of the IMPORT parameter :
    ALIAS     TYPE     BAPIALIAS                               User Name Alias
    ALIASX     LIKE     BAPIALIASX                               User alias change flag
    Thanks,
    Greetson

  • How to change the folder name in the web report.

    hi experts,
    can anybody give me the solution, how to change the folder name in the web report. any help is appreciated.
    waiting for ur favourable response.
    thanks
    suri

    Hi Tony,
    Yes, the business requires, only to change in the webreport only not in bex and roles. any suggestions will be helpful to me.
    thanks
    surendra

  • How to read Sender Interface name in adapter Module in PI 7.31

    Hello All,
    I am working on Adapter module .it accomplish to generate file with message id,message key ,sent time,received time,FromService(Business system names),toServiece(Business system name),sender interface name,receiver interface name .
    i got all details in my file by calling module data by method get principal data,but i am fail to get sender interface in that file .
    can you please guide me how to get sender interface name in adapter module.
    I am getting some information from this following blogs
    https://scn.sap.com/thread/1583665
    How to read Sender Interface name in Adapter module
    but i am facing same error what they faced.
    Please guide me to how to get sender interface name in adapter module.
    Thanks
    Ganesh

    Hi Ganesh
    Write a module in the sender adapter and use this piece of code
    Message mes = null;
    mes = (Message) inputModuleData.getPrincipalData();
    String SI = mes.getAction().getName();
    Also you can read the same by creating a UDF in message mapping
    Following is the code
    InputHeader inputHeader = container.getInputHeader();
    String SI = inputHeader.getInterface() ;

  • How to change data source name and context root during deployment

    Hi,
    Env:
    WLS 10.1.3
    JDev 11.1.1.6
    Hudson
    I need to deploy two instances of my ADF application on the same development enviroment. We are using Hudson to deploy. My question is how to change data source name and application context root before second deployment.
    Kuba

    I don't believe there is an inbuilt facility to do this.
    Previously how I've done this is when checking files out using Hudson jovs, before the build I then use an Ant extension called XmlTask (http://www.oopsconsultancy.com/software/xmltask/) to modify the required XML files.
    Can I ask why you're doing this in the first place please? Multi-tenancy? 2 versions of the same app?
    CM.

  • How to change ASE server name in windows

    how to change the server name in Adaptive server enterprise running on windows

    Windows is going to require a few more steps if ASE is running as a service.
    Update all registry entries containing <servername> with <newservername>:
    HKLM\SOFTWARE\SYBASE\Server
    HKLM\SYSTEM\CurrentControlSet\Services\SYBSQL_<servername>[ _BS | _XP ]
    NOTE: Doing a registry search on <servername> will bring up a ton of other locations, eg, legacy entries, ControlSet00X, etc ... not sure if all of these have to be changed, too ...
    NOTE: Haven't installed any of the latest ASE packages in windows so don't know if SAP's gone an changed the HKLM\SOFTWARE sub-branch name from SYBASE to SAP
    =========================
    In addition to Ryan's notes:
    - any other sysservers entries that refer to the old servername (eg, loopback)
    - any remote servers would need to update their external/remote logins, remote servers and/or proxy definitions ... as appropriate
    - if the ASE is involved in replication then you're looking at whole 'nother can of worms ... off the top of my head ... rs_databases, rs_idnames, rs_repdbs ... and of course any repdefs/subs that include the ASE name ?
    - obviously (?) any monitoring/maintenance/operational jobs ... documentation ...

  • How to change an account name?

    Hello
    How to change my account name?
    Name is very old and needs an update.
    Thanks,
    Villem

    Unfortunately, you can't.
    Can I change my Skype Name in Skype for Windows desktop?
    Regards,
    Tamim
    Location - Dhaka | Bangladesh - Standard Time Zone: GMT/UTC + 06:00 hour
    If one of my replies has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others.

  • How to Change Journal Header name to Custom Header Name while GL Importing?

    Hello Experts,
    I am in situation where customer wanted to keep their own journal header naming conventions to imported journals in Oracle GL for custom Journal sources.
    As I know while importing journals, Oracle Creates the Journal Name based on the below mentioned logic.
    "Journal Import creates a default journal entry name using the following format:
    (Optional User-Entered REFERENCE4)(Category Name)(Currency)
    (Currency Conversion Type, if applicable)
    (Currency Conversion Rate, if applicable)
    (Currency Conversion Date, if applicable) (Encumbrance Type ID, if applicable)
    (Budget VersionID, if applicable). If you enter a journal entry name,
    Journal Import prepends the first 25 characters of your journal entry name to
    the above format"
    But then How it is possible to only allow journal header Name to be used present in REFERENCE4 excluding all other string provided by Oracle? Instead of using omitted string custmoer wanted to keep their own parameters. Example - REFERENCE4.A.B.C etc.
    Is it possible to solve this using seeded setup or modifying some hook packages or anything else?
    As far as I know there can be one workaround to be use of updating journal header name after journal import being completed successfully for custom journal source. But only fear is Oracle doesnt allow updating the base table without API. Am I rght?
    So it would be really great if anyone of you can suggest the best solution or best possible workaround.
    Thanks

    Duplicate - How to Change Journal Header name to Custom Header Name while GL Importing?

  • How to change the bluetooth name? in my pc,

    Hi there!
    How to change the Bluetooth name for my N70.
    I can change it in my N70, but the first installed name still pops up on my computer. Can't find it anywhere so i can have the same name in my phone as on the computer. Is there some kind of registry that keeps the first name maybe??
    Any ideas?
    Owned: Nokia 1600 - 3120 - 5110 - 6110 - 7110 - 6310i - N70 - N72.
    Using now: 6310i & N70 - N72

    I am not sure about how to change SERVICE_NAME in PL/SQL Developer (if at all it can be done in that ), but you will have to change the SERVICE_NAME in the TNSNAMES.ORA file.
    1. Locate the entry for PLSExtProc in the file tnsnames.ora at:
    $ORACLE_HOME/network/admin/tnsnames.ora
    2. Change the SERVICE_NAME = ORCL
    3. Save and reconnect
    Aalap Sharma :)

  • I have a MacBook Pro, how to change the computer name in the "Find Iphone"

    I have a MacBook Pro, how to change the computer name in the "Find Iphone"?

    Thank you for help! I was inattentive reading your answer. The thing which confused me was that I noted in blue. I had to just write in a red box and close the configuration window.

  • Has anybody found out how to change the workgroup name in 10.5?

    I have been trying to connect to XP machine shared folders and it is not working.
    I've tried using smb and it gives connection error or says Ithe user has not permission in the machine
    I've started in 10.4 from backup disk and it is working OK.
    I see that in 10.4 it asked for DOMAIN/ Workgroup name , and this option has disappeared in 10.5
    Has anybody found out how to change the workgroup name in 10.5?

    System Preferences - Networking

  • HT1428 How to change the account name in Mac OS X via a command line. I did a type-o on the account name. So instead of it saying "Company" it says "Comany"  for the account logon.

    How to change the account name in Mac OS X via a command line. When I created the account I mistyped the name. I have a management suite where I can execute remote scripts. I would like to run a script that changes the name from oldname to newname.
    None of these Macs have been used currently.
    Thank you,
    Brian

    If user account shortname, see Changing user account shortname

  • How to change the "short name (account name?)" and home directory name?

    Hi,
    I recently purchased a new iMac and migrated account info from my MacBook Pro.  I happened to use random account name during migration without knowing it will not be easy to change the short name (account name?) and home directory name.  As a result, I am now having extremely confusing short name and home directory name on my new iMac.
    I did online search to find out how to change the two names, but I could only found somethig like "enabiling root user and....."  I have no idea what it was talking about and I don't want to take risk altering such advance set up manually.
    Please advice how I can change the short name and home directory name safely without much PC knowledge.
    Thank you very much in advance.

    There are a few ways of doing this. The easiest method is logging into the first account and copying everything to an external drive (or flash drive or whatever), which changes the permissions so that others can see the files.
    Then, login with the new account and copy the files over. Once they are copied, the correct permissions will be applied again (so other people on your computer can't access them).
    If you can't do this method for one reason or other, you can do some terminal commands to change the ownership of the files. Login to the new account. If it is an admin account, open terminal and type the following command:
    sudo chown -R -v yourusername:admin /Users/originalaccountnamehere
    That should change the ownership of the files from your old account to the new one. At that point, you can simply drag the files into place.

  • How to change your user name for the Ipod nano...

    Can anyone please explain how to change the user name on your Ipod nano?

    hiya!
    do you mean the nano's name in the ipod source list?
    if so, select the ipod in the itunes sourcelist. click on it once, and pause for a second or so. you should then be able to type in what you please.
    love, b

Maybe you are looking for

  • Unable to Capture files

    Hi, I've been trying to perform a capture using Premiere Pro CS4. The camera im using is Sony DCR-HC42e. When I try using the capture feature, and the setting are for DV, the capture window advisory shows " Cant activate recorder. Try resetting camer

  • Mail and Keychain

    I have about 10 different mail accounts, on 2 of them only, the password won't register with my keychain even though I keep checking the box and then again only some of the times Any ideas ?

  • Text Edit Tool icon missing in Acrobat Standard X

    Hi, In Acrobat 8 Standard, when I click "Text Edit Tool" icon, I can start insert, delete or replce text comments without re-click any  "insert", "delete" or "replace" icon in the Text Edit Tool until I press"Esc" key.  I just install Acrobat Standar

  • Ibook hard drive needed, old one is going out....

    yes, making a horrid lawn-mower or hellicopter sound at times, then crashing. so i need to replace the hard drive, but where do i get it and what kind?

  • ITunes LP HELP.

    I bought the blueprint 3 itunes lp and everytime I change the album title on the LP file AND the songs in itunes then go to play the lp it doesnt load it jus opens a blank white window. because my itunes is so organized I wanna know how to change it