Catalog:setActiveSources( sources )

The API doc says: "Do not mix collections with folders".
It also says: "This is  the equivalent of selecting items on the leftmost panel in the Library  module"
I regularly select both collections and folders in the leftmost panel... Hmmm... I wonder what's the rub?
R
Excerpt from API doc:
catalog:setActiveSources( sources )
Sets the sources from which the grid photos are currently drawn. This is  the equivalent of selecting items on the leftmost panel in the Library  module. The active sources can be a set of collections and collection  sets, or a set of folders.First supported in version 3.0 of the Lightroom SDK.
Parameters
1. sources
(string or array) Can be an array of objects, or a string that identifies a predefined set of photos.
If an array, it can contain any mix of LrCollection, LrCollectionSet, LrPublishedCollection and LrPublishedCollectionSet, or it can contain one or more LrFolder objects. Do not mix collections with folders.
If a string, it must be one of the string constants defined in these LrCatalog properties:
kAllPhotos
kQuickCollectionIdentifier
kPreviousImport
kTemporaryImages
kLastCatalogExport
kTargetCollection
Return valueTrue on success, false if the sources are not correctly specified.

I read that a couple of months ago and wondered the same thing.  But I never got around to testing the actual semantics, because getActiveSources() is broken:
http://forums.adobe.com/message/3302290#3302290
Also, it's undocumented that you need to call setActiveSources() from within a task:
http://forums.adobe.com/message/3302389#3302389

