How to approach ABAP OO programming the right way...

Hello experts,
I am an old school procedural ABAP programmer and I recently I have been experementing with ABAP Objects since I've read a few columns the advantages of ABAP OO and also currently learning its syntax. Now, does ABAP Objects conform to the old way of say, doing reports like at selection-screen output, at selection-screen, on value-request for..., start-of-selection, end-of-selection, top-of-page, etc. I have been doing some practice programs and I am not sure if my approach is correct. Example, I created a class named cl1 and I have a method named upload. Now, the UPLOAD method contains the function 'GUI_UPLOAD'. Is this the right way of doing it? Also, How come I cannot create structures inside a class?
Again, thanks guys and have a nice day!

Hi,
I have these three progs from one of the previous posts.
Good approach on using constructors. I am not finding the original link.
*& Report ZABAP_OBJ_01 *
REPORT zabap_obj_01 .
PARAMETERS : p_vbeln LIKE vbap-vbeln OBLIGATORY,
             p_matnr LIKE mara-matnr.
TYPES : BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln,
matnr TYPE vbap-matnr,
arktx TYPE vbap-arktx,
END OF ty_vbap.
* CLASS sales_order DEFINITION
CLASS sales_order DEFINITION.
  PUBLIC SECTION.
    DATA : v_matnr TYPE mara-matnr,
    v_vbeln TYPE vbap-vbeln.
    METHODS : constructor IMPORTING vbeln TYPE vbap-vbeln
    matnr TYPE mara-matnr OPTIONAL.
    DATA : it_vbap TYPE STANDARD TABLE OF ty_vbap.
    METHODS : get_vbap_details,
    disp_vbap_details.
ENDCLASS. "sales_order DEFINITION
* CLASS sales_order IMPLEMENTATION
CLASS sales_order IMPLEMENTATION.
  METHOD get_vbap_details.
    CLEAR : it_vbap.
    REFRESH : it_vbap.
    SELECT vbeln
    matnr
    arktx
    FROM vbap
    INTO TABLE it_vbap
    WHERE vbeln = p_vbeln.
  ENDMETHOD. "get_vbap_details
  METHOD constructor.
    CLEAR : v_vbeln,
    v_matnr.
    v_vbeln = vbeln.
    v_matnr = matnr.
  ENDMETHOD. "constructor
  METHOD disp_vbap_details.
    DATA : wx_vbap LIKE LINE OF it_vbap.
    LOOP AT it_vbap INTO wx_vbap.
      WRITE :/ wx_vbap-vbeln,
      wx_vbap-matnr,
      wx_vbap-arktx.
    ENDLOOP.
    CLEAR : it_vbap.
  ENDMETHOD. "disp_vbap_details
ENDCLASS. "sales_order IMPLEMENTATION
DATA : obj TYPE REF TO sales_order.
START-OF-SELECTION.
  IF NOT p_matnr IS INITIAL.
    CREATE OBJECT obj EXPORTING vbeln = p_vbeln
    matnr = p_matnr.
  ELSE.
    CREATE OBJECT obj EXPORTING vbeln = p_vbeln.
  ENDIF.
  CALL METHOD obj->get_vbap_details.
  CALL METHOD obj->disp_vbap_details.
*& report ziga_abapobjects_asgn01 *
  REPORT ziga_abapobjects_asgn01 .
  PARAMETER : p_matnr LIKE mara-matnr.
* CLASS lcl_material DEFINITION
CLASS lcl_material DEFINITION.
  PUBLIC SECTION.
    DATA: v_matnr TYPE mara-matnr.
    METHODS : constructor IMPORTING matnr TYPE mara-matnr,
    get_material_description.
  PRIVATE SECTION.
    DATA : v_maktx TYPE makt-maktx.
ENDCLASS. "lcl_material DEFINITION
* CLASS lcl_material IMPLEMENTATION
CLASS lcl_material IMPLEMENTATION.
  METHOD get_material_description.
    CLEAR v_maktx.
    SELECT SINGLE maktx INTO v_maktx
    FROM makt
    WHERE matnr = v_matnr AND
    spras = 'E'.
  ENDMETHOD. "get_material_description
  METHOD constructor.
    CLEAR v_matnr.
    v_matnr = matnr.
  ENDMETHOD. "constructor
