How to send EOF to spawned process....

Folks,
On Linux, the list of disks can be obtained as follows:
# format < /dev/null
Without redirecting /dev/null to its input, command "format" requires you to enter a value or CTRL-C.
I am trying to run format as a process within my Java code:
ProcessBuilder pb = new ProcessBuilder(args)
Process p = pb.start();
OutputStream os = p.getOutputStream();
os.close(); // Hopefully, sends EOF
p.waitFor();
As you can see, I am closing the input to the process, hoping that this will send an EOF to the process. However, the output that I get is erratic. Sometimes, I see the output and sometimes I don't.
My guess is that either I am not doing the right thing or may be I am closing the stream even before any processing is done.
I would appreciate your help in understanding what needs to be done to simulate redirecting /dev/null to the process.
Thank you in advance for your help.
Regards,
Peter

Thank you baptos and EJP.
I tried to show only the relevant code snippet earlier. I am also processing the other two streams using StreamGobbler class. Here are more details:
ProecessBuilder pb = new ProcessBuilder(args);
Process p = pb.start();
if (simulateDevNull == true) {
OutputStream os = p.getOutputStream();
os.close();
stdOut = new StreamGobbler(p.getInputStream());
stdErr = new StreamGobbler(p.getrrorStream());
stdOut.start();
stdErr.start();
p.waitFor();
Class StreamGobbler is a thread based class that can be used to process the output and the error from the spawned process in a separate thread. You can find many references to StreamGobbler class on the net.
Regards,
Peter

Similar Messages

  • How to send the status of Process Chain to email address?

    Hi,gurus here.
    We monitor process chains' work status by RSPCM, but it's inconvenient.
    Any method to send process chains' work status via email immediately instead of RSPCM?

    Any process in process chain fails, below will send mail to mail ID that specified
    This can be perfectely done using Tcode ALRTCATDEF.
    1. go to ALRTCATDEF
    2. select classification "Process Chains"
    3. click on display/change
    4. double-click on "error in a process of a process chain"
    5. click on "fixed recipients"
    6. write in your username (you have to maintain your e-mail address in SU01 for that to work)
    7. save
    8. go to your process chain (rspc)
    9. go into edit mode
    10. from the menu, select Process chain -> attributes -> alerting
    11. check "send alerts if errors occur".
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=64389689

  • How to send to the socket EOF flag? Only socket.close() works fine :)

    I send a binary file from server socket to client socket. And I have some problem with client (but actually with server :) ).
    That is my server code which sends a file:
    OutputStream os = null;
    FileInputStream fis = null;
    try{
        fis = new FileInputStream( "some-file.png" );
    } catch ( FileNotFoundException e1 ) {}
    try {
        os = socket.getOutputStream();
        int c = -1;
        while( ( c = fis.read() ) != -1 ) {
            os.write( c );
        os.flush();
    //    os.close();
    } catch ( IOException e2 ) {}And that is client which receives a file:
    try {
        int sChunk = 8192;
        InputStream is = socket.getInputStream();
        FileOutputStream out = new FileOutputStream( "file.png" );
        byte[] buffer = new byte[ sChunk ];
        int length;
        while ( ( length = is.read( buffer, 0, sChunk ) ) > -1 )
            out.write( buffer, 0, length );
        out.close();
    } catch ( IOException e ) {
    }A client's while never continues cause I don't know how to send EOF from server.
    If I do: "os.close();" at the end of server sending - it works... But.. It closes my socket! But I want to work with socket after that :)
    How to send correct EOF flag from server? I think it's the root of all problems here..
    Edited by: JavaProger on Mar 22, 2009 4:43 PM

    os = socket.getOutputStream();
    int c = -1;
    while( ( c = fis.read() ) != -1 ) {
    os.write( c );
    }That's about as inefficient as it could be. Try this:
    int count;
    byte[] buffer = new byte[8192];
    while ((count = fis.read(buffer)) > 0)
    os.write(buffer, 0, count);
    os.close();
    Hmm, you're doing that in the client, why not in the server?
    } catch ( IOException e2 ) {}Never ignore an exception. In this case you should close the socket.
    } catch ( IOException e ) {See above.
    A client's while never continues cause I don't know how to send EOF from server.You can't send an EOF from the server. You can cause an EOS (end of stream on the socket) at the reader, by closing the socket, or shutting down its output, but then you can't send anything else on the socket. You have two choices:
    (a) use a connection per file. If the files are large the overhead is minimal.
    (b) use an application protocol to tell the reader when the file is complete. Typically this takes the form of sending the file length as a long first, and taking care to read exactly that many bytes when reading, which takes a bit of care, especially on the last buffer. Another way is to send the length ahead of each buffer, sending zero after the last buffer. You can do all this with the methods of DataInputStream and DataOutputStream.

  • How to Send an Email to Outlook using process type in RSPC?

    Hi,
    How to Send an Email to Outlook using process type in RSPC?
    We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
    Actually i tried with create message its not happening...
    Plz let me know .. its urgent ...
    Regards,
    Satish

    Hello Satish,
    If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
    Here's  a sample ABAP code:
      data: ls_docdata type SODOCCHGI1,
            lt_objcont type table of solisti1,
            lt_receivers type table of somlreci1,
            ls_objcont type solisti1,
            ls_receivers type somlreci1,
            ls_user type syuname.
    * Fill these variables with subject and msg lines that you need.
    data: MAIL_SUBJECT     TYPE STRING,
    MSG_LINE1     TYPE STRING,
    MSG_LINE2     TYPE STRING,
    MSG_LINE3     TYPE STRING,
    MSG_LINE4     TYPE STRING,
    MSG_LINE5     TYPE STRING.
      ls_docdata-obj_descr = mail_subject.
      ls_objcont-line = msg_line1.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line2.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line3.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line4.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line5.
      append ls_objcont to lt_objcont.
    * t_userlist contains the list of users to whom th email will be sent.
      loop at t_userlist into ls_user.
        ls_receivers-receiver = ls_user.
    "Change the type  here if email is for outlook users, See documentation
    " of function module in SE37
        ls_receivers-rec_type = 'B'.            
        ls_receivers-express = 'X'.
        append ls_receivers to lt_receivers.
      endloop.
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                   = ls_docdata
        tables
         OBJECT_CONTENT                   = lt_objcont
         receivers                        = lt_receivers
       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
    You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
    Hope this helps.

  • How to send JMS Message from a BPM Process

    Hi All
    I have small query regarding sending JMS Message from a bpm process. Is it possible to send JMS message from one bpm process to another bpm process.
    I have a scenario in which I need to send a JMS message to a queue where another process is listening on that queue and as soon as the message is received on the queue the process instance is created.
    I know how to listen for the JMS message on the queue, but I don't how to send a JMS message from a process.
    Also Can I create process by sending the Notification to the process instead of a JMS message. But the process to be created is not a subprocess i.e. Can notification be send accross different processes.
    Any information or example in this regard would be helpful.
    Thanks in advance
    Edited by: user9945154 on Apr 22, 2009 7:46 PM

    Hi,
    Here's one approach to sending JMS messages from an Oracle BPM process. If you're doing this just to send a message into another process, do not take this approach. It's far easier and quicker if you do this using the OOTB "send notification" logic.
    These steps describe how to do this using WebLogic. The steps would be different if you're using another ap server / JMS provider.
    1. Guessing you've already done this, but first expose the two required WebLogic jar files for JMS messaging as Java components in the External Resources. The two files for WebLogic are weblogic.jar and wljmsclient.jar” (located in the < WebLogic home directory > /weblogic/server/lib” directory).
    AquaLogic BPM JMS Queue Listener for WebLogic 8.1
    2. You've probably already done this, but add an External Resource to represent the J2EE container:
    • Name: “weblogicJ2EE” - this is important and will be used in the next step
    • Supported Type: “GENERIC_J2EE”
    • Initial Context Factory: “weblogic.jndi.WLInitialContextFactory”
    • URL: “t3://localhost:7001”
    • Principal: and Credentials: whatever userid and password you defined to access theWebLogic administrative console.
    3. Create the External Resource that represents the send queue configuration. In this example, I'm calling it “WebLogic Send Queue”. This is important - remember what you named it because you will use this name in the logic that sends the JMS message. This new External Resource is configured as:
    • J2EE: “weblogicJ2EE” (same name as the second External Resource you created)
    • Destination Type: “QUEUE”
    • Lookup Name: “weblogic.examples.jms.exampleQueue”
    • Connection Factory Lookup Name: “weblogic.examples.jms.QueueConnectionFactory”
    4. Here's the logic to send a Message to the Queue
    <pre class="jive-pre"><p />msg as String = "Hello World"
    jmsMsg as Fuego.Msg.JmsMessage
    msg = "<?xml version=\"1.0\"?><Msg>" + msg + "</Msg></xml>"
    jmsMsg = JmsMessage(type : JmsMessageType.TEXT)
    jmsMsg.textValue = msg
    sendMessage DynamicJMS
    using configuration = "WebLogic Send Queue",
    message = jmsMsg</pre>
    Note that the “sendMessage” method uses the configuration parameter “WebLogic Send Queue”. You previously created a JMS messaging service External Resource with this name in the third step.
    Again, please don't go this route if you're just using it to send notifications between processes,
    Dan

  • How process app for customers, and how to send dunning notice to vendors

    Hi experts,
    can any one help on this
    how process app for customers, and how to send dunning notice to vendors
    Thanks & regards,
    vinod
    Moderator: Please, read and respect SDN rules

    Hi,dear
    you should enter customer account numbers in f110 for payment receiving from customer, and assign dunning procedure to vendor master record and process the dunning to vendor by using f150.
    regards,
    nagesh.

  • How to send process instructions to new pcs system

    Hi, we have PCS system known as performer. we need to send the process order header data to this pcs system. i created all z characteristics and z process instruction type and assigned to CRD. Now i could not understand how to send this info to perfomer. do i need to send this to xi and from xi i need to send to performer? is there any way to send directly to performer? please guide me so that i follow the same.

    Close inactive apps
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app's windows upwards to close
    3. The app will fly off the screen
    http://support.apple.com/kb/ht5137

  • How to send email if job fails?

    I'm wondering how to send an email if a data load fails.  Or, do the same, if a Select > Into or Insert > Select  . . . or whatever . . . fails. Last week I set up a process to send an email using SQL Server express. 
    http://www.sqlservercentral.com/blogs/querying-microsoft-sql-server/2013/09/02/sending-mail-using-sql-server-express-edition/
    I can easily include a simple script at the end of a SQL statement:
    exec
    msdb.dbo.sp_send_dbmail
    So, if I run a Select, or whatever, I can run the exec and send an email.  Now, I'm trying to think about how to send an email if a process fails.  I don't think you can do it with a simple Select. 
    Any ideas, anyone?
    Thanks.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    This is a good read to understand on error handling in SQL
    http://www.sommarskog.se/error_handling_2005.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • WAK1  ----    How to send Free Goods details  to POS

    Gurus,
      I have created the free goods data and everything works fine.
    When I create a whole sales order , I am getting the free goods.
    Now I want to send the information to POS . Can anyone help me how to send this
    I tried WPMA , but nothing is working.
    What are the IDoc configuration for this . and how to send the free goods information as Idoc.
    Hope I have explained my query in a understable manner .
    Kindly help in this regard
    Regards
    Raj

    Hi Raj,
    Basically, I agree with Christian.
    Here's my points:
    1. IDoc type WPDBBY is the only standard message type for free goods for POS outbound.
        The detail info about free goods is on segement E1WPBB06 : POS Interface: Condition Scale.
    2. Assortment list does have condition type of article sales price (in standard IS-Retail it's VKP0 & VKA0), E1WBB07 : Assortment list IDoc: Conditions per unit of measure & E1WBB08 : Assortment list IDoc: Condition value per unit of meas.
        But it doesn't contain any data for free goods.
    3. You could maintain SD free goods condition in a Promotion, but this data is not included in IDoc of promotion WPDREB.
        SD free goods condition is applied for sales order processing only.
    Regards,
    Steven

  • How to send Standard SC fields in SRM to a PO in R/3

    Dear All ,
    Please  can some one let me know on  how to send the Limit Item SC Start date and end date which is at the line item level (already)
    to a PO at the line item level .  i.e we do not need to enhance the screen just include it in the BAPI which sends data to the backend .
    I tried searching for more docs yet did not find anything much .
    I found out there is a class CL_BBP_BS_ADAPTER_PO_CRT_ERP10 where CREATE_DOCUMENT decides what fields would be passed .. In that there is a FM which is being called from ECC .. and in that there is header and header X field ..which has the fields which I need VPER start and end date ..so I am assuming from the SC it is passed to header level of PO through this ..
    CALL FUNCTION 'BAPI_PO_CREATE1'
           DESTINATION av_rfc_dest
           EXPORTING
             poheader               = as_po_out-is_poheader      "#EC ENHOK
             poheaderx              = as_po_out-is_poheaderx
    Now I want the same fields to be passed to item level of the PO ..  could you confirm on what exactly I should do ?I saw the below tables not sure what I should do with them to include the 2 fields I want which should be passed to ECC it is not in the it_poitem and it_poitemx structures .
    please advise ... .
    TABLES
              poitem                 = as_po_out-it_poitem        "#EC ENHOK
             poitemx                = as_po_out-it_poitemx       "#EC ENHOK
                 extensionin            = as_po_out-it_extensionin   "#EC ENHOK
      *      extensionout      = as_po_out-it_extensionout "not used by SRM
              poexpimpitem      = as_po_out-it_poexpimpitem      "#EC ENHOK
              poexpimpitemx     = as_po_out-it_poexpimpitemx     "#EC ENHOK
             potextheader      = as_po_out-it_potextheader "not used by SRM
    *      popartner         = as_po_out-it_popartner    "not used by SRM
    I am not sure if what I have searched is correct as well Please let me know if I am wrong  and where to check for the requirement .

    Hi Vinita,
    Please clear my understanding. you have a requirement (special one) to pass the Valid start and Valid end date in the PO at item level for framework order (Limit order).
    Are you sure of the requirement. Thus Standard ECC FO these fields are at the header level and not item level.
    Please confirm whether this a special process to pass the dates in FO at item level.
    Then how and for what is this FO process used?
    Thanks.
    From RBEI,
    Snehal

  • How to Send Appointment via mail adapter

    Hi Guys,
         I need to send the appointment and vTodo via mail adapter, any way i need to develop a mail adapter module. Till now i have finished this part,and i can send normal mail even normal mail with attachment. But i don't know how to send appointment via mail adapter.
    This is payload content of appointment which got from Exchange server to gmail:
    _=_NextPart_001_01C71EC0.97A011C6
    Content-Type: text/plain;
        charset="GB2312"
    Content-Transfer-Encoding: quoted-printable
    When: 2007=C4=EA6=D4=C227=C8=D5=D0=C7=C6=DA=C8=FD 3:30 =CF=C2=CE=E7-4:00 = =CF=C2=CE=E7 (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi.
    Where: China
    ~*~*~**
    This is calendar content
    _=_NextPart_001_01C71EC0.97A011C6
    Content-class: urn:content-classes:calendarmessage
    Content-Type: text/calendar;
        method=REQUEST;
        name="meeting.ics"
    Content-Transfer-Encoding: 8bit
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+01.00) Sarajevo/Warsaw/Zagreb
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20061213T141132Z
    DTSTART;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T140000
    SUMMARY:This is calendar test
    UID:040000008200E00074C5B7101A82E0080000000030D51864C81EC701000000000000000
    010000000CA9F127EA8947844BC4DD47F269BDEA9
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky":MAILTO:rocky@***.com
    ORGANIZER;CN="Xu":MAILTO:rocky@**.com;roc*@gmail.com
    LOCATION:Shanghai
    DTEND;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T160000
    DESCRIPTION:This is calendar content\N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20061213T141132Z
    LAST-MODIFIED:20061213T141133Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    X-MICROSOFT-CDO-OWNERAPPTID:367904726
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20061213T141132Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20061213T141132Z
    END:VEVENT
    END:VCALENDAR
    _=_NextPart_001_01C71EC0.97A011C6--
    My question is
      1. How to generate this kind of payload in mail adapter module?
      2. It is possible to send appointment via mail adapter?
    Following i can get from other system, even using mail package check or not using mail package check.
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+08.00) Kuala Lumpur/Singapore
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20070608T025852Z
    DTSTART;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T110000
    SUMMARY:This is meeting request with attachment
    UID:040000008200E00074C5B7101A82E0080000000000A9BD0BA7A9C701000000000000000
    010000000C5E16D144D1612498C0EF7E2115EFEC4
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky
    ":MAILTO:roc*@**
    ORGANIZER;CN="Xu,y":MAILTO:roc*@**
    LOCATION:India labs
    DTEND;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T113000
    DESCRIPTION:This is content!  &#60;&#60;shanghai.txt&#62;&#62; \N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20070608T025925Z
    LAST-MODIFIED:20070618T033505Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    ATTACH:CID:008501c7b159$a9d41d3b$_CDOEX
    X-MICROSOFT-CDO-OWNERAPPTID:1468557271
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20070608T025852Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20070608T025852Z
    END:VEVENT
    END:VCALENDAR
    Thanks & regards
    Rocky

    Hi
    have a look at this
    You can use Java/ABAP proxies to do this job for you..
    Java Proxy >> will read the mail(with the attachments) with the help of Java APIs and send the message into XI ABAP Proxy >> for this you will have to first convert the attachment into a message and then you can proceed in the regular fashion.
    Not all adapters can process attachments, I'm not sure why you are having trouble with using module processor in the mail adapter. Just check if the service pack that you are using supports this feature.
    If you are on WAS 6.10 and above you can achieve this and there is an excellent weblog by Thomas Jung on this topic at
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    reading Pdf Through mail easly done with Java Proxy, which will read the mail(with the attachments) with Java APIs and send the message into XI and then map with the Target ABAP proxy structure .
    Thanks

  • How to send purchase order via e-mail.

    Please could someone let me know how to send purchase order via e-mail.
    I am an BC.
    e-mailing is functionning however I am not very familiar in settings for MM

    No, you do not need to touch ME_PRINT_PO. You need to put code before and after ME_PRINT_PO in the print program.
    Step 1 - Copy the standard print program SAPFM06P to make a Z version, lets call it ZSAPFM06P
    Step 2 - Copy include FM06PE02 to make a Z version, lets call that ZFM06PE02.
    Step 3 - ZSAPFM06P change the statement "Include FM06PE02" to read "Include ZFM06PE02".
    Step 4 - In include ZFM06PE02 you will find a subroutine called "ENTRY_NEU". In this subroutine you will see it first calls ME_READ_PO_FOR_PRINTING then calls ME_PRINT_PO. Before it calls ME_PRINT_PO just put:
    l_nast-nacha = 1.
    CLEAR l_nast-dimme.
    This means that ME_PRINT_PO will not e-mail, it will create a spool request.
    Step 5 - Still in ZFM06PE02, after ME_PRINT_PO has been called, add new code. First check that ent_retco EQ 0. If it does not then exit.
    Step 6 - Get the spool ID created by ME_PRINT_PO by either moving sy-msgv1 to a variable or select from NAST.
    Step 7 - Call function CONVERT_OTFSPOOLJOB_2_PDF using the spool ID from step 6, and put the result from table PDF into an internal table you can use later. ALso store the export variable pdf_bytecount, you will need it later.
    Step 8 - Call function SX_TABLE_LINE_WIDTH_CHANGE using the table from step 7 as content_in and put the results from content_out into a new internal table.
    Step 9 - Add some text into a internal table of type solisti1, this will be the body text of the e-mail.
    Step 10 - Add whatever receivers you want into an internal table of type somlreci1. If you just want it to go to the address that the PO would have gone to anyway, select the e-mail address from ADR6 where the address number = l_doc-xekko-adrnr, that is the data from the PO.
    Step 11 - Populate an internal table of type sopcklsti1 with data relevant to your PDF table from step 8 and the text table from step 9. You will have to put the size of the PDF from step 7 (pdf_bytecount) on the PDF line and the size of the text will be the number of lines of text * 255.
    Step 12 - Add info to a structure of type sodocchgi1. You can add the e-mail title in here, field obj_descr. Also add the size of the PDF and the size of the text from step 12 into doc_size, and give the doc a name in field obj_name. This can be anything, ZPDFPO for example.
    Step 13 - Call SO_DOCUMENT_SEND_API1 using the tables from steps 8, 9, 10 and 11 and the structure from step 12. You can amend the sending e-mail also. Set commit_work to space.
    Step 14 - That is all you need, but I actually call function RSPO_R_RDELETE_SPOOLREQ to delete the spool request created in step 4, then call NAST_PROTOCOL_UPDATE to add some more messages to the processing log of the PO.
    That is all.

  • How to send data to RFC Destination(RFC SENDER Adapter)

    Hi ,
    Scenario:  R/3 Backendà RFC Sender Adapterà XIàsome other system.
    I have configured the RFC destination (of the type TCP/IP) at R/3 System and have registered the Program ID (specified in the RFC destination) in the XI server and using it in the configuration parameters of the RFC Sender Adapter.
    Problem: I do not know how I can send data to the RFC destination. (Should I use a report program/ ABAP Function Module?) Can anybody provide me with a sample code of Report Program/Function module (whichever is required), how to send data to the RFC Destination, so that it may be picked up by my RFC Sender Adapter.
    Thanks and Regards,
    Siva Maranani

    I have one query for you that
    I am trying to develop a scenario in SAP XI
    SAP R/3 ( RFC function module) sends a synchronous request to the XI and SAP XI will send this request to a third party web application using HTTP receiver adapter.
    I am able to send the data/message and it is successfully received at the third party web application.
    But I am facing one issue that I am unable to receive any message/data in my RFC module back.i have seen in sxmb_moni that the two messages are displayed in successfuly processed but in SAP R/3 side nothing get happedned
    Can you tell me how to use some waiting mechanism in function module to wait for the response from SAP XI.
    Regards
    Gopesh

  • How to send file to FTP on conditional basis.

    Hi SAP Guru's,
    Can somebody please tell me how to create a file on conditional basis in FTP.
    My requirement is that I have to create a file in different directory according to the sender port field.
    Interface
    IDOC -
    > XI -
    > File
    SNDPRN(DGE008,DGE006,..............) now I need to create the file according to the SNDPRN field.
    Example
    SNDPRN (DGE006)----
    > Target (DGE006/xyz/abc/filename.xml)
    SNDPRN (DGE008)----
    > Target(DGE008/xyz/abc/filename.xml)
    Also how do I send the data to the specific directory because I only get the SNDPRN(DGE008) from the idoc but how to send the data to /xyz/abc/ directory.
    I have tried dynamic configuration but it is not working.
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String MyDirName=DirName;
    String ourSourceFileName = conf.put(key,MyDirName);
    return "";
    Error in Adapter Monitoring
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
    CAN SOMEBODY PLEASE HELP ME.
    Edited by: Muhammad  iqbal on Jul 12, 2010 3:04 PM

    Off course I did.
    I have done the following in Int Rep.
    Step 1,
    Create an udf for dynamic configuration and mapped it with the MT
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String MyDirName=DirName;
    conf.put(key,MyDirName);
    return "";
    Steps in Int Dir
    Target Directory: /
    File Name: filename.xml
    Use Adapter Specific Message Attribute = checked
    Fail if Adapter Specific Message Attribute missing = checked
    Directory = checked
    Error in Adapter Monitoring
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
    CAN SOMEBODY HELP ME IN THIS MATTER.

  • How to send a large file in XI ?

    How to send a large file in XI ?

    hi,
    use a splitting mechanism to convert large files into smaller files and process them as if they where independent.
    You can use the "Recordsets Per Message" parameter in the File Adapter sender comm channel by using File Content Conversion, to create a new message for each 1000,10000,etc records in the source file...this could be a way of splitting.
    If you scenario works ok for small files, maybe you can develop another scenario that runs previous the current one, that only splits files (e.g. File-XI-File) and then puts the output smaller files in the directory that your current scenario monitors.
    Check this blog for huge file processing
    /people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover
    Thanks,
    Vijaya

Maybe you are looking for

  • Need Suggestion on OLAP model

    HI All, We do have a reqirement to design a OLAP model for consolidating the issues identified on ASSETS from various sources\system. Let us take one sample record; Issue | Asset | Status |Priority |St_DT |End_Dt ISS1 | ASS1,ASS2 |Open |High |1-Jan-1

  • Multi-channel Audio Recording

    I am using a Canon XL1s and recording to 4 audio channels. On Location recognizes this and says it is capturing all 4 channels. But how do I access the 3/4 channels after recording? Channels 1/2 are the only ones that play back.

  • Tree creation algorithm needed. Experts pls help

    hi, I'm writing a program that read data from database to create a Tree. The database table: DATA          PREDATA          POSTDATA 1 4 5 2 6 7 3 1 2 4 8 9 If the DATA has a PREDATA, it will be inserted into the left node otherwise null and POSTDATA

  • Failover - How to achieve a transparent failover using SQLPlus

    AIX 5.3 Oracle Clusterware 10.2.0.4.0 Oracle Enterprise Edition 10.2.0.4.0 This is the behavior I see from an Oracle Client session which is to be expected if I read RAC: Frequently Asked Questions [ID 220970.1] see below (1) SQLPlus session connecte

  • Need help with physical table

    Hello All, I have a table in Oracle database which stores the results of the financial report. Let's call it table R. I imported the table R into physical layer of Administration Tool. The data is stored in the following format: multiple departments