HLS IP with multiple outputs

Hello all,
I'm currently working with Vivado HLS (2014.4) and am trying to generate an IP with has an generic amount of OUTputs.
For better explanation I've made an "block-image" (sort of) how it should look like when imported in Vivado (in a Block Design):
So it gets an array of booleans (preferable generic!) and splits it into "sizeof(bool[])" output signals.
What I mean with generic is showed in the following picture:
This is the "utility vector logic"-IP from Vivado. There you can set, if double-clicked, the parameter "CSIZE" which directly sets the size of in- and output arrays to CSIZE.
I'm trying to achieve something similar:
I want to Input an array  "in[CSIZE]" and split it into CSIZE output wires!
Best would be if i would be able to set the parameter CSIZE of my synthesized IP in Vivado, the way it's done in the "utility vector logic" - IP through the Properties menu.
1) Is this even possible with High Level Synthesis?
2) If not: Is it possible with a fixed size input array (like in[5]) and then manually set the number of output wires to e.g. 5?
3) If this is too isn't possible: How does is work to output a boolean array ("Res[9:0]") like it's done in the "utility vector logic"-IP?
3.1) Which directives would i have to use to achieve this goal?
Because right now, I don't know how to output a boolean array as signal (it always changes to memory, or if implemented as Pointer it's no output (it's on the left side)
It should look something like this (analog to "utility vector logic"):
where in and out are boolean ports.
Preferable the size of the in- and output array is generic and settable in the Vivado properties menu (like mentioned in the example above)!
4) Could you give me according c++ code snippets to solve my problems and to achieve my goal?
My goal is to connect multiple own IP's (theirs clock) with the multiple output ports of the generated IP above (therefore multiple outputs).
I'm grateful for every answer I get!
Thank You very much!
Best regards,
Tilo