ENDCLASS. "lcl_material IMPLEMENTATION
DATA : obj TYPE REF TO lcl_material.
START-OF-SELECTION.
  CREATE OBJECT obj EXPORTING matnr = p_matnr.
  CALL METHOD obj->get_material_description.
  prg3)
  report ziga_abapobjects_asgn01 .
  PARAMETER : p_matnr LIKE mara-matnr.
* CLASS lcl_material DEFINITION
CLASS lcl_material DEFINITION.
  PUBLIC SECTION.
    METHODS : constructor IMPORTING matnr TYPE mara-matnr,
    write_material_desc.
    CLASS-METHODS : class_constructor.
  PRIVATE SECTION.
    CLASS-DATA: v_matnr TYPE mara-matnr.
    DATA : v_maktx TYPE makt-maktx.
    METHODS : get_material_description.
ENDCLASS. "lcl_material DEFINITION
* CLASS lcl_material IMPLEMENTATION
CLASS lcl_material IMPLEMENTATION.
  METHOD get_material_description.
    CLEAR v_maktx.
    SELECT SINGLE maktx INTO v_maktx
    FROM makt
    WHERE matnr = v_matnr AND
    spras = 'E'.
  ENDMETHOD. "get_material_description
  METHOD constructor.
    WRITE :/ 'Inside Instance Constructor'.
    CLEAR v_matnr.
    v_matnr = matnr.
    CALL METHOD get_material_description.
  ENDMETHOD. "constructor
  METHOD write_material_desc.
    WRITE :/ 'Material Description :', v_maktx.
  ENDMETHOD.                    "write_material_desc
  METHOD class_constructor.
    WRITE :/ 'Inside Static Constructor'.
  ENDMETHOD.                    "class_constructor
ENDCLASS. "lcl_material IMPLEMENTATION
DATA : obj TYPE REF TO lcl_material,
obj1 TYPE REF TO lcl_material.
START-OF-SELECTION.
  CREATE OBJECT obj EXPORTING matnr = p_matnr.
  CALL METHOD obj->write_material_desc.
  CREATE OBJECT obj1 EXPORTING matnr = '000000000000000110'.
  CALL METHOD obj1->write_material_desc.
  CALL METHOD obj->write_material_desc.
  prg4)
  report ziga_abapobjects_asgn01 .
  PARAMETER : p_matnr LIKE mara-matnr.
* CLASS lcl_material DEFINITION
CLASS lcl_material DEFINITION.
  PUBLIC SECTION.
    METHODS : constructor IMPORTING matnr TYPE mara-matnr,
    write_material_desc,
    get_material_description.
    CLASS-METHODS : class_constructor.
  PRIVATE SECTION.
    CLASS-DATA: v_matnr TYPE mara-matnr.
    DATA : v_maktx TYPE makt-maktx.
ENDCLASS. "lcl_material DEFINITION
* CLASS lcl_material IMPLEMENTATION
CLASS lcl_material IMPLEMENTATION.
  METHOD get_material_description.
    CLEAR v_maktx.
    SELECT SINGLE maktx INTO v_maktx
    FROM makt
    WHERE matnr = v_matnr AND
    spras = 'E'.
  ENDMETHOD. "get_material_description
  METHOD constructor.
    WRITE :/ 'Inside Instance Constructor'.
    CLEAR v_matnr.
    v_matnr = matnr.
  ENDMETHOD. "constructor
  METHOD write_material_desc.
    WRITE :/ 'Material Description :', v_maktx.
  ENDMETHOD.                    "write_material_desc
  METHOD class_constructor.
    WRITE :/ 'Inside Static Constructor'.
  ENDMETHOD.                    "class_constructor
ENDCLASS. "lcl_material IMPLEMENTATION
DATA : obj TYPE REF TO lcl_material,
obj1 TYPE REF TO lcl_material.
START-OF-SELECTION.
  CREATE OBJECT obj EXPORTING matnr = p_matnr.
  CALL METHOD obj->get_material_description.
  CALL METHOD obj->write_material_desc.
  CREATE OBJECT obj1 EXPORTING matnr = '000000000000000110'.
  CALL METHOD obj1->get_material_description.
  CALL METHOD obj1->write_material_desc.
  CALL METHOD obj->get_material_description.
  CALL METHOD obj->write_material_desc.
  REPORT ziga_abapobjects_asgn01 .
  PARAMETER : p_matnr LIKE mara-matnr.