Similar Messages

  • Shopping cart from catalog in sourcing cockpit

    Hi experts
    I have a doubt when I create a shopping cart from a catalog it's going to sourcing cockpit of the buyer I am in SRM 5.5 ECS, I have configuted in customizing for soucing option 5 Aut Grouping . Sourcing for itens whithout assigned souce,
    It must send for soucing cockpit only itens without source.
    Someone knows how to solve it?
    Thanks
    Nilson

    Hi
    Which SRM version are you using ?
    <b>This is correct.. It's standard functionality...</b> For every shopping cart, created from catalogs, the SOS (Source of supply) - Vendor will always be available.. (Until and unless you have activated any other Active BADI) and once the Shopping cart is complete and is ordered... It will directly by pass the buyer and will directly go the Approver for Approval, if required.. Otherwise, Back-end document (PO, Pur Req.. etc ) will get created...
    Do let me know.. Incase you still face any issues.
    Regards
    - Atul

  • Replace with catalog in sourcing

    Hi all,
    In sourcing cockpit, I replace a free text shopping requirement to a catalog item and then process it to create a PO.
    But when i check the shopping cart, the free text does not get replaced by the catalog product.
    This information is available only in the PO
    Where in the shopping cart can I see the replaced catalog item
    Basically I'm trying to determine whether the shopping cart item is a catalog product or not
    Rgds
    Venkat

    Hi Venkat
    Question not clear?
    1. Are buyer expected to change the free text product category ?
    Answer: - NO
    only Requester able to change before he ordered a cart . since now the cart is in Purchaser work list ,requester may not do this request. Admin can do it if he has access on behalf of REQUESTER.
    Muthu

  • I have PE11and LR5 and want to use/create one catalog or source file.

    When I use the LR5 function "upgrade PE catalogue" for use in LR5 it works very well (first time! great new function) - however - it does not recognize the 6000 photos the still are in the subfolders from "my pictures" like c:/my pictures/adobe/digital camera/date these files where created by earlier PE versions.
    So the question(s) are:
    1. How to move all the photos in sub folders from "my pictures" - without having to do that one by one - so the LR5 function "upgrade PE catalogue" will recognise all the photos
    2. Is there another way to build one source file "my pictures" to use both in PE11 and LR5 without loosing metadata - qualifications and tags. I have a large collection of photos (>15.000) as I work on (semi) professional base since a number of years.
    thanks to all the wizards....

    No the left behind photos in the subfolders were not imported in Lightroom
    tx for your interest
    I don't think you answered either of my questions, and thus I am not able to help further.
    So, to ask again, hoping for a direct answer this time:
    1. Are these "left behind" files in formats recognized by Lightroom? What are the formats of these photo files?
    2. Are you saying that (other than for these 6000 files that were not converted), the metadata did not show up in Lightroom?

  • Working around bogus top-level folders in catalog

    I have a catalog originally created on Mac and then moved to Windows, and it has two poison top-level folders that cause various SDK methods to fail.  For example, they cause catalog:setActiveSources({folder}) to have an assertion failure. 
    For one of the folders, folder:getPath() returns nil. For another of the folders, folder:getPath() returns a Windows UNC file path that doesn't exist. I discovered this heuristic for identifying these bogus folders:
    function isValidTopLevelFolder (folder)
        local success, f = LrTasks.pcall (function ()
            return catalog:getFolderByPath (folder:getPath ()) end)
        return success and f
        end
    I've already provided this catalog to Becky Sowada of Adobe, following up on a bug report in the feedback forum. But I thought this work-around might be of usefulness to others someday.

    Not quite, what I wanted to do… But, I think I can work with the "Unified folder view".

  • SRM MDM Catalog - Data import

    Hi all,
    I am using srm mdm catalog 3.0 . Please let me know, how can i map the below fields fron Catalog.xsl file with SRM MDM pre-defined repository:
    1-Image
    2.Hypelinks
    3.Catalog Name , Catalog ID [the client is asking whether , it's mandatory to maintain Catalog ID, Catlog Name]
    In the Catalog.xsl source file , i hard coded the value of Hyperlink files like "www.abc.com", but when in MDM DATA Manger it doesn't get stored as URL .
    Q2. Everytime when i import , do the Catalog Manager needs to Value Mapping manually? is there any way to automate this.
    Plzzzzzzzzzzzz let me know, i require the info very badlyyyyyyyyy.
    Thanks al

    resolved

  • Sourcing of product categories

    Hi,
    We are running on SRM 5.0 and ECC 6.0
    In our scenario--if shopping cart is a catalog item,purchase order is created automatically.
    If the shopping cart is created using 'describe requirement' link--the shopping cart is sent to sourcing.
    But in the configuration step "define sourcing for product categories'...all the categories are included and have the entry 'sourcing always carried out'.
    And we also have the sourcing BADI 'define execution of sourcing' implemented.The logic in it is if the item is from catalog,no sourcing should be carried out.But if it isn't a catalog item, carry out sourcing.
    My question is--do we need the configuration step of 'define sourcing for product categories'?Will the BADI not suffice?
    Thanks
    Trey

    Hi
    I believe it is standard but you can take into cockpit badi bbp_src_determine (you can write your own logic).
    Always your catalog have fixed source of supply so it will not go to sourcing cockpit even though define sourcing always.
    am i correct.
    br
    muthu

  • My Lightroom won't export sharp. I have tried everything including creating a new catalog. Is there a bug?

    Okay...so I am wondering if there is a bug. I have tried changing the settings as far as sharpening for screen/matte...etc...tried to start a new catalog. Same thing. I am scared to uninstall and reinstall because i already have it on two computers. I don't have the actual cd to download as I did it through the internet. Will it be able to install it again after uninstalling?

    MAR07001 wrote:
    Lr5.4
    Thanks. Unfortunately, all nr/sharpening bugs are supposedly fixed @Lr5.4.
    So if seemingly not fixed, it begs the question:
    * Is it you? or is it Lightroom?
    Does it work as expected in a previous version of Lightroom? (you double-check by downloading and installing a previous version of Lightroom..).
    Consider posting a zip file containing:
    * one-photo catalog with source file (export one photo as catalog).
    * export preset (.lrtemplate file in Export Presets folder along with the rest of your presets/preferences..).
    so others can try to reproduce.
    If forum upload feature not working for you (it hasn't for me yet), you can use dropbox or yousendit.com.
    Rob

  • Use of SOURCE OF SUPPLY table under the SOURCE OF SUPPLY/SERVICE AGENTS tab

    Hi,
    We are on SRM 7.1.
    Can someone please explain me the use of the SOURCE OF SUPPLY table under the SOURCE OF SUPPLY/SERVICE AGENTS tab in the shopping cart screen?
    I can see the following columns in the SOURCE OF SUPPLY table under the SOURCE OF SUPPLY/SERVICE AGENTS tab:
    Supplier number
    Supplier name
    Priority description
    Item
    Currency
    Supplier Product number

    Hi,
    There  are many  ways assign a source during shopping cart creation.
    1.  Free Text Shopping cart
    During creation of shopping cart after entering the description ,qty price . go to source of supply tab--enter the source
    and save the shopping cart.  Once the shopping cart is approved .PO is created for the vendor what you assigned.
    2.During the creation of shopping cart using  MDM catalog ,the source is assigned in the MDM catalog  no need to assign
    Once the shopping cart is approved .PO is created for the vendor that is coming from the MDM catalog.
    Regards
    G.Ganesh Kumar

  • Sysprep unattend file not applying when image is captured with wds (no errors)

    So I've been around the block a bit using sysprep and wds.  Recently I've created a reference image with a virtualbox environment using windows 7 x64. I was succesfully able to create a reference image, sysprep it and capture it to the wds server. My
    plan there after was to create driver specific images for each model computer we use here after not having much success using the driver store (another story)
    Any how So I take my reference image and deploy it to a new computer... In this case an HP Probook 5310m.  Install any missing drivers and Sysprep it with the following command.  sysprep /generalize /oobe /unattend:unattend.xml /shutdown
    Below is the sysprep file I have been using
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="generalize">
            <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SkipRearm>0</SkipRearm>
            </component>
            <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <DoNotCleanUpNonPresentDevices>true</DoNotCleanUpNonPresentDevices>
                <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SkipAutoActivation>true</SkipAutoActivation>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ShowWindowsLive>false</ShowWindowsLive>
                <TimeZone>Eastern Standard Time</TimeZone>
                <CopyProfile>true</CopyProfile>
                <ProductKey>74fdj-7dtw8-q9mp9-ypth8-qb27y</ProductKey>
            </component>
        </settings>
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Logo>c:\windows\system32\oemlogo.bmp</Logo>
                    <SupportHours>Regular Business Hrs (Overnight Support Provided)</SupportHours>
                    <SupportURL>url</SupportURL>
                    <SupportPhone>Phone number</SupportPhone>
                </OEMInformation>
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <NetworkLocation>Work</NetworkLocation>
                    <ProtectYourPC>1</ProtectYourPC>
                    <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>
                </OOBE>
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <Password>
                                <Value>TAAxAEQAMwBzAHQAcgBpACEAUABhAHMAcwB3AG8AcgBkAA==</Value>
                                <PlainText>false</PlainText>
                            </Password>
                            <Description>Local Administrator</Description>
                            <DisplayName>Root</DisplayName>
                            <Group>Administrators</Group>
                            <Name>Root</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
                <TimeZone>Eastern Standard Time</TimeZone>
                <ShowWindowsLive>false</ShowWindowsLive>
                <FirstLogonCommands>
                    <SynchronousCommand wcm:action="add">
                        <Order>1</Order>
                        <CommandLine>slmgr.vbs /ipk {serial key}</CommandLine>
                    </SynchronousCommand>
                    <SynchronousCommand wcm:action="add">
                        <Order>2</Order>
                        <CommandLine>slmgr.vbs /ato</CommandLine>
                    </SynchronousCommand>
                </FirstLogonCommands>
            </component>
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-US</UserLocale>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="catalog:v:/sources/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    The machine succesfully syspreps and shuts down. I restart the computer pxe boot and capture the image succesfully.
    Now here comes my problem...
    Upon deploying the above driver specific image.. my sysprep file is not applied.  Nothing from the OOBE wizard answers to the pc logo , or first logon commands are applied ... nothing.. I have gotten no errors during this whole process.  I have
    started to try to read the logs within the panther folder but havent gotten far.
    What is weird to me is that I have tried recreating this image... deploy the reference image... add drivers ... sysprep ...shutdown.  And if I boot normally (without capturing the image) the computer shows all of the sysprep changes..  Only when
    i capture the image does it not apply the changes....
    I'm stumped...
    Any ides?

    Confirm this scenario: You installed Windows, then ran sysprep and used the /unattend switch. Then you captured the image.
    In this scenario there are 2 deployment methods.
    1. If you deploy the image with DISM, the answer file generated by sysprep is detected on first boot and settings are applied. It is the same function as if you ran sysprep and chose to restart.
    2. If you deploy the image using Setup.exe, it does not use the answer file specified by sysprep prior to capturing. I have not looked into *why* this happens, but I suspect that after the image is applied, it replaces the unattend.xml with the generic one.
    If you are using Setup.exe, you need to use its /unattend switch and point to the answer file location. This location cannot be inside of the image. If you are not using setup.exe in a manual method (using WDS) you will need to apply the answer file to the
    install image in the WDS snap-in.

  • Windows 7 and sysprep

    An annoyance.  I have a sysprep'd Windows 7 x64 Ghost image.  Prior to creating the image my setup workstation's computer name is set to "win7image".  My sysprep is configured so that all I have to do once I lay this image on another
    computer is to give the computer a name.
    Shortly after naming the computer, I am prompted to logon (for the first time).
    The login prompt is already populated with "win7image\MyAdmin"
    When I try to logon with the local MyAdmin account or any other account my sysprep has created, I get a message that the "The domain name is not valid.  Please try again."
    I am able to logon but I must use the syntax "computername\MyAdmin" which is annoying.  I would like to type only my local account name because we recently switched to a cumbersome naming convention that I loath to type.
    Is there something I am missing in my unattend.xml file?
    Thanks for any comments.
    Ed
    My unattend.xml
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
    <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SkipRearm>0</SkipRearm>
    </component>
    </settings>
    <settings pass="specialize">
    <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SkipAutoActivation>true</SkipAutoActivation>
    </component>
    <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RunSynchronous>
    <RunSynchronousCommand wcm:action="add">
    <Path>net user MyAdmin /active:yes</Path>
    <Order>1</Order>
    </RunSynchronousCommand>
    </RunSynchronous>
    </component>
    </settings>
    <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <FirstLogonCommands>
    <SynchronousCommand wcm:action="add">
    <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ipk #####-#####-#####-#####-#####</CommandLine>
    <Order>1</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
    <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
    <Order>2</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
    <CommandLine>c:\somecommand.exe</CommandLine>
    <Description>Install Something</Description>
    <Order>3</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    </FirstLogonCommands>
    <OOBE>
    <HideEULAPage>true</HideEULAPage>
    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
    <NetworkLocation>Work</NetworkLocation>
    <ProtectYourPC>1</ProtectYourPC>
    </OOBE>
    <UserAccounts>
    <LocalAccounts>
    <LocalAccount wcm:action="add">
    <Password>
    <Value>EncryptedPassword</Value>
    <PlainText>false</PlainText>
    </Password>
    <Description>AltAdmin&apos; Standard Local Admin Account</Description>
    <DisplayName>altadmin</DisplayName>
    <Group>Administrators</Group>
    <Name>altadmin</Name>
    </LocalAccount>
    <LocalAccount wcm:action="add">
    <Password>
    <Value>EncryptedPassword</Value>
    <PlainText>false</PlainText>
    </Password>
    <Description>Non Admin Guest Account</Description>
    <DisplayName>tseug</DisplayName>
    <Group>Users</Group>
    <Name>tseug</Name>
    </LocalAccount>
    <LocalAccount wcm:action="add">
    <Description>Administrator</Description>
    <DisplayName>MyAdmin</DisplayName>
    <Group>Administrators</Group>
    <Name>MyAdmin</Name>
    </LocalAccount>
    </LocalAccounts>
    <AdministratorPassword>
    <Value>EncryptedPassword</Value>
    <PlainText>false</PlainText>
    </AdministratorPassword>
    </UserAccounts>
    <RegisteredOrganization>State of Insanity</RegisteredOrganization>
    <RegisteredOwner>State of Insanity</RegisteredOwner>
    <Display>
    <ColorDepth>32</ColorDepth>
    <HorizontalResolution>1024</HorizontalResolution>
    <RefreshRate>60</RefreshRate>
    <VerticalResolution>768</VerticalResolution>
    </Display>
    <VisualEffects>
    <FontSmoothing>Standard</FontSmoothing>
    </VisualEffects>
    <TimeZone>Mountain Standard Time</TimeZone>
    </component>
    <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <InputLocale>en-us</InputLocale>
    <SystemLocale>en-us</SystemLocale>
    <UILanguage>en-us</UILanguage>
    <UserLocale>en-us</UserLocale>
    </component>
    </settings>
    <cpi:offlineImage cpi:source="catalog:f:/sources/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>

    Hi,
    As far as I know, if computer is in domain, it will priority log on to domain. Please notice where it log on to when typing the username.
    Also, please verify the following group policy.
    Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Option -> disable "Interactive logon: Do not display last user name"
    After disabling this policy, the name of the last user to log on is displayed. If the issue persists, you can type with ".\MyAdmin" instead of full
    computer name.
    Best Regards,
    Niki
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Problem in placing checkboxes in output in grid display

    hi experts,
    I not getting checkboxes when i am using the concept of dynamic internal table and oops concept.and i am not getting how to pass data from dynamic internal table to standard internal table and i have searched in forums i got some solutions but i tried out with those solution but i havent got the output with checkboxes. so i am pasting the below code.so kindly help me in this regard.
    the functionality of below code is to copy tables across clients.for this i have created two containers in same layout i.e.one for source client details and other for target client details.
    TYPE-POOLS *
    TYPE-POOLS: slis.
    *-- Tables Declaration
    TABLES:  dd02l, t000.
    *-- Constants Declaration
    CONSTANTS: lc_z   TYPE char1  VALUE 'Z',
               lc_y   TYPE char1  VALUE 'Y'.
    *--Internal table and Work Area Declaration
    DATA: lines LIKE sy-dbcnt VALUE 0.
    DATA: icursor TYPE cursor.
    *DATA: icursor1 TYPE cursor.
    DATA: lv_count TYPE i.
    DATA: lv_table_var1  TYPE char1.
    DATA: lv_ans TYPE char1.
    DATA : gd_tabname  TYPE tabname.
    *field catalog for source client
    DATA: c_cont1 TYPE REF TO cl_gui_custom_container,
    c_alv1 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat1 TYPE lvc_t_fcat ,
    ty_fieldcat1 TYPE lvc_s_fcat ,
    struc_desc1   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue1 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue1 TYPE slis_t_fieldcat_alv,
    l_structure1   TYPE REF TO data,
    l_table1    TYPE REF TO data.
    check boxes for source client.
    for check boxes.
    class lcl_event_receiver definition deferred.  "for event handling
    DATA: ok_code LIKE sy-ucomm,
          save_ok LIKE sy-ucomm,
    g_event_receiver TYPE REF TO lcl_event_receiver,
    gs_layout TYPE lvc_s_layo,
          g_max TYPE i VALUE 100.
    types: begin of gs_outtab.
    types: checkbox type c,                "field for checkbox
    t_name TYPE tabname,
    t_ref TYPE REF TO data.
    *include structure itab.
    types: celltab type lvc_t_styl.        "field to switch editability
    types: end of gs_outtab.
    data: gt_outtab type gs_outtab occurs 0 with header line,
    wa type gs_outtab.
    LOCAL CLASSES
    This local class only handles event DOUBLE_CLICK.
    Wenn the user double clicks on a checkbox cell the status of
    this cell is switched from editable to not editable and vice versa.
    class lcl_event_receiver definition.
    public section.
    methods: catch_doubleclick
             for event double_click of cl_gui_alv_grid
             importing
                e_column
                es_row_no
                sender.
    endclass.
    class lcl_event_receiver implementation.
    method catch_doubleclick.
      data: ls_outtab type gs_outtab,
             ls_celltab type lvc_s_styl.
               if e_column-fieldname ne 'CHECKBOX'.
        exit.
      endif.
      read table gt_outtab into ls_outtab index es_row_no-row_id.
    The loop is only needed if there are other columns that
    use checkboxes. At this point the loop could be
    replaced by a READ of the first line of CELLTAB.
          loop at ls_outtab-celltab into ls_celltab.
            if ls_celltab-fieldname eq 'CHECKBOX'.
    §B4.Switch the style to dis- or enable a cell for input
             if ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
              ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
             else.
              ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
             endif.
             modify ls_outtab-celltab from ls_celltab.
            endif.
          endloop.
          modify gt_outtab from ls_outtab index es_row_no-row_id.
        call method sender->refresh_table_display.
    endmethod.
    endclass.
    *field catalog for target client
    DATA: c_cont2 TYPE REF TO cl_gui_custom_container,
    c_alv2 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat2 TYPE lvc_t_fcat ,
    ty_fieldcat2 TYPE lvc_s_fcat ,
    struc_desc2   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue2 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue2 TYPE slis_t_fieldcat_alv,
    l_structure2   TYPE REF TO data,
    l_table2    TYPE REF TO data.
    *for source client
    TYPES: BEGIN OF itab,
            t_name TYPE tabname,
            t_ref TYPE REF TO data,
    END OF itab.
    *for target client
    TYPES: BEGIN OF itab1,
             t_name1 TYPE tabname,
             t_ref1 TYPE REF TO data,
    END OF itab1.
    *-- Field Symbol declaration for Dynamic Internal Table for source client
    FIELD-SYMBOLS:  TYPE ANY.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_table    LIKE dd02l-tabname,
                p_mdt_fm LIKE t000-mandt DEFAULT sy-mandt,
                p_mdt_to LIKE t000-mandt DEFAULT '910'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON p_table.
      lv_table_var1  = p_table+0(1).
    *-- Validation for Standard tables
      IF ( lv_table_var1 NE lc_z ) AND ( lv_table_var1 NE lc_y ).
        MESSAGE e001(00)  WITH text-002.
      ENDIF.
    *-- Start of Selection
    START-OF-SELECTION.
    for source client----
      DATA itab2 TYPE itab.
      DATA t_ref1 TYPE REF TO data.
      itab2-t_name = p_table.
    for target client----
      DATA itab3 TYPE itab1.
      DATA t_ref2 TYPE REF TO data.
      itab3-t_name1 = p_table.
    *-- Create Dynamic Internal table for source client
      CREATE DATA itab2-t_ref TYPE TABLE OF (itab2-t_name) .
      ASSIGN itab2-t_ref->* TO  0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
    ENDIF.
      CALL SCREEN 3000.
    *&      Module  STATUS_3000  OUTPUT
          text
    MODULE status_3000 OUTPUT.
      SET PF-STATUS 'ZTESTMENU'.
    SET TITLEBAR 'xxx'.
    For Source client
    *for check boxes.
    if c_cont1 is initial.
        perform create_and_init_alv.
      endif.
    IF c_alv2 IS INITIAL.
        CREATE OBJECT c_cont2
          EXPORTING
            container_name              = 'CONTAINER_TARGET'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv2
            EXPORTING
              i_parent          = c_cont2.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat2.
        ENDIF.
        CALL METHOD c_alv2->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'x'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     =
            it_fieldcatalog               = it_fieldcat2
       it_sort                       =
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  USER_COMMAND_3000  INPUT
          text
    MODULE user_command_3000 INPUT.
    save_ok = ok_code.
      clear ok_code.
      case save_ok.
        WHEN 'BACK'.
          LEAVE PROGRAM.
           when 'EXIT'.
         perform exit_program.
        when 'SELECT'.
          perform select_all_entries changing gt_outtab[].
        when 'DESELECT'.
          perform deselect_all_entries changing gt_outtab[].
        when 'RESET'.
          perform reset_selected_entries changing gt_outtab[].
       when 'SWITCH'.
         perform switch_activation changing gt_outtab[].
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_3000  INPUT
    *&      Form  field_cat1
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat1 .
    Dynamic creation of a structure
      CREATE DATA l_structure1 TYPE (p_table).
      ASSIGN l_structure1->* TO .
    Fields Structure
      struc_desc1 ?= cl_abap_typedescr=>describe_by_data( .
      Build Fieldcatalog
        ty_fieldcat1-checkbox = 'X'.
        ty_fieldcat1-fieldname = -name.
        ty_fieldcat1-ref_table = p_table.
        APPEND ty_fieldcat1 TO it_fieldcat1.
      Build Fieldcatalog
        ls_fieldcatalogue1-fieldname = create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat1
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table1
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table1->* TO  = gt_outtab[].
    Read data from the table selected.
      SELECT * FROM (p_table)
         CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE  TO wa.
      INSERT wa into table  gt_outtab.
    ENDLOOP.
    ENDFORM.                    " field_cat1
    *&      Form  field_cat2
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat2 .
      CREATE DATA l_structure2 TYPE (p_table).
      ASSIGN l_structure2->* TO .
    Fields Structure
      struc_desc2 ?= cl_abap_typedescr=>describe_by_data( .
      Build Fieldcatalog
        ty_fieldcat2-fieldname = -name.
        ty_fieldcat2-ref_table = p_table.
        APPEND ty_fieldcat2 TO it_fieldcat2.
      Build Fieldcatalog
        ls_fieldcatalogue2-fieldname = create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat2
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table2
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table2->* TO .
    Read data from the table selected.
      SELECT * FROM (p_table) CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE
                   WHERE mandt =  p_mdt_to.
    ENDFORM.                    " field_cat2
    *&      Form  create_and_init_alv
          text
    -->  p1        text
    <--  p2        text
    form create_and_init_alv .
    data: lt_exclude type ui_functions.
      create object c_cont1
             exporting container_name = 'CONTAINER_SOURCE'.
      create object c_alv1
             exporting i_parent = c_cont1.
    PERFORM field_cat1.
    perform exclude_tb_functions changing lt_exclude.
    perform build_data.
    gs_layout-stylefname = 'CELLTAB'.
      call method c_alv1->set_table_for_first_display
           exporting is_layout             = gs_layout
                     it_toolbar_excluding  = lt_exclude
           changing  it_fieldcatalog       = it_fieldcat1
                     it_outtab             = gt_outtab[].
      create object g_event_receiver.
      set handler g_event_receiver->catch_doubleclick for c_alv1.
    Set editable cells to ready for input initially
      call method c_alv1->set_ready_for_input
       exporting
        i_ready_for_input = 1.
    endform.                    " create_and_init_alv
    *&      Form  exclude_tb_functions
          text
         <--P_LT_EXCLUDE  text
    form exclude_tb_functions changing pt_exclude type ui_functions.
      data ls_exclude type ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      append ls_exclude to pt_exclude.
    endform.                    " exclude_tb_functions
    *&      Form  build_data
          text
    -->  p1        text
    <--  p2        text
    form build_data .
    data:ls_celltab type lvc_s_styl,
            lt_celltab type lvc_t_styl,
            l_index type i.
    *-- get the number of entries in table
      SELECT COUNT(*) FROM dd03l INTO lv_count
                                WHERE tabname   =  p_table
                                  AND fieldname = 'MANDT'.
    Check MANDT field the the table, if not exists through an error message
      IF lv_count = 0.
        MESSAGE i000(8i) WITH text-001 space space.
        EXIT.
      ELSE.
    *-- Delete the Table Entries in the target system
        DELETE FROM (p_table) CLIENT SPECIFIED
              WHERE mandt = p_mdt_to.
        COMMIT WORK.
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_fm.
        IF sy-subrc .
       move-corresponding <tab1> to gt_outtab.
      if gt_outtab-connid eq '400'.
        gt_outtab-checkbox = 'X'.
      endif.
       append gt_outtab.
    endloop.
    ls_celltab-fieldname = 'CHECKBOX'.
    ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
    loop at gt_outtab.
       l_index = sy-tabix.
       refresh lt_celltab.
       ls_celltab-fieldname = 'CHECKBOX'.
       ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
       insert ls_celltab into table lt_celltab.
       insert lines of lt_celltab into table gt_outtab-celltab.
       modify gt_outtab index l_index.
    endloop.
    endform.                    " build_data
    *&      Form  select_all_entries
          text
         <--P_GT_OUTTAB  text
    form select_all_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c,
            l_locked type c.
    *§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
          you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          perform check_lock using    ls_outtab
                             changing l_locked.
          if l_locked is initial
             and not ls_outtab-checkbox eq '-'.
            ls_outtab-checkbox = 'X'.
          endif.
          modify pt_outtab from ls_outtab.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " select_all_entries
    *&      Form  deselect_all_entries
          text
         <--P_GT_OUTTAB[]  text
    form deselect_all_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c,
            l_locked type c.
    *§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
          you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          perform check_lock using    ls_outtab
                           changing l_locked.
          if l_locked is initial
             and not ls_outtab-checkbox eq '-'.
            ls_outtab-checkbox = ' '.
          endif.
          modify pt_outtab from ls_outtab.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " deselect_all_entries
    *&      Form  reset_selected_entries
          text
         <--P_GT_OUTTAB[]  text
    form reset_selected_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c.
    *§A4b. Before you set, (b)reset or evaluate checkboxes,
         you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          if     not ls_outtab-checkbox is initial
             and not ls_outtab-checkbox eq '-'.
            clear ls_outtab.
            modify pt_outtab from ls_outtab.
          endif.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " reset_selected_entries
    *&      Form  check_lock
          text
         -->P_LS_OUTTAB  text
         <--P_L_LOCKED  text
    form check_lock using    ps_outtab type gs_outtab
                    changing p_locked.
      data ls_celltab type lvc_s_styl.
      loop at ps_outtab-celltab into ls_celltab.
        if ls_celltab-fieldname = 'CHECKBOX'.
          if ls_celltab-style eq cl_gui_alv_grid=>mc_style_disabled.
            p_locked = 'X'.
          else.
            p_locked = space.
          endif.
        endif.
      endloop.
    endform.                               " check_lock
    and when i am running this code its going for runtime.i know the cause also as the data from dynamic internal table is not properly moved to standard internal.but i am not getting how to do this.please can u help out in this regard with code.
    thank u.
    soham

    hi experts,
    I not getting checkboxes when i am using the concept of dynamic internal table and oops concept.and i am not getting how to pass data from dynamic internal table to standard internal table and i have searched in forums i got some solutions but i tried out with those solution but i havent got the output with checkboxes. so i am pasting the below code.so kindly help me in this regard.
    the functionality of below code is to copy tables across clients.for this i have created two containers in same layout i.e.one for source client details and other for target client details.
    TYPE-POOLS *
    TYPE-POOLS: slis.
    *-- Tables Declaration
    TABLES:  dd02l, t000.
    *-- Constants Declaration
    CONSTANTS: lc_z   TYPE char1  VALUE 'Z',
               lc_y   TYPE char1  VALUE 'Y'.
    *--Internal table and Work Area Declaration
    DATA: lines LIKE sy-dbcnt VALUE 0.
    DATA: icursor TYPE cursor.
    *DATA: icursor1 TYPE cursor.
    DATA: lv_count TYPE i.
    DATA: lv_table_var1  TYPE char1.
    DATA: lv_ans TYPE char1.
    DATA : gd_tabname  TYPE tabname.
    *field catalog for source client
    DATA: c_cont1 TYPE REF TO cl_gui_custom_container,
    c_alv1 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat1 TYPE lvc_t_fcat ,
    ty_fieldcat1 TYPE lvc_s_fcat ,
    struc_desc1   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue1 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue1 TYPE slis_t_fieldcat_alv,
    l_structure1   TYPE REF TO data,
    l_table1    TYPE REF TO data.
    check boxes for source client.
    for check boxes.
    class lcl_event_receiver definition deferred.  "for event handling
    DATA: ok_code LIKE sy-ucomm,
          save_ok LIKE sy-ucomm,
    g_event_receiver TYPE REF TO lcl_event_receiver,
    gs_layout TYPE lvc_s_layo,
          g_max TYPE i VALUE 100.
    types: begin of gs_outtab.
    types: checkbox type c,                "field for checkbox
    t_name TYPE tabname,
    t_ref TYPE REF TO data.
    *include structure itab.
    types: celltab type lvc_t_styl.        "field to switch editability
    types: end of gs_outtab.
    data: gt_outtab type gs_outtab occurs 0 with header line,
    wa type gs_outtab.
    LOCAL CLASSES
    This local class only handles event DOUBLE_CLICK.
    Wenn the user double clicks on a checkbox cell the status of
    this cell is switched from editable to not editable and vice versa.
    class lcl_event_receiver definition.
    public section.
    methods: catch_doubleclick
             for event double_click of cl_gui_alv_grid
             importing
                e_column
                es_row_no
                sender.
    endclass.
    class lcl_event_receiver implementation.
    method catch_doubleclick.
      data: ls_outtab type gs_outtab,
             ls_celltab type lvc_s_styl.
               if e_column-fieldname ne 'CHECKBOX'.
        exit.
      endif.
      read table gt_outtab into ls_outtab index es_row_no-row_id.
    The loop is only needed if there are other columns that
    use checkboxes. At this point the loop could be
    replaced by a READ of the first line of CELLTAB.
          loop at ls_outtab-celltab into ls_celltab.
            if ls_celltab-fieldname eq 'CHECKBOX'.
    §B4.Switch the style to dis- or enable a cell for input
             if ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
              ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
             else.
              ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
             endif.
             modify ls_outtab-celltab from ls_celltab.
            endif.
          endloop.
          modify gt_outtab from ls_outtab index es_row_no-row_id.
        call method sender->refresh_table_display.
    endmethod.
    endclass.
    *field catalog for target client
    DATA: c_cont2 TYPE REF TO cl_gui_custom_container,
    c_alv2 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat2 TYPE lvc_t_fcat ,
    ty_fieldcat2 TYPE lvc_s_fcat ,
    struc_desc2   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue2 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue2 TYPE slis_t_fieldcat_alv,
    l_structure2   TYPE REF TO data,
    l_table2    TYPE REF TO data.
    *for source client
    TYPES: BEGIN OF itab,
            t_name TYPE tabname,
            t_ref TYPE REF TO data,
    END OF itab.
    *for target client
    TYPES: BEGIN OF itab1,
             t_name1 TYPE tabname,
             t_ref1 TYPE REF TO data,
    END OF itab1.
    *-- Field Symbol declaration for Dynamic Internal Table for source client
    FIELD-SYMBOLS:  TYPE ANY.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_table    LIKE dd02l-tabname,
                p_mdt_fm LIKE t000-mandt DEFAULT sy-mandt,
                p_mdt_to LIKE t000-mandt DEFAULT '910'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON p_table.
      lv_table_var1  = p_table+0(1).
    *-- Validation for Standard tables
      IF ( lv_table_var1 NE lc_z ) AND ( lv_table_var1 NE lc_y ).
        MESSAGE e001(00)  WITH text-002.
      ENDIF.
    *-- Start of Selection
    START-OF-SELECTION.
    for source client----
      DATA itab2 TYPE itab.
      DATA t_ref1 TYPE REF TO data.
      itab2-t_name = p_table.
    for target client----
      DATA itab3 TYPE itab1.
      DATA t_ref2 TYPE REF TO data.
      itab3-t_name1 = p_table.
    *-- Create Dynamic Internal table for source client
      CREATE DATA itab2-t_ref TYPE TABLE OF (itab2-t_name) .
      ASSIGN itab2-t_ref->* TO  0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
    ENDIF.
      CALL SCREEN 3000.
    *&      Module  STATUS_3000  OUTPUT
          text
    MODULE status_3000 OUTPUT.
      SET PF-STATUS 'ZTESTMENU'.
    SET TITLEBAR 'xxx'.
    For Source client
    *for check boxes.
    if c_cont1 is initial.
        perform create_and_init_alv.
      endif.
    IF c_alv2 IS INITIAL.
        CREATE OBJECT c_cont2
          EXPORTING
            container_name              = 'CONTAINER_TARGET'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv2
            EXPORTING
              i_parent          = c_cont2.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat2.
        ENDIF.
        CALL METHOD c_alv2->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'x'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     =
            it_fieldcatalog               = it_fieldcat2
       it_sort                       =
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  USER_COMMAND_3000  INPUT
          text
    MODULE user_command_3000 INPUT.
    save_ok = ok_code.
      clear ok_code.
      case save_ok.
        WHEN 'BACK'.
          LEAVE PROGRAM.
           when 'EXIT'.
         perform exit_program.
        when 'SELECT'.
          perform select_all_entries changing gt_outtab[].
        when 'DESELECT'.
          perform deselect_all_entries changing gt_outtab[].
        when 'RESET'.
          perform reset_selected_entries changing gt_outtab[].
       when 'SWITCH'.
         perform switch_activation changing gt_outtab[].
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_3000  INPUT
    *&      Form  field_cat1
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat1 .
    Dynamic creation of a structure
      CREATE DATA l_structure1 TYPE (p_table).
      ASSIGN l_structure1->* TO .
    Fields Structure
      struc_desc1 ?= cl_abap_typedescr=>describe_by_data( .
      Build Fieldcatalog
        ty_fieldcat1-checkbox = 'X'.
        ty_fieldcat1-fieldname = -name.
        ty_fieldcat1-ref_table = p_table.
        APPEND ty_fieldcat1 TO it_fieldcat1.
      Build Fieldcatalog
        ls_fieldcatalogue1-fieldname = create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat1
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table1
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table1->* TO  = gt_outtab[].
    Read data from the table selected.
      SELECT * FROM (p_table)
         CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE  TO wa.
      INSERT wa into table  gt_outtab.
    ENDLOOP.
    ENDFORM.                    " field_cat1
    *&      Form  field_cat2
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat2 .
      CREATE DATA l_structure2 TYPE (p_table).
      ASSIGN l_structure2->* TO .
    Fields Structure
      struc_desc2 ?= cl_abap_typedescr=>describe_by_data( .
      Build Fieldcatalog
        ty_fieldcat2-fieldname = -name.
        ty_fieldcat2-ref_table = p_table.
        APPEND ty_fieldcat2 TO it_fieldcat2.
      Build Fieldcatalog
        ls_fieldcatalogue2-fieldname = create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat2
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table2
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table2->* TO .
    Read data from the table selected.
      SELECT * FROM (p_table) CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE
                   WHERE mandt =  p_mdt_to.
    ENDFORM.                    " field_cat2
    *&      Form  create_and_init_alv
          text
    -->  p1        text
    <--  p2        text
    form create_and_init_alv .
    data: lt_exclude type ui_functions.
      create object c_cont1
             exporting container_name = 'CONTAINER_SOURCE'.
      create object c_alv1
             exporting i_parent = c_cont1.
    PERFORM field_cat1.
    perform exclude_tb_functions changing lt_exclude.
    perform build_data.
    gs_layout-stylefname = 'CELLTAB'.
      call method c_alv1->set_table_for_first_display
           exporting is_layout             = gs_layout
                     it_toolbar_excluding  = lt_exclude
           changing  it_fieldcatalog       = it_fieldcat1
                     it_outtab             = gt_outtab[].
      create object g_event_receiver.
      set handler g_event_receiver->catch_doubleclick for c_alv1.
    Set editable cells to ready for input initially
      call method c_alv1->set_ready_for_input
       exporting
        i_ready_for_input = 1.
    endform.                    " create_and_init_alv
    *&      Form  exclude_tb_functions
          text
         <--P_LT_EXCLUDE  text
    form exclude_tb_functions changing pt_exclude type ui_functions.
      data ls_exclude type ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      append ls_exclude to pt_exclude.
    endform.                    " exclude_tb_functions
    *&      Form  build_data
          text
    -->  p1        text
    <--  p2        text
    form build_data .
    data:ls_celltab type lvc_s_styl,
            lt_celltab type lvc_t_styl,
            l_index type i.
    *-- get the number of entries in table
      SELECT COUNT(*) FROM dd03l INTO lv_count
                                WHERE tabname   =  p_table
                                  AND fieldname = 'MANDT'.
    Check MANDT field the the table, if not exists through an error message
      IF lv_count = 0.
        MESSAGE i000(8i) WITH text-001 space space.
        EXIT.
      ELSE.
    *-- Delete the Table Entries in the target system
        DELETE FROM (p_table) CLIENT SPECIFIED
              WHERE mandt = p_mdt_to.
        COMMIT WORK.
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_fm.
        IF sy-subrc .
       move-corresponding <tab1> to gt_outtab.
      if gt_outtab-connid eq '400'.
        gt_outtab-checkbox = 'X'.
      endif.
       append gt_outtab.
    endloop.
    ls_celltab-fieldname = 'CHECKBOX'.
    ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
    loop at gt_outtab.
       l_index = sy-tabix.
       refresh lt_celltab.
       ls_celltab-fieldname = 'CHECKBOX'.
       ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
       insert ls_celltab into table lt_celltab.
       insert lines of lt_celltab into table gt_outtab-celltab.
       modify gt_outtab index l_index.
    endloop.
    endform.                    " build_data
    *&      Form  select_all_entries
          text
         <--P_GT_OUTTAB  text
    form select_all_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c,
            l_locked type c.
    *§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
          you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          perform check_lock using    ls_outtab
                             changing l_locked.
          if l_locked is initial
             and not ls_outtab-checkbox eq '-'.
            ls_outtab-checkbox = 'X'.
          endif.
          modify pt_outtab from ls_outtab.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " select_all_entries
    *&      Form  deselect_all_entries
          text
         <--P_GT_OUTTAB[]  text
    form deselect_all_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c,
            l_locked type c.
    *§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
          you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          perform check_lock using    ls_outtab
                           changing l_locked.
          if l_locked is initial
             and not ls_outtab-checkbox eq '-'.
            ls_outtab-checkbox = ' '.
          endif.
          modify pt_outtab from ls_outtab.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " deselect_all_entries
    *&      Form  reset_selected_entries
          text
         <--P_GT_OUTTAB[]  text
    form reset_selected_entries changing pt_outtab type standard table.
      data: ls_outtab type gs_outtab.
      data: l_valid type c.
    *§A4b. Before you set, (b)reset or evaluate checkboxes,
         you must check the input cells.
    If all entries are ok, ALV transferes new values to the output
    table which you then can modify.
      call method c_alv1->check_changed_data
                  importing
                     e_valid = l_valid.
      if l_valid eq 'X'.
        loop at pt_outtab into ls_outtab.
          if     not ls_outtab-checkbox is initial
             and not ls_outtab-checkbox eq '-'.
            clear ls_outtab.
            modify pt_outtab from ls_outtab.
          endif.
        endloop.
        call method c_alv1->refresh_table_display.
      endif.
    endform.                               " reset_selected_entries
    *&      Form  check_lock
          text
         -->P_LS_OUTTAB  text
         <--P_L_LOCKED  text
    form check_lock using    ps_outtab type gs_outtab
                    changing p_locked.
      data ls_celltab type lvc_s_styl.
      loop at ps_outtab-celltab into ls_celltab.
        if ls_celltab-fieldname = 'CHECKBOX'.
          if ls_celltab-style eq cl_gui_alv_grid=>mc_style_disabled.
            p_locked = 'X'.
          else.
            p_locked = space.
          endif.
        endif.
      endloop.
    endform.                               " check_lock
    and when i am running this code its going for runtime.i know the cause also as the data from dynamic internal table is not properly moved to standard internal.but i am not getting how to do this.please can u help out in this regard with code.
    thank u.
    soham

  • How to get checkboxes in dynamic ALV list generation

    hi ,
    below is the code in which two lists we wll be displayed in one layout dynamically(i.e after entering the table name two lists wll be displayed in one layout) from two different clients(i.e. source and target).
    TYPE-POOLS *
    TYPE-POOLS: slis.
    *-- Tables Declaration
    TABLES:  dd02l, t000.
    *-- Constants Declaration
    CONSTANTS: lc_z   TYPE char1  VALUE 'Z',
               lc_y   TYPE char1  VALUE 'Y'.
    DATA: ok_code TYPE sy-ucomm.
    *--Internal table and Work Area Declaration
    DATA: lines LIKE sy-dbcnt VALUE 0.
    DATA: icursor TYPE cursor.
    *DATA: icursor1 TYPE cursor.
    DATA: lv_count TYPE i.
    DATA: lv_table_var1  TYPE char1.
    DATA: lv_ans TYPE char1.
    DATA : gd_tabname  TYPE tabname.
    *for check boxes
    DATA:l_pos TYPE i VALUE 1.
    *field catalog for source client
    DATA: c_cont1 TYPE REF TO cl_gui_custom_container,
    c_alv1 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat1 TYPE lvc_t_fcat ,
    ty_fieldcat1 TYPE lvc_s_fcat ,
    struc_desc1   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue1 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue1 TYPE slis_t_fieldcat_alv,
    l_structure1   TYPE REF TO data,
    l_table1    TYPE REF TO data.
    for check boxes for source client
    DATA: ls_edit TYPE lvc_s_styl,
    lt_edit TYPE lvc_t_styl.
    *field catalog for target client
    DATA: c_cont2 TYPE REF TO cl_gui_custom_container,
    c_alv2 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat2 TYPE lvc_t_fcat ,
    ty_fieldcat2 TYPE lvc_s_fcat ,
    struc_desc2   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue2 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue2 TYPE slis_t_fieldcat_alv,
    l_structure2   TYPE REF TO data,
    l_table2    TYPE REF TO data.
    *for source client
    TYPES: BEGIN OF itab,
            t_name TYPE tabname,
            t_ref TYPE REF TO data,
    *for checkboxes.
            check(1),
    style TYPE lvc_t_styl,
    END OF itab.
    *for target client
    TYPES: BEGIN OF itab1,
             t_name1 TYPE tabname,
             t_ref1 TYPE REF TO data,
    END OF itab1.
    *-- Field Symbol declaration for Dynamic Internal Table for source client
    FIELD-SYMBOLS: <tab> TYPE table.
    FIELD-SYMBOLS: <tab1> TYPE ANY.
    FIELD-SYMBOLS: <l_mandt>.
    FIELD-SYMBOLS: <str_comp1> TYPE abap_compdescr,
                   <dyn_str1> TYPE ANY.
    *--Field Symbol declaration for Dynamic Internal Table for target client
    FIELD-SYMBOLS <tab2> TYPE table.
    FIELD-SYMBOLS <tab3> TYPE ANY.
    FIELD-SYMBOLS: <l_mandt1>.
    FIELD-SYMBOLS: <str_comp2> TYPE abap_compdescr,
                   <dyn_str2> TYPE ANY.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_table    LIKE dd02l-tabname,
                p_mdt_fm LIKE t000-mandt DEFAULT sy-mandt,
                p_mdt_to LIKE t000-mandt DEFAULT '910'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON p_table.
      lv_table_var1  = p_table+0(1).
    *-- Validation for Standard tables
      IF ( lv_table_var1 NE lc_z ) AND ( lv_table_var1 NE lc_y ).
        MESSAGE e001(00)  WITH text-002.
      ENDIF.
    *-- Start of Selection
    START-OF-SELECTION.
    --for source client--
      DATA itab2 TYPE itab.
      DATA t_ref1 TYPE REF TO data.
      itab2-t_name = p_table.
    --for target client--
      DATA itab3 TYPE itab1.
      DATA t_ref2 TYPE REF TO data.
      itab3-t_name1 = p_table.
    *-- Create Dynamic Internal table for source client
      CREATE DATA itab2-t_ref TYPE TABLE OF (itab2-t_name) .
      ASSIGN itab2-t_ref->* TO <tab>.
      CREATE DATA t_ref1 LIKE LINE OF <tab>.
      ASSIGN t_ref1->* TO <tab1>.
    *-- Create Dynamic Internal table for target client
      CREATE DATA itab3-t_ref1 TYPE TABLE OF (itab3-t_name1) .
      ASSIGN itab3-t_ref1->* TO <tab2>.
      CREATE DATA t_ref2 LIKE LINE OF <tab2>.
      ASSIGN t_ref2->* TO <tab3>.
    *-- get the number of entries in table
      SELECT COUNT(*) FROM dd03l INTO lv_count
                                WHERE tabname   =  p_table
                                  AND fieldname = 'MANDT'.
    Check MANDT field the the table, if not exists through an error message
      IF lv_count = 0.
        MESSAGE i000(8i) WITH text-001 space space.
        EXIT.
      ELSE.
    *-- Delete the Table Entries in the target system
        DELETE FROM (p_table) CLIENT SPECIFIED
              WHERE mandt = p_mdt_to.
        COMMIT WORK.
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_fm.
        IF sy-subrc <> 0.
          MESSAGE e000(8i) WITH text-001.
        ENDIF.
        DO.
          FETCH NEXT CURSOR icursor INTO TABLE <tab> PACKAGE SIZE 1000.
          IF sy-subrc <> 0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Modify Field 'MANDT' with the Target Client no.
          LOOP AT <tab> ASSIGNING <tab1>.
            ASSIGN COMPONENT: 'MANDT'  OF STRUCTURE <tab1> TO <l_mandt>.
            <l_mandt> = p_mdt_to.
            MODIFY <tab> FROM <tab1>.
            lines = lines + 1.
          ENDLOOP.
    *-- Insert records into target table
          INSERT (p_table) CLIENT SPECIFIED FROM TABLE <tab>.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
    ENDIF.
    for target client
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_to.
        IF sy-subrc <> 0.
          MESSAGE e000(8i) WITH text-001.
        ENDIF.
        DO.
          FETCH NEXT CURSOR icursor INTO TABLE <tab2> PACKAGE SIZE 1000.
          IF sy-subrc <> 0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
      ENDIF.
      CALL SCREEN 3000.
    *&      Module  STATUS_3000  OUTPUT
          text
    MODULE status_3000 OUTPUT.
      SET PF-STATUS 'ZTESTMENU'.
    SET TITLEBAR 'xxx'.
    For Source client
      IF c_alv1 IS INITIAL.
        CREATE OBJECT c_cont1
          EXPORTING
            container_name = 'CONTAINER_SOURCE'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv1
            EXPORTING
              i_parent = c_cont1.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat1.
        ENDIF.
        CALL METHOD c_alv1->set_table_for_first_display
         EXPORTING
    i_buffer_active               =
    i_bypassing_buffer            =
    i_consistency_check           =
    i_structure_name              =
    is_variant                    =
    i_save                        =
    i_default                     = 'x'
    is_layout                     =
    is_print                      =
    it_special_groups             =
    it_toolbar_excluding          =
    it_hyperlink                  =
    it_alv_graphics               =
    it_except_qinfo               =
    ir_salv_adapter               =
    CHANGING
    it_outtab           = <tab>
    it_fieldcatalog     = it_fieldcat1
    it_sort                       =
    it_filter                     =
    EXCEPTIONS
    valid_parameter_combination = 1
    program_error                 = 2
    too_many_lines                = 3
    others                        = 4
        IF sy-subrc <> 0.
                                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    For Target client
      IF c_alv2 IS INITIAL.
        CREATE OBJECT c_cont2
          EXPORTING
            container_name              = 'CONTAINER_TARGET'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv2
            EXPORTING
              i_parent          = c_cont2.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat2.
        ENDIF.
        CALL METHOD c_alv2->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'x'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     = <tab2>
            it_fieldcatalog               = it_fieldcat2
       it_sort                       =
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  USER_COMMAND_3000  INPUT
          text
    MODULE user_command_3000 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_3000  INPUT
    *&      Form  field_cat1
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat1 .
    Dynamic creation of a structure
      CREATE DATA l_structure1 TYPE (p_table).
      ASSIGN l_structure1->* TO <dyn_str1>.
    Fields Structure
      struc_desc1 ?= cl_abap_typedescr=>describe_by_data( <dyn_str1> ).
      LOOP AT struc_desc1->components ASSIGNING <str_comp1>.
      Build Fieldcatalog
        ty_fieldcat1-fieldname = <str_comp1>-name.
        ty_fieldcat1-ref_table = p_table.
       CLEAR: l_pos.
    *l_pos = l_pos + 1.
    *ty_fieldcat1-seltext = 'CHECK'.
    *ty_fieldcat1-fieldname = 'CHECK'.
    *ty_fieldcat1-tabname = 'ITAB'.
    *ty_fieldcat1-col_pos = l_pos.
    *ty_fieldcat1-checkbox = 'X'.
    *ty_fieldcat1-edit = 'X'.
    *ty_fieldcat1-outputlen = '5'.
    APPEND ty_fieldcat1 TO it_fieldcat1.
      Build Fieldcatalog
        ls_fieldcatalogue1-fieldname = <str_comp1>-name.
        ls_fieldcatalogue1-ref_tabname = p_table.
        APPEND ls_fieldcatalogue1 TO lt_fieldcatalogue1.
      ENDLOOP.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat1
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table1
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table1->* TO <tab>.
    Read data from the table selected.
      SELECT * FROM (p_table)
         CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE <tab>
                   WHERE mandt = p_mdt_fm.
    ENDFORM.                    " field_cat1
    *&      Form  field_cat2
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat2 .
      CREATE DATA l_structure2 TYPE (p_table).
      ASSIGN l_structure2->* TO <dyn_str2>.
    Fields Structure
      struc_desc2 ?= cl_abap_typedescr=>describe_by_data( <dyn_str2> ).
      LOOP AT struc_desc2->components ASSIGNING <str_comp2>.
      Build Fieldcatalog
        ty_fieldcat2-fieldname = <str_comp2>-name.
        ty_fieldcat2-ref_table = p_table.
        APPEND ty_fieldcat2 TO it_fieldcat2.
      Build Fieldcatalog
        ls_fieldcatalogue2-fieldname = <str_comp2>-name.
        ls_fieldcatalogue2-ref_tabname = p_table.
        APPEND ls_fieldcatalogue2 TO lt_fieldcatalogue2.
      ENDLOOP.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat2
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table2
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table2->* TO <tab2>.
    Read data from the table selected.
      SELECT * FROM (p_table) CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE <tab2>
                   WHERE mandt =  p_mdt_to.
    ENDFORM.                    " field_cat2
    *FOR THE ABOVE CODE I NEED CHECKBOXES IN THE FIRST LIST AND I HAVE TRIED MANY WAYS BUT I HAVENT GOT THE SOLUTION. SO, PLZ CAN U EXPLAIN BY MENTIONING THE PIECE OF CODE IN ABOVE CODE.
    PLZ DO THE NEED FUL.
    thanks in advance.

    hi ,
    below is the code in which two lists we wll be displayed in one layout dynamically(i.e after entering the table name two lists wll be displayed in one layout) from two different clients(i.e. source and target).
    TYPE-POOLS *
    TYPE-POOLS: slis.
    *-- Tables Declaration
    TABLES:  dd02l, t000.
    *-- Constants Declaration
    CONSTANTS: lc_z   TYPE char1  VALUE 'Z',
               lc_y   TYPE char1  VALUE 'Y'.
    DATA: ok_code TYPE sy-ucomm.
    *--Internal table and Work Area Declaration
    DATA: lines LIKE sy-dbcnt VALUE 0.
    DATA: icursor TYPE cursor.
    *DATA: icursor1 TYPE cursor.
    DATA: lv_count TYPE i.
    DATA: lv_table_var1  TYPE char1.
    DATA: lv_ans TYPE char1.
    DATA : gd_tabname  TYPE tabname.
    *for check boxes
    DATA:l_pos TYPE i VALUE 1.
    *field catalog for source client
    DATA: c_cont1 TYPE REF TO cl_gui_custom_container,
    c_alv1 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat1 TYPE lvc_t_fcat ,
    ty_fieldcat1 TYPE lvc_s_fcat ,
    struc_desc1   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue1 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue1 TYPE slis_t_fieldcat_alv,
    l_structure1   TYPE REF TO data,
    l_table1    TYPE REF TO data.
    for check boxes for source client
    DATA: ls_edit TYPE lvc_s_styl,
    lt_edit TYPE lvc_t_styl.
    *field catalog for target client
    DATA: c_cont2 TYPE REF TO cl_gui_custom_container,
    c_alv2 TYPE REF TO cl_gui_alv_grid,
    it_fieldcat2 TYPE lvc_t_fcat ,
    ty_fieldcat2 TYPE lvc_s_fcat ,
    struc_desc2   TYPE REF TO cl_abap_structdescr,
    ls_fieldcatalogue2 TYPE slis_fieldcat_alv,
    lt_fieldcatalogue2 TYPE slis_t_fieldcat_alv,
    l_structure2   TYPE REF TO data,
    l_table2    TYPE REF TO data.
    *for source client
    TYPES: BEGIN OF itab,
            t_name TYPE tabname,
            t_ref TYPE REF TO data,
    *for checkboxes.
            check(1),
    style TYPE lvc_t_styl,
    END OF itab.
    *for target client
    TYPES: BEGIN OF itab1,
             t_name1 TYPE tabname,
             t_ref1 TYPE REF TO data,
    END OF itab1.
    *-- Field Symbol declaration for Dynamic Internal Table for source client
    FIELD-SYMBOLS: <tab> TYPE table.
    FIELD-SYMBOLS: <tab1> TYPE ANY.
    FIELD-SYMBOLS: <l_mandt>.
    FIELD-SYMBOLS: <str_comp1> TYPE abap_compdescr,
                   <dyn_str1> TYPE ANY.
    *--Field Symbol declaration for Dynamic Internal Table for target client
    FIELD-SYMBOLS <tab2> TYPE table.
    FIELD-SYMBOLS <tab3> TYPE ANY.
    FIELD-SYMBOLS: <l_mandt1>.
    FIELD-SYMBOLS: <str_comp2> TYPE abap_compdescr,
                   <dyn_str2> TYPE ANY.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_table    LIKE dd02l-tabname,
                p_mdt_fm LIKE t000-mandt DEFAULT sy-mandt,
                p_mdt_to LIKE t000-mandt DEFAULT '910'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON p_table.
      lv_table_var1  = p_table+0(1).
    *-- Validation for Standard tables
      IF ( lv_table_var1 NE lc_z ) AND ( lv_table_var1 NE lc_y ).
        MESSAGE e001(00)  WITH text-002.
      ENDIF.
    *-- Start of Selection
    START-OF-SELECTION.
    --for source client--
      DATA itab2 TYPE itab.
      DATA t_ref1 TYPE REF TO data.
      itab2-t_name = p_table.
    --for target client--
      DATA itab3 TYPE itab1.
      DATA t_ref2 TYPE REF TO data.
      itab3-t_name1 = p_table.
    *-- Create Dynamic Internal table for source client
      CREATE DATA itab2-t_ref TYPE TABLE OF (itab2-t_name) .
      ASSIGN itab2-t_ref->* TO <tab>.
      CREATE DATA t_ref1 LIKE LINE OF <tab>.
      ASSIGN t_ref1->* TO <tab1>.
    *-- Create Dynamic Internal table for target client
      CREATE DATA itab3-t_ref1 TYPE TABLE OF (itab3-t_name1) .
      ASSIGN itab3-t_ref1->* TO <tab2>.
      CREATE DATA t_ref2 LIKE LINE OF <tab2>.
      ASSIGN t_ref2->* TO <tab3>.
    *-- get the number of entries in table
      SELECT COUNT(*) FROM dd03l INTO lv_count
                                WHERE tabname   =  p_table
                                  AND fieldname = 'MANDT'.
    Check MANDT field the the table, if not exists through an error message
      IF lv_count = 0.
        MESSAGE i000(8i) WITH text-001 space space.
        EXIT.
      ELSE.
    *-- Delete the Table Entries in the target system
        DELETE FROM (p_table) CLIENT SPECIFIED
              WHERE mandt = p_mdt_to.
        COMMIT WORK.
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_fm.
        IF sy-subrc <> 0.
          MESSAGE e000(8i) WITH text-001.
        ENDIF.
        DO.
          FETCH NEXT CURSOR icursor INTO TABLE <tab> PACKAGE SIZE 1000.
          IF sy-subrc <> 0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Modify Field 'MANDT' with the Target Client no.
          LOOP AT <tab> ASSIGNING <tab1>.
            ASSIGN COMPONENT: 'MANDT'  OF STRUCTURE <tab1> TO <l_mandt>.
            <l_mandt> = p_mdt_to.
            MODIFY <tab> FROM <tab1>.
            lines = lines + 1.
          ENDLOOP.
    *-- Insert records into target table
          INSERT (p_table) CLIENT SPECIFIED FROM TABLE <tab>.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
    ENDIF.
    for target client
    *-- Open cursor
        OPEN CURSOR WITH HOLD icursor FOR
          SELECT * FROM (p_table) CLIENT SPECIFIED
                  WHERE mandt = p_mdt_to.
        IF sy-subrc <> 0.
          MESSAGE e000(8i) WITH text-001.
        ENDIF.
        DO.
          FETCH NEXT CURSOR icursor INTO TABLE <tab2> PACKAGE SIZE 1000.
          IF sy-subrc <> 0.
            CLOSE CURSOR icursor.
            EXIT.
          ENDIF.
    *-- Close the cursor
          CALL FUNCTION 'DB_COMMIT'.
        ENDDO.
      ENDIF.
      CALL SCREEN 3000.
    *&      Module  STATUS_3000  OUTPUT
          text
    MODULE status_3000 OUTPUT.
      SET PF-STATUS 'ZTESTMENU'.
    SET TITLEBAR 'xxx'.
    For Source client
      IF c_alv1 IS INITIAL.
        CREATE OBJECT c_cont1
          EXPORTING
            container_name = 'CONTAINER_SOURCE'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv1
            EXPORTING
              i_parent = c_cont1.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat1.
        ENDIF.
        CALL METHOD c_alv1->set_table_for_first_display
         EXPORTING
    i_buffer_active               =
    i_bypassing_buffer            =
    i_consistency_check           =
    i_structure_name              =
    is_variant                    =
    i_save                        =
    i_default                     = 'x'
    is_layout                     =
    is_print                      =
    it_special_groups             =
    it_toolbar_excluding          =
    it_hyperlink                  =
    it_alv_graphics               =
    it_except_qinfo               =
    ir_salv_adapter               =
    CHANGING
    it_outtab           = <tab>
    it_fieldcatalog     = it_fieldcat1
    it_sort                       =
    it_filter                     =
    EXCEPTIONS
    valid_parameter_combination = 1
    program_error                 = 2
    too_many_lines                = 3
    others                        = 4
        IF sy-subrc <> 0.
                                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    For Target client
      IF c_alv2 IS INITIAL.
        CREATE OBJECT c_cont2
          EXPORTING
            container_name              = 'CONTAINER_TARGET'.
        IF sy-subrc = 0.
          CREATE OBJECT c_alv2
            EXPORTING
              i_parent          = c_cont2.
        ENDIF.
        IF sy-subrc EQ 0.
          PERFORM field_cat2.
        ENDIF.
        CALL METHOD c_alv2->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'x'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     = <tab2>
            it_fieldcatalog               = it_fieldcat2
       it_sort                       =
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  USER_COMMAND_3000  INPUT
          text
    MODULE user_command_3000 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_3000  INPUT
    *&      Form  field_cat1
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat1 .
    Dynamic creation of a structure
      CREATE DATA l_structure1 TYPE (p_table).
      ASSIGN l_structure1->* TO <dyn_str1>.
    Fields Structure
      struc_desc1 ?= cl_abap_typedescr=>describe_by_data( <dyn_str1> ).
      LOOP AT struc_desc1->components ASSIGNING <str_comp1>.
      Build Fieldcatalog
        ty_fieldcat1-fieldname = <str_comp1>-name.
        ty_fieldcat1-ref_table = p_table.
       CLEAR: l_pos.
    *l_pos = l_pos + 1.
    *ty_fieldcat1-seltext = 'CHECK'.
    *ty_fieldcat1-fieldname = 'CHECK'.
    *ty_fieldcat1-tabname = 'ITAB'.
    *ty_fieldcat1-col_pos = l_pos.
    *ty_fieldcat1-checkbox = 'X'.
    *ty_fieldcat1-edit = 'X'.
    *ty_fieldcat1-outputlen = '5'.
    APPEND ty_fieldcat1 TO it_fieldcat1.
      Build Fieldcatalog
        ls_fieldcatalogue1-fieldname = <str_comp1>-name.
        ls_fieldcatalogue1-ref_tabname = p_table.
        APPEND ls_fieldcatalogue1 TO lt_fieldcatalogue1.
      ENDLOOP.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat1
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table1
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table1->* TO <tab>.
    Read data from the table selected.
      SELECT * FROM (p_table)
         CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE <tab>
                   WHERE mandt = p_mdt_fm.
    ENDFORM.                    " field_cat1
    *&      Form  field_cat2
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat2 .
      CREATE DATA l_structure2 TYPE (p_table).
      ASSIGN l_structure2->* TO <dyn_str2>.
    Fields Structure
      struc_desc2 ?= cl_abap_typedescr=>describe_by_data( <dyn_str2> ).
      LOOP AT struc_desc2->components ASSIGNING <str_comp2>.
      Build Fieldcatalog
        ty_fieldcat2-fieldname = <str_comp2>-name.
        ty_fieldcat2-ref_table = p_table.
        APPEND ty_fieldcat2 TO it_fieldcat2.
      Build Fieldcatalog
        ls_fieldcatalogue2-fieldname = <str_comp2>-name.
        ls_fieldcatalogue2-ref_tabname = p_table.
        APPEND ls_fieldcatalogue2 TO lt_fieldcatalogue2.
      ENDLOOP.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = it_fieldcat2
       i_length_in_byte          =
        IMPORTING
          ep_table                  = l_table2
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 1
       others                    = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ASSIGN l_table2->* TO <tab2>.
    Read data from the table selected.
      SELECT * FROM (p_table) CLIENT SPECIFIED
         INTO CORRESPONDING FIELDS OF TABLE <tab2>
                   WHERE mandt =  p_mdt_to.
    ENDFORM.                    " field_cat2
    *FOR THE ABOVE CODE I NEED CHECKBOXES IN THE FIRST LIST AND I HAVE TRIED MANY WAYS BUT I HAVENT GOT THE SOLUTION. SO, PLZ CAN U EXPLAIN BY MENTIONING THE PIECE OF CODE IN ABOVE CODE.
    PLZ DO THE NEED FUL.
    thanks in advance.

  • My images in LR 4.3 suddenly have been duplicated.

    All of my 20,000 images in LR 4.3 were suddenly duplicated.  All the adjustments, ratings,just as if I had selected all and clicked "Create virtual Copy".  Is there a way to eliminate duplicate images or undo this mystriuos process?  In checking, the second image is a copy of the JPEG image which I exposrted to another location.  How can I handle these to somehow get rid of them or do they really not do anything except clutter up the content?
    Thanks

    Now I think I understand even less than before about your workflow
    So let me continue with [more questions]:
    Are you using a Mac or a Windows-PC?
    Msmoto1 wrote:
    I move NEF files from the XQD card inot a file called NEF Dirct [via Windows Explorer or Mac Finder?], this being on a 2 TB hard drive attcahed via USB.  From this NEF Direct folder, I then import the files to LR [via ADD in the import dialog of LR?].  I further deit, deleting about 75% of the files from the disk after impart. [could have some danger here so early, so I'd be cautious and just label them as reject - hit letter X, do actual deletion sometime later.]
    To make it easier to find the NEF files once I have taken them in from the XQD card [why find them - in which software? LR is sufficient, you need not consciously know where the files are as long as you do every subsequent move from within LR], I every now and then close the folder and crewate a new folder [via Windows Explorer or Mac Finder?] to bring over the NEF files from the card.  My suspician is this either changing the folder name or something in this area is why the NEF files are not seen by LR. [should not matter if you do this before the import. Afterwards you would break the link if done outside from LR.] In spite of this, the ones brought up by the aparent glitch after the backup on 12.27.12 show the actual image exported to another folder on the same external hard drive, but do not seem able to find the original NEF files. [Does that mean you have "?" in your thumbnails, saying the file is offline or missing?] [Did you do an Export from LR?]
    So, while the catalog is a bit cluttered, it is not showintg the most recent images in both NEF and JPEG, so maybe it is a wait and see issue. [There are no wait and see issues. LR needs some time to create its previews, but you see the thumbnails all the time.]
    I suppose I could somehow go back to the 12.27.12 backup catalog and import the more recent images form the current catalog.  Is this possible? [Did you already do some work on these more recent images, like keywording and developing?]
    Generally you can merge 2 different catalogs into 1, but careful setting of check-marks, in order to not have even more clutter by virtual copies.
    You would open the catalog with most good stuff in it: assume the 12.27.12-catalog, or better a copy created by Windows Explorer/Mac Finder, in order to still have it - things can always go wrong.
    Then you choose Menu File-Import From Another Catalog, then select your current catalog.
    LR will show a box for "preparing", then come up with a dialog box:
    if there are new photos found (bound to in your case), you can add them without moving.
    If there are metadata changes to the images which overlap in both catalogs, you can select from the dropdown list to Replace Nothing /  Metadata and Develop Settings only / Metadat, develop seetings and negative files.
    You can tick for a virtual copy (so you have 2 interpretation versions, one from each catalog). If tick "Show preview", you get a similar list of thumbnails like in the original import dialog to Check all, Uncheck all and recheck selectively.
    You could ease this if you would not take the full current catalog as source for the merge, but export from your current catalaog the supposed incremental portion of images in between Dec27 and today. Then there would be no overlap between the 12.27.12-backup and the source. You do this by first opening your current catalog, selecting the images between Dec27 and today, then go for File-Export as catalog.
    All this ex-/importing of catalogs may be superfluous if you did not yet invest work in the images between Dec27 and today, other than merely importing them into your current catalog.
    If so, then simply re-do the import into the 12.27.12-copy.
    My instructions only work if you have all the NEFs available, and can remove any "?" by plugging your external USB-HD.
    If you should still have "?" which you cannot relink, you are in more trouble.
    Forgive me if I may understimate your LR knowledge due to your juniority on this forum, but it may be worth while to first ensure your overall understanding of LR. If you learn best by watching video tutorials, I'd recommend Julianne Kost's intro series http://tv.adobe.com/show/getting-started-with-adobe-photoshop-lightroom-4/.
    If you prefer reading material for easy searchability, I'd recommend an eBook from Victoria Bampton: "The missing LR FAQs" http://www.lightroomqueen.com/books/adobe-lightroom-4-missing-faq/
    Good luck,
    Cornelia

  • Notification of successful deployment to production server from within

    How can code running on a production server be notified that a successful deployment (of new/changed catalogs) has completed to that server? A side affect is the catalog schema switches from CATA to CATB or vice versa. Another way to phrase the question is how to be notified of catalog schema switches at the time they occur?
    Thanks.

    That URL hangs but I think I found the spot in the Programmer's Guide. It talks about a DeploymentManager but only vaguely.
    I found some code that uses the DeploymentEvent and DeploymentEventListener mechanism. You register your listener with the DeploymentAgent (via config) and then receive all the deployment events. The only question is which of the many events/states that are reported is the one that means the catalog data source has switched?
    http://docs.oracle.com/cd/E22630_01/Platform.1002/apidoc/atg/deployment/common/event/DeploymentEvent.html

Maybe you are looking for

  • Custom page breaks with "@media print" in CSS when creating a PDF from HTML?

    Searching for threads containing the text string "@media print" gave me zero hits, so I guess I'm either the smartest guy in the entire universe for coming up with this idea or the dumbest for the same reason since I must be missing something that ev

  • Calling the function from SQL query

    Hi, I am trying to run the below statement, Select to_number(apps.pay_balance_pkg.get_value( 326, :paa.assignment_action_id,to_date ('31032011','ddmmyyyy'))) from dual; getting an error as : ORA-14552 cannot perform a DDL, commit or rollback inside a

  • Oracle related - On Solaris 10

    Hi, I face problem while installing SAP Solution Manager 4.0/ Oracle 10.2.0.2 on Solaris 10. SAP experts say it is an OS related problem. The relevent portions of log is given below. Please help to solve this. sapinst.log ERROR 2006-10-05 16:50:18 CJ

  • Gaming and Temperatures

    So I am looking into purchasing my favorite gaming series newest addition to their line up: Civilization 5. I tried the demo and it works fine in boot camp on medium settings which is great. My issue is the temperature of my macbook pro. I have a pro

  • Installation problem; can't install anything after failed install

    Hi everybody, I have just changed computer and I tried to instal Cubase LE4 on my new macbook air running on OS X Mavericks (10.9.2). I have encouter similar problems of others that tried the same operation on SL years ago, namely: when the installat