Add icon on spark button skin

Hello all I am trying to add different icon on different buttons. I have my skin file ready but not sure if I have to create different skin class for different button. It sounds inefficient. Any suggestions? Thanks for the reply...
<s:Button id="pass"
      width="110"
      height="35"
      fontWeight="bold"
          fontSize="12"
      fontFamily="arial"
      label="Past Track"
     click="pass_clickHandler(event)" skinClass="skins.CustomSkin"/>      
<s:Button id="future"
      width="110"
      height="20"
      fontWeight="bold"
      fontSize="12"
      fontFamily="arial"
      label="Future Plan"
          click="future_clickHandler(event)"
          skinClass="skins.CustomSkin"/>
Skin.....
   <!-- layer 2: fill -->
    <!--- @private -->
    <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="2">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="#304fd7"
                             color.over="#4b6bf6"
                             color.down="0xAAAAAA"
                             alpha="0.85" />
            <s:GradientEntry color="#1f38a3"
                             color.over="#3653cf"
                             color.down="0x929496"
                             alpha="0.85" />
        </s:LinearGradient>
    </s:fill>
</s:Rect>
<!-- icon --> // I could add my icon here but that would make me to create 
                  //different icon image for different button

so you could do something like this even though it doesn't have to be a required item.
    public class ImageButton extends Button
         *  The skin part that defines the area where
         *  the user may drag to resize the window.
        [SkinPart(required="true")]
        public var buttonImage:Object
Then , in your skin you would have an mxml image with the same name ( buttonImage ) that you would position in the skin.  In the mxml where you use the class you could just do
<custom:ImageButton id="ib" buttonImage="assets/myButton.jpg" />
I must warn you though , skinning is not my specialty.
If this post was helpful please mark it as such.
Sincerely ,
  Ubu

