PS Dynamic Script for Test-Connection on OU and SubOU.

I have a non working PowerShell script for searching an OU in an 2008 level Active directory, but it is obviously incomplete. I was able to retrieve part of the script from another forum (cant remember which one, or I would kindly give them the credit they
deserve), but I was hoping to include a variable to in the "SearchBase" option below and make it dynamic, where I can change the OU to ping from a top level and have it also work under a child OU if I need to.
Outcome: Ping OU and child OU and have the option to ping either selection. Of course I would manually enter in my Search base parameters when prompted from the shell. I just want to have any easy way of ping all computers from an OU level without having
to paste the lower part of the script to my PowerShell script pane and changing the OU from there. If I can get the correct parameters working, then it would be easy to load this function to my PS profile. Thank you, and help is appreciated. Hoping someone
can let me know what I am missing to get this functional.
function
get-DCping
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
# Param1 help description
[Parameter(Mandatory=$true,
                   ValueFromPipelineByPropertyName
=$true,
                   Position
=0)]
[string]$Search)
$rtn
=
$null
Get-ADComputer
-Filter
-SearchBase
'OU=$Search,DC=domain,DC=domain' 
|
{$rtn
=
Test-Connection
-CN
$_.name
-Count
1
-BufferSize
16
-Quiet
IF
($rtn
-match
'True') {write-host
-ForegroundColor
green
$_.name}
ELSE
{ Write-host
-ForegroundColor
red
$_.name }}

