Using pico or nano to edit text file in ssh connection to remote osx host

Hi everybody!
I can not get thru to a point when I'll be able to edit files on a remote osx comuter with pico or nano editors. When I connect thru ssh and start pico it says
Error opening terminal: network
I am a newbie to Unix beast. Vi is too complex for me.
Thanks,
Maxim
PowerBook G4 1GHz 12 40GB SD   Mac OS X (10.4.4)  
PowerBook G4 1GHz 12 40GB SD   Mac OS X (10.4.4)  

Maxim,
The problem appears to be the value of your environment variable TERM. It seems to be set to network. It needs to be set to something that pico and nano will understand. Since I do not know what your shell is I need to give you two methods of setting the TERM variable. One of the methods will fail as it is not appropriate for the shell you are using. If it does, don't worry about it just try the other method.
The first method has two commands. Note: capitalization is significant here. They are:
TERM=vt100
export TERM
If those commands give an error message, use this command:
setenv TERM vt100
You should now be able to edit your files.
I am using a terminal type of vt100 as it is about the simplest terminal type and is supported by just about every unix you might be using to connect to the mac as you do not provide that information.
Hope this information helps.
Curt

Similar Messages

  • Remotely editing text files in Windows WinRM/PSExec/Powershell/cmd

    Hi!
    How can I remotely edit a text file in Windows?
    I am running and administering a number of Windows 7 workstations and Windows Server 2012 machines. I would like to be able to remotely edit text files on any of these machines. I can connect to any of these machines via psexec or powershell remoting. I
    can also connect via rdp, but for the workstations I would rather not kick the user off unless I absolutely have to.
    For example, we manage state configuration using
    Salt. Local configuration files are stored in C:/salt/conf. I would like to be able to edit these config files on the fly.
    This question on Stack Overflow covers the same topic, but none of the answers are particularly satisfying. Some of the possible solutions
    are:
    Remote Desktop: as I say, I would rather not have to kick a user off their workstation
    Edit a file over a UNC path: this only works for files on a share, and setting up arbitrary shares for quick edits seems like a bad idea.
    Install some manner of ftp or ssh server on all the target computers. This would certainly work, but it is it necessary with WinRM already active? I feel like installing and configuring extra software across all the machines in my organisation would be
    a last resort.
    Edit with a command line editor (e.g. vim, emacs) over a remote powershell session. This doesn't work. I don't understand the technical details, but a powershell remote session isn't interactive in the same way that ssh connections are.
    Edit using powershell's -replace operator, out-file and add-content cmdlets. This works, but is hardly the same as a fully featured text editor.
    Retrieve content from the remote, edit locally, and post back to the remote. This works, and is arguably the best solution I've found. Code sample from SO:
    PS C:\Users\Meredith> Invoke-Command -Session $ps -ScriptBlock {get-content c:/inetpub/myapp/web.config} > web.config
    edit web config
    PS C:\Users\Meredith> get-content web.config | Invoke-Command -Session $ps -ScriptBlock {set-content c:/inetpub/myapp/web.config}
    The last two options are the workflow that I've been using for now. Regex replacement for very simple changes, and copying to local and editing there for more complicated ones. Neither is ideal, but they work. It just feels incredibly old fashioned.
    I'm considering writing a plugin to my editor of choice (vim) to perform the remote fetch and save, to make my workflow a little bit smoother. Before I try that, I just want to know if there's anything that I've missed, or misunderstood.
    Cheers

    What is the "redirector"?
    I posted the same question to Stack Overflow, and was told about administrative shares. I wasn't aware of this, and it's exactly what I wanted. I can open the filetree of a remote machine with the path \\machinename\c$\. Perfectly simple, now that I know
    the answer.

  • Editing text file on application server

    Hello,
    I have created a utility in which I can move files from one folder to another. Now we also need a option by which I can edit text file on the server folders. Is there a function module by which I can edit text from application server ?
    Regards,
    Rajesh.

    With OPEN DATASET and READ you can load them into an internal table. Next put them on screen in lets say the text editor (enjoy SAP Controls). This is one way of doing this, other way would be:
    Upload data with OPEN DATASET into internal table, download file to local drive (cl_gui_frontendservices=>gui_download), open it with notepad (for example) edit it and save. Next upload file into your program (cl_gui_frontendservices=>gui_upload) and download it to server again (OPEN DATASET and TRANSFER).
    If available you can also use transaction CG3Z and CG3Y.

  • Read and Edit Text Files

    I wanted to find out if there is a way to read linux
    configuration files, edit parameters in them and save them using
    coldfusion. I know PHP has the capability to do this, but I don't
    know if CF does and how powerful it is.

    If it's plain text, just write it into a textarea and let
    your users edit it there. When they submit, use cffile to overwrite
    the text file.
    There are other ways to allow users to edit text in a web
    app, such as the "contenteditable" attribute in IE, but the basic
    idea remains the same.
    Or do you mean that the app will alter the files
    automatically? If that's the case, then regular expressions would
    likely be the way to go.

  • How can I use sql loader to load a text file into a table

    Hi, I need to load a text file that has records on lines tab delimited into a table. How would I be able to use the sql loader to do this? I am using korn shell to do this. I am very new at this...so any kind of helpful examples or documentation would be very appreciated. I would love to see some examples to help me understand if possible. I need help! Thanks alot!

    You should check out the documentation on SQL*Loader in the online Oracle document titled Utilities. Here's a link to the 9iR2 version of it: http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96652/part2.htm#436160
    Hope this helps.

  • Using counter to time stamp to text file

    Dear all,
    I am using counter to acquire singnal from quadrature linear encoder. I would like to time stamp the data acquisition to text file but I found that I can't choose to read time. Anyone know how to solve this problem?
    Attachment is my program.
    Thank you very much!
    Best regards,
    George
    Attachments:
    encoder continous 21-4-2013.vi ‏28 KB

    Hi,
    Have you seen these two articles?
    http://digital.ni.com/public.nsf/allkb/68806B93A21​355E98625726F0064822B
    http://digital.ni.com/public.nsf/allkb/5D42CCB17A7​0A06686256DBA007C5EEA
    Basically, it can be done, but be aware it may not be as accurate as you would like.  Follow the code in the first article and note that the easiest way would be to just use the basic File I/O VIs to write to text file, since the Write to Measurement File VI will only work with waveforms and you have counter output.
    Matt Lee
    National Instruments
    Applications Engineer

  • Using a scanner to parse a text file

    Hi,
    I'm running into some difficulties using a pattern for my scanner (java.util.Scanner). I need to scan a text file which consists of records. Each record has a keyword and a value (like property files):
    Example:
    FACILITY=TEST
    LOT=1234567
    DEVICE=abcdefgNormally, every record will be ended by a carriage return and line feed. So what I did was using a scanner with cr/lf as delimiter. That worked fine for most records but there are some records which span several lines (with cr/lf at the end of each line), e.g.:
    MAP_XY.01.01=" Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20
    19/15 13/4 Y-3 34/24 22/13 11/2 Y-2 36/30 28/24 22
    21/12 10/4 2/0 Y-1 38/0 Y0 40/35 33/22 20/15 13/0 Y1 41
    40/32 30/8 6/-1 Y2 42/26 24/-2 Y3 42/-5 Y4 47/11 9
    8/3 1/-6 Y5 48/47 45/39 37/18 16/-7 Y6 49/8 6/-8 Y7 49
    47/8 6/4 2/-8 Y8 50/9 7/3 1/-9 Y9 51/11 9/-10 Y10 51
    50/33 31/-10 Y11 52/40 38/35 33/23 21/16 14/-11 Y12 52
    51/34 32/15 13/4 2/-11 Y13 53/40 38/35 33/-12 Y14 53
    52/35 33/27 25/18 16/13 11/9 7 5 2/0 -4/-12 Y15 53
    52/-12 Y16 53/22 20/-5 -7/-13 Y17 54/47 45/-7 -9/-13 Y18 54
    53/22 20 18/2 0/-13 Y19 55/16 14/13 11/-2 -4/-13 Y20 55
    53/41 39/35 33/-14 Y21 55/52 50/48 46/16 14/10 8/-2 -4
    -6/-14 Y22 54/33 31/7 5/4 2/0 -2/-9 -11/-13 Y23 55
    54/53 51/26 24/-2 -4/-13 Y24 55/15 13/-14 Y25 55 53
    52/-7 -9/-10 -12/-14 Y26 54/44 42/14 12/10 8/-4 -6
    -7/-10 -12/-13 Y27 55/52 50/23 20/16 14/-13 Y28 54
    53/12 10/-1 -3/-13 Y29 55/44 42/-13 Y30 55/15 13/10 8
    7/-13 Y31 55/17 15/-13 Y32 54/44 42/-1 -3/-13 Y33 54
    53/41 39/30 28/-13 Y34 54 52/37 35/19 17/12 9/8 5/3 1
    0/-4 -6 -9/-11 Y35 54/-13 Y36 54/35 33/31 29/13 11
    10/2 0/-2 -4/-13 Y37 54/-13 Y38 53/11 9/0 -2/-9 -11
    -12 Y39 53/35 33/31 29/-12 Y40 53/22 20/15 13/-12 Y41 52
    50/15 13/10 8/-11 Y42 52/11 9/5 3/-6 -8/-11 Y43 51
    50/41 39/10 8/0 -2/-10 Y44 51/28 26 24/15 13/12 10
    9/-10 Y45 50/43 41/32 30/4 2/-9 Y46 49/31 29/13 11
    10/-8 Y47 49/47 45/30 28/24 22/-8 Y48 48/42 40 38/12 10
    9/-7 Y49 47/42 40/38 36/-6 Y50 44/33 31/30 28/6 4/-5 Y51 44
    43/28 26/17 15/13 11/-2 Y52 44/32 30/-2 Y53 43/32 30
    29/13 11/-2 Y54 42/27 25/24 22/16 9 7/-1 Y55 41/21 19
    18/0 Y56 39/15 13/6 4 2 Y57 38/20 18/3 Y58 36/5 Y59 34
    33 31/30 28/7 Y60 31/28 26/10 Y61 27/14"
    BIN_COUNT.01.09=12345Using the following delimiter does not work
    fileScanner.useDelimiter("\\s*=\\s*");because the result would be something like:
    keyword: FACILITY     value: TEST
    LOTkeyword: 1234567
    DEVICE     value: abcdefgWhat I need is a pattern which also handles carriage return/line feed until a new keyword (like LOT for example) occurs.
    The correct result should be:
    keyword: FACILITY     value: TEST
    keyword: LOT            value: 1234567
    keyword: DEVICE     value: abcdefg
    keyword: MAP_XY.01.01 value: " Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20...
    {code}
    I hope, I did explain clearly enough...
    Any help would be appreciated.
    Thanks and best regards
    - Stephan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Any help would be appreciated.You have grouping and data in the groupings and you are attempting to parse it all at one go.
    Won't work. (Might in a perfect world but not in this one.)
    You need a parsers that do the following
    1. Parser text file (stream) into records.
    2. Parse records into data.
    You can put both into one class or not.
    Your record parser is going to be based roughly on the following scheme.
    1. Find keyword,
    2. Look up format defined for keyword
    3. Attempt to read format found.
    4. Error if format not found.
    5. Else return the record found.
    I say roughly because as noted above you need to know what the actual output looks like. It is possible to determine this if you have enough examples but it is a lot easier if you actually get the specification that tells you what it looks like.
    I suspect, but don't know that the "format" in the above will consist of the following.
    <word><text>
    or
    <word><text>
    <space><text>
    <space><text>
    You could just create one format for the all but you will likely have record types that don't fit that and the earlier you detect errors the better.

  • EDITING TEXT FILE

    anyone here know how to edit a text file
    i can open the file and i try println it adds to the already content of the file
    i was thinking of EDITING THE FILE
    i mean changing some parts of the files
    example i could always change line #2 if it contains data about AGE
    somehing like that

    i was thinking of EDITING THE FILE
    i mean changing some parts of the files
    example i could always change line #2 if it contains
    data about AGE
    somehing like thatThe easiest way is to read the whole file, line by line, and store the lines in a String array. Then change the lines in the array. Finally, overwrite the file with the lines in the array.
    Unfortunately, there is a slight problem with doing that. Suppose you write the first line to your file. That will delete everything in the file. But then suppose your program crashes. Poof! You will lose all your data except the one line you wrote to the file.
    So to be safe, you need to write to a new file, and when you are done, delete the old file and then change the name of the new file to the old file name. Creating File objects for your files will provide the means for doing that.

  • Issues with cs5.0.03- cannot use CUDA, cannot find cuda support text file

    Hi,
    I am working with a big project and recently upgraded my video card to a GTX 570.
    I cannot enable the CUDA engine in project settings, it is completely greyed out..  Doing some searches, everyone seems to point at a cuda support text file...
    Kicker 2-
    I go to the Root directory of where adobe is installed, see the CS5 folder- with NO Cuda supported list.... Do a complete search of the whole machine, nothing.
    Updated adobe, no change
    Most up to date video drivers from Nvidia are already installed. 
    Went through Nvidia control panel to manually set it to render using the GPU- no change...
    I am at a loss here, any ideas or help would be much appreciated.

    Hello,
    Thank you for your time-
    Ok, I remoted back into the machine and took a closer look again,  Somehow half of the CS5 suite is on the C drive, and the other is on the storage- CS5 primarly. How I personally do not know, but from there was able to locate the needed folders, and created the text file.  All is well now, I just told them to finish the project first, before we move it over where it belongs.
    Joe Bloe P. Thank you very much.

  • How can I use JDeveloper 3.2 to edit *.js file?

    Could someone please tell where to configure JDeveloper 3.2 to recognize javascript files with the .js extension?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected] - JDeveloper Team:
    Hi,
    I don't think it's possible to get syntax highlighting etc. for .js files, but you can tell JDevleoper to treat them as text files by editing the line that starts:
    jdeveloper.ide.treatAsText
    in jdeveloper.properties in the jdev lib directory to include .js. Make sure you close JDev before editing this file, since it overwrites it when it quits.
    Brian<HR></BLOCKQUOTE>
    Thank you Brian that easily solved my problem.
    null

  • How to edit Text Files?

    Hi,
    I have a text file with sample data like this.
    Nokia|25
    Motorola|30
    LG|20
    Samsung|50
    Sony|25
    I will get an argument like ‘Nokia’. I need to compare it with the data in the file. If I find a matching record in the file, I need to decrement the quantity, i.e 25 in this case(Nokia) and display a message in the screen.
    Can someone tell me how this can be achieved?
    Thanks.

    Thanks for your reply. You have mentioned "When an update happens flush the list of items back to the file. ". If I am going to write it back to the same file, it will get appended right?. I need to update the file. Do you mean to say that i delete the existing file and re-create it and then flush the contents into the file?
    I have just started coding in Java. So if incase you feel my question is absurd, please excuse me.

  • Using my iPod Nano 4GB (2nd gen) with the Fatman iTube's  remote control.

    I am using the iPod Nano 4GB with my new 'Fatman iTube' valve amp and dock.
    http://www.fat-man.co.uk/docs/product/itube_1.htm
    All works fine (beautiful sound) but only some of the remote control functions work.
    Volume and power off/on and treble/bass work fine but the iPod functions like skip and FF and playlists and menu dont work from the remote control.
    The company that make the amp (TLA) and the dealer (Audio T) both inform me that this is a common problem with remote controls on 3rd party iPod dock hi-fi systems and that Apple are not revealing when they will issue a software fix.
    It only happens with 2nd gen Nanos. All other iPod types talk with these remotes with no problem.
    I have been given a temporary 'workaround' by the manufacturer which is OK for now.
    Have any of you had similar problems between the 2nd generation Nano and remote controls on 3rd party (non Apple) hifi systems?
    Thanks
    iMac 20" Mac OS X (10.4.9)
    iMac 20" Mac OS X (10.4.9)

    hi,
    try the following article my friend...it will definitely resolve your problem..
    http://docs.info.apple.com/article.html?artnum=302420
    http://docs.info.apple.com/article.html?artnum=61711
    Regards,
    Sam

  • Help about editing text file by QT

    Hi again
    I have faced another problem today >> which is so bad
    see this screenshot to understand the problem : http://qkpic.com/c28fb
    Has anybody an idea about how to solve that ?
    This is a quick review about how to do it : http://www.youtube.com/watch?v=6PS2FOjRCgk
    But it dznt work with me at all !
    i tried it in both ".txt" & "png" files >> it dznt work
    Please if anybody has a solution for this problem ,, i would be grateful a lot
    Thanks in advance
    sc0rpio

    Jon Walker wrote:
    My guess would be, if you tried using a PNG image and this work flow failed, that you neglected to export the PNG file with an alpha channel. You must either create the image file on a transparent background or designate what area of the image is to be made transparent before exporting with the alpha channel.pecifics for doing this depend on the graphic application you use. If using an application like Photoshop, create the image as you normally would and then go to the help menu and follow instructions for exporting a transparent image. Either an PNG or GIF will work.
    @Jon Walker
    Thanks for the reply
    You are right if i am using a picture ,, but let me remind you that i am using a subtitle file ".txt"
    which i opened by Quicktime to merge it with the movie file to get a translated movie.
    Anyway ,, i have converted the subtitle file to a ".mov" file so that i can now open it by photoshop
    it's opened as layers ( about 50 layer ) and i am trying now to edit the first layer and apply then to
    all ,, i hope that it works.
    See this screenshot : http://qkpic.com/32ee6
    i believe that it can be solved directly just by using QT >> i feel there is a simply way

  • Editing text files

    Im trying to write a program that opens many files .def and should replace every / with \.
    but I'm encountering problem with the method that has to replace the character in the file.
    first attempt:
    public void changer(String pathFile){
         try{
              RandomAccessFile toEdit = new RandomAccessFile(new File(pathFile), "rw");
              String line = "";
              while(line != null){
                   riga = toEdit.readLine();
                   String newLine;
                   newLine = line.replaceAll("/", "\\");
                   toEdit.writeChars(newLine);
              toEdit.close();
         catch(IOException e){
              System.out.println(e.getMessage);
              System.exit(1);
    }this throws an exception java.lang.StringIndexOutOfBoundException: String index out of range: 1
    exception in thrown by replaceAll method.
    second attempt:
    public void changer(String pathFile){
         try{
              RandomAccessFile toEdit = new RandomAccessFile(new File(pathFile), "rw");
              String line = "";
              while(line != null){
                   riga = toEdit.readLine();
                   String newLine;
                   for(int i = 0; i<line.length(); i++){
                        if(riga.charAt(i) == '/'){
                             newLine = line.replace('/', '\\')
                             toEdit.writeChars(nuovaRiga)
                        else
                             continue;
              toEdit.close();
         catch(IOException e){
              System.out.println(e.getMessage);
              System.exit(1);
    }this throws an exception java.lang.NullPointerException
    thrown by length() method.
    problem 2: both method don't replace line with newLine but just write newLine after line in the text.
    I've read the api documentation for RandomAccessFile but I haven't found a method that really substitute the line or only the char.
    any suggestion?

    No, you are never reading a second line, you read into riga, which you ignore.oh, sorry, that was an error in copying/translating my code.
    here's the correct one.
    public void changer(String pathFile){
         try{
              RandomAccessFile toEdit = new RandomAccessFile(new File(pathFile), "rw");
              String line = "";
              while(line != null){
                   line = toEdit.readLine();
                   String newLine;
                   newLine = line.replaceAll("/", "\\");
                   toEdit.writeChars(newLine);
              toEdit.close();
         catch(IOException e){
              System.out.println(e.getMessage);
              System.exit(1);
    public void changer(String pathFile){
         try{
              RandomAccessFile toEdit = new RandomAccessFile(new File(pathFile), "rw");
              String line = "";
              while(line != null){
                   line = toEdit.readLine();
                   String newLine;
                   for(int i = 0; i<line.length(); i++){
                        if(line.charAt(i) == '/'){
                             newLine = line.replace('/', '\\')
                             toEdit.writeChars(newLine);
                        else
                             continue;
              toEdit.close();
         catch(IOException e){
              System.out.println(e.getMessage);
              System.exit(1);
    }

  • Wrong format on text file using SO_NEW_DOCUMENT_ATT_SEND_API1 FM

    Hi All!!
    I've been looking in the forum but couldn't find the solution...
    I'm using this FM to send a text file by email.
    I got the email and the file attached but the file is not right
    I shoud get:
    texttexttexttext blablabla  texttexttexttext
    texttexttexttext blablabla  texttexttexttext
    texttexttexttext blablabla  texttexttexttext
    texttexttexttext blablabla  texttexttexttext
    but I'm getting
    texttexttexttext blablabla  texttexttexttext
    . ...................................... texttexttexttext blablabla  texttexttexttext
    . ....................................... ......................................  texttexttexttext blablabla  texttexttexttext
    . ....................................... ....................................... ...................................... texttexttexttext blablabla  texttexttexttext
    (dots are not being displayed)
    I've tried concatenating '0A' or '09' at the end of each line but I'm still getting the wrong alinegment. 
    Any idea?
    Thanks.
    Edited by: Ina on Sep 15, 2009 1:01 PM
    Edited by: Ina on Sep 15, 2009 1:02 PM

    ***********Declarations *******************************
    constants :  c_cret(2)        TYPE c VALUE cl_abap_char_utilities=>cr_lf,
                        c_tab(2)         TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
    DATA : i_objtxt            TYPE STANDARD TABLE OF solisti1,        " Internal table to hold Mail details
                 i_objpack        TYPE STANDARD TABLE OF sopcklsti1,   " Internal table to hold Mail details
                 i_objhead        TYPE STANDARD TABLE OF solisti1,        " Internal table for the Mail data
                 i_objbin           TYPE STANDARD TABLE OF solisti1,        " Internal table to hold the Object text
                 i_rcvrs            TYPE STANDARD TABLE OF somlreci1.
    DATA : wa_objtxt        LIKE LINE OF i_objtxt,
                wa_objpack       LIKE LINE OF i_objpack,
                wa_objhead       LIKE LINE OF i_objhead,
                wa_objbin        LIKE LINE OF i_objbin,
                 wa_rcvrs         LIKE LINE OF i_rcvrs.
    ********Send Mail***************************************
      DATA : l_lines TYPE i.
      DATA : l_attlines TYPE i.
    Mail Body text
      wa_objtxt-line = title
      APPEND wa_objtxt TO i_objtxt.
      DESCRIBE TABLE i_objtxt LINES l_lines.
    *Document Attributes
      i_doc_chng-obj_name  = 'TEST'. " input contains the attributes of the document to be sent
      i_doc_chng-obj_descr = 'bla bla bla'
    Mail details
      CLEAR wa_objpack.
      wa_objpack-head_start = c_1.
      wa_objpack-head_num   = c_0.
      wa_objpack-body_start = c_1.
      wa_objpack-body_num   = l_lines.
      wa_objpack-doc_type   = 'RAW'.
      APPEND wa_objpack TO i_objpack.
      IF NOT i_output IS INITIAL.   
        LOOP AT i_output INTO wa_output.
          CONCATENATE wa_output-matnr1  wa_output-text INTO wa_objbin SEPARATED BY c_tab.   "first line
          CONCATENATE c_cret wa_objbin  INTO wa_objbin.
          APPEND  wa_objbin TO i_objbin.
        ENDLOOP.
      DESCRIBE TABLE i_objbin LINES l_attlines.
      READ     TABLE i_objbin INTO wa_objbin INDEX l_attlines.
      CLEAR wa_objpack.
      wa_objpack-transf_bin = 'X'.
      wa_objpack-head_start = c_1.
      wa_objpack-head_num   = c_0.
      wa_objpack-body_start = c_1.
      wa_objpack-body_num   = l_attlines.
      wa_objpack-doc_type   = 'TXT' .
      wa_objpack-obj_name   = text-201.
      wa_objpack-obj_descr  = text-201.
      wa_objpack-doc_size   = ( l_attlines - 1 ) * 255
                                                + STRLEN( wa_objbin ).
      APPEND wa_objpack TO i_objpack.
      MOVE p_list TO wa_rcvrs-receiver.
      wa_rcvrs-rec_type = 'U'            " Internet ID
      wa_rcvrs-rec_date = ''.
      PERFORM touppercase CHANGING wa_rcvrs.
      APPEND wa_rcvrs TO i_rcvrs.
      CLEAR wa_rcvrs.
      wa_objhead-line = text-201.
      APPEND wa_objhead TO i_objhead.
    Call function to send the mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = i_doc_chng
          put_in_outbox                = c_x
          commit_work                 = c_x
        TABLES
          packing_list                   = i_objpack
          object_header              = i_objhead
          contents_bin                = i_objbin
          contents_txt                 = i_objtxt
          receivers                      = i_rcvrs
        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.
      CASE sy-subrc.
        WHEN '0'.
          WAIT UP TO 2 SECONDS.
          SUBMIT rsconn01 WITH mode = 'INT'
                          AND RETURN.
          MESSAGE s010(ad)  WITH 'Mail Sent Successfully'(i50).
    ENSCASE.
    Try this code with your data, this should work.
    Edited By Tejaswini Khante

Maybe you are looking for