How do I parse for the 2nd CN in a line?

Hi,
Via Powershell, I list all my NTDS Settings Objects with some properties, but out of the Distinguished Name I just want the 2nd CN which contains the Server Name.  I just do a Get-Adobject on the Objectclass of nTDSDSA to get this data, so how would
I read this via the pipeline and just grab the 2nd CN or server name?
DistinguishedName
CN=NTDS Settings,CN=Srv01,CN=Servers,CN=SA,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=SrvName01,CN=Servers,CN=SB,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=SrvSomething01,CN=Servers,CN=SC,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=WhoKnows001,CN=Servers,CN=SC,CN=Sites,CN=Configuration,DC=mydomain,DC=com
Thanks for your help! SdeDot

Hi,
Via Powershell, I list all my NTDS Settings Objects with some properties, but out of the Distinguished Name I just want the 2nd CN which contains the Server Name.  I just do a Get-Adobject on the Objectclass of nTDSDSA to get this data, so how would
I read this via the pipeline and just grab the 2nd CN or server name?
DistinguishedName
CN=NTDS Settings,CN=Srv01,CN=Servers,CN=SA,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=SrvName01,CN=Servers,CN=SB,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=SrvSomething01,CN=Servers,CN=SC,CN=Sites,CN=Configuration,DC=mydomain,DC=com
CN=NTDS Settings,CN=WhoKnows001,CN=Servers,CN=SC,CN=Sites,CN=Configuration,DC=mydomain,DC=com
Thanks for your help! SdeDot
I think Leif-Arne Helland's solution would work, I would do it differently.
$DN = "CN=NTDS Settings,CN=Srv01,CN=Servers,CN=SA,CN=Sites,CN=Configuration,DC=mydomain,DC=com"
$servername = ($dn.split(","))[1].replace("CN=","")
$servername
What you essentially are doing $dn.split(",") is splitting it by commas, you then select [1] which is the second result in the split, "cn=srv01", then you leverage the Replace command to search for "cn=" and replace it with "nothing"
or "".
Entrepreneur, Strategic Technical Advisor, and Sr. Consulting Engineer - Strategic Services and Solutions Check out my book - Powershell 3.0 - WMI: http://amzn.to/1BnjOmo | Mastering PowerShell Coming in April 2015! This posting is provided AS IS with no
warranties or guarantees, and grants no rights.

