Run through UI Elements

Hi
I want to define change Eventlistener for all elements in a
mxml component dynamically ( myUI.mxml).
I tried this inside a class that extends canvas:
_ui = new myUI()
this.addChild(_ui);
for(var i in _ui){
_ui
.addEventListener(Event.CHANGE, valueChanged);
but the "for in" loop doesn`t do anything.
is there a way to run through all children/properties of a
mxml component?
thanks for help!
muzi

_ui is a new UI component you created and added. You
shouldn't be looping through it.
You can use:
this.getChildren() ;
It returns an array of UI components that are children of
your component. You can then loop through that array, cast each
element as a 'DisplayObject' and add event listeners to it.
Also helpful is:
getChildAt(index:int);
Returns a DisplayObject object at position 'index'.

Similar Messages

  • Going through all elements in array

    Hi there,
    This problem has been getting to me and I know the answer is right in front of my face, so just wondering if someone can help point it out for me?
    I have a folder of files (txt, tdms, etc) and my code is set up to report back all the files on the folder and number of files as an array. Then I want to be able to go through each element 1 by 1 and use each sepearte element later on.
    The idea is I will have a folder where new files are constantly saved and I was this program to check the folder (in case it has been updated) and then for me to be able to use the new files as well. (eventually i will assign each element in the array to the end of a path so that each file will be called as the system goes through the array).
    I've tried this with a for loop, as in standard text based programming that is the go to way but when I run it like this in labview, it doesnt look like the system is running through the array. Is this just becaus eit is happening so fats,, it wont show on the front panel or have I missed something? I have attached the code
    Kelly
    Attachments:
    ArrayElements.vi ‏9 KB

    Kelly,
    accessing each individual item in the array is possible by using an "auto-indexing" input tunnel. Right-click your input-tunnel and select "Enable Indexing" for this. It is rather strange that it is not already like this as for for-loops, auto-indexing is default. Please note that with auto-indexing input-tunnels, you don't need to conntect the "N" terminal. Also, the "Index Array" function in the loop is not necessary as well (in fact, it will create a wiring error).
    Output-tunnels is the same... but in your provided example, the code will be "Rube Goldberg" as it does nothing else then to copy the array if you configure the output-tunnel to be auto-indexing. So this only makes sense, if you add some analysis functions in the loop which modify specific elements.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • ComboBox - iterate through dropdown elements?

    I need to subdivide a large list of elements in a comboBox into smaller groups in Flash. Is there anyway to loop throught the elements and set te background color of each element to a value in the dataProvider object?
    I can run through the loop using myPoS_combobox.dropdown
    var ddList = myPoS_combobox.dropdown
    for(var propertyName in ddList) {
         trace(ddList[propertyName])
    But I can't seem to get to the individual elements, much less change their properties.
    THANKS!

    I can do that, but what I need to do is change individual cell background colors. Here is my data provider:
    private var PoS_label_array:Array = new Array(
                        {label:"SN\tsubject noun", data:"SN", myColor:ShurleyColors.shurleyBlue},
                        {label:"CSN\tcomp subject noun", data:"CSN", myColor:ShurleyColors.shurleyBlue},
                        {label:"OP\tobject of the preposition noun", data:"OP", myColor:ShurleyColors.shurleyBlue},
                        {label:"COP\tcomp object of the preposition noun", data:"COP", myColor:ShurleyColors.shurleyBlue},
                        {label:"DO\tdirect object noun", data:"DO", myColor:ShurleyColors.shurleyBlue},
                        {label:"CDO\tcomp direct object noun", data:"CDO", myColor:ShurleyColors.shurleyBlue},
                        {label:"IO\tindirect object noun", data:"IO", myColor:ShurleyColors.shurleyBlue},
                        {label:"CIO\tcomp indirect object noun", data:"CIO", myColor:ShurleyColors.shurleyBlue},
                        {label:"PrN\tpredicate noun", data:"PrN", myColor:ShurleyColors.shurleyBlue},
                        {label:"CPrN\tcomp predicate noun", data:"CPrN", myColor:ShurleyColors.shurleyBlue},
                        {label:"OCN\tobject compliment noun", data:"OCN", myColor:ShurleyColors.shurleyBlue},
                        {label:"COCN\tcomp object compliment noun", data:"COCN", myColor:ShurleyColors.shurleyBlue},
                        /* PRONOUNS */
                        {label:"SP\tsubject pronoun", data:"SP", myColor:ShurleyColors.shurleyPurple},
                        {label:"CSP\tcomp subject pronoun", data:"CSP", myColor:ShurleyColors.shurleyPurple},
                        {label:"OPP\tobject of the prep pronoun", data:"OPP", myColor:ShurleyColors.shurleyPurple},
                        {label:"DO\tdirect object pronoun", data:"DO", myColor:ShurleyColors.shurleyPurple},
                        {label:"IO\tindirect object pronoun", data:"IO", myColor:ShurleyColors.shurleyPurple},
                        {label:"OCP\tobject compliment pronoun", data:"OCP", myColor:ShurleyColors.shurleyPurple},
                        /* VERBS */
                        {label:"V\tverb", data:"V", myColor:ShurleyColors.shurleyRed},
                        {label:"CV\tcomp verb", data:"CV", myColor:ShurleyColors.shurleyRed},
                        {label:"V-t\tverb transitive", data:"V-t", myColor:ShurleyColors.shurleyRed},
                        {label:"CV-t\tcomp verb transitive", data:"CV-t", myColor:ShurleyColors.shurleyRed},
                        {label:"CV\tcompound verb", data:"CV", myColor:ShurleyColors.shurleyRed},
                        {label:"LV\tlinking verb", data:"LV", myColor:ShurleyColors.shurleyRed},
                        /* DESCRIPTIVE */
                        {label:"Adv\tadverb", data:"Adv", myColor:ShurleyColors.shurleyPink},
                        {label:"Adj\tadjective", data:"Adj", myColor:ShurleyColors.shurleyGreen},
                        {label:"CAdj\tcomp adjective", data:"CAdj", myColor:ShurleyColors.shurleyGreen},
                        {label:"PNA\tpos noun adjective", data:"PNA", myColor:ShurleyColors.shurleyGreen},
                        {label:"PPA\tpos pro adjective", data:"PPA", myColor:ShurleyColors.shurleyGreen},
                        {label:"A\tarticle adjective", data:"A", myColor:ShurleyColors.shurleyGreen},
                        {label:"OCA\tobject compliment adjective", data:"OCA", myColor:ShurleyColors.shurleyGreen},
                        {label:"COCA\tcomp object compliment adjective", data:"COCA", myColor:ShurleyColors.shurleyGreen},
                        {label:"PA\tpredicate adjective", data:"PA", myColor:ShurleyColors.shurleyGreen},
                        {label:"CPA\tcomp predicate adjective", data:"CPA", myColor:ShurleyColors.shurleyGreen},
                        {label:"P\tpreposiiton", data:"P", myColor:ShurleyColors.shurleyOrange},
                        {label:"C\tconjunction", data:"C", myColor:ShurleyColors.shurleyDarkGray},
                        {label:"I\tinterjection", data:"I", myColor:ShurleyColors.shurleyLightGray}
    What I want to do is se the cells of the dropdown to the myColor property in the data provider.

  • I have an apple iphone 4 that I want to download audio books from my library onto it.  I cannot figure out how to do that.  The iphone does not show up on my mac laptop as a connected device.  Does this kind of download have to run through itunes?  Thanks

    I have an apple iphone 4 that I want to download audio books from my library onto.  I cannot figure out how to do that.  The iphone does not show up on my mac laptop as a connected device.  Does this kind of download have to run through itunes?  Thanks

    Yes it is done through iTunes. The iPhone will never show up in Finder as a device. The following is general information on iTunes sync: http://support.apple.com/kb/HT1386 and the following is a previous discussion where the post by Andreas Junge helped others that had a problem syncing audiobooks: https://discussions.apple.com/message/20052732#20052732

  • When MRP run through background process in MDBT open PR and PO not comming?

    Hi,
    When MRP run through backgroung process in MDBT open PR and PO not coming in MDBT result.
    Pls advise accordingaly.
    Regards
    rk

    Ram,
    Either I am totally misunderstanding your statements, or your business people are misinformed.  
    The output of MD01 (MRP total run in foreground) and the output of MDBT (MRP total Run in Background) ARE IDENTICAL, provided you have selected the same parameters.  
    Neither output contains a discrete listing of open Purchase orders and Purchase requisitions.
    Standard output of both MD01 and MDBT are:
    1.  List of materials processed, with exception messages
    2.  Statistics
    In addition, both of these programs also write MRP records to the MRP databases, provided that the "Display Material List" parameter is set.  In this case, both of these programs will produce data that can be further reviewed and managed in MD05 and MD06. MD06 is the tool that most planners use to process the MRP database info.
    If you wish to see a listing of the entire MRP results (either MD01 or MDBT), then execute transaction MDLD.  This will produce either a spoolfile or a printed document.
    For the PO or PR listings, review my earlier suggestions.
    Rgds,
    DB49

  • Insert statement not working when Interface is run through PI ..

    Hi Every one,
    There is an interface(Server proxy) which updates a ztable in the program. Updates are happening when we are running this interface manually(putting Payload manually) but in case there are already entries in ztable and we are trying to update these records, even after handling exception z table is not getting updated when run through PI and happening manually.
    Please suggest me for the same.
    Vivek

    Tobias from this forum had the answer!
    http://powershell.com/cs/forums/p/5438/8786.aspx#8786
    His fix:
    Whenyou putput text from powershell, the console width is assumed. Since task scheduler runs its own hidden console, the width of that console is used to truncate the text.
    You can work by this issue by setting the width yourself. Try using a combination of Format-Table -auto / Format-List -auto and Out-File -width like this:
    get-process | Format-Table -Auto | Out-File c:\test.txt -Width 10000
    The format-cmdlet with -Auto makes sure the file uses only as much width as is truly needed. The -Width parameter sets the maximum width available.
    If you must redirect the output to something else, replace Out-File with Out-String -Stream -Width 10000 and then redirect the result to whereever you want.
    Note that multiline strings will still be truncated after the first line.
    My code looks like this:
    #Export Dataset Table to a text file       
    $DataSet.Tables[0] | Format-Table -Auto | Out-File $rcvrFileName -Width 10000
    This worked like a charm.
    Thanks!

  • How can I put a limit on how many times my 'if' statement runs through?

              while (done == false)
                   testnumber++;               //Testing the next number
                   testdivisor = 1;          //Resetting the testdivisor
                   System.out.println("1st while statement");
                   if (testdivisor <= testnumber)
                        testdivisor++;
                        divisors = testdivisor % testnumber;
                        System.out.println("2nd while statement");
                        if  (divisors == 0)
                             divisor1= testdivisor/testnumber;
                             System.out.print (divisor1);
                             System.out.println("3rd while statement");I need to stop it after it goes through the 4th if statement 4 times. The specific code might not make sense because it's a rough copy, but it will give you an idea of the program real quick.
    So is there any way to make it stop after 4 runs through the last if statement?

    So is there any way to make it stop after 4 runs
    through the last if statement?If you seriously can't think of how to do that, are you sure programming is up your alley?
    int hits = 0;
    while (!done) {
      if (divisors == 0) {
        ++hits;
        ... // do your current stuff
        if (hits >= 4) break;

  • Is there a way to play flv & mkv file formats through media element in windows 8.1 app ?

    i am trying to develop a video player so i just thought Is there a way to play flv & mkv file formats through media element in windows 8.1 app ? , coz when i tried media element it is supporting only mp4 & avi formats.

    Here is a list of Media Foundation codecs
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd757927(v=vs.85).aspx
    For the rest of the formats you have you write your own MFT-based codec and ship the codec with your app. See also
    implementing a Codec MFT (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757274(v=vs.85).aspx)
    Media extensions sample (https://code.msdn.microsoft.com/windowsapps/Media-extensions-sample-7b466096)
    MKV and FLV are just container formats, though, you need to survey some video files to see what video codecs are actually in streams and support them one by one. Supporting some proprietary video formats may involve licensing costs from patent holders.
    Visual C++ MVP

  • Any ideas on a cleaner way to write this? - run through a function with multiple steps; if any step fails, restart the function from the begining

    Basically there are 3 different functions for various "tests"; they each return "1" if the test passes and "0" on failure.  A "master" function calls these 3 functions in the desired order and keeps a counter
    of tests that pass.  The counter has to be 1 to proceed to step 2, has to be 2 to proceed to step 3, and when it's 3 the loop closes.
    This approach is giving the expected results, but I was wondering if anyone has ideas on a cleaner approach?  What I really wanted to accomplish was to have the 3 tests past in succession and to provide an overall pass and proceed to the next step;
    and also to exit the function if any step fails rather than running through each step before trying again.  If the script were to for example loop through the 3 tests and wait until each one passes, tests 1 and 2 might pass, but then 3 might fail
    a few times and finally pass before the script exits.  I did not want to allow for that scenario to count as an overall pass.
    Function Test1 {
    If PASS Return 1
    If FAIL Return 0
    Function Test2 {
    If PASS Return 1
    If FAIL Return 0
    Function Test3 {
    If PASS Return 1
    If FAIL Return 0
    Function TestAll
    [int]$counter = 0
    $Check1 = Test1
    If ($check1 -eq 1) {$counter++}
    If ($counter -lt 1) {Exit}
    Start-Sleep -s 15
    $check2 = Test2
    If ($check2 -eq 1) {$counter++}
    If ($counter -lt 2) {Exit}
    Start-Sleep -s 15
    $check3 = Test3
    If ($check3 -eq 1) {$counter++}
    If ($counter -lt 3) {Exit}
    Return $counter
    Do {$STATUSCOUNT = TestAll}
    While ($STATUSCOUNT -lt "3")

    This is cleaner:
    Function Test1 {
    If PASS Return 1
    If FAIL Return 0
    Function Test2 {
    If PASS Return 1
    If FAIL Return 0
    Function Test3 {
    If PASS Return 1
    If FAIL Return 0
    Function TestAll{
    while($true){
    while($true){
    $counter=0
    if(($counter+=Test1) -ne 1){break}
    if(($counter+=Test2) -ne 2){break}
    if(($counter+=Test2) -ne 3){break}
    return
    Write-Host ('try again' + $counter) -fore
    TestAll
    Of course all of your test functions have syntax errors.
    \_(ツ)_/

  • Report not running through Forms menu

    Hi Gurus,
    In our reports we have used Query PL/SQL to reference cursor. When it is compiled and an executable 'rep' file is created, which when
    called through froms menu generates following error and aborts the report.
    REP-1401:'qr_1refcurds': Fatal PL/SQL error occured.
    ORA-06508: PL/SQL: could not find program unit being called
    The same report when called through forms menu, without the compiled version, executes smoothly. Also it runs through report builder perfectly after compilation and generation of rep file.
    Would appreciate if anyone can provide suitable guidelines to solve this issue.
    null

    hello,
    is the program-unit you are trying to call, in an external plsql-library ? if so, you have to provide the PLX version of this library in order to use it from a REP file.
    however, why are you using the compiled REP version at all ? i would suggest to use the RDF file.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Aim to process all files in folders on desktop to run through photoshop and save in multiple locations

    Aim to process all files in folders on desktop to run through photoshop and save in multiple locations
    Part one:-
    Gather information from desktop to get brand names and week numbers from the folders
    Excluding folders on desktop beginning with "2" or "Hot"
    Not sure about the list of folders
    but I have got this bit to work with
    set folderPath to "Hal 9000:Users:matthew:Desktop:DIVA_WK30_PSD" --<<this would be gained from the items on the desktop
    set {oldTID, my text item delimiters} to {my text item delimiters, ":"}
    set folderName to last text item of folderPath
    set my text item delimiters to "_WK"
    set FolderEndName to last text item of folderName
    set brandName to first text item of folderName
    set my text item delimiters to "_PSD"
    set weekNumber to first text item of FolderEndName
    set my text item delimiters to oldTID
    After running this I have enough information to create folders in multiple locations, (i need to know where they are so that photoshop can later save them in those multiple locations
    So I need the following folders created
    Locally
    Hal 9000:Users:matthew:Pictures:2011-2012:"WK" + weekNumber
    Hal 9000:Users:matthew:Pictures:2011-2012:"WK" + weekNumber: brandName
    Hal 9000:Users:matthew:Pictures:2011-2012:"WK" + weekNumber: brandName: brandName + "_WK" + weekNumber + "_LR" --(Set path for Later)PathA
    Hal 9000:Users:matthew:Pictures:2011-2012:"WK" + weekNumber: brandName: brandName + "_WK" + weekNumber + "_HR"--(Set path for Later)PathB
    Network
    Volumes:GEN:Brands:Zoom:Brands - Zoom:Upload Photos:2012:"Week" + weekNumber
    Volumes:GEN:Brands:Zoom:Brands - Zoom:Upload Photos:2012:"Week" + weekNumber:brandName + "_WK" + weekNumber + "_LR"  --(Set path for Later)PathC
    Volumes:GEN:Website_Images --(no need to create folder just set path)PathD
    FTP (Still as a normal Volume) So like another Network
    Volumes:impulse:"Week" + weekNumber
    Volumes:impulse:"Week" + weekNumber:Brand
    Volumes:impulse:"Week" + weekNumber:Brand:brandName + "_WK" + weekNumber + "_LR"  --(Set path for Later)PathE
    Volumes:impulse:"Week" + weekNumber:Brand:brandName + "_WK" + weekNumber + "_HR"  --(Set path for Later)PathF
    I like to think that is end of Part 1
    Part 2
    Take the images  (PSD's) from those folders relevant to the Brand then possibly run more applescript that opens flattens and then saves it in the locations above.
    For example….
    An image in folder DIVA_WK30_PSD will then run an applescript in Photoshop, lets call it DivaProcessImages within this we then save to PathA, PathB, PathC, PathD, PathE, PathF the folder path of C should therefore look like this
    Volumes:GEN:Brands:Zoom:Brands - Zoom:Upload Photos:2012:Week30:DIVA_WK30_LR and of course save the image as original filename.
    Then from the next folder
    An image in folder Free_WK30_PSD will then run an applescript in Photoshop, lets call it FreeProcessImages within this we then save to PathA, PathB, PathC, PathD, PathE, PathF the folder path of C should therefore look like this
    Volumes:GEN:Brands:Zoom:Brands - Zoom:Upload Photos:2012:Week30:Free_WK30_LR and of course save the image as original filename.
    The photoshop applescript i'm hoping will be easier as it should be a clearer step by step process without any if's and but's
    Now for the coffee!!

    Hi,
    MattJayC wrote:
    Now to the other part, where each folder was created (and those that already existed) how do I set them as varibles?
    For example,
    set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
    This line was used to create more than one folder as it ran though the folders on the desktop. The next part is I will need to reference them to save files to them.
    You can use a records
    Examples
    if you want the path of localBrandFolder_High_Res  of "Diva", if "Diva" is the second folder of the Desktop
    You get the path with this : localBrandFolder_High_Res of record 2 of myRecords
    if you want the path of localWeekFolder  in the first folder of the Desktop
    You get the path with this : localWeekFolder of record 1 of myRecords
    Here is the script
    set myRecords to {}
    set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
    repeat with i from 1 to number of items in dtF
        set this_item to item i of dtF
        if this_item does not start with "2_" and this_item does not start with "Hot" then
            try
                set folderPath to this_item
                set {oldTID, my text item delimiters} to {my text item delimiters, ":"}
                set folderName to last text item of folderPath
                set my text item delimiters to "_WK"
                set FolderEndName to last text item of folderName
                set brandName to first text item of folderName
                set my text item delimiters to "_PSD"
                set weekNumber to first text item of FolderEndName
                set my text item delimiters to oldTID
            end try
            try
                set this_local_folder to "Hal 9000:Users:matthew:Pictures:2011-2012"
                set var1 to my getFolderPath("WK" & weekNumber, this_local_folder)
                set var2 to my getFolderPath(brandName, var1)
                set var3 to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", var2)
                set var4 to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", var2)
                --set up names to destination folders and create over Netwrok including an already exisiting folder
                set this_Network_folder to "DCKGEN:Brands:Zoom:Brand - Zoom:Upload Photos:2012:"
                set var5 to my getFolderPath("WK" & weekNumber, this_Network_folder)
                set var6 to my getFolderPath(brandName, var5)
                set var7 to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", var6)
                set website_images to "DCKGEN:Website_Images:"
                --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                set this_ftp_folder to "Impulse:"
                set var8 to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                set var9 to my getFolderPath(brandName, var8)
                set var10 to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", var9)
                set var11 to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", var9)
                set end of myRecords to ¬
      {localWeekFolder:var1, localBrandFolder:var2, localBrandFolder_Low_Res:var3, localBrandFolder_High_Res:var4, networkWeekFolder:var5, networkBrandFolder:var6, networkBrandFolder_Low_Res:var7, ftpWeekFolder:var8, ftpBrandFolder:var9, ftpBrandFolder_Low_Res:var10, ftpBrandFolder_High_Res:var11}
            end try
        end if
    end repeat
    localBrandFolder_High_Res of record 2 of myRecords -- get full path of localBrandFolder_High_Res in the second folder of Desktop
    on getFolderPath(tName, folderPath)
        tell application "Finder" to tell folder folderPath
            if not (exists folder tName) then
                return (make new folder at it with properties {name:tName}) as string
            else
                return (folder tName) as string
            end if
        end tell
    end getFolderPath

  • Unable to open PDF document when run through task/workflow

    Hi all,
    I am currently usign a background method to send a smartform as a PDF document to all the agents who approve.
    When i send the smartform in mail as a PDF documetn throught the task i get an error message when opening the PDF document which says that 'The file could nto be opened because it was either not a supported file type or because the file was damaged(for example, it was sent as an email attachment and wasn't decoded correectly'.
    The below is the code i am using to send the smartform
    { CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZFI_ASSET_PDA_NOTIF'
        IMPORTING
          fm_name            = lv_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.}
    { ls_ctrlop-getotf    = 'X'.
      ls_ctrlop-no_dialog = ''.
      ls_compop-tdnoprev  = 'X'.
    ls_ctrlop-DEVICE = 'LOCL'.
      ls_ctrlop-preview   = 'X'.
      ls_ctrlop-no_dialog = 'X'.}
      CALL FUNCTION lv_form_name
        EXPORTING
          control_parameters = ls_ctrlop
          output_options     = ls_compop
          user_settings      = 'X'
          gv_prctr_txt       = gv_prctr_txt
          gv_cc_text         = gv_cc_text
          gv_class_txt       = gv_class_txt
          gv_lname           = gv_lname
          gv_fname           = gv_fname
          gv_position        = gv_position
          gv_initiator       = gv_initiator
          gv_bookcost        = gv_bookcost
          gv_bookvalue       = gv_bookvalue
          gv_date            = gv_date
          gv_prctr           = gv_prctr
          gs_anla            = gs_anla
          gv_emv             = gv_emv
          gv_cond            = gv_cond
          gv_operable        = gv_operable
          gv_action          = gv_action
          gv_justify         = gv_justify
          gv_replace         = gv_replace
          gv_replace_comment = gv_replace_comment
          gv_process         = gv_process
        IMPORTING
          job_output_info    = lt_job_output
        EXCEPTIONS
          usage_error        = 1
          system_error       = 2
          internal_error     = 3
          OTHERS             = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S'  NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT lt_job_output-otfdata INTO ls_otf.
        lt_otf = ls_otf.
        APPEND lt_otf.
        CLEAR lt_otf.
      ENDLOOP.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = lv_len_in
        TABLES
          otf                   = lt_otf
          lines                 = lt_tline
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
    Fehlerhandling
      IF sy-subrc EQ 0.
      ENDIF.
      LOOP AT lt_tline.
        TRANSLATE lt_tline USING '~'.
        CONCATENATE ls_buffer lt_tline INTO ls_buffer.
      ENDLOOP.
      TRANSLATE ls_buffer USING '~'.
      append ls_buffer TO lt_objbin.
    DATA  lv_counter         TYPE i.
      DO.
        lt_record = ls_buffer.
        APPEND lt_record.
        SHIFT ls_buffer LEFT BY 255 PLACES.
        IF ls_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Attachment
      REFRESH:
      lt_reclist,
      lt_objtxt,
      lt_objbin,
      lt_objpack.
      CLEAR ls_objhead.
      lt_objbin[] = lt_record[].
    lt_objhex[] = lt_record[].
      CLEAR lv_descp.
      CONCATENATE 'Asset'
                  gs_anla-anln1
                  'Approval details'
             INTO lv_descp
    SEPARATED BY space.
    Create Message Body
    Title and Description
      CONCATENATE  'Please find attached the approval details of asset : '
                   gs_anla-anln1
              INTO lv_mail_descp
             SEPARATED BY space .
      lt_objtxt = lv_mail_descp.
      APPEND lt_objtxt.
      CLEAR  lv_mail_descp .
    appending space lines into text of mail.
    DO 3 times.
      CLEAR lt_objtxt.
      APPEND lt_objtxt .
    ENDDo.
    CONCATENATE 'This is an automatically generated message.'
                 'Please do not reply to this mail.'
           INTO lv_mail_descp
         SEPARATED BY space .
    lt_objtxt = lv_mail_descp.
    APPEND lt_objtxt.
      DESCRIBE TABLE lt_objtxt LINES lv_lines_txt.
      READ     TABLE lt_objtxt INDEX lv_lines_txt.
      ls_doc_chng-obj_name = 'smartform'.
      ls_doc_chng-expiry_dat = sy-datum + 10.
      ls_doc_chng-obj_descr = lv_descp.
      ls_doc_chng-sensitivty = 'F'.
      ls_doc_chng-doc_size = ( lv_lines_txt - 1 ) * 255  + STRLEN( lt_objtxt ) .
    Main Text
    wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt ).
      CLEAR lt_objpack-transf_bin.
      lt_objpack-head_start = 1.
      lt_objpack-head_num = 0.
      lt_objpack-body_start = 1.
      lt_objpack-body_num = lv_lines_txt.
    lt_objpack-doc_type = 'RAW'.
        lt_objpack-doc_type = 'TXT'.
      APPEND lt_objpack.
    Attachment
    (pdf-Attachment)
      lt_objpack-transf_bin = 'X'.
      lt_objpack-head_start = 1.
      lt_objpack-head_num   = 0.
      lt_objpack-body_start = 1.
      DESCRIBE TABLE lt_objbin LINES lv_lines_bin.
      READ TABLE lt_objbin INDEX lv_lines_bin.
      lt_objpack-doc_size = ( lv_lines_bin - 1 ) * 255 + STRLEN( lt_objbin ) .
      lt_objpack-body_num = lv_lines_bin.
      lt_objpack-doc_type = 'PDF'.
      lt_objpack-obj_name = 'ATTACHMENT'.
      lt_objpack-obj_descr = lv_descp.
      APPEND lt_objpack.
      LOOP AT t_mail_addr.
        CLEAR lt_reclist.
        lt_reclist-receiver = t_mail_addr-mailid.
        lt_reclist-rec_type = 'U'.
        APPEND lt_reclist.
      ENDLOOP.
      IF t_mail_addr[] IS INITIAL.
        CLEAR lt_reclist.
        lt_reclist-receiver = mail id.
        lt_reclist-rec_type = 'U'.
        APPEND lt_reclist.
      ENDIF.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = ls_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = lt_objpack
          object_header              = ls_objhead
          contents_bin               = lt_objbin
          contents_txt               = lt_objtxt
          receivers                  = lt_reclist
         CONTENTS_HEX                = lt_objbin
        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.
      DATA: l TYPE sy-subrc.
      l = sy-subrc.
    When i run the above code in Se38, I get an email with a attachment that i am able to open. The problem seems to be with user WF_BATCH.
    I have already checked all the existing threads on this. I did this coding as per one of the SDN threads itself.
    I am able to open the PDF attachment even when i test the method. The problem is only when it is run through a task/workflow.
    Please advice.
    Thanks and Regards,
    Soumya Gayatri.
    Edited by: Soumya Gayatri on Apr 14, 2009 8:40 PM
    Edited by: Soumya Gayatri on Apr 14, 2009 8:44 PM
    Edited by: Soumya Gayatri on Apr 14, 2009 8:45 PM
    Edited by: Soumya Gayatri on Apr 14, 2009 8:47 PM
    Edited by: Soumya Gayatri on Apr 14, 2009 8:47 PM

    Hello,
    You should see an "Edit" in the top right of your post, you can use that to edit it.
    As I said, use  before and after the coding, but without the spaces (after "{" and before "}" ).
    Try it!
    Testing:
    this is code
    regards
    Rick Bakker
    Hanabi Technology

  • I am unable to sign into my account through Adobe Elements 12. I can sign in on Adobe's website, and through Revel online, and through my smartphone, however when I try to sign in through Adobe Elements 12 directly, the hourglass never stops turning, and

    I am unable to sign into my account through Adobe Elements 12. I can sign in on Adobe's website, and through Revel online, and through my smartphone, however when I try to sign in through Adobe Elements 12 directly, the hourglass never stops turning, and turning.

    Hi,
    Have you tried working through this document - it does apply to Elements as well.
    Sign in, activation, or connection errors | CS5.5 and later
    If you still have problems you may need to contact the Adobe activation team - see the "Still need help?" link at the end of the document.
    Good luck
    Brian

  • HT1454 Can't see ipod videos from 60GB ipod classic.  I have Apple USB/video cable running through Onkyo receiver into Samsung TV. Video & TV out settings seem correct-I can see album cover, but no video. Is it possible to get itunes music videos to play

    Can't see ipod videos from 60GB ipod classic.  I have Apple USB/video cable running through Onkyo receiver into Samsung TV. Video & TV out settings seem correct-I can see album cover, but no video. Is it possible to get itunes music videos to play or do I need to get new ipod.   It works on my iPad and iPhone, but not through iPod Classic.

    Are these music videos located under Videos on your iPod?  Do it play other regular movies (if you have any on the device)?
    B-rock

  • Video sound to TV won't run through headphones

    Hi,
    I have my stereo and TV hooked up to a MacMini (the 2009 slim metal one with the optical drive).  I have a headphone splitter attched to the headphones jack going to the TV and the stereo.  The Mini is hooked up to the TV with a mini DP connector to a DVI-to-HDMI cable (but this same thing happens with a regular DVI cable).  With my old 2,1 Mini that was fine since everything ran through the headphones.
    Now I want to do the same thing but iTunes I can't get the video to run through the headphones.  The only way I get sound to the TV is to run it through the HDMI output (even when using the mini DP).  But then I have to manually change the sound output.
    Is it possible to either:
    1. Have iTunes run out the headphones jack and everything else run out the HDMI?  or
    2. Have everything run out the headphones output?

    Info to add:
    When any digital video is plugged into the Mini, the video sound only works when it's set to HDMI.
    To get sound to my stereo I have to switch it to headphones.  Even though I have a connector going from the headphone jack to the DVI audio input on my TV, there's no sound in headphone mode.
    I tried an external USB sound card and had the same problem.  Just instead of headphones it was the USB soundcard.
    Maybe it's my TV...

Maybe you are looking for

  • How can I change my icloud email details and password on icloud

    how can I change my icloud email details and password on my iphone 5s tried all day without success, I have changed my apple ID and password thats okay. Joan

  • Bounding box and pdf export

    Hi all, I'm using Illustrator CS4 and I have interest in the bounding box of a figure when I export it as a pdf. I'm using the crop area tool (also called ArtBoard, ToolShift+O) to set-up by hand the bounding box and then export the figure as a pdf.

  • BufferedReader - reading text files in chunks

    Currently I am using the following to read in a file, 1 line at a time BufferedReader reader = new BufferedReader(new FileReader(inFile));           String line = null;                    // While there are lines to read from the file while ((line=re

  • SQL Query (Oracle 10g)

    Hi All, Please find the following requirement. Requirement - There are 2 standalone database named database A and database B used by 2 separate application. Database A has schema S1 and Database B has schema S2. Schema S1 has around 40 master tables

  • How do I remove a favicon once set and replace with a new one?

    I want to replace an existing favicon with a new one and it won't allow me.  does anyone have a work around?