Hi
You can't use VHLS to get an IP with parameters;
To be optimal, a change of parameter would need the generated RTL to change, and at the moment, if you wanted to change your IP then you need to rerun C-synthesis. In other words, VHLS doesn't generate IPs with parameters.
For the other question , check the use or array partition complete;
Be aware that outputs have a valid driven interface by default - that's because the outputs may not be valid at every clock cycle when the IP is running.
An example of what you described might be this clock divider that generates N outputs where gen_clk[i] is input clock divided by (M/rate[i])
const unsigned int n_outputs = 5;
void top(unsigned int M, unsigned int rate[n_outputs], bool gen_clk[n_outputs]) {
#pragma HLS array_partition variable=rate complete dim=0
#pragma HLS array_partition variable=gen_clk complete dim=0
#pragma HLS interface ap_none port=gen_clk
#pragma HLS pipeline
unsigned int i;
static unsigned int counter[n_outputs];
static bool int_clk[n_outputs];
for(i=0;i<n_outputs;i++) {
// pipeline (II=1) at top level makes this loop unrolled
bool clk_enable = counter[i]>M;
int_clk[i] ^= clk_enable;
counter[i] = clk_enable ? counter[i]-M: counter[i]+rate[i];
gen_clk[i] = int_clk[i];
but be aware that the tool tells you clearly:
@W [RTGEN-101] Port 'gen_clk_0' with mode 'ap_none' may require an associated data valid signal to correctly communicate with other blocks or a test bench; automatic C/RTL co-simulation may not be able to verify such a port.
In IPI you may not be able to integrate this as the outputs are not decorated as being of type "clocks".
I hope this helps.

Similar Messages

  • Plugins with multiple outputs

    I'm using Logic Express with Linplug's RMIV drum plugin and there are multiple outputs. How do I route these as mono to different tracks (kick, snare, hats, toms, cymbals, etc on each track)then route to a drumsub track? It barley touches on this in the manual but I'm pretty sure I need aux objects....or do I? Any help would be greatly appreciated.

    The Instrument track should be sent to Output 1-2, and so should all your AUX tracks.
    If you want to use a submix for all your drums, then change all the outputs (instrument track and AUXs) to any one unused bus (for example, bus 2). Then bus 2's fader will control the overall level of your drums.
    but I'm not getting any audio into the aux channels even when I select it in the i/o section
    When you chose your drum instrument on its instrument track, did you select 'Multi-Channel'? That's necessary to get Logic to send the outputs of your instrument to their respective AUX tracks.

  • Webservice with multiple output parameters

    As a follow up on Can't create Webservice Project question of mine I have another question.
    I have my webservice now, but only one output parameter. I can only find java-bean examples with just one. How do I get multiple of them.
    Groetjes,
    Jeschael

    Hi Jan,
    I've created a structure. It is a (non EJB) bean with 6 private Strings with getters and setters. I put it into a List (Vector to be precise). When I try to test it, using the Web Services Navigator, I get an error.
    The structure really is just a copy from a SAP-ABAP structure. It looks like this:
    Created on Feb 21, 2007
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    package com.test.struc;
    import java.io.Serializable;
    @author JeschaelL
    To change the template for this generated type comment go to
    Window>Preferences>Java>Code Generation>Code and Comments
    public class Hrwpc_S_KeyObjec implements Serializable {
         public String PlanVersion;                    //plvar
         public String ObjectType;                    //otype
         public String ObjectID;                    //objid
         public String StartDate;                    //begda
         public String EndDate;                     //endda
         public String PlanningStatus;               //istat
         public String HistoricalRecordFlag;     //histo
         public String ObjectAbbreviation;          //short
         public String ObjectName;                    //stext
         public String ExtendedObjectID;          //realo
    @return
         public String getEndDate() {
              return EndDate;
    @return
         public String getExtendedObjectID() {
              return ExtendedObjectID;     }
    @return
         public String getHistoricalRecordFlag() {
              return HistoricalRecordFlag;
    @return
         public String getObjectAbbreviation() {
              return ObjectAbbreviation;
                   -- etcetera --
    Thanks for your time,
    Jeschael

  • Problem with multiple output for software simulated project

    When a software simulated project in captivate is published more than thrice, the output is not generated properly, i.e not in-line with the project. Is this a problem with my system or due to some settings in captivate which is not activated?

    Thanks for the suggestions Malcolm,
    They're very handy app's for sure, but unfortunately they didn't fix the problem.
    Detour DID overide the routing for iChat's general bleeps & noises, but not the audio stream from video conferences (which is the problem I want to fix).
    If anyone has any other suggestions for fixes, I'd appreciate it!
    Thanks again,
    Jason

  • Scheduling a job with multiple output formats.

    Urgent!!
    Basically while scheduling a job in BI Publisher we specify an output format. It can be PDF, CSV, HTML or so… Is there a way to specify more than one output format while scheduling a job.
    Thanks in advance.
    Ashok

    you have to re-publish them.
    for a run, you can have only one output .

  • Compare of 2 tables with multiple output rows???

    I have two table which hold port and process information from a network scan.  One table is a baseline and the other is a recent scan.  The tables contain the ports and services from all the systems scanned for each system.  
    I need to compare the two tables and show what the difference is.  One report showing just the unique ports not in the baseline and another to show a complete list of all the ports not in the baseline and the associated computer name.  I need both
    the reports to be able to show if the difference is a port that was in the baseline that is not in the new scan or is a new port not in the baseline.
    Here are the table formats I have:
    Baseline
    Date
    Plant
    ComputerName
    Protocol
    LocalAddress
    LocalPort
    RemoteAddress
    RemotePort
    State
    ProcessName
    Scan
    Date
    Plant
    ComputerName
    Protocol
    LocalAddress
    LocalPort
    RemoteAddress
    RemotePort
    State
    ProcessName

    tablediff:- Just find the tablediff.exe and change the sourceserver,source database  -sourcetable and same thing you need to do it for destination.
    Interchange it for the second run
    C:\Program Files\Microsoft SQL Server\100\COM>tablediff.exe -SourceServer hqvd0026\kat -SourceDatabase dssp -sourcetable Baseline -DestinationServer hqvd0026\kat -DestinationDatabase dssp -destinationtable Scan -c -f c:\tablediff.sql
    OR 
    A=A-B
    The following query returns any distinct values from the query to the left of the EXCEPT operand
    that are not also found on the right query.
    select * from dbo.baseline
    except
    select * from dbo.scan
    The following query returns any distinct values that are returned by both the query on the left and right sides of the INTERSECT operand.
    select * from dbo.baseline
    INTERSECT
    select * from dbo.scan
    -Prashanth

  • Multiple-Output Planning (MOP) Question

    Dear Gurus,
    I have a requirment to have a functionality similar to that of Multiple Output Planned orders(MOP). My only limitiation is we will not have a SAP SCM(APO) to do that.
    I read a post on this forum IS-Mill: Multiple-Output Planning (MOP)
    Which simply says we cannot have Multiple Output planned orders with out SAP-SCM(APO) system.. I need to create multiple outputs, if having a production order with multiple output is possible, then I am more then happy.
    Any suggestions? All help is highly appreciated
    Thanks again.
    Regards
    VG
    Edited by: Vaibhav Gupta on Oct 21, 2009 7:54 PM

    Hi Vaibhav,
    can you please elaborate on your scenario and Industry you intend to use this functionality ?
    Thanks,
    Sandeep Mondkar
    SCM Manufacturing

  • Multiple Output Ports In Logic Audio.

    Multiple Output Ports In Logic Audio.
    Many people have had problems with Multiple Output Ports with Logic Audio I have come up with a solution that allows me to program 8 synths using 8 ports. Have a look at my site if you have problems with your Output Ports
    http://logicports.webs.com/

    Hi
    King Mike Here wrote:
    I have come up with another way to look at the problem, and I have come up with an alternative solution to the problem. In the process I have learned something, but thank you for showing me the correct method.
    For sure, your efforts have lead to a greater understanding of how the Environment works, and yes, your method would work, but it's really long-winded :-)
    Another way to set this whole shebang up is to use Audio MIDI Setup to configure the 'Virtual" external synths, MIDI Ports, Receive Channels etc.
    When you make an External MIDI track in Logic via the Library, Logic will automatically create the Multi-Instrument objects, preconfigured with the correct channels enabled.
    The downside of this method comes with regard to Patch Names within the Multi-Instruments. You would need to set these up every time (or save as a template).
    Note: do not use the "Manual" Multi's at the same time as the Audio MIDI Setup method.... you end up with 2 of everything in the Library (and potentially duplicates in the Environment).
    Best
    CCT

  • Multiple outputs addicitve drums

    hi
    can anybody walk me through this? i want to use an addictive drums instance with multiple outputs. i have chosen the mult out instrument but don't see any difference. how do i assign an for example the highhat to a different output?
    thanks for the help!
    w

    Hi
    On the AD Kit Page, click the arrow or "out" button at the bottom of the fader for the hi-hat. Then in Logic open the mixer and at the bottom of the fader for AD you'll see a plus and a minus button. Press the plus button to open the channels for the individual kit pieces. Incidentally if some channels are unused and you want rid of them, highlight them and click delete on your keyboard.

  • Problem with multiple applications using one audio output

    Hey there, I'm having issues setting up my 5.1 headset seen here (http://www.sharkoon.com/?q=en/content/x-tatic-digital) to work with multiple applications.
    Right now I have audio streaming from a flash video, when I try run "$ speaker-test -c 6" I get the following error:
    speaker-test 1.0.25
    Playback device is default
    Stream parameters are 48000Hz, S16_LE, 6 channels
    Using 16 octaves of pink noise
    ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
    Playback open error: -16,Device or resource busy
    If I try open another application which uses this device, the first application has its sound cut off.
    2 more things to note:
    - My preference for setup would be audio output through S/PDIF and input through USB, with the USB output disabled (To not waste system resources).
    - I unmuted all channels in ALSA, however when I ran the test only 2 channels seemed to be working (Front L&R), it may have been defaulting to the USB connection, in which case, that explains only 2 channels being in use, is there a method of setting the S/PDIF as default system wide?
    Thanks in advance for any help given!

    brebs wrote:It's put the comments on multiple lines - fix that.
    Woops, I guess my paste messed up, new .asoundrc: http://pastie.org/3706033
    I can run both at the same time, however I cannot hear any audio. Do I somehow have to change the default device, if so how can I do that?
    Edit:
    Restarted system now I get:
    speaker-test 1.0.25
    Playback device is default
    Stream parameters are 48000Hz, S16_LE, 2 channels
    Using 16 octaves of pink noise
    Rate set to 48000Hz (requested 48000Hz)
    Buffer size range from 2048 to 8192
    Period size range from 1024 to 1024
    Using max buffer size 8192
    Periods = 4
    was set period_size = 1024
    was set buffer_size = 8192
    0 - Front Left
    Segmentation fault
    (That's with both commands)
    EDIT 2:
    Interesting, apparently 2 audio streams are working, however the console thing still doesn't work..?
    EDIT 3:
    Didn't last long, now flash crashes and html 5 doesn't work -.-
    EDIT 4:
    Flash only works when other audio is active, however it has constant popping sound. I went through the system logs to get the errors of when flash crashes, it's audio crashing it, here's the error:
    Apr  1 02:04:15 localhost kernel: [ 7057.499787] AudioThread[6227]: segfault at 7f2e2f7a8008 ip 00007f2e413a2786 sp 00007f2e33614ae8 error 7 in libasound.so.2.0.0[7f2e4131e000+eb000]
    Last edited by B3NW (2012-04-01 01:11:04)

  • XML output with multiple tags in one line

    I have not done much XML exporting with SQL. Previously I had just been ending my SQL queries with
    FOR XML RAW ('Company'), ROOT ('Companies'), ELEMENTS;
    and it formatted my query nicely in an XML output. That put every column name as a tag and the cell data within the tag.
    However, now the criteria has changed on me. I need to create a tag with multiple sub tags in it.
    Example: <Location Floor="10" Suite="512" DoorType="Metal">
    But I'll still need other tags to be normal in the XML output such as
    <Address>123 Fake St</Address>
    <City>Springfield</City>
    <Location Floor="10" Suite="512" DoorType="Metal">
    Is there any way to get this XML mixed in the output like above?
    Thank you for any help. 

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • HT202000 Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers )

    Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers ) I do this on my Windows but cannot find for mac.  I am transitioning from Windows brain to Mac brain and having a little difficulty
    OS Yosemite

    Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers ) I do this on my Windows but cannot find for mac.  I am transitioning from Windows brain to Mac brain and having a little difficulty
    OS Yosemite

  • One Output with multiple communication types

    Hello,
    My requirement is to print the document as well as send an email to the customers from the same output.  Basically One output with multiple communication types ( PRINT  & EMAIL).  How to configure this in the output type configuration area? Please reply. Thanks

    This should be possible with the same output type,
    have the output type defined with multiple medium in NACE under processing routines. (say print out in one line & external send in another).
    have the condition record maintained appropriately for different customers with different medium.
    Note: if your access has customer, dont think you can maintain both 1 & 5 for the same access.
    if this functionality is required, i think you can acheive this by maintaining the output under different access, but this will not ensure the same condition type flowing into the document unless the earlier condition type goes to processed status.
    Thanks & Regards
    Ilango

  • Multiple outputs with Ultrabeat

    Hi,
    Is there a way to use multiple-outputs with Ultrabeat in Mainstage like you can in Logic Studio?

    Yes.
    In Mainstage insert a Multi-output version of UB on a channel strip. In UB assign outputts to the voices. In the Channels strip area click on the + button on the UB Channel strip. It will create Aux's with UB outputs as their inputs.
    JG

  • Sending mail with multiple attachment

    hi.
    i want to send mail with multiple attachment.
    i m succeed in sending multiple attachment but the second pdf is not open.
    its given error like "This file is damaged and could not be open.
    pls check my code. and
    give the solution....
    point should be assured...........
    hope all u r understand my problem..
    & tell me where is i m missing something.
    REPORT  YSDPASALE1_MAIL LINE-SIZE 110.
    data : year_month(6) type c.
    data : from_date like sy-datum,to_date like sy-datum.
    INITIALIZATION.
    year_month = sy-datum+0(6).
    CONCATENATE year_month '01' into from_date.
    to_date = sy-datum.
    ranges : temp for mkpf-budat.
    temp-low = from_date.
    temp-high = to_date.
    append temp to temp.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
           jobname like TBTCJOB-JOBNAME,
           L_RELEASE(1) TYPE c.
    CONSTANTS : l_c_device(4)    VALUE 'LOCL'.
    DATA : t type i value 0.
    DATA : p_email1 like somlreci1-receiver,
            p_sender LIKE somlreci1-receiver.
    Data Declaration
    DATA: gd_recsize TYPE i,gd_recsize1 TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject  LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att1 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att2 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_desc1 TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des,
          gd_mtitle LIKE sodocchgi1-obj_descr.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    DATA: BEGIN OF mailstr OCCURS 0,
            p_email like somlreci1-receiver,
          END OF mailstr.
    DATA: mailtab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    DATA: ypp18tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis008tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ysd15tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis10tab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    SUBMIT YSDPASALE1 with bdt in temp
                           to sap-spool
                          with line-size = '255'
                           with KEEP_IN_SPOOL = 'X'
                           with IMMEDIATELY = ' '
                           WITHOUT SPOOL DYNPRO
                           AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf.
        select yemail as p_email into CORRESPONDING FIELDS OF TABLE ymis008tab
          from ymail
          where ytcode = 'YMIS008'.
    ELSE.
       SKIP.
       WRITE:/ 'Program must be executed in background in-order for spool & mail sending',
               'request to be created.'.
      ENDIF.
    wait up to 3 seconds.
      submit YSD_MONTHLY_SALES
                                USING SELECTION-SET 'MAIL'
                                to sap-spool
                               with KEEP_IN_SPOOL = 'X'
                               with IMMEDIATELY = ' ' "SPACE
                               WITHOUT SPOOL DYNPRO
                               AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
        IF sy-batch EQ 'X'.
        gd_attachment_desc1  = 'YMIS10'.
        gd_mtitle = 'Monthly Sales Report'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf1.
       loop at it_mess_att.
        move it_mess_att1 to it_mess_att.
        APPEND it_mess_att.
       endloop.
       APPEND LINES OF it_mess_att1 to it_mess_att.
       free it_mess_att1.
        it_mess_att[] = it_mess_att1[].
        insert LINES OF it_mess_att1 into it_mess_att.
        APPEND LINES OF it_mess_att2 to it_mess_att .
         insert LINES OF it_mess_att1 into it_mess_att.
         insert LINES OF it_mess_att2 into it_mess_att.
       loop at ymis008tab into mailstr.
         p_email1 = mailstr-p_email.
          p_email1 = '[email protected]'.
           PERFORM process_email.
       endloop.
           clear mailstr.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
      ELSE.
        SKIP.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
          FORM get_job_details                                          *
    FORM get_job_details.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
          FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    FORM convert_spool_to_pdf1.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att1 = gd_buffer.
        APPEND it_mess_att1.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
          FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      DESCRIBE TABLE it_mess_att1 LINES gd_recsize1.
      CHECK gd_recsize > 0 or gd_recsize1 > 0.
      PERFORM send_email." USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM send_email." USING p_email.
    CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = gd_attachment_desc1 .
    gd_attachment_desc = 'YPP18 - Daily Highlights'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Dear Sir,'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'kindly find the attached document'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
    it_mess_bod        = 'Do not reply on this mail, It is generated from SAP'.
    APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'Regards,'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Arpit Shah'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                          it_mess_att1
                                    using "p_email
                                          gd_mtitle
                                         'Testing mail generated from SAP'
                                         'Daily Highlights Abstract Report - YPP18'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                              it_attach1
                                        using "p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1,w_doc_data1 like sodocchgi1.
    ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data1-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    For 2nd Attachments
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach1 INDEX w_cnt.
      w_doc_data-doc_size = w_doc_data1-doc_size +
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach1 ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
    APPEND LINES OF it_attach1 to t_attachment.
      t_attachment[] = it_attach1[].
    APPEND LINES OF it_attach1 to t_attachment.
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = 1.
    DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    DESCRIBE TABLE it_mess_att LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS008'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS008'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
      clear t_packing_list.
    for 2 attachments
      data : a type i,b type i.
       a = t_packing_list-body_num.
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = a + 1. "1
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach1 LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS10'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    a = t_packing_list-body_num.
    clear t_packing_list.
    * Create attachment notification
    t_packing_list-transf_bin = 'X'.
    t_packing_list-head_start = 1.
    t_packing_list-head_num   = 1.
    t_packing_list-body_start = a + 1.
    t_packing_list-body_num = t_packing_list-body_num + 1.
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
    t_packing_list-body_num = a + t_packing_list-body_num .
    t_packing_list-doc_type   =  ld_format.
    t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
    t_packing_list-obj_name   =  'YMIS10'."ld_attfilename.
    t_packing_list-doc_size   =  t_packing_list-body_num * 255.
    APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
    loop at ymis008tab into mailstr.
      t_receivers-receiver = mailstr-p_email.  "ld_email.
      t_receivers-receiver = p_email1.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'. "X   "Read Acknoledgement
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
    endloop.
       CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    Rgds.
    Arpit

    Hi Arpit,
    Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
    Regards,
    John.

Maybe you are looking for

  • Link to document not opening document in browser or client app

    hi All, i am using office 365 e1, i have aspx page on which we are fetching link of document and showing using CSOM. when user click on link instead of opening in client app or browser it is downloading.  if you have solution please help me

  • Differences between human workflow in SOA Suite or in BPM Suite?

    according to: http://www.oracle.com/technetwork/middleware/soasuite/index-090227.html both oracle suites have human workflow. can anyone point out what is the real difference then between this two human workflow components? if there is non: can anyon

  • Command+R WIFI problem

    I went to verify my macintosh HD in disk utility and it said I need to restart my computer, hold cmd+r and then go to disk utility. The problem I have is when i hold command R and it tells me to choose a network, nothing comes up. I can't do anything

  • Connection Test SAPNET_RFC

    Logon Connection Error Error Details Error when opening an RFC connection Error Details ERROR: SAP gateway connection failed. Is SAP gateway started? Error Details LOCATION: SAP-Server  on host dev (wp 0) Error Details COMPONENT: CPIC Error Details C

  • No audio from tv

    I tried all the troubleshooting from apple and still have no audio from my tv with apple tv connected.