Similar Messages

  • How do I suggest an accessory for the 2nd gen nano?

    I'm trying to make a suggestion to Apple to make a belt clip for the 2nd gen nano like the older 40gb iPods had. How do I make one, because I can't find any sort of suggestion box(for lack of better term)

    You may be able to use the apple iPod feedback form
    to make that type of suggestion. You might also want
    to check other sites that make iPod accessories to
    see if they have one that you may like.
    http://www.apple.com/feedback/ipodnano.html
    Thank you!=)

  • For the 2nd day my iPhone 5 will not let me download updates for apps.  When i click update, it acts as if it is going to update but puts all apps in "waiting" status.  I've tried selecting each, as well as deleting and re-downloading but to no avail.

    For the 2nd day my iPhone 5 will not let me download updates for apps.  I've tried selecting each to click off wait, and have selected new updates indvidually instead of all together.  Also have shut the phone down and have even deleting the apps completely and re-downloaded but to no avail.  Each app continues to sit on my screen with the line below as if it is about to download but never does, and now any apps I've tried to updated will not let me use them.

    Oh my gosh I had the EXACT same problem, and for ages I couldn't figure out how to fix it until today. Here's what I did:
    First I went onto my computer, opened itunes, and un-installed tumblr, vine and kik. These were the apps I was having problems with (it said I had them on my phone but, like you, they didn't show).
    Then I went to the itunes store, searched for each one, and it said I could update them so I did (just FYI: for tumblr a window popped up saying "please click ok to confirm you are 17 years or older", so I did that also)
    When I went back to my phone and tried installing them again (still on my computer), it worked!
    I hope this helps, because it was incredibly frustrating. Good luck!

  • When Webdynpro popup is opened for the 2nd time, image is not shown

    Hi Experts,
    We have created a WebDynpro with a popup window.
    This is shown in an iView in the portal.
    If the popup is opened for the first time it looks good.
    If the popup is opened for the 2nd time the image is not shown and the title is shown with a different font.
    If we do a preview of the iView in PCD content area, the title and image is shown and the right font is used: also when you open this for the second time.
    If the iView is in a role the problem appears.
    How can this be solved?
    Thanks in advance,
    Joeri

    Sounds like a wrong reference to a stylesheet.
    Use IE Developer Toolbar or Firefox to debug the code. Or view source (of the popup) and search for .css. Do the same for the popup that doesn't work. Check if there are differences.
    Good luck!
    Noel

  • How can I check for the existence of an XML file in Illustrator Javascript??

    I'm writing a Javascript to run at startup. I want to check for the existence of XML files and process them, if they are available. How can I check for their existence?

    Your first line just sets a variable to a string value… getFiles() is a method of Folder… so
    var InputXMLDir = Folder( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/" );
    Not a PC user so I can't remember if the colon is OK…? As you appear to know the file name why bother with a folder get files anyhow you could just check if the file exists then do some thing…
    alert( File( "D:/Brackets/Create_Bracket_Graphics/Input/XML-n-Templates/brackets_men_web.xml" ).exists );

  • How to create F4 for the standard transaction

    Hi all ,
    How to create F4 for the standard transaction for a particular field .
    Bye

    Santosh,
        You can create F4 values for a field in a standard Transaction .
    1. First search for a standard search help meeting your requirement .
    2. If you don't find one, create your own custom (z) serach help .
    ( 1 is preferable )
    After that, include that serch help to the standard field in the transaction .
    For this u need to go to the screen
    ( F1->F9-> screen-> Field )
    Click on the property of the field and include the search help .
    You ll require the access key from the basisi guys as u r changing standard .
    Hope it helps,
    ~ laxmi
    Reward for helpful answers

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • How do I test for the presence of an active open document in Photoshop?

    I’m new to Adobe scripting, and one of my first scripts deals with the activeDocument in Photoshop.
    If there is no activeDocument, I want to display a message and terminate the script.  My efforts
    so far have been met with frustration.  While developing the script in ExtendScript Toolkit,
    I used the  test expression "activeDocument in app", and everything worked as expected. And when I installed the script
    in the Photoshop scripts folder and ran it from Photoshop with a document open, it also worked.
    But when I ran the script from Photoshop with no document open, it failed.
    Moreover, after that,the script failed when I tried to run it in ESTK.
    I did some testing and found that my test expression, "activeDocument in app"
    was returning true, even though no document was open.
    Still in ESTK, I replaced the “app” with ”Application” in the test expression.  That worked when
    I stepped through the script.  But when I tried to run it without stopping, it stopped at the
    test expression, and displayed the error message, “Application is undefined.”
    So how do I test for the presence of an open document in Photoshop ??

    After posting this, I discovered the Photoshop Scripting Forum, and I found my answer there.—
    I should have used “app.Documents.length” as my test expression.

  • Alv display for the 2nd time.

    Hi everybody
    I have created a interactive alv report. when i am going for   first display it is giving correct result whne i go for 2nd time it is not initilizing the grids the records are displayed twice or same record is displayed. i have check BCALV_GRID_03 but i could not understand it properly so i am giving my code please help.
    *& Report  ZVTEST1                                                     *
    REPORT  ZVTEST1 .
    class lcl_event_receiver definition deferred.
    class cl_event_receiver definition deferred.
    TYPE-POOLS : SLIS.
    tables : ekko,ekpo,lfa1.
    data : begin of itab occurs 0,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
          end of itab.
    data : begin of inv_det occurs 0,
             ebeln like ekko-ebeln,
             bedat like ekko-bedat,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
           end of inv_det.
    data : begin of mat_det occurs 0,
             ebeln like ekko-ebeln,
             lifnr like ekko-lifnr,
             bedat like ekko-bedat,
             matnr like ekpo-matnr,
             menge like ekpo-menge,
             netpr like ekpo-netpr,
             NETWR LIKE EKPO-NETWR,
             maktx like makt-maktx,
           end of mat_det.
    DATA :TEST_GRID TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT TYPE SCRFNAME VALUE 'TESTING_ALV',
          TEST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT TYPE LVC_S_LAYO,
          TEST_FIELDCAT TYPE LVC_T_FCAT,
          ok_code like sy-ucomm,
          event_receiver type ref to lcl_event_receiver,
          event_receiver1 type ref to cl_event_receiver,
          TEST_GRID1 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT1 TYPE SCRFNAME VALUE 'PARTYWISE_DETAILS',
          TEST_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          ls_layout TYPE lvc_s_layo,
          TEST_LAYOUT1 TYPE LVC_S_LAYO,
          TEST_FIELDCAT1 TYPE LVC_T_FCAT,
          TEST_GRID2 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT2 TYPE SCRFNAME VALUE 'INVOICE',
          TEST_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT2 TYPE LVC_S_LAYO,
          TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    select-options: s_bedat for ekko-bedat.
    CALL SCREEN 100.
    class LCL_EVENT_RECEIVER definition.
      public section.
          methods:
          handle_double_click
            for event double_click of cl_gui_alv_grid
                importing e_row e_column.
      private section.
    endclass.
    class LCL_EVENT_RECEIVER implementation.
    method handle_double_click.
        data: itab1 like line of itab.
        read table itab index e_row-index into itab1.
        perform select_table_invdet using itab1
                                   changing inv_det.
        call screen 200 starting at 10 5.
    endmethod.
    endclass.
    class CL_EVENT_RECEIVER definition.
      public section.
          methods:
           handle_hotspot_click
            for event hotspot_click of cl_gui_alv_grid
                importing e_row_id e_column_id es_row_no.
      private section.
    endclass.
    class CL_EVENT_RECEIVER implementation.
    method handle_hotspot_click.
        data: itab2 like line of inv_det.
        read table inv_det index e_row_id-index into itab2.
        perform select_matdet using itab2
                                   changing mat_det.
        call screen 300 starting at 15 5.
    endmethod.
    endclass.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'TEST'.
    PERFORM SELECT-DATA.  " FOR THE INITIAL LIST.
    PERFORM ALV_DISPLAY.   "TO DISPLAY INITIAL SCREEN.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
       WHEN 'BACK'.
         LEAVE TO SCREEN 0.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  SELECT-DATA
          text
    -->  p1        text  DATA SELECTION FOR THE 1ST LIST
    <--  p2        text
    FORM SELECT-DATA .
    select alifnr sum( bnetwr ) as netwr
        into corresponding fields of itab
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where abedat in s_bedat group by alifnr.
        select single name1 from lfa1 into itab-name1
           where lifnr = itab-lifnr.
    append itab.
    endselect.
    ENDFORM.                    " SELECT-DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text  DISPLAY THE LIST FIRST TIME.
    <--  p2        text
    FORM ALV_DISPLAY .
    IF TEST_GRID IS INITIAL.
         CREATE OBJECT TEST_CONTAINER
           EXPORTING
             CONTAINER_NAME              = 'TESTING_ALV'.
          CREATE OBJECT TEST_GRID
            EXPORTING
              I_PARENT          =  TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           IS_LAYOUT                     =  TEST_LAYOUT
         CHANGING
           IT_OUTTAB                     =  ITAB[]
           IT_FIELDCATALOG               =  TEST_FIELDCAT[].
    create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click for TEST_GRID.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = TEST_CONTAINER.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  PROC_CATALOG
          text
         <--P_TEST_FIELDCAT  text
    FORM PROC_CATALOG  CHANGING P_TEST_FIELDCAT type lvc_t_fcat.
    data: TEST_fieldcat type lvc_s_fcat.
    TEST_FIELDCAT-fieldname = 'LIFNR'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '12'.
    TEST_FIELDCAT-coltext   = 'VENDOR CODE'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR CODE'.
    *TEST_FIELDCAT-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NAME1'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '25'.
    TEST_FIELDCAT-coltext   = 'VENDOR NAME'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR NAME'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NETWR'.
    TEST_FIELDCAT-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT-OUTPUTLEN = '20'.
    TEST_FIELDCAT-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    ENDFORM.                    " PROC_CATALOG
    *&      Form  PROC_LAYOUT
          text
         <--P_TEST_LAYOUT  text
    FORM PROC_LAYOUT  CHANGING P_TEST_LAYOUT type lvc_s_layo.
    p_TEST_layout-zebra = 'X'.
    p_TEST_layouT-grid_title = 'TEST INTERACTIVE ALV'.
    p_TEST_layout-smalltitle = 'X'.
    p_TEST_layout-no_hgridln    = 'X'.
    p_TEST_layout-excp_conds  = 'X'.
    p_TEST_layout-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT
    *&      Form  select_table_invdet
          text
         -->P_ITAB1  DATA SELECTION FOR THE 2ND LIST
         <--P_INV_DET  text
    FORM select_table_invdet  USING    P_ITAB1 like line of itab
                              CHANGING P_INV_DET.
    clear inv_det.
    select alifnr aebeln abedat sum( bnetwr ) as netwr
        into corresponding fields of inv_det
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where  alifnr = p_itab1-lifnr and abedat in s_bedat group by
         alifnr  aebeln a~bedat.
        select single name1 from lfa1 into inv_det-name1
           where lifnr = inv_det-lifnr.
    append INV_DET.
    endselect.
    ENDFORM.                    " select_table_invdet
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
    IF TEST_GRID1 IS INITIAL.
        CREATE OBJECT TEST_CONTAINER1
           EXPORTING
             CONTAINER_NAME              = 'NEXT_CONT'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
      ENDIF.
         CREATE OBJECT TEST_GRID1
           EXPORTING
             I_PARENT          = TEST_CONTAINER1.
       PERFORM PROC_CATALOG1 CHANGING TEST_FIELDCAT1.
       PERFORM PROC_LAYOUT1 CHANGING TEST_LAYOUT1.
        CALL METHOD TEST_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
            IS_LAYOUT                     =  test_layout1
          CHANGING
            IT_OUTTAB                     =  inv_det[]
            IT_FIELDCATALOG               =  TEST_FIELDCAT1[].
    create object EVENT_RECEIVER1.
        set handler EVENT_RECEIVER1->handle_hotspot_click for TEST_GRID1.
    ELSE.
       CALL METHOD TEST_GRID1->REFRESH_TABLE_DISPLAY.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           =  TEST_container1.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
          text
    MODULE USER_COMMAND_0200 INPUT.
      case ok_code.
        when 'EXIT'.
    leave to screen 0.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Form  PROC_CATALOG1
          text
         <--P_TEST_FIELDCAT1  text
    FORM PROC_CATALOG1  CHANGING P_TEST_FIELDCAT1 type lvc_t_fcat.
    data: TEST_fieldcat1 type lvc_s_fcat.
    TEST_FIELDCAT1-fieldname = 'EBELN'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '12'.
    TEST_FIELDCAT1-coltext   = 'P.O NUMBER'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O NUMBAR'.
    TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'BEDAT'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '10'.
    TEST_FIELDCAT1-coltext   = 'P.O.DATE'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O.DATE'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'NETWR'.
    TEST_FIELDCAT1-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT1-OUTPUTLEN = '20'.
    TEST_FIELDCAT1-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    ENDFORM.                    " PROC_CATALOG1
    *&      Form  PROC_LAYOUT1
          text
         <--P_TEST_LAYOUT1  text
    FORM PROC_LAYOUT1  CHANGING P_TEST_LAYOUT1  type lvc_s_layo.
    p_TEST_layout1-zebra = 'X'.
    p_TEST_layouT1-grid_title = 'DATE WISE PURCHASE ORDERS'.
    p_TEST_layout1-smalltitle = 'X'.
    p_TEST_layout1-no_hgridln    = 'X'.
    p_TEST_layout1-excp_conds  = 'X'.
    p_TEST_layout1-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT1
    *&      Form  select_matdet
          text
         -->P_ITAB2  text
         <--P_MAT_DET  text
    FORM select_matdet  USING    P_ITAB2 like line of inv_det
                        CHANGING P_MAT_DET.
    select ebeln bedat lifnr from ekko into corresponding fields of mat_det
        where ebeln = p_itab2-ebeln and bedat = p_itab2-bedat
          and lifnr = p_itab2-lifnr..
    select matnr menge netpr NETWR from ekpo
       into corresponding fields of mat_det
         where ebeln = mat_det-ebeln.
    select single maktx from makt into corresponding fields of mat_det
         where matnr = mat_det-matnr.
    append mat_DET.
    endselect.
    endselect.
    ENDFORM.                    " select_matdet
    *&      Module  STATUS_0300  OUTPUT
          text
    MODULE STATUS_0300 OUTPUT.
    set pf-status 'TEST1'.
    IF TEST_GRID2 IS INITIAL.
       CREATE OBJECT TEST_CONTAINER2
         EXPORTING
           CONTAINER_NAME              = 'INVOICE_DETAILS'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
        ENDIF.
        CREATE OBJECT TEST_GRID2
          EXPORTING
            I_PARENT          = TEST_CONTAINER2.
         PERFORM PROC_CATALOG2 CHANGING TEST_FIELDCAT2.
         PERFORM PROC_LAYOUT2 CHANGING TEST_LAYOUT2.
         CALL METHOD TEST_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
           EXPORTING
             IS_LAYOUT                     = test_layout2
           CHANGING
             IT_OUTTAB                     = mat_det[]
             IT_FIELDCATALOG               = test_fieldcat2[].
    else.
    CALL METHOD TEST_GRID2->GET_FRONTEND_LAYOUT
      IMPORTING
        ES_LAYOUT = ls_layout.
    CALL METHOD TEST_GRID2->SET_FRONTEND_LAYOUT
      EXPORTING
        IS_LAYOUT = ls_layout.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = test_container2.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        TITEL         = SY-REPID
        TXT1          = SY-SUBRC
        TXT2          = 'ERROR IN FLUSH'.
    ENDIF.
    ENDMODULE.                 " STATUS_0300  OUTPUT
    *&      Module  USER_COMMAND_0300  INPUT
          text
    MODULE USER_COMMAND_0300 INPUT.
    case ok_code.
        when 'BACK'.
            leave to screen 0.
        WHEN 'CANCLE'.
          LEAVE PROGRAM.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0300  INPUT
    *&      Form  PROC_CATALOG2
          text
         <--P_TEST_FIELDCAT2  text
    FORM PROC_CATALOG2  CHANGING P_TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    data: TEST_fieldcat2 type lvc_s_fcat.
    TEST_FIELDCAT2-fieldname = 'MATNR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '12'.
    TEST_FIELDCAT2-coltext   = 'MATERIAL NO'.
    TEST_FIELDCAT2-SELTEXT   = 'MATERIAL NO'.
    *TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MAKTX'.
    TEST_FIELDCAT2-REF_TABLE = 'MAKT'.
    TEST_FIELDCAT2-OUTPUTLEN = '30'.
    TEST_FIELDCAT2-coltext   = 'DESCRIPTION'.
    TEST_FIELDCAT2-SELTEXT   = 'DESCRIPTION'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MENGE'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '10'.
    TEST_FIELDCAT2-coltext   = 'QUANTITY'.
    TEST_FIELDCAT2-SELTEXT   = 'QUANTITY'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETPR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETWR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    ENDFORM.                    " PROC_CATALOG2
    *&      Form  PROC_LAYOUT2
          text
         <--P_TEST_LAYOUT2  text
    FORM PROC_LAYOUT2  CHANGING P_TEST_LAYOUT2  type lvc_s_layo.
    p_TEST_layout2-zebra = 'X'.
    p_TEST_layouT2-grid_title = 'PURCHASE ORDERS MATERIAL WISE DETAILS'.
    p_TEST_layout2-smalltitle = 'X'.
    p_TEST_layout2-no_hgridln    = 'X'.
    p_TEST_layout2-excp_conds  = 'X'.
    p_TEST_layout2-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT2
    thanks
    Vinayak.

    Vinayak,
    Add the Code(ELSE part) into the Form ALV_DISPLAY.
    IF TEST_GRID IS INITIAL.
      CREATE OBJECT TEST_CONTAINER
        EXPORTING
          CONTAINER_NAME = 'TESTING_ALV'.
      CREATE OBJECT TEST_GRID
        EXPORTING
         I_PARENT = TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_LAYOUT = TEST_LAYOUT
          CHANGING
               IT_OUTTAB = ITAB[]
               IT_FIELDCATALOG = TEST_FIELDCAT[].
        create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click
           for   TEST_GRID.
    <b>ELSE.
       CALL METHOD TEST_GRID->REFRESH_TABLE_DISPLAY(
                 "EXPORTING
                 "IS_STABLE =
                 "I_SOFT_REFRESH=
                            ).</b>
    ENDIF.
    Thanks
    Kam
    Note: Allot points for all worthful postings

  • How to creat deadlock for the purchase order in SAP Workflow

    How to creat deadlock for the purchase order in SAP Workflow

    Hi Ben,
    Are you using FM "CONVERT_DATE_TO_EXTERNAL" before passing delivery date?  If not, use FM like this, before passing the date to BAPI_PO_CREATE1 and it might work
      DATA: vf_doc_date(10),
                 internal_date TYPE d.
         vf_doc_date = sy-datum.              "Document date.
         internal_date = vf_doc_date.
      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
        EXPORTING
          date_internal            = internal_date
        IMPORTING
          date_external            = vf_doc_date
        EXCEPTIONS
          date_internal_is_invalid = 1
          OTHERS                   = 2.
    Regards,
    Vivek

  • Is there any type of HiFi Station available for the 2nd Gen. iPod shuffle?

    I was wondering if there is any type of HiFi Station available for the 2nd Gen. iPod shuffle.
    With HiFi Station I mean those docking stations which directly play the music from your iPod, so that you don´t need to connect to your Computer f.e.
    Does anybody know if something like this exist, or if it is only available for ALL other iPod models???
    Thanks already!
    Stefan

    YOu can use one of these with any other iPod "HiFi Station": http://www.griffintechnology.com/products/dockshuffle/
    Use your 2nd generation iPod shuffle in full-size Universal Dock devices.
    Your iPod shuffle is an incredible entertainment value in an incredibly small package. It delivers the music just like its full-size iPod cousins. But one thing it doesn't do is fit in the dock well in your made-for-iPod speaker system.
    That's why we made a Dock Adapter especially for 2nd generation iPod shuffle. The Dock Adapter is shaped just like the dock connector on the bottom of every full-size iPod. Plug it into your iPod shuffle's headphone jack, and suddenly the little guy fits in your iPod speakers just like the big guys.
    Take Griffin Dock Adapter with you, and you can play your iPod shuffle wherever there's a set of Universal Dock speakers.

  • How can I test for the bas unit enterd in a control?

    How can I to create a polymorphic vi where the user can enter either volume or temperature.
    how can Labwiev test for the base unit entered
    pseudocode example:
    input X
    if X.base_unit == m^3 do ....... 
    thanks for any suggestion to resolve or avoid my problem
    Solved!
    Go to Solution.

    Hi schaerm,
    you have to dig deeper.
    An idea is this one:
    The red marked word is containing the unit - in a coded way. Somewhere in the LV help you can find the description of this coding (I remember a chapter on memory representations of all LV datatypes...). (There surely is an easier or better way - but the example is done quic&dirty.)
    You can also format the number into a string and analyze the unit here...
    Message Edited by GerdW on 02-07-2010 07:21 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Hi, please can you tell me when the ipad mini 2 is coming out? i don't know whether to get the ipad mini, or wait for the 2nd generation

    hi, please can you tell me when the ipad mini 2 is coming out? i don't know whether to get the ipad mini, or wait for the 2nd generation

    Oh, ok. thanks for the help anyway

  • How to create Variables for the Key Figures

    Hi All,
    How to create Variables for the Key Figures
    Thanks
    Bhaskar

    Hi,
    It is not possible to create the variables on Key figures directly. But we can create a formula variable with processing type 'User Entry' ,SO that the user entered value can be used in the calculations of the query.
    With rgds,
    Anil Kumar Sharma .P

  • How do I Prepare for the Adobe Certified Associate (ACA) exam.

    how do I Prepare for the Adobe Certified Associate (ACA) exam

    I have NO idea where you should ask that question, but THIS forum is about help with installing Cloud programs
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You MAY be able to select a forum for the specific Adobe question you have
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

Maybe you are looking for

  • Need to use IPhoto library to view photos in Frontrow?

    Hi just setting up my Mac mini. I have all my pictures organized in folders stored on a NAS. Is there a way to browse those folders/pictures in Front Row or will it only work if I have all the photos imported into IPhoto? I have tried to make an alia

  • How to transfer video files from win 8 to iPad Air

    i am using itunes home sharing for this but I am unable to transfer.

  • Aperture 3 - Stacks Now Stuck Closed

    Updated to Aperture 3 and updated to 3.0.1. Loaded up a few projects no problem. Used stacks quite a bit, no problem. Now all of a sudden most stacks I have are stuck closed! If a click on a stack the outside area turns dark grey (which is normal) bu

  • What to do against QFS metadata lag?

    I am using Sun QFS as shared cluster filesystem for a farm of content upload servers (Aspera). When testing the failover functionality, I found out that files written on one cluster node sometimes take 1-2 minutes until they show up on the other node

  • Lenovo Veriface 3.6.0.0730 won't run on windows 7 login...HELP!

    Dear, What could be wrong? installation was ok...enrolled image all everything was fine...but on startup windows login it wont load....checked on msconfig there is a line for veriface "PManage.exe" only...is this fine? Thanks ASAP!