Similar Messages

  • Add icon in Bar Button of Status Gui

    Hi Guys,
    I'd like to add an ICON_POSITIVE of <icon> in the bar button, but when trying it in status gui it show me an error message: "The icon ICON_POSITIVE doesn't exist".
    Please, help me.
    Yours sincerely,
    Marcos.

    Hi guy,
    I've already checked it in this table and the icons ICON_POSITIVE and ICON_NEGATIVE are there, but aren't allowed to be used in Bar Button of Status Gui.
    Thanks,
    Marcos.

  • Button Skin: How to add button properties (over, down,up)

    Hi all,
         I made a custom button "skin" because I want my buttons to be images with NO box or border around it and it works great, but I don't know how to add the button functionality. ex. In "over" state buttons tend to light up and in "down" state they tend to get darker. Anyone know how to apply this to an image??? below is my code. Thanks guys!!
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx" width="64" height="64">
        <fx:Metadata>
            [HostComponent("spark.components.Button")]
        </fx:Metadata>
        <s:states>
            <s:State name="over" />
            <s:State name="down" />
            <s:State name="up" />
            <s:State name="disabled" />
        </s:states>   
        <mx:Image source="@Embed(source='assets/images/lightbulb.png')"/>
    </s:SparkSkin>

    You could try something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx"
                 width="64" height="64">
        <fx:Metadata>
            [HostComponent("spark.components.Button")]
        </fx:Metadata>
        <s:states>
            <s:State name="over" />
            <s:State name="down" />
            <s:State name="up" />
            <s:State name="disabled" />
        </s:states>   
        <mx:Image source="@Embed('assets/images/lightbulb.png')"
                  source.over="@Embed('assets/images/lightbulb_lit.png')"
                  source.down="@Embed('assets/images/lightbulb_dark.png')"
                  source.disabled="@Embed('assets/images/candle.png')" />
    </s:SparkSkin>
    Peter

  • [svn:fx-4.x] 14327: Fix maximize/ restore button in spark chrome skin when running on AIR 2.

    Revision: 14327
    Revision: 14327
    Author:   [email protected]
    Date:     2010-02-22 08:48:05 -0800 (Mon, 22 Feb 2010)
    Log Message:
    Fix maximize/ restore button in spark chrome skin when running on AIR 2.
    Listen for the Window state change event instead of expecting the change to happen immediately.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-25303
    Reviewer: Alex
    Tests run: checkintests
    Is noteworthy for integration: No.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25303
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/airspark/src/spark/components/Window.as
        flex/sdk/branches/4.x/frameworks/projects/airspark/src/spark/components/WindowedApplicati on.as
        flex/sdk/branches/4.x/frameworks/projects/airspark/src/spark/components/windowClasses/Tit leBar.as

    Stope
    Mailing me ***
    Sent from my I phone

  • How to intercept style changes in skin for spark Button?

    How to intercept style changes in skin for spark Button?
    Thank you.

    How to intercept style changes in skin for spark Button?
    Thank you.

  • How make delete and add buttons as default apex icons(delete , add icons)

    Hi,
    I am new to Oracle apex , Please help me from below issue.
    I am having buttons called Add, Delete whic needs to be display as default apex delete, add icons.
    I have refered below link, even though i didn't get how to apply this.
    http://apex.oracle.com/pls/otn/f?p=45958:21:0:::::
    Please help me how add this icons and where can i see this icons in workspace.
    Thanks and regards,
    Ibrahim Sayyed.

    To call an image, you need to enter something like this in a HTML Region Body, Footer or Header:
    &lt;img src="#IMAGE_PREFIX#alert_error.gif" title="delete" onclick="apex.submit('DELETE')" style="cursor:pointer">What are "default apex delete, add icons"?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Dynamic skinning of Spark button?

    I wish to use Spark Button for my video player's  play / pause button. I thought I would create 2 different skin files and  dynamically assign them to the play / pause button in the ActionScript function  but found that Spark Button's skin property is read-only! Any suggestions on how  this can be done (without creating 2 different buttons)?

    To answer my own question (thanks to Deepa Subramaniam of Adobe), you can use the new Flex 4 style to dynamically apply a skin to a component, as follows:
                playPause.setStyle("skinClass", PlayButtonSkin);
    or
                playPause.setStyle("skinClass", PauseButtonSkin);

  • Default skin for spark button class

    Hi, where in the spark button class or superclasses does it specify its default skin?

    Spark components like Button.as don't define thier default skins internally. If you want a skinnable component to have a default skin so that you don't have to  manually specify the skin every time you have two options. The preferred method, and the one used in the flex sdk, is to use a css file to specify the skin for the component. If you don't want to do that, then the other option is to call setStyle("skinClass", YourSkinClass) inside the constructor of the actionscript component.

  • Errors when using Spark Buttons in dynamically loaded modules loaded by dynamically loaded modules

    Ok ... I have to admit this issue is rather special ;-)
    I have a flex application that loads a list of modules after the user logs in, depending on the permissions of the user.
    One of these modules contains a component, that allows the user to configure settings for different types of objects.
    For each object type (can be extended) there exists one module swf.
    The strange problem I am having now is that as soon as a Spark Button (or anything derived from one ... CheckBox) inside the settings-module. I get the following error (unfortunately in german ... but I'll try to translate).
    This error happens when using a spark CheckBox (Which is derived from Spark Button):
    ArgumentError: Error #2004: Einer der Parameter ist ungültig.
    at flash.display::Graphics/drawRect()
    at mx.graphics::RectangularDropShadow/drawShadow()[E:\dev\4.x\frameworks\projects\framework\ src\mx\graphics\RectangularDropShadow.as:575]
    at mx.skins.spark::BorderSkin/updateDisplayList()[E:\dev\4.x\frameworks\projects\sparkskins\ src\mx\skins\spark\BorderSkin.mxml:174]
    at mx.core::UIComponent/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework\src\m x\core\UIComponent.as:8709]
    at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework \src\mx\managers\LayoutManager.as:663]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:718]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
    When having a look at the problem the cause is that width and height are not set (NaN).
    If I use a plain Button I get the same error in "drawRoundRect".
    As soon as I change back to a mx-Button/Checkbox, everything is fine.
    In my current Case I wanted to use a custom TreeItemRenderer to display a CheckBox in the tree. This tree Item renderer is included in a custom Lib that is used by all modules.
    I have one Second Level module using this renderer. I have one Third Level Module thas uses the exact same tree definition. If I use the MX CheckBox I get CheckBoxes in the Second- and Third-Level Module. If I use the Spark-CheckBox I get a CheckBox in my Second Level Module and the above Error in the Third Level Module.
    To make everything even stranger: I have a custom component loading my modules and I use this in the Top Level Module to load the Second Level Modules and in my Second Level Module to load my Third Level Modules (So I would guess If my loader is broken, then the Second Level Modules should not work either).
    Help is greatly appreciated :-)
    Regards,
          Chris

    Ok, I managed to find out what was going wrong and to get my stuff working again. I have to admit that I have no idea why my application / flex was showing this behaviour. The only way I could track this down was by undoing the Subversion checkins one by one. Finding out what was happening using common sense seems to be out of the question with this issue.
    My application is built up of a main application swf that loads module swfs and a library swc that contains common stuff and is used in the main application and the modules.
    I now had some custom TreeItemRenderers in my modules. The problem was caused by moving a custom TreeItemRenderer from one module to the library-swc. I could successfully reproduce this. If I add only one class extending TreeItemRenderer to my library (I don't even have to use it), the entire flex system goes haywire. As soon as I remove that class, everything is ok. I checked, if there might be a problem with third party libs containing flex core classes which might be used instead of the sdk ones, but after looking at the catalogs of the third party swcs I couldn't find a reference to TreeItemRenderer.
    Any Ideas? I sort of dislike the idea of being able to run into such strange problems. Is there a tool that allows me to check for class compatibility issues?

  • How to align label text to the left in Spark Button (no "textAlign" style)?

    Hi all,
    "textAlign" style is excluded for Spark Button, and probably for a good reason.
    [Exclude(name="textAlign", kind="style")]
      If I want to align Spark Button text label to the left, should I create custom skin to accomplish that?
    Something e.g:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            minWidth="21" minHeight="21"
            alpha.disabled="0.5">
    <s:Label
            id="labelDisplay"       
            textAlign="left"               
            left="2" right="2" top="2" bottom="2"/>
    </s:Skin>

        Right, I though about this approach vith setStyle too, but this is not that convenient.
        I looked into source code and find out that spark.components.Button class adds to the spark.components.supportClasses.ButtonBase only one public property "emphasized".
      Because I do not need this property in my project, I've extended my custom LinkButton component from ButtonBase to allow setting "textAlign" style in MXML for this component.
    import spark.components.supportClasses.ButtonBase;
    public class LinkButton extends ButtonBase {
       Also,  inside custom Skin from my Button component I do not set explicitly "textAlign" style value to the button label, I let button label to inherit style value specified in MXML for the style textAlign of my ListButton component.
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            minWidth="21" minHeight="21"
            alpha.disabled="0.5">       
        <fx:Metadata>
            [HostComponent("component.LinkButton")]
        </fx:Metadata>   
    <s:Label
            id="labelDisplay"
            textDecoration="underline"
            maxDisplayedLines="1"
            verticalAlign="middle"
            color="{getStyle('color')}"
            color.over="{getStyle('textRollOverColor')}"       
            color.down="{getStyle('textSelectedColor')}"       
            left="10" right="10" top="2" bottom="2"/>
    </s:Skin>

  • How to add a google+ share button to a composition?

    I am working on a little app for which I want to add share buttons.
    I don't have problems adding Facebook share and Twitter buttons, However I cannot find a way to add a Google+ share button.
    For FB I create a rectangle and name it fbBtn. Then on click I add the foolowing code:
    FB.ui({
              method: 'feed',
              name: 'Win designer fashion jewelry from Baloka',
              link: ' http://www.mysite.com/',
              picture: 'http://www.mysite.com/external-xfbml/share-image.gif',
              caption: 'Win designer fashion jewelry from Baloka',
              description: 'Baloka is giving away 22 designer fashion jewelry by Maria Mizrahi. Check this out. Do you want to win? You could...',
              message: ''
    For Twitter I create a rectangle and name it twitterBTN. Then I add this code to document.compositionReady:
    var twitter = sym.$("twitterBTN");
    var c = '<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://baloka.com/content/socialApp/fb.html" data-text="Win cool trendy designer fashion jewelry - check this out" data-via="BalokaDesign" data-count="none" data-hashtags="BalokaSweepstakes">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id =id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(docu ment,"script","twitter-wjs");</script>';
    twitter.html(c);
    For Google + I found two ways to add a share button:
    First:
    Adding this snipped to the html document (not in EA):
    div class="edgeLoad-EDGE-467457915"><a href="https://plus.google.com/share?url={http:baloka.com}" onclick="javascript:window.open(this.href,
      '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img
      src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a></div>
    and adding this to the head:
    <!-- Add the following three tags inside head. -->
        <meta itemprop="name" content="Baloka Sweepstakes">
        <meta itemprop="description" content="Win designer fashion jewelry by Maria Mizrahi - Baloka.
        There are 22 prizes including earrings, bracelets, necklaces and a couple of $100 gift certificates.
        Please share with your friends.">
        <meta itemprop="image" content="http://cdn2.bigcommerce.com/server2100/a154e/products/102/images/243/LittleTotemEarrings__ 55527.1355162788.1280.1280.jpg">
    This works as expected, but I am having a hard time position the button in the right place on my page. I can see the button in EA, but the position I set it in there is not maintained once the file is published.
    Thus, I would like to know how to include the code directly in EA as I am doing with the Twitter and facebook buttons.
    Second:
    Adding this to the html document (not in EA):
    <div id="gplus1" data-action="share" data-annotation="bubble" class="edgeLoad-EDGE-467457915"></div>
    <!-- Place this tag after the last share tag. -->
    <script type="text/javascript">
          (function() {
                    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                    po.src = 'https://apis.google.com/js/plusone.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      </script>
    Again, this works, although with this code I don't know  how to customize the name, description and image for the info I am sharing.
    In this case I was able to include the code on EA adding the following to document.compositionReady:
    var googleplus = sym.$('googleplus');
    var click = "javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');";
    var g = '<a href="https://plus.google.com/share?url={http://baloka.com/content/socialApp/fb.html}" onclick="click";return false;"><img src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a>';
    googleplus.html(g);
    The problem here is that instead of opening a window, it replaces the page with the one supposed to be on a different window, which I don't like.
    So, in short, I need some help figuring out how to include the code directly in EA for the first method for Google+.

    I don't have an answer for you, but I do have a question. You said the FB code works. What did you do? What did you put in your html page? I tried the FB code above and it gives me an ID error. Appreciate it if you can elaborate more. I just posted the ff in the forum "Customizing FB Share in Edge Animate"
    Thank you!

  • How do I add a close window button/image

    All I want to do: Add a close window button (round/square with an "x" through it) to either one or many html files. I don't see how to do this.
    Using RoboHelp 8 HTML and WinXP. Thanks.

    Ahh I see now. You are asking where to obtain such an image!
    The RoboHelp Gallery doesn't contain one. Sorry. You will need to obtain one from any number of other locations.
    You might look at the following link for one possibility.
    Icon Archive
    Here are a couple from my own colloection. You might right-click and save as.
    There are also a number of packages you may purchase or find. Perhaps the following link will help.
    Click here to search Google
    I cannot advise on the legal implications of using said images.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

  • How to change an icon of a button

    hi guys,
    i want to change the icon of a button when it is click
    how can i do it?
    thanks

    You register a listener for that button, e.g.:
    button.addActionListener(new...)
    Then add code to the listener class:
    button.setIcon(new...)
    If you've not come across listeners yet though, you'll need to explore these a bit first.
    Andy.

  • Custom button skin with scaleGrid 9 slice image does not appear in Design Mode

    So in a custom button skin I have a nine sliced image, and then throw that onto an MXML page. In design view, I cannot get the component to show the image that I've thrown on it. Unless I do a hack on the MXML page by adding the image in it's scaleGrid form to the page somewhere. Then it seems to act as like a preloader for the image so it actually displays. But I don't want to do this hack on every page that uses this component. Is there a work around?
    Here's the button skin:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        width.disabled="296" height.disabled="73">
    <!-- host component -->
    <fx:Metadata>
                        [HostComponent("spark.components.Button")]
                        [Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)]
    </fx:Metadata>
    <!-- states -->
    <s:states>
                        <s:State name="disabled" />
                        <s:State name="down" />
                        <s:State name="over" />
                        <s:State name="up" />
    </s:states>
              <s:Group width="100%" height="100%" >
      <s:Image width="100%" height="100%" smooth="true" source="@Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)"/>
    </s:Group>
    <!-- text -->
              <s:Label id="labelDisplay" left="10" right="10" top="2" bottom="2" horizontalCenter="0"
                                   maxDisplayedLines="1" textAlign="center" verticalAlign="middle" verticalCenter="1"
                                   color="#FFFFFF" >
      <s:filters>
                                  <s:DropShadowFilter distance="0" angle="90" color="0x000000" alpha="1" blurX="2" blurY="2" strength="16" quality="3" />
      </s:filters>
    </s:Label>
    </s:Skin>
    And then I throw that button into an MXML page. The image doesn't show up in design view.
    <s:Button x="330" y="94" width="134" height="57" label="Button" skinClass="features.shared.NineSliceButtonSkin" />
    This hack, fixes the button! And all other buttons that use that skin.
    <s:Image width="100%" height="100%" smooth="true" source="@Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)"/>
    <s:Button x="330" y="94" width="134" height="57" label="Button" skinClass="features.shared.NineSliceButtonSkin" />

    Looking for an answer too!

  • ADD ICON

    IN alv I NEED TO ADD ICON THAT WHEN I CLICK ON IT
    IT PRINT SMARTFORM LAYOUT
    DO TOU KNOW ?
    THANKS

    Hi Liat,
    For ALV grid function module. Below is the code i have written to display list of contacts. the user has able to select mutliple contacts displayed in the screen and select the Button 'PRINT CONTRACT' to print smartform.
    If need complete code give me your mail id, i will send you.
    My code works for Tcode VA42.
    You have to create GUI status in SE41 to display button on tool bar.
    Display output in a ALV Grid
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           I_CALLBACK_PROGRAM                = gs_repid
           I_CALLBACK_PF_STATUS_SET          = 'ALV_STATUS'
           I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
           IS_LAYOUT                         = gs_layout
           IT_FIELDCAT                       = gt_fieldcat
           IT_SORT                           = gs_sort
           I_SAVE                            = 'A'
         TABLES
           T_OUTTAB                          = it_cntrt
         EXCEPTIONS
           PROGRAM_ERROR                     = 1
           OTHERS                            = 2
       IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    FORM user_command USING l_ucomm      LIKE sy-ucomm
                            l_selfield   TYPE slis_selfield.
      RANGES: r_kappl FOR nast-kappl,
              r_objky FOR nast-objky,
              r_kschl FOR nast-kschl,
              r_nacha FOR nast-nacha.
      DATA: l_jobname  TYPE TBTCJOB-JOBNAME,
            l_jobcount TYPE TBTCJOB-JOBCOUNT,
            l_repid    TYPE sy-repid,
            l_print_params TYPE PRI_PARAMS,
            l_arc_params   TYPE ARC_PARAMS,
            l_valid        TYPE c,
            l_retcode      TYPE sy-subrc,
            l_blines       TYPE i.
      CASE l_ucomm.
      Process button seleted
        WHEN c_sform.
        process selected records.
          LOOP AT it_cntrt INTO wa_cntrt.
             IF wa_cntrt-box = 'X'.
              place output type in the contract
                PERFORM bdc_output USING wa_cntrt
                                   CHANGING l_retcode.
                IF l_retcode = 0.
                add record for jobground job
                  r_objky-sign   = 'I'.
                  r_objky-option = 'EQ'.
                  r_objky-low    = wa_cntrt-vbeln.
                  APPEND r_objky.
                ENDIF.
                CLEAR: wa_cntrt, l_retcode, r_objky.
             ENDIF.
          ENDLOOP.
        WHEN c_dclick.
        set contract number id with the selected contract
          SET PARAMETER ID 'AUN' FIELD l_selfield-value.
          SET PARAMETER ID 'KTN' FIELD l_selfield-value.
        call va42 tcode when double click on contract
          CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
      ENDCASE.
      DESCRIBE TABLE r_objky LINES l_blines.
    IF NOT r_objky[] IS INITIAL.
      IF l_blines > 0.
        Background job name.
          CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
                 INTO l_jobname.
        Application
          r_kappl-sign   = 'I'.
          r_kappl-option = 'EQ'.
          r_kappl-low    = 'V1'.
          APPEND r_kappl.
        Message Type
          r_kschl-sign   = 'I'.
          r_kschl-option = 'EQ'.
          r_kschl-low    = c_kschl.
          APPEND r_kschl.
        Message transmission medium
          r_nacha-sign   = 'I'.
          r_nacha-option = 'EQ'.
          r_nacha-low    = '1'.
          APPEND r_nacha.
          l_repid = sy-repid.
        Print Parameters
          CALL FUNCTION 'GET_PRINT_PARAMETERS'
            EXPORTING
              DESTINATION                  = p_print
              MODE                         = c_batch
              NO_DIALOG                    = 'X'
              REPORT                       = l_repid
              EXPIRATION                   = 2
              IMMEDIATELY                  = 'X'
              NEW_LIST_ID                  = 'X'
            IMPORTING
              OUT_ARCHIVE_PARAMETERS       = l_arc_params
              OUT_PARAMETERS               = l_print_params
              VALID                        = l_valid
            EXCEPTIONS
              ARCHIVE_INFO_NOT_FOUND       = 1
              INVALID_PRINT_PARAMS         = 2
              INVALID_ARCHIVE_PARAMS       = 3
              OTHERS                       = 4.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        opening the job
          CALL FUNCTION 'JOB_OPEN'
            EXPORTING
              JOBNAME                = l_jobname
            IMPORTING
              JOBCOUNT               = l_jobcount
           EXCEPTIONS
             CANT_CREATE_JOB        = 1
             INVALID_JOB_DATA       = 2
             JOBNAME_MISSING        = 3
             OTHERS                 = 4.
          IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        Job submit
          SUBMIT rsnast00 TO SAP-SPOOL
                          USER sy-uname
                          WITH s_kappl IN r_kappl
                          WITH s_objky IN r_objky
                          WITH s_kschl IN r_kschl
                          WITH s_nacha IN r_nacha
                          WITH p_print  EQ p_print
             VIA JOB l_jobname NUMBER l_jobcount
             SPOOL PARAMETERS l_print_params
             WITHOUT SPOOL DYNPRO
             AND RETURN.
          IF sy-subrc <> 0.
          display message when error in scheduling background job
            MESSAGE E016 WITH 'Error scheduling Job'.
          ENDIF.
        Job close
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              JOBCOUNT                          = l_jobcount
              JOBNAME                           = l_jobname
              STRTIMMED                         = 'X'
           EXCEPTIONS
             CANT_START_IMMEDIATE              = 1
             INVALID_STARTDATE                 = 2
             JOBNAME_MISSING                   = 3
             JOB_CLOSE_FAILED                  = 4
             JOB_NOSTEPS                       = 5
             JOB_NOTEX                         = 6
             LOCK_FAILED                       = 7
             OTHERS                            = 8.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
      ENDIF.
    ENDFORM.
    FORM bdc_output USING    wa_cntrt  TYPE ty_cntrt
                    CHANGING l_retcode TYPE sy-subrc.
    DATA: l_nast TYPE TABLE OF nast,
           it_nast TYPE TABLE OF nast,
           w_nast TYPE nast,
           l_cellno(2) TYPE n,
           l_vbelv TYPE vbfa-vbelv,
           l_vbpa  TYPE vbpa,
           l_yes(1),
           l_temp(40) TYPE c,
           l_lines    TYPE i,
           l_lesscnt  TYPE i,
           l_less(1),
           l_lines1(2) TYPE n.
        REFRESH: it_nast, l_nast, it_bdc.
        CLEAR: l_nast, w_nast, l_yes, l_cellno,
               it_nast, l_nast, it_bdc.
        PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
          PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
          PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
        PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
        SELECT *
          FROM nast
          INTO CORRESPONDING FIELDS OF TABLE l_nast
         WHERE kappl = c_kappl
           AND objky = wa_cntrt-vbeln.
        IF sy-subrc = 0.
            SORT l_nast BY kschl vstat.
            DESCRIBE TABLE l_nast LINES l_lines.
            LOOP AT l_nast INTO w_nast.
                l_cellno = sy-tabix.
                IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
                  EXIT.
                ENDIF.
                IF w_nast-kschl > c_kschl OR
                   ( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
                   IF l_less = space.
                     l_cellno = l_cellno - 1.
                   ENDIF.
                   CLEAR l_less.
                  IF l_cellno = 0.
                     l_cellno = 1.
                  ENDIF.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
                  EXIT.
                ELSEIF w_nast-kschl < c_kschl.
                  l_less = 'X'.
                  l_lesscnt = l_lesscnt + 1.
                ENDIF.
            ENDLOOP.
        ELSE.
            l_cellno = '01'.
            PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
              CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
              CONDENSE l_temp.
              PERFORM dyn_fld USING l_temp 'Y6C4'.
              CLEAR l_temp.
              PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        IF l_less = 'X'.
            l_lesscnt = l_lesscnt + 1.
                  l_cellno = l_lesscnt.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
        PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
          PERFORM dyn_fld USING 'NAST-LDEST' p_print.
          PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
          PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
        PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
          PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
        CALL TRANSACTION c_tcode USING it_bdc
                                 MODE c_mode     "'N'
                                 UPDATE c_updat  "'A'
                                 MESSAGES INTO it_mesg.
        IF sy-subrc = 0.
          l_retcode = 0.
        ENDIF.
    ENDFORM.                    " bdc_output
    *&      Form  dyn_scr
          text
         -->P_0642   text
         -->P_0643   text
         -->P_0644   text
    FORM dyn_scr USING    P_0642
                          P_0643
                          P_0644.
        MOVE:  p_0642 TO wa_bdc-program,
               p_0643 TO wa_bdc-dynpro,
               p_0644 TO wa_bdc-dynbegin.
        APPEND wa_bdc TO it_bdc.
        CLEAR wa_bdc.
    ENDFORM.                    " dyn_scr
    *&      Form  dyn_fld
          text
         -->P_0654   text
         -->P_0655  text
    FORM dyn_fld USING    P_0654
                          P_0655.
       MOVE: p_0654 TO wa_bdc-fnam,
             p_0655 TO wa_bdc-fval.
       APPEND wa_bdc TO it_bdc.
       CLEAR wa_bdc.
    ENDFORM.                    " dyn_fld
    FORM alv_sort.
      DATA: wa_sortcat  TYPE slis_sortinfo_alv.
      WA_SORTCAT-SPOS      = 1.
      WA_SORTCAT-FIELDNAME = 'KUNNR'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      CLEAR wa_sortcat.
      WA_SORTCAT-SPOS      = 2.
      WA_SORTCAT-FIELDNAME = 'VBELN'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      WA_SORTCAT-SPOS      = 3.
      WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
    ENDFORM.                    " alv_sort

Maybe you are looking for

  • System Accepting for Making PO based on Un-released PR

    Dear gurus, We have activated PR Release stategy without classification. Even though PR was not released, system allowing to create a PO with reference to that PR. Please look into this and guide me, where we need to check/ verify the settings for no

  • Need iMac 5,1 install disk

    My late 2006 iMac intel is working with boot camp, but has lost the Mac side volume information.  Tech Tool Pro 4 tests all show everything is find but has no Volume info.  I can launch Boot Camp with Window XP and all works fine. I was  hopping to r

  • Problem in FI_ITEMS_MENUE01

    Hi, We have implemented the BADI FI_ITEMS_MENUE01 to add a new push button. In Development system Push button is visible and the functionality is working as required. When I moved the transport to Quality, new push button is not displayed. All the tr

  • Hanging after update to 10.4.3.

    Hi, since I'ved upgrade to 10.4.3 my computer doesn't come back after the sleep function of energyfunction. The only way up is to complete restart the computer. Anyone a idea?

  • Application crash without dump

    My application built in Java (uses multithreads) interacts with a server via CORBA interface. My application further interacts with another application built in Java. The flow is like this: The request to manage objects comes from a C++ application v