Hi,
Here's a starter:
Function Get-DCPing {
[CmdletBinding()]
param(
[string]
$OrganizationalUnit
Get-ADComputer -Filter * -SearchBase $OrganizationalUnit | ForEach {
$computerName = $_.Name
$props = @{
ComputerName = $computerName
Alive = $false
If (Test-Connection -ComputerName $computerName -Count 1 -Quiet) {
$props.Alive = $true
New-Object PsObject -Property $props
Don't retire TechNet! -
(Don't give up yet - 13,225+ strong and growing)

Similar Messages

  • Dynamic Scripting for Call Center Surveys

    Hi All,
    I need to create dynamic scripting for Call Centres. Any idea how dynamic scripting can be done.
    Thanks a lot.
    Amiga

    Hi Raja,
    Basically, there should be a provision to create/modify a transaction and questions based on the response provided. So if a question is asked in a survey and the response is "Yes", the next question should be different to the one for a "No" answer. Similarly there should be a provision to create actions based on responses.
    Hope this makes it a bit clearer.
    Thanks
    Amiga

  • Help! I want a perl script for test

    I am not familar with perl and XMLDB.
    The database which managed by other team report the following errors.
    They said the error was caused by the perl scipt which contents a statment using XML object.
    So I want a perl script for test.
    Please help me.
    oracle 9.2.0.3.0
    Alert.log
    ORA-00600: internal error code, arguments: [qmxarElemAt2], [0], [], [], [], [], [], []
    listener.log
    connect_data=(sid=###)(cid=(PROGRAM=perl@###)(USER=oracle)))*(ADDRESS=(PROTOcol=tcp)(host=)
    establish###
    Edited by: 964446 on Oct 10, 2012 6:10 AM

    I can't check on iTunes until tomorrow morning, but in the meantime I can tell you what's wrong with your original feed. The top two lines read
    <?xml version="1.0"?>
    <rss version="2.0">
    They should read
    <?xml version="1.0" encoding="UTF-8"?>
    <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    Without the itunes URL in the second line iTunes cannot parse the required tags to show your episodes. I would guess that the line was there originally but got removed, after which iTunes would not recognize new episodes. Put it back and reload the feed, and it should work if iTunes hasn't terminated your podcast in the meantime.
    But to answer your original question: assuming you have access to both feeds; copy everything in the original feed from the first <item> to the last </item> near the bottom.
    In the new feed, find the last </item> tag at the bottom (just above the </channel> and </rss> tags), start a new line just after it and insert the material you posted from the original feed (though there are an awful lot of episodes there, and though it's technically not a problem you might want to consider whether you really need all of them in the feed).
    If you don't have direct access to the feeds but are using one of the podcast creation services which don't allow this, you will have to follow whatever method they provide for adding the episodes, possibly one at a time.

  • Want to create unix shell script for  Clone procedure in 11i and r12

    Want to create unix shell script for Clone procedure in 11i and r12 .Can anyone help me on this as I m new to oracle apps and scripting.
    Thanks in advance .

    user11958935 wrote:
    Thanks but I want it for application cloning ie adcfgclone and autoconfig etc .Please see old threads for similar topic/discussion.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+Rapid+AND+Clone&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+AutoConfig&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Help With dynamic scripting for Dervied Property

    Hi,
    I am trying to get the the list of child nodes and then loopthorugh those nodes to do some calculation in a derived propety using dynamic scripting. I tried with below script.
    var childEnumerator = node.GetChildEnumerator();
    while(childEnumerator.MoveNext())
        var propValue = childEnumerator.GetCurrent().PropValue("Custom.Salary");
        print(propValue);
    While Evaluating this script I am getting below mentioned error. Any idea what i am missing here?
    DRM-16008: There was an error calculating Script property Custom.TotalSalaryExp for EMP_Zone/Emp/PPD1: TypeError: 'GetChildEnumerator' is not a function
    Please help me out. thanks fr your co-operation
    Regards,
    Sudipta

    Try this instead...
    var childEnumerator = node.GetChildEnumerator();
    childEnumerator.MoveNext();
    while(childEnumerator.GetCurrent() != null)
        var propValue = childEnumerator.GetCurrent().PropValue("Custom.Salary");
        print(propValue);
    childEnumerator.MoveNext();

  • Startup scripts for DB in one $OH and AS in another $OH

    Hello, I am setting up Oracle Collaboration Suite 10g on a SLES9 SP3 machine. I have used the installers and followed the docs (so I ended up creating oracle users, setting kernel params, modifying limites, etc myself). I am now trying to figure out how to get this setup to start on boot. I found the orarun package but the Oracle Collaboration Suite (OCS) docs seem to recommend against this. I am willing to use it if it works, however. I have also looked at the ocsctl_sample script that is installed in the apps tier, but that doesn't seem to handle starting a db in a different $OH and can not be run by root. I wrote a wrapper to use "su oracle -c cmd" but that didn't work out either.
    The setup I have is a database instance in one $ORACLE_HOME, and then the app server and apps in a separate $ORACLE_HOME (infrastructure/OID is on another server). Both of these $OH instances are listed in /etc/oratab of course. Since OCS handles mail it listens on privileged ports (25, 143, etc), so this listener may need to be started by root. I am thinking I only want one opmn instance, one apache instance, and one em instance on the system as well. I read through the init.d/oracle script from the orarun package and it seems like it only looks at the first $OH found in /etc/oratab if the /etc/profile.d/oracle.sh file is not found (I moved it out of the way as I have two scripts I use to set oracle environments depending on whether I'm working on the db or the as).
    Has anyone either used orarun or developed other scripts for starting a db instance in one $OH and an app server in another? Any tips?
    Thanks in advance,
    Chris

    Well, the issue is really multiple ORACLE_HOMEs. The single box install of OCS is two, in OCS 9i it was three. There is no problem with it, you just have to set the environment(mr obvious).
    As far as having a single EM, you'll have two on your apps box. One for the apps, the other for the DB. Again, no problem because they are on different ports.
    So, I guess the simplest explanation is just to write your own script. You can either create a sudoer for the mail listener, or set the setuid bit. There is a note on metalink for starting the mail listener as Oracle user.
    The safest way would be to log in as root each time the mail listener needs started, it depends what you can tolerate. You will come across these very same issues if you setup the web cache etc. for reserved ports.
    Another issue for automating the startup with your environment, is the fact that it is on two boxes. The processes need started in a particular order, the DB, Infra, then the apps. I don't have a good suggestion for that. You really should have put the DB and infra on one box, and the apps on another.

  • COBRAS Import for Unity Connection 8.5 and Subscriber LDAP Integration Status

    Using COBRAS Import for Unity Connection 1.1 Build 212 with Unity 4.2 Voicemail Only and Connection 8.5(1)SU1 with LDAP Directory Integration
    When I run COBRAS the old alias matches the new alias and my desire is for subscribers being moved to be LDAP inegrated.  However after COBRAS runs, the radio box for LDAP Integration Status on the subscriber is set to Do Not Integrate with LDAP Directory. Is there a way for COBRAS to select Integrate with LDAP Directory when the alias matches on LDAP?

    Hi ben,
    If you are just importing from and not authenticating against LDAP, then the PIN comes
    from the Connection Template you used to build the users;
    Note that no passwords or PINs are copied from the LDAP directory to the Connection database. If
    you want Connection users to authenticate against the LDAP directory, see the “LDAP
    Authentication” section on page 9-7.
    http://www.cisco.com/en/US/docs/voice_ip_comm/connection/8x/design/guide/8xcucdg040.html
    Cheers!
    Rob
    "Show a little faith, there's magic in the night" - Springsteen

  • How to create a dynamic menu for each group of responsibility and  user

    Hi
    I am using Jdev 11.1.1.6 and new to ADF, my application require to populate menu which would be different for different groups of user, and the user in each group would have different submenu depends on their responsibilities assigned to each one of them.
    so on the top level would be menu_top_item1, menue_top_item2
    |-->submenu1_1 |-->submenu2_1
    |-->submenu1_2 |-->submenu2_2
    also the menu would need to be on_mouse_over to show the submenu items or collapsed back.
    any idea what would be the best approch? or is there any example around?
    thanks a lot

    You can use ADF Security to control access to menu options.
    More about ADF Security here:
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/AdfSecurity/AdfSecurity.html
    If you also use WebCenter you might use their menuing option:
    https://blogs.oracle.com/shay/entry/webcenter_portal_intro_for_adf

  • How do I connect my Centro to the Internet via bluetooth over PC's Internet? Where is Centro's PPP Connection Type? How do I setup Login Script for bluetooth connection?

    I am trying to set up bluetooth on the Centro to connect to the internet via my PC's internet.
    HotSync over bluetooth works successfully.
    Computer specs: Toshiba P205-S6277; Bluetooth Stack v5.10.04 (currently using); Bluetooth Monitor v3.01 (to use Vista's built-in bluetooth)
    I think I have narrowed my problem down to 3 things.
    (1) Finding Network Access properties (to allow connected devices to access the internet)
    (2) Finding Centro's Network Connection Type: PPP
    (3) Finding the correct Login Script to use
    for (1) I think I've looked everywhere; found nothing on Network Access. 
    Checked control panel: only Bluetooth Local COM
    Right-clicked bluetooth icon > Settings: File transfer, PAN Networking, PAN DHCP server, AV controls. Other bluetooth settings are for file transfer or object push. I don't see anything like this.
    I'm stumped on (2). It seems as if palm removed this option under Centro's Advanced network settings .
    Nearly all the forums that I read says to choose Connection Type: PPP.
    (3) Found 2 scripts that seemed would work. I don't know how it exactly works but it sounds workable.
    First script:
    Send: CLIENT
    Send: CLIENT
    Wait for: CLIENTSERVER
    End:
    Script 1 Connect Log:
    =======================================
    Connect Log
    S: client
    S: client
    R:
    Err: 0x121F   <<<netErrUserCancel b/c I canceled it. 
    Not connected
    ========================================
    I canceled it because the process would stay on "Signing In" then it automatically "Canceled" itself.
    Second script:
    Send CR:
    Delay: 1
    Send: CLIENT
    Wait For: CLIENTSERVER
    End
    **UPDATE** I found on this forum (Reply # 3689) that the script is needed only if you are using Palm OS 4 or under. Centro uses Palm OS 5.49121. Can anyone support this?
    Even without the script it has problems "Signing In".
    I'm currently reading this site and trying out its decribed methods. I will update this thread when I get the results.
    I'm using the Centro. And If anyone's been able to successfully connect to the internet on the Centro via a bluetooth connection to the PC WITHOUT 3rd party applications, please share.  If not, please share any ideas.
    Thanks!
    -Eric
    Post relates to: Centro (AT&T)
    Message Edited by naisanza on 01-01-2009 02:26 PM

    I've been going at this for days, and have probably exhausted all the proposed solutions on the first 3 pages of various google searches. I'm getting the feeling that Vista users are pretty much SOL for the time being.
    For the record, I just tried out a few of the solutions (mRouter & SoftickPPP) on XP and they work perfectly.
    Post relates to: Centro (Verizon)
    Message Edited by Cogwheel on 02-13-2009 09:45 AM

  • [SOLVED] Script for auto-connection

    Hey,
    I want to write a script that does the following:
    When I switch my laptop on, checks (using the "iwlist wlan0 scan" command) which wireless networks are in range.
    Then, if my home's essid is found, launch the file that connects to that network.
    I know quite a few programming languages (JAVA, C, C++, etc.), but no scripting languages what so ever..
    I would like a recommendation of a good scripting language to use, and maybe a few pointers as well..
    Thanks in advance
    Fiod
    Last edited by fiod (2007-10-22 18:16:52)

    I started to write a script wich list the available networks in python
    maybe that can help you for starting
    It is really fun to write python but when you come from java or C, you have to learn a new way of programming !!!
    Python is really easy to learn.
    #!/usr/bin/env python
    import os
    class AccessPoint:
    adress = ""
    essid = ""
    quality = 0
    mode = ""
    frequency = ""
    channel = 0
    encryptionKey = ""
    encryptionType = "No Information available"
    def __init__(self, address):
    self.address = address
    def __cmp__(a, b):
    return cmp(a.quality, b.quality)
    tmpFile = "/tmp/wifiap"
    interface = "wlan0"
    if (os.path.exists(tmpFile) == False):
    os.system ("iwlist %s scan > %s" % (interface,tmpFile))
    data = open(tmpFile).readlines() # open the file
    accessPoints = []
    for line in data:
    if "Address" in line: # create a new network dict
    address = line[line.find("Address") + 8:]
    accessPoints.append(AccessPoint(address.strip()))
    elif "ESSID" in line:
    accessPoints[-1].essid = line[line.find("ESSID") + len("ESSID") + 1:].strip()
    elif "Mode" in line:
    accessPoints[-1].mode = line[line.find("Mode") + len("Mode") + 1:].strip()
    elif "Frequency" in line:
    accessPoints[-1].frequency = line[line.find("Frequency") + len("Frequency") + 1:].strip()
    elif "Encryption key" in line:
    accessPoints[-1].encryptionKey = line[line.find("Encryption key") + len("Encryption key") + 1:].strip()
    elif "IE" in line:
    accessPoints[-1].encryptionType = line[line.find("IE") + len("IE") + 1:].strip()
    elif "Quality" in line:
    accessPoints[-1].quality = line[line.find("Quality") + len("Quality") + 1:line.find("Signal")].strip()
    elif "Channel" in line:
    accessPoints[-1].channel = line[line.find("Channel") + len("Channel") + 1:].strip()
    accessPoints.sort()
    accessPoints.reverse()
    print "Listing found networks:"
    print '%-18s %-20s %-8s %-7s %-4s (%s)' % ("ADDRESS", "ESSID", "QUALITY", "CHANNEL", "ENCRYPTION KEY" , "ENCRYPTION TYPE")
    for accessPoint in accessPoints:
    print '%-18s %-20s %-8s %-7s %-4s (%s)' % (accessPoint.address, accessPoint.essid, accessPoint.quality, accessPoint.channel, accessPoint.encryptionKey , accessPoint.encryptionType)

  • Script for internet connect with dial up modem, check email & log off

    I am looking for a script to connect to the internet (with dial up) external apple modem, then check email and then log off and disconnect. I don't want any other applications opening internet connect? A would use this script file with ical and could have my email checked and open up in the morning before I leave for work....being that we have dial up the entire process of connecting to the internet and checking email is time consuming. Any help is greatly appreciated. thks

    You need some additional logic in there - as written, the script will launch mail, then immediately disconnect the internet connection.
    At the very least you need to add a delay before disconnecting to allow for Mail to download awaiting messages.
    Since you cannot predict how long a delay you'll need, a better approach would be to query Mail.app and wait until it's idle, like:
    tell application "Mail"
      launch -- doesn't need to be frontmost
      check for new mail -- get all mail
      repeat until (get background activity count) = 0
        delay 2 -- wait 2 seconds before checking again
      end repeat
    end tell
    In this way the script forces a check of new mail (don't assume that Mail.app is set to auto-check, especially for dialup users who often compose mail offline and may have automatic checking disabled), and it hangs around until Mail.app has finished downloading all the messages.

  • Scripting for database connection

    I am wondering if it is possible to create a new panel (like the folders panel).
    The reason I ask is that, at work we use bridge to process all of our images, but use a database to store them all. The database uses a tree structure that I want to see on a panel like the Folders panel. That way we could edit the images straight from the database...
    Is it even possible to create new panels?

    In all seriousness, wouldn't a MySQL forum be a much better place to ask this?
    It would seem you would get a lot more replies.

  • Using Dynamic Link for projects cut in Premiere and effects in AE.. Rendering Question..

    Hello,
    So this baffles me. I've been working a lot in Premiere CC lately with ProResHQ green screen material. I send the sequence or individual clips using After Effects by right clicking on the clip in Premiere and selecting Create After Effects Composition...
    So I do my thing and when it comes time to render, I select render from IN to OUT in Premiere and wait. Now here's my question. If I select render in Premiere, it will be very sluggish until I click on the After Effects icon in my dock which brings the app to the foreground again. For some reason, this will dramatically accelerate my render speeds in premiere after I re-select the AE app. Why is this doing this?
    I'm using a new Mac Pro trashcan tower 3.5 clock speed. 64GB ram. Dual D700 graphics card. I am using a USB3.0 drive for my editing and the internal drive on the tower for the scratch. I'm getting a Lacie 1TB little bigdisk thunderbolt2 that will be my prime scratch and video location for future stuff.
    Thanks for your help -
    R

    Generally speaking, there is no 'one & only' proper workflow. Just keep in mind the following:
    - not all effects and transitions are properly translated when travelling from PrPro to AE;
    - in Dynamic Link scenario PrPro communicates with AE projects via single instance of headless AE, which creates a bottleneck. See this good old thread on Dynamic Link workflow, pay attention to Todd's comments;
    - since AE allows to set a DI as a proxy to dynamically linked comp, with reasonable amount of dynamically linked comps in PrPro project you can enjoy the best of both worlds, instantly switching between a DI and dynamically linked comp back and forth with no needs to replace anything in PrPro timeline. Test on your own with which amount of dynamically linked comps setting DIs as proxies still work. For my rig test 30 min sequence built out of 935 dynamically linked comps, which are just source footages in their own comps, hence, the equivalent to rendered DIs set to proxies, takes around 27 hours to render, while 30 min sequence built out of the same 935 source footages renders in real time.

  • How to set up TC for ethernet connections to MacBook and MacMini?

    Hi MacGurus
    Current setup:
    - ISP provided modem for incoming signal.
    - TC (1st generation from 2008) connected to ISP modem via ethernet cable (TC port: the one next to USB port with roughly an O-symbol). Is this the correct port to use?
    - Our ISP provider only supports 5 IP addresses and in our network we also have PCs/mobiles occupying IP addresses.
    - The back-up from MacBook to TC works fine through the connected ethernet cable between MacBook and one of the three ethernet (not the above mentioned O-symbol) ports on the TC.
    This is what I would like to do:
    - Ethernet cables from TC to both a MacBook (from 2008) and a MacMini (from 2008), i.e not use wireless transmission
    - Switch off wireless function on TC.
    - Use the TC to provide IP addresses for both the MacBook and MacMini in order to leave the other IP addresses for the PCs/mobiles.
    Is there any other information needed from me in order to help solving the problem?
    Thank you very much in advance.
    Cheers/WA

    Thx for quick response, below some "answers".
    It helps if you spell out a few things.
    - ISP provided modem for incoming signal.
    Who is the ISP? And what model is the modem provided? Is this dsl or cable or fibre or something else? *** ADSL
    - TC (1st generation from 2008) connected to ISP modem via ethernet cable (TC port: the one next to USB port with roughly an O-symbol). Is this the correct port to use?
    The answer depends.. is the ISP modem also a router? Is the TC setup to bridge or route? *** Yes, the modem is also a wirelss & ethernet router. *** I do not know if the TC is bridge or route, how can I see that?
    - Our ISP provider only supports 5 IP addresses and in our network we also have PCs/mobiles occupying IP addresses.
    Here is where I am getting confused actually.. Most ISP supply just 1 IP.. the router translates that single public IP to all the computer and devices on your network which run on a private IP network.
    Is the ISP giving you 5 public addresses?? Are they ipv4 or ipv6? Setting up blocks of ip addresses is more a business setup.. where multiple devices need direct internet access eg servers.. without being hidden behind a NAT router.
    So the more info you can give the better.
    *** Sorry for confusion. It is likely that the ISP provider gives 1 IP address, and that the modem generates up to 5 IP addresses. It is most certainly only a standard private setup, no business setup.
    This is what I would like to do:
    - Ethernet cables from TC to both a MacBook (from 2008) and a MacMini (from 2008), i.e not use wireless transmission
    - Switch off wireless function on TC.
    - Use the TC to provide IP addresses for both the MacBook and MacMini in order to leave the other IP addresses for the PCs/mobiles.
    What IP addresses are you getting now?
    If you plug ethernet to the macbook and mini now.. and turn off wireless, what IP address are they getting??
    If the TC is in router mode they should get 10.0.1.x IP and be able to ping and share with each other.. without needing to do anything.
    *** I am now connected to the modem (wireless), as I cannot connect through the ethernet cable.

  • Need help in dynamic report for a range of year and period

    Dear all,
    I need help in creating an ALV report with dynamic columns based on the Year and period entered on the selection screen. for example if in the year we enter 2002 and period range from 10 to 12 then we should get the 3 columns display for cost(example) for period 10/2002, 11/2002 and 12/2002.
    Can anyone help me in achieving this dynamically since the user can enter the year also in intervals along with the period and data also needs to be populated in the corresponding columns.
    An example code would be of great help.
    Thanks,
    Amit

    Hi,
    Use field symbols as follows.
    TYPE-POOLS : SLIS.
    TABLES : MARC,T001W.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARC-MATNR,
           END OF ITAB.
    DATA : FIELDSTAB TYPE LVC_T_FCAT,
           STAB      TYPE LVC_S_FCAT,
           T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           S_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           NEW_LINE TYPE REF TO DATA,
           NEW_TABLE TYPE REF TO DATA,
           INDEX(3) TYPE C,
           STR(70),
           TEXT(6),
           CNT(1),
           TEXT1(16),
           REPID LIKE SY-REPID.
    FIELD-SYMBOLS : <FS> TYPE STANDARD TABLE,
                    <WA> TYPE ANY.
    SELECT-OPTIONS : S_WERKS FOR MARC-WERKS NO INTERVALS,
                     S_MATNR FOR MARC-MATNR NO INTERVALS.
    INITIALIZATION.
      REPID = SY-REPID.
    START-OF-SELECTION.
      SELECT * FROM MARC
               INTO CORRESPONDING FIELDS OF TABLE ITAB
               WHERE MATNR IN S_MATNR
               AND   WERKS IN S_WERKS.
      SORT ITAB BY MATNR.
      DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR.
      STAB-FIELDNAME = 'MATNR'.
      STAB-DATATYPE  = 'CHAR'.
      STAB-INTLEN    = '18'.
      APPEND STAB TO FIELDSTAB.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR TEXT.
        CNT = CNT + 1.
        CONCATENATE  'EISLO' CNT INTO TEXT.
        STAB-FIELDNAME = TEXT.
        STAB-DATATYPE  = 'CHAR'.
        STAB-INTLEN    = '16'.
        APPEND STAB TO FIELDSTAB.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = FIELDSTAB
        IMPORTING
          EP_TABLE        = NEW_TABLE.
      ASSIGN NEW_TABLE->* TO <FS>.
      CREATE DATA NEW_LINE LIKE LINE OF <FS>.
      ASSIGN NEW_LINE->* TO <WA>.
      PERFORM MOVE_DATA.
      CLEAR S_FIELDCAT.
      S_FIELDCAT-FIELDNAME = 'MATNR'.
      S_FIELDCAT-TABNAME = ITAB.
      S_FIELDCAT-SELTEXT_M = 'Part Number'.
      S_FIELDCAT-NO_ZERO = 'X'.
      S_FIELDCAT-DDICTXT   = 'M'.
      APPEND S_FIELDCAT TO T_FIELDCAT.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR T001W.
        CNT = CNT + 1.
        SELECT SINGLE * FROM T001W WHERE WERKS = S_WERKS-LOW AND SPRAS = SY-LANGU.
        CLEAR TEXT.
        CONCATENATE 'EISLO' CNT INTO TEXT.
        S_FIELDCAT-FIELDNAME = TEXT.
        S_FIELDCAT-SELTEXT_M = T001W-NAME2.
    S_FIELDCAT-NO_ZERO = 'X'.
        S_FIELDCAT-DDICTXT   = 'M'.
        APPEND S_FIELDCAT TO T_FIELDCAT.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IT_FIELDCAT = T_FIELDCAT[]
        TABLES
          T_OUTTAB    = <FS>.
    *&      Form  MOVE_DATA
          text
    FORM MOVE_DATA.
      LOOP AT ITAB.
        CLEAR STR.
        CONCATENATE ITAB-MATNR ' ' INTO STR SEPARATED BY SPACE.
        LOOP AT S_WERKS.
          CLEAR MARC.
          SELECT SINGLE * FROM MARC WHERE MATNR = ITAB-MATNR AND WERKS = S_WERKS-LOW.
          IF SY-SUBRC EQ 0.
            CLEAR TEXT1.
            TEXT1 = MARC-EISLO.
            CONCATENATE STR TEXT1 INTO STR SEPARATED BY SPACE.
          ELSE.
            CONCATENATE STR '0' INTO STR SEPARATED BY SPACE.
          ENDIF.
        ENDLOOP.
        <WA> = STR.
        APPEND <WA> TO <FS>.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    "MOVE_DATA
    Reward points if helpful.
    Regards,
    Sankar..

Maybe you are looking for

  • Bug in adding Question slides?

    Firstly, thank to those who replied to my previous rant... restarting solved that problem. Current rant: I think there's a bug in the Adding Question slides... but maybe it's me. Here's the scenario: I have a Master slide that says "MCQ, T/F, FIB, Se

  • Regarding CO-PA CUBES

    Hai Experts,                       I want to see the co-pa releated cubes in Business Content .Can any one tell me what are the co-pa releated cubes and data sourcer present in ECC6.0 . plz dont give me the url just you give the PREDEFINED CUBE NAMES

  • Replica Password Server Issue

    I have and 10.6.3 OD master and OD replica set up. Everything looks okay in the logs for both, green light in Server admin for both, and seems fine on the surface. I have various services (kerio mail, AFP, SMB) connecting to the OD Replica for authen

  • Preview Window in Kangaroo Style

    Hello I am new to Premier CS4.  I have a brand new 2.2Ghz Dual Core Intel processor, and 4Gb of RAM running Vista Premium I am trying to edit video, but I find the preview window in the top right hand side does not play smooth video, it chops it up i

  • Netflix App still says "incorrect email or password"

    After a couple of months of multiple restarts and reinstalling. I'm at a loss for what to do. I have an iPhone 4. If you know what to do or have any trouble shooting methods, please let me know.