* CLASS lcl_material DEFINITION
CLASS lcl_material DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS : write_material_desc,
    get_material_description,
    class_constructor.
  PRIVATE SECTION.
    CLASS-DATA: v_matnr TYPE mara-matnr.
    CLASS-DATA: v_maktx TYPE makt-maktx.
ENDCLASS. "lcl_material DEFINITION
* CLASS lcl_material IMPLEMENTATION
CLASS lcl_material IMPLEMENTATION.
  METHOD get_material_description.
    CLEAR v_maktx.
    SELECT SINGLE maktx INTO v_maktx
    FROM makt
    WHERE matnr = v_matnr AND
    spras = 'E'.
  ENDMETHOD. "get_material_description
  METHOD write_material_desc.
    WRITE :/ 'Material Description :', v_maktx.
  ENDMETHOD.                    "write_material_desc
  METHOD class_constructor.
    WRITE :/ 'Inside Static Constructor'.
    v_matnr = '000000000000000110'.
  ENDMETHOD.                    "class_constructor
ENDCLASS. "lcl_material IMPLEMENTATION
START-OF-SELECTION.
  CALL METHOD lcl_material=>get_material_description.
  CALL METHOD lcl_material=>write_material_desc.
Arun Sambargi.

Similar Messages

  • I've filmed The Mill in flood from my iPhone 4s, but when I got it on my laptop it's up-side-down, how do I turn a film the right way up so I can up-load to FB?

    I've filmed The Mill in flood from my iPhone 4s, but when I got it on my laptop it's up-side-down, how do I turn a film the right way up so I can up-load to FB?

    You can load it from your iphone directly to facebook?

  • How to create a custom panel in the right way (without having an empty panel in the file info) ?

    Hi Everyone
    My name is Daté.
    I'm working in the fashion industry as a designer and Design consultant to help fashion brands improving the design workflow by using Adobe softwares and especially Illustrator.
    I'm not a developper, but i'm very interested about the possibility to introduce xmp technology to provide more DAM workflows in the fashion industry.
    Fashion designers produce a lot of graphical objects in illustrator or Photoshop. Unfortunately they are faced to a big challenge which is about how to manage, search, classify and get this files faster. Of course PDM system or PLM system are used in the Fashion industry to manage data, but for many companies, implemanting this kind of database is very complex.
    When i look at what you can do with xmp, it seems to be an interesting way of managing design files, then i started to follow Adobe instruction to try to build a custom panel.
    The main idea is to (Theory) :
    create custom panels used by fashion designers to classify their design files.
    Use Adobe Bridge to search files, create smart collection to make basic reports in pdf and slideshows
    Find someone to make a script able to export metadata in xml files
    Use indesign and the xml file to generate automatically catalogues or technical sheets based on xmp values
    I have created a custom panel by using the generic panel provided by Adobe and i have modified the fields to feet with the terms used in the fashion industry and it works well.
    But unfortunately, when i try to create my own custom panel from scratch with Flashbuilder (4.6) and the Adobe CSExtensionBuilder_2 (Trial version), it doesn't work!
    Here is the process :
    I have installed flashbuilder 4.6
    I have download the XMP Fileinfo SDK 5.1 and placed the com.adobe.xmp.sdk.fileinfo_fb4_1.1.0.jar in C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\eclipse\plugins
    In Flashbuilder, i have created a new project and select xmp Custom panel
    The new project is created in flashbuilder with a field with A BASIC Description Field
    To generate the panel, right click the project folder and select xmp / Publish Custom Panel
    The panel is automatically generated in the following folder : C:\Users\AppData\Roaming\Adobe\XMP\custom file info panels\3.0\panels
      Go to illustrator, Open the file Info
    The panel appears empty
    The others panel are also empty
    The panel is created and automatically placed in the right folder, but when you open it in Illustrator by selecting the File Info option in the File Menu, this custom panel appears empty!!! (only the title of the tab is displayed). This panel also prevent the other panels to be displayed.
    When you delete this custom panels from the folder C:\Users\AppData\Roaming\Adobe\XMP\custom file info panels\3.0\panels and go back to the File Info, the other panels display their content properly.
    I also try to use the plugin XMP Namespace designer to create my own namespace. this plugin is also able to generate a custom panel, but this one also appears empty in AI or Photoshop.
    I try to follow the process described in Adobe xmp documentation many times, but it didn't works.
    It seems that many peaople have this issue, but i dodn't find a solution in the forum.
    I try to create a trust file (cfg), but it didn't work.
    It would be so kind if you can help me to understand why i can't create a custom panel normally and how to do it in the right way.
    Thanks a lot for your help,
    Best regards,
    Daté 

    Hi Sunil,
    After many trial, i realize the problem was not coming from the trust file, but from the way i have created the custom panel.
    There is 2 different ways, the first described below is not working whereas the second is fine :
    METHOD 1 :
    I have downloaded the XMP-Fileinfo-SDK-CS6
    In the XMP-Fileinfo-SDK-CS6 folder, i copied the com.adobe.xmp.sdk.fileinfo_fb4x_1.2.0.jar plugin from the Tools folder and i pasted it in the plugind folder of Flashbuilder 4.6
    The plugin install an XMP project
    In Flashbuilder 4.6 i have created a new project (File / New /Project /XMP/XMP Custom Panel)
    A new xmp project is created in flashbuilder.
    You can publish this project by right clicking the root folder and selecting XMP / Publish Custom Panel
    The custom file info panel is automatically published in the right location which is on Mac : /Users/UserName/Library/Application Support/Adobe/XMP/Custom File Info Panels/3.0 or /Users/UserName/Library/Application Support/Adobe/XMP/Custom File Info Panels/4.0
    Despite the publication of the custom file info panel and the creation of a trust file in the following location : "/Library/Application Support/Macromedia/FlashPlayerTrust", the panel is blank in Illustrator.
    I try this way several times, with no good results.
    METHOD 2 :
    I have installed Adobe CSExtensionBuilder 2.1 in Flash Builder
    In FlashBuilder i have created a new project (File / New /Project /Adobe Creative Suite Extension Builder/XMP Fileinfo Panel Project)
    As the system display a warning about the version of the sdk to use to create correctly a custom file info, I changed the sdk to sdk3.5A
    The warning message is : "XMP FileInfo Panel Projects must be built with Flex 3.3, 3.4 or 3.5 SDK. Building with Flex 4.6.0 SDK may result in runtime errors"
    When i publish this File info panel project (right click the root folder and select Run as / Adobe illustrator), the panel is published correctly.
    The last step is to create the trust file to display the fields in the panel and everything is working fine in Illustrator.
    The second method seems to be the right way.
    For sure something is missing in the first method, and i don't understand the difference between the XMP Custom Panel Project and the XMP Fileinfo Panel Project. Maybe you can explain it to me.
    So what is the best solution ? the right sdk to use acording to the creative suite (the system asks to use 3.3 or 3.5 sdk for custom panels, so why ?)
    I'm agree with Pedro, a step by step tutorial about this will help a lot of peaople, because it's not so easy to understand!!!
    Sunil, as you belong to the staff team, can you tell me if there is  :
    A plugin or a software capable to extract the XMP from llustrator files to generate XML workflows in Indesign to create catalogues
    A plugin to allow indesign to get custom XMP in live caption
    A plugin to allow Bridge to get custom XMP in the Outputmode to make pdf or web galeries from a smart collection
    How can you print the XMP data with the thumbnail of the file ?
    Thanks a lot for your reply.
    Best Regards
    Daté

  • Have a new PC desktop with 4 hard drives, new c, d and old c, d, My ipad library is in old c, how to get my itune open the right drive, it keeps on open in new c drive.

    Have a new PC desktop with 4 hard drives, new c, d and old c, d, My ipad library is in old c, how to get my itune open the right drive, it keeps on open in new c drive. It said my computer is not authorized. I want to move all the old c to the new c drive, or get the itune to open my old c drive when I log in.

    might be some help on one of these links.
    Windows - Change iPad default backup location
    http://apple-ipad-tablet-help.blogspot.com/2010/07/change-ipad-default-backup-lo cation.html
    Windows - Changing IPhone and iPad backup location
    http://goodstuff2share.wordpress.com/2011/05/22/changing-iphone-and-ipad-backup- location/
    Sync Your iOS Device with a New Computer Without Losing Data
    http://www.howtogeek.com/104298/sync-your-ios-device-with-a-new-computer-without -losing-data/
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive
    https://discussions.apple.com/docs/DOC-3141
     Cheers, Tom

  • Having read how one might be able to send a video that is too large, it seems that those videos and still pictures that are sent, well at least for me anyway, end up 90 degrees to the horizontal...how do i send a pic, or video that is the right way up???.

    my question relates to the orientation of the videos, and still pictures that are sent via the ipad2...they always seem to be 90 degrees to the horizontal...can anyone suggest how to send them so that they will be the right way up???

    my question relates to the orientation of the videos, and still pictures that are sent via the ipad2...they always seem to be 90 degrees to the horizontal...can anyone suggest how to send them so that they will be the right way up???

  • Do any one knows how to add those arrows from the right and left side of the screen in the youtube widget which allows you to navigate back and forth between video clips?

    do any one knows how to add those arrows from the right and left side of the screen in the youtube widget which allows you to navigate back and forth between video clips?

    do any one knows how to add those arrows from the right and left side of the screen in the youtube widget which allows you to navigate back and forth between video clips?

  • I hit the wrong monitor refresh rate and now lost monitor picture.  How can I get back to the right refresh rate with no pic to view?

    I hit the wrong monitor refresh rate and now lost monitor picture.  How can I get back to the right refresh rate with no pic to view?

    Try this:
    Mac OS X 10.6 Help: If you changed your display’s resolution and now it doesn’t display a picture

  • I don't know much about computers can anyone walk me through this ? How Do I Change The Software Update Server Address On A Client  ? what do I open and how do i put it in the right spot?

    I don't know much about computers can anyone walk me through this ? How Do I Change The Software Update Server Address On A Client  ? what do I open and how do i put it in the right spot?

    The simplest method is to run a defaults command on the client Macs (easily pushed via Apple Remote Desktop):
    defaults write com.apple.SoftwareUpdate CatalogURL 'HTTP_URL_FOR_CATALOG'
    for a user. If you run it via sudo it will set it for whenever you use softwareupdate as root.
    The HTTP_URL_FOR_CATALOG has been changed with Mac OS X 10.6.  If you use MCX it will automatically pick the new catalog – however if  doing it manually the following URLs need to be used for whichever  client version is in question:
    Mac OS X 10.4: http://mysus.example.com:8088/index.sucatalog
    Mac OS X 10.5: http://mysus.example.com:8088/index-leopard.merged-1.sucatalog.sucatalog
    Mac OS X 10.6: http://mysus.example.com:8088/index-leopard-snowleopard.merged-1.sucatalog
    Mac OS X 10.7: http://mysus.example.com:8088/index-lion-snowleopard-leopard.merged-1.sucatalog
    Mac OS X 10.8: index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
    To double check this applied you can run the following command:
    /usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.SoftwareUpdate.plist
    and /usr/libexec/PlistBuddy -c Print ~/Library/Preferences/com.apple.SoftwareUpdate.plist
    to see what settings are for the computer and user appropriately.
    If  this is working correctly when running Software Update (GUI) you should  see the server address appear in parenthesis in the title of the  window.
    MCX
    Another alternative is to use Workgroup  Manager to manage the preferences via MCX from your server. This can be  done for users, or for computers if they are bound to your Open Directory.
    If you are using 10.5 Server or newer: you can simply use the Software Update section under Preferences.
    Manually:
    Choose the accounts, computers, or groups to have the preference applied to.
    Click on Preferences, and then the Details tab
    Press the Add… button and navigate to /Library/Preferences/com.apple.SoftwareUpdate.plist
    Press Edit…
    Under Often, add a New Key and enter the name CatalogURL
    Make sure the type is string and then enter your SUS URL (eg. http://mysus.example.com:8088/index.sucatalog or if using 10.6: http://mysus.examle.com:8088/ – see above from the defaults section)
    Press  Apply Now, then Done. Once users/computers have refreshed their MCX  settings (usually the next login or restart) the new settings will take  over.
    If this is working correctly when running Software  Update (GUI) you should see the server address appear in parenthesis in  the title of the window.
    In order to have a system-wide configuration one has to run the following:
    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index.sucatalog"
    In order to correctly work both on Leopard and Snow Leopard the right command to issue is:
    defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index-leopard-snowleopard.merged-1.sucatalog"
    Happily used and tested on my network
    The DNS trick that Chealion points out is fantastic. I use it at our office, and every computer on our LAN  will automatically pull the updates from the local repository at high  speed without any configuration.
    Create the swscan.apple.com DNS zone on your internal DNS server, and have it resolve via an A record to your Mac
    Tags: automaticupdates mac clients macosx setting as default software update
    Category: Serverfault
    Share
    0
    0
    Google +
    0
    0
    0
    5
    You might also like:
    Can I Update My Jb 4s To 6.1.2 Without Restore? Tue. Jan 21st, 2014
    Iphone 4 Not Charging After Update To IOS6 
    IPad 2 Not Updating To IOS 5.1 
    How To Resolve The â€âunable To Install Update” Error For OTA IOS Updates? 
    What Is â€âSoftware Update” Doing When It Says â€âChecking For New Software”? 
    Advertisement
    Comment
    - See more at:  http://www.eonlinegratis.com/2013/how-do-i-change-the-software-update-server-add ress-on-a-client-mac-to-use-my-own-server/#sthash.YhHp5zWk.dpuf

  • I want to buy the iphone 5 A1429 GSM model. I want to buy it online from Austrian Apple store. How do I ensure I get the right model?

    I want to buy the iphone 5 A1429 GSM model. I want to buy it online from Austrian Apple store. How do I ensure I get the right model?

    That's the only model iPhone 5, sold by Apple as officially unlocked, in Europe. Thus, if you order an officially unlocked iPhone 5, that's what you'll get.

  • How do you make to program the radio station on my remote contol ?

    how do you make to program the radio station on my remote contol ?

    Programming the radio stations (in hifi-mode) is explained in the "getting started" manual. Be aware of the fact that when you unplug the power cable all memory settings are lost.
    JaDi.

  • Ok so how do I delete the "Rebuilt Library" the right way?

    I just tried to rebuild a totally messed up library. But the Library Manager failed to import over 1,000 of my photos. (iPhoto telling me it doesn't have enough memory to function.
    I imagine I will be able to rebuild the library again once I move the library to my external hard drive. Right? Can someone let me know the right way to set that up? I have been searching through old posts but can only find people talking about problems after the library has already been moved.
    Thanks a lot.

    Since you speak of a "rebuild Library" I assume that you used iPhoto Library manager and still have your original library too. If this is not correct stop and post the correct information
    quit iPhoto and drag the "rebuilt library" to the trash and drag the iPhoto library to your external drive - you might want to wait to empty the trash until everything is done and good. Launch iPhoto while depressing the option (alt) key and use the select library option to point to the iPhoto library that you just drug to the EHD. Now you should have iPhoto running with the original (presumedly messed up) library - use IPLM to do yoru rebuild now
    LN

  • [Solved]Bash:Manipulating arrays of paths? the right way or not?

    Note: Refer to the following posts for better solutions and/or alternatives.
    This is a mock segment of a script I'm writting and I need to know if I'm doing it the correct way or at least in a proper bash way...
    the following works but will it always parse in a sorted manner. I have a set of directories that are named by date in the YYYY-MM-DD (International) format and want to be sure that they will always be treated as directory paths even when special characters "\n,\t,\s ...etc" are encountered in the path. The number of these directories changes and is compared to a set NUM-ber variable and when there are more than the set number the oldest ones are removed which brings a second question. Being dated as YYYY-MM-DD they sort from oldest to newest(lexicographical order) but do they always and is this the right way to deal with elements in an array separated by nulls? Any Comments or suggestions would be appreciated as I'm learning bash for the  time being (perl is next) and gathered this from bits and peices on verious wikis and forums. I basically want know if this a correct approach to the subject of extracting and performing actions on elements of an array that are directory paths.
    #!/bin/bash
    oifs="$IFS"
    IFS=$'\0'
    DIRTREE=(/path/to/dated/directories/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    NUM=5
    HOWMANYMORE=$(echo $(( ${#DIRTREE[@]} - $NUM )))
    if (( ${#DIRTREE[@]} > $NUM )) ; then
    rm -rv "${DIRTREE[@]:0:$HOWMANYMORE}"
    fi
    IFS="$oifs"
    Note:I have tested this for those wondering
    Last edited by Thme (2012-11-30 16:58:13)

    aesiris wrote:
    there is a special syntax for appending elements to an array:
    array+=(element1 element2 ...)
    you can simplify to
    NUM=3
    combined=()
    for dir in set1 set2 set3; do
    new=(/home/maat/dateddirs/"$dir"/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    (( count= ${#new[@]} - NUM ))
    combined+=("${new[@]:0:$count}")
    done
    This works as really well, however, in my case I still need the other sets in separate arrays for other purposes in my personal script so I adapted the approach a little and got this which uses the array+=(foo) syntax properly now. I was aware of this feature in bash arrays and experimented with it but had no success adding elements from other arrays until you demonstrated it in your example by adding them though a "for loop" and doing the arithmetic there... My current one now is very similar...I'm not sure how to reduce it further if possible but I need the other arrays as I do something completely different with them:
    #!/bin/bash
    NUM=10
    set1=(/home/maat/datedfolders/set1/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set2=(/home/maat/datedfolders/set2/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set3=(/home/maat/datedfolders/set3/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    CT1=$(( ${#set1[@]} - NUM ))
    CT2=$(( ${#set2[@]} - NUM ))
    CT3=$(( ${#set3[@]} - NUM ))
    for X in "${set1[@]:0:$CT1}" "${set2[@]:0:$CT2}" "${set3[@]:0:$CT3}"
    do
    combined+=("$X")
    done
    for
    for Xdirs in "${combined[@]}"
    do
    rm -rv "$Xdirs"
    done
    I'm considering changing the title of this thread as it reveals a little more than I originally expected to go over and provides some pitfalls as well as ways to approach array manipulation which can be applied to wide range of uses in bash scripting. Others may find totally different uses for what we've discussed here so....
    Last edited by Thme (2012-11-30 10:41:02)

  • Am I approaching this fold animation the correct way?

    Hi guys,
    I am using Flash CS6 on OSX 10.8.2. I am trying to create an animation of a box that is folded in half down the middle before opening up with a concertina movement. (I've attached an image that will hopefully be able to explain what I am trying to make a little better!)
    This is how I have gone about trying to achieve this:
    I have created two rectangle shapes each on a separate layers and converted them to movie symbols.
    The top symbol has a nested animation which is a 3D rotation.
    The 3D rotation centre point is set on the centre of the top edge of the symbol and rotates on the x-axis.
    The bottom symbol has essentially the same nested animation however with the 3D rotation centre point set on the centre of the bottom edge.
    The bottom symbol then has a motion tween (not nested) to move downwards as the nested animations play.
    As the animation is playing though I am having a bit of a problem making everything line up correctly! I've tried few other ways of trying to achieve this (shape tween) but with no real luck. Am I approaching this the right way? If anybody had any feedback or advice I would really appreciate it! I'm trying to get the basic animation correct first before I make it more complicated!
    Thanks in advance
    Henry

    Hi Ned
    Thank you for your advice it was very helpful. I did as you suggested the panels now move together seamlessly when they rotate
    I have been experimenting this afternoon and added two more pannels. My only problem now is that I am having trouble getting everything to line up properly after the animations are complete. Allthough each panel is set to rotate at the same angle for the direction it is suppose to rotate in everything looks out of place on the final frame. Has this something to do with the perspective and vanishing points? The vanishing point is currently set at the center of the stage and the perspective angle is 55. (I've attached the another image so you can see what I mean!)
    Also I was wondering why sometimes when I try to edit the co-ordinates for the 3D centre point in the transform panel that it automatically defaults to another value? Say for example I set the centre point on the X-axis to 200 pixels on an object sometimes it automatically defaults to 201.1 or 198.9.
    Thanks again for your help.

  • Is bgRFC Out-Inbound the right way for this... ?

    Hi guys,
    my scenario is:
    n systems (SAP) send data to ONE server (AS ABAP). The data will delivered via one and the same RFC FM to be stored in exactly ONE file per day.
    I have to ensure quality of service and delivery.
    So my first question is if bgRFC is the right way of doing so...
    MY idea was: I have exactly ONE inbound queue name on server/central system to ensure, that there will be only one unit to write data into file at the same time...
    Second: when the sender system calls one function module several times, how do I have to configure the queue names...
    I'm facing problems regarding this (please see below)
    the error occurs whenever the FM is called more than once per unit and I have only ONE inbound queue name declared...
    (please see coding below)
    Any ideas on that?
    Best -
    Christoph
    coding example....
      DATA:
            my_destination TYPE REF TO if_bgrfc_destination_outbound,
            my_unit        TYPE REF TO if_qrfc_unit_outinbound,
            dest_name      TYPE bgrfc_dest_name_outbound,
            queue_name     TYPE qrfc_queue_name,
          dest_name = 'SID'.
          my_destination = cl_bgrfc_destination_outbound=>create( dest_name ).
    loop... (to split XLarge amounts of data)
    CALL FUNCTION 'MSGRECEIVER'
        IN BACKGROUND UNIT my_unit
    exporting lt_data
    endloop...
    my_unit->add_queue_name_outbound( QUEUE_NAME = '<prefix>_OUT'
    my_unit->add_queue_name_inbound( QUEUE_NAME = '<prefix>_IN'
                                            IGNORE_DUPLICATES = abap_true ).
    Problem:
    the error occurs, when more than one function module is called by the sender system... and having only ONE inbound queue name declared...
    Edited by: Christoph Aschauer on Jul 28, 2011 1:08 PM

    Start here to learn After Effects:
    http://adobe.ly/AE_basics
    This series of videos ends with exporting to H.264 (.mp4):
    https://helpx.adobe.com/creative-cloud/learn/start/aftereffects.html

  • The "right" way to handle multiple devices, accounts and the cloud?

    Perhaps a bit premature, but I figure it's never too early to start planning. 
    Here's our current setup - I currently have four iDevices in the faily (three iPhones and one iPod Touch.  All are syncing to the same Mac Mini, albeit with different logins (and different iTunes store ids).  All four of these are kept in sync via Home Sharing so we have access to the music/apps/etc acquired by the others.
    Enter the iCloud - how does this fit in?  What's the *right* way to do this? 
    I can see two options:
    1)     Continue to utilize four iTunes store ids, sync them via Home Sharing and add four iClouds
         Advantages
              totally independent devices, users, etc.
         Disadvantages
              must pay for four "iTunes Match" services to access non-iTunes music on each of the four devices
              will iTunes-purchased music automaticaly sync to iCloud if it is shared via Home Sharing (or only by the original purchaser)?
    2)     Use one iTunes Store id for all iDevices
         Advantages
              single point of acquisition and distribution for all devices
         Disadvantages
              need to find a way to merge IDs (is this even possible?)
    Are there other advantages/disadvantages to these options?  Are there other options?  What's the easiest to set up and support?  Any other thoughts?
    Thanks in advance for your input.

    Well it seems like the first thing you should do is consolidate your iTunes libraries so that you don't have 4 copies of everything, one for each user logged in to your Mac Mini. How you do that is consolidate all 4 iTunes folders to one folder located in the /Users/Shared/ folder and update each of your iTunes to point to that folder accordingly. That way you have one iTunes library, only one copy of your media, but accessible from multiple users.
    One caveat is that if somebody is logged on and has iTunes open, you can't fast switch to another user and open iTunes. Apple made it so that only one user and one instance of iTunes can open a iTunes library at a time.
    For your iTunes match situation, it does sound like you would be much better off sharing a single Apple ID with one iTunes Match. For consolidating, make sure you have everything everybody has shared via Home Sharing to the main account you'd like to move over to, and then simply go to each device Settings, Store, and the sign out of the original Apple ID and logon using the shared main Apple ID. I just looked at it and the automatic downloading is already live in iOS! You can specify if you want to do music, apps, and books separately in case you may want to automatically download music but not apps or books.

Maybe you are looking for

  • PL/SQL Function Syntax help please...

    Can someone help me with the syntax here please? I am sure i am doing something wrong in my LOOP. create or replace FUNCTION fcn_chk_dec(p_date number) return NUMBER as --DECLARE v_date NUMBER; v_active NUMBER; v_prev NUMBER; v_delta NUMBER; v_perc_d

  • BizTalk map Julian date

    Hi, how can i convert date into julian date in BT map.  Thanks in adv. 2Venture2

  • How do I delete music off of iTunes as well as my iPhone 5

    How do I delete music from my phone as well as iTunes

  • Won't boot after kernel upgrade

    I installed Arch and attempted to upgrade the kernel. I had to remove these pkgs because the depended on previous kernel: ipw3945 madwifi ndiswrapper rt2500 tiacx After kernel upgrade, won't boot: Root device '....' doesn't exist, attempting to creat

  • Can I add music to a Web-Flash Gallery?

    I thought that I had done this in LR2, but I cannot find an option inthe Flash gallery to add a soundtrack.  Is this possible in LR3?