To import a dynpro dynamically

Hi,
I want to know if it is possible to import dynamically a Dynpro from a programm to an other programm.
I found the command "IMPORT DYNPRO" but it doesent worked.
Plaise help me.
Thanks

Hi Abderrazzak,
  sorry but it is not possible to import dynpros from program to program. (like you do with READ REPORT statement)
Regards, Manuel

Similar Messages

  • Importing Web Dynpro DC in 2004s

    Hi All,
    I wanted to know whether we can import Web Dynpro DC in 2004s that was Build n Deployed using 2004 . As we are upgrading from 2004 to 2004s.I tried to do the above test for a sample local DC of web Dynpro which i had developed in 2004 and deployed it on WAS 6.4 ,I then Imported the same DC in 2004s and tried to Rebuild the DC for deploying it on WAS 7.0 but it gave following ERROR !!
    com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn cannot be resolved (or is not a valid type) for the method
    <b>WdDoApplicationStateChange</b>
    I had deleted gen_wdp folder before rebuilding the project in 2004s
    kindly help me with information and source/documents on how to use same DC of 2004 in 2004s
    Thanks !

    Hi,
    Pls check the following documents available for system DC.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ded11778-0801-0010-258f-ac3b9408a194
    Used compontents for Web Dynpro DC not found
    How to sync Web Dynpro DC
    Hope this will help you,
    Br,
    AKL
    Pls reward pts.

  • IMPORT statement with dynamic variable

    Friends, Need Help!!!!!!!
    Im trying IMPORT variable contents from a cluster table VARI. I can do a IMPORT without issues when I use exact name of the variable but I have issues with dynamic variable selection. Pls see code below.
    loop at objects.
       assign objects-name to <fs>.
       IMPORT <fs> to tmp_var from database vari(va) id st_key.
    endloop.
    I do not get any value to tmp_var.  Need help!
    thanks
    Bhaskar

    Try this.
    loop at objects.
    IMPORT (objects-name) to tmp_var from database vari(va) id st_key.
    endloop.
    Does it work?
    Regards,
    RIch Heilman

  • Import/Export dynpro not working

    IMPORT DYNPRO h f e m ID id
    http://help.sap.com/abapdocu_70/en/ABAPIMPORT_DYNPRO.htm
    I would like to use IMPORT DYNPRO to import screen attributes and program flow and then perform necessary changes and export/generate the modified screen.
    well i used the sample from http://www.sapfans.com/sapfans/repos/poonam.htm, but regardless of how many times I tried, I couldn't get it to work. I'm still stuck at the first step, IMPORT DYNPRO will return sy-subrc = 4 (screen does not exist) no matter what program/screen I use.
    Any idea?, Thanks
    Edited by: afro100 on Oct 22, 2009 9:45 AM
    Edited by: afro100 on Oct 25, 2009 8:24 AM

    See the following example
    Double click on the method name; on the editor write the following code:
    METHOD onactionaction_find .
      DATA: node_node_vbak           TYPE REF TO if_wd_context_node,
        elem_node_vbak                      TYPE REF TO if_wd_context_element,
        stru_node_vbak                        TYPE if_input_view=>element_node_vbak .
    navigate from <CONTEXT> to <NODE_VBAK> via lead selection
      node_node_vbak = wd_context->get_child_node( name = if_input_view=>wdctx_node_vbak ).
    get element via lead selection
      elem_node_vbak = node_node_vbak->get_element(  ).
    get all declared attributes
      elem_node_vbak->get_static_attributes(
       IMPORTING static_attributes = stru_node_vbak ).
      DATA: ls_where(72) TYPE c,
            lt_where LIKE TABLE OF ls_where,
            lt_vbak TYPE STANDARD TABLE OF zstr_vbak.
    create where condition
      IF NOT stru_node_vbak-vbeln EQ ''.
        CONCATENATE 'VBELN = ''' stru_node_vbak-vbeln '''' INTO ls_where.
        APPEND ls_where TO lt_where.
      ENDIF.
      IF NOT stru_node_vbak-erdat EQ '00000000'.
        CONCATENATE 'ERDAT = ''' stru_node_vbak-erdat '''' INTO ls_where.
        IF stru_node_vbak-vbeln NE ''.
          CONCATENATE 'AND' ls_where INTO ls_where SEPARATED BY space.
        ENDIF.
        APPEND ls_where TO lt_where.
      ENDIF.
      SELECT VBELN ERDAT ERZET ERNAM ANGDT BNDDT AUDAT VBTYP TRVOG AUART
             AUGRU GWLDT SUBMI LIFSK FAKSK NETWR WAERK VKORG VTWEG SPART
             VKGRP VKBUR GSBER GSKST GUEBG GUEEN KNUMV
      FROM vbak INTO TABLE lt_vbak WHERE (lt_where).
      DATA:
        node_node_alv                       TYPE REF TO if_wd_context_node,
        stru_node_alv                       TYPE if_input_view=>element_node_alv .
    navigate from <CONTEXT> to <NODE_ALV> via lead selection
      node_node_alv = wd_context->get_child_node( name = if_input_view=>wdctx_node_alv ).
    get all declared attributes
      node_node_alv->bind_table( lt_vbak ).
    ENDMETHOD

  • Problem with importing web dynpro project

    we did a web dynpro project and we want work on this project on another computer wich conecting to the same server.
    we checked all the definations include the JCO definations and all the same.
    when we try deploy and run the project we get internal server error.
    can someone help what wrong and what to do?
    this is the error log:
    #1.5#000423886958006E0000066B00000A24000437A7577C8C11#1187091773681#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#sap.com/tcwddispwda#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#Guest#2####7e4347524a5b11dcc145000423886958#SAPEngine_Application_Thread[impl:3]_15##0#0#Error##Plain###Processing HTTP request to servlet [dispatcher] finished with error. The error is: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.taldor.tablecapabilties.CTablecapabilties. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.<init>(DelegatingComponent.java:51)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:381)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:700)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:269)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:74)
         ... 27 more
    Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Unable to create connection for RFC Metadata Repository WD_RSDAS_RFC_METADATA_DEST
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.RFCMetadataRepository.getSingleton(RFCMetadataRepository.java:198)
         at com.taldor.tablecapabilties.model.Bapi_Bank_Getlist_Input.<init>(Bapi_Bank_Getlist_Input.java:51)
         at com.taldor.tablecapabilties.CTablecapabilties.<init>(CTablecapabilties.java:252)
         at com.taldor.tablecapabilties.wdp.InternalCTablecapabilties.<init>(InternalCTablecapabilties.java:246)
         ... 32 more
    Caused by: com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscapeException: Error while obtaining JCO connection.
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:170)
         at com.sap.tc.webdynpro.services.sal.sl.core.SystemLandscapeInternal.getJCOClientConnectionUnMapped(SystemLandscapeInternal.java:36)
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.RFCMetadataRepository.getSingleton(RFCMetadataRepository.java:192)
         ... 35 more
    Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to resolve JCO destination name 'WD_RSDAS_RFC_METADATA_DEST' in the SLD. No such JCO destination is defined in the SLD.
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.resolveConnectionParameter(JCOClientConnection.java:467)
         at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.init(AbstractJCOClientConnection.java:233)
         at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.<init>(AbstractJCOClientConnection.java:218)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.<init>(JCOClientConnection.java:129)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:168)
         ... 37 more
    #1.5#000423886958006E0000066D00000A24000437A7577C9187#1187091773681#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#sap.com/tcwddispwda#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#Guest#2####7e4347524a5b11dcc145000423886958#SAPEngine_Application_Thread[impl:3]_15##0#0#Error#1#/System/Server/WebRequests#Plain###Processing HTTP request to servlet [dispatcher] finished with error.
    The error is: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.taldor.tablecapabilties.CTablecapabilties. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
    Exception id: [000423886958006E0000066B00000A24000437A7577C8C11]#

    Hi,
    I think the development components are missing in the new system.
    In this case...instead of importing the developed web Dynpro components into another computer... copy the entire folder (DC-Development Components) from the original system to the new system. Make sure the path and folder name are same in new system. Hope it should resolve the issue.
    Regards,
    Padman

  • Export/Import xml from dynamic pdf form using java

    Hi,
    I have been searching for the last 2-3 days on the internet for this. Some posts do talk about it, but none have provided the answer I was looking for. Hopefully this is the correct forum to post the question in.
    I am working on a desktop swing application that works on extracting and changing data in a XFA form, I would like to export the form's content modify it and import it back using java. This is so easy with the Adobe Reader, where it nicley exports the form content as an XML document, you can change it manually and the import the data back. I am searching for a way of doing this in java. I found XPAAJ.jar mentioned in some forums, that may make this easy. I havent been able to use it, since I cant find it anywhere.
    I found a blog from Mike Potter
    http://blogs.adobe.com/mikepotter/2006/07/download_xpaaj.html
    This says that XPAAJ is free as long as I use it on forms developed using livecycle. I dont own livecycle, but the forms that I am working has been built using livecycle.  So my questions are:
    1. Is XPAAJ the correct library to use, to export and import XML data from a dynamic pdf form?
    2. Is XPAAJ free to use and distribute as long as it works on pdf forms developed by livecycle?
    3. Where can I download XPAAJ from?
    4. If XPAAj is no longer available, is there any other free library that does this?
    5. If there isn't any free library, how much would cost me to use and distribute the library along with my desktop application?
    Thanks
    Sethu

    Hi Sethu;
    First, its important to know that xpaaj never was a supported piece of software.  It was supplied "as is" with no support from Adobe.  It has been pulled and is no longer available from the Adobe web site.  Mike's blog is from 2006, so its really old information.
    1. Is XPAAJ the correct library to use, to export and import XML data from a dynamic pdf form?
    While the xpaaj library will import and export data to/from a form on the client, Adobe now recommends using the LiveCycle ES Forms server.
    2. Is XPAAJ free to use and distribute as long as it works on pdf forms developed by livecycle?
    The license stated that you need to own one of Adobe's server side products (not LiveCycle Designer, but one of the server side LiveCycle products).
    3. Where can I download XPAAJ from?
    XPAAJ was pulled by Adobe.  They found a few bugs and since it was unsupported software they just pulled it from the web site.
    4. If XPAAj is no longer available, is there any other free library that does this?
    Not from Adobe.  Adobe recommends using the LiveCycle ES Forms software for merging data and forms.
    5. If there isn't any free library, how much would cost me to use and distribute the library along with my desktop application?
    As far as I know there Adobe doesn't have a client side library available for this (merging dynamic XDP based forms with data).

  • Importing data into dynamic form

    I have not yet had a chance to work with LiveCycle, and I have been given a project which I need to determine if LiveCycle would be the correct solution. The client originally wanted this to be a Microsoft Word form, but I doubt that I can meet the requirements using Word.
    I need to design a form which a user can enter multiple line items either manually, or by importing existing data. The data itself would be about 40-50 distinct pieces of data, in a block of  several sections and multiple lines (i.e Name, Address block, Phone/fax/email, contact and comment section, etc) and would be a combination of text fields and checkboxes. There would be 2-3 of these blocks per page (with a static header/footer), plus a cover page with data fields for the organization using the form.
    I know that I could create this type of dynamic form in LiveCycle to be entered manually, but I don’t know what options, if any, I would have in giving the user the ability to import existing data from an unknown source (could be a text file, a local or hosted database, excel, etc.).
    My questions are about the feasibility of LiveCycle for this project:
    Can data be imported from a data source the user chooses? Are there any limitations to what kinds of data sources can be used? Would I need to program a custom function to allow the user to match the proper fields for the import, or is there a built in function to handle this?
    Would there be any platform/application limitations? Can the form be used with Reader on a desktop computer (Mac or PC), or on a tablet (and if so, is a specific app necessary instead of the default app)?
    Are there any other foreseeable issues I may have to deal with?

    Thanks for the info. A few followup questions if you don't mind:
    1. Needs to configure an ODBC-connection on every system it is used.
    This form will be sent to our client, and they will send it to their customers. Can the connection setup be scripted, or is it simple enough that a generic set of instruction can be given to the end user to allow them to setup the connection and map their fields to the form's content easily?
    2. Requires Acrobat or a reader-enabled from to use in Reader. Data is automatically populated in the form fields. Only xml files for import allowed. Allows to use XSLT to format imported data.
    I doubt that the end user would have their data in a compatible XML format, so this option may not be necessary. Is Reader-enabling a form in LiveCycle comparable to the process in Acrobat? I have heard LiveCycle Enterprise is very expensive and required for certain functions, does this apply here? Does this require a specific server setup for these forms?
    3. Difficult scripting to update field values automatically. Works in Reader and Acrobat.
    The data would not need to be updated automatically, just pull current data into the form. This would be a one-way operation, there would be no need to update the data source from values within the form. I would still need to give the user a way to map their fields to the form.
    Are you aware of any tutorials or example files that would help give me a start? I had a brief look at the LiveCycle Designer ES2 Scripting Reference, but I"m not sure which objects to look into.
    None of these methods will work on mobile devices as there is currently no support of XFA in Reader Mobile.
    Good to know. The same is probably true if I were to create the form in Word/Office.

  • Is it possible to create Table Controls(in Dynpro) dynamically

    HI All
    I am not sure if we can create screen elements dynamically especially Table Controls. I need to create a Table control in a custom screen but the fields/columns in the table control are known at run time. Is it possible?? Appreciate any light on this subject.
    Thanks
    Van

    hi
    ccheck for the link
    Check following link for the same.
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D52%26threadID%3D45079%26messageID%3D459011%23459011
    also take a look at the FM
    take a look at FM:
    FREE_SELECTIONS_INIT
    FREE_SELECTIONS_DIALOG
    hope will be helpfull to you.
    regards
    vijay
    <u><b>plz reward pts if helpful</b></u>

  • How can get my labels in a screen(dynpro) dynamically .

    Hi All,
    I have a route screen which has got 6 fields which are the activities in PLPO.So the text of these activites which are 6 are gonna changes.Like let us say for material 5867 I will have to go read PLPO and read VGWTS for it and then on basis of VGWTS there will read TC21 and get all the parametrs like PAR01,PAR02...PAR06.IF they are having some value for it then go read tc20t and get the text for it from TC20t and that is gonna be the text(They are label before input box) in my screen.So it changes dynamically like this.How can i Do this?
    Regards,
    Vijay

    How are your six screen fields named and how are the corresponding variables named in your logic? Let us say your fields on the screen are named FIELD1, FIELD2, FIELD3, FIELD4, FIELD5 and FIELD6. Your program should also have 6 variables named the same. Then you move the texts into these six variables, you should see your values in the screen.

  • Is it possible to creat Table Controls(Dynpro) dynamically

    HI All
    I am not sure if we can create screen elements dynamically especially Table Controls. I need to create a Table control in a custom screen but the fields/columns in the table control are known at run time. Is it possible?? Appreciate any light on this subject.
    Thanks
    Van

    hi
    ccheck for the link
    Check following link for the same.
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D52%26threadID%3D45079%26messageID%3D459011%23459011
    also take a look at the FM
    take a look at FM:
    FREE_SELECTIONS_INIT
    FREE_SELECTIONS_DIALOG
    hope will be helpfull to you.
    regards
    vijay
    <u><b>plz reward pts if helpful</b></u>

  • IMPORT from database with dynamic parameter list

    Hi Gurus,
    Iu2019m having problems during import from a cluster table.
    I wanu2019t to do an import with a dynamic parameter list, but I cannot get it to work.
    Sample code ********
    DATA: BEGIN OF st_key,
    report LIKE rsvar-report,
    variant LIKE rsvar-variant,
    END OF st_key.
    DATA dirtab1 LIKE cdir OCCURS 10 WITH HEADER LINE.
    DATA dirtab2 LIKE cdir OCCURS 10 WITH HEADER LINE.
    st_key-report = 'ZPRG'.
    st_key-variant = 'VAR1'.
    IMPORT DIRECTORY INTO dirtab1 FROM DATABASE vari(vb) ID st_key.
    IMPORT DIRECTORY INTO dirtab2 FROM DATABASE vari(va) ID st_key.
    DATA: tmp_var(100)   TYPE c.
    This works - P_BWTAR is a parameter from the selection screen registred in VARI
    I'm getting the content of the field in tmp_var
    IMPORT p_bwtar TO tmp_var FROM DATABASE vari(va) ID st_key.
    This does not work - the parameter P_BWTAR is in the dirtab2-name
    I'm not getting the content
    LOOP AT dirtab2.
        IMPORT dirtab2-name FROM DATABASE vari(va) ID st_key.
      ENDIF.
    ENDLOOP.
    I have tried the syntax IMPORT (dirtab2-name) ........
    but this fails the syntax check.
    Please - if you have any suggestions  :o)
    Best Regards,
    Vibeke

    Dear Vibeke,
    Could you please explain us how you solved the problem because you have the same issue ?
    thanks a lot
    KR
    véronique

  • Import ess web dynpro to netweaver studio

    Hi guys,
    I want to import an web dynpro application, esstratre, to my netweaver studio. The source can be found in my WAS j2ee server, there are a zip file. But the zip file is not a valid netweaver studio project and can't import to netweaver studio directly, how can i import the source to my IDE?
    Thank you very much!

    hi xiaoming,
    I am really sorry,
    Check with this thread it deals with the import/export ear or project file
    Export/Import Web Dynpro project
    u check this link it deals with the ess problem
    His question is whats the best way to modify those SAP delivered WebDynpro apps. How do i import it to NetWeaver Developer Studio and how do i redeploy the changed app?
    Re: Customize/Change ESS MSS WebDynpro Applications (ECC 5.0)
    Regards,
    Vijayakhanna Raman
    Message was edited by: Vijayakhanna Raman

  • Dynamic import of metadata in owb?

    hello,
    I have to create a data warehouse in an Oracle database 11gR1, the production system is based on Oracle 9.2.0.1, to capture data changes I have to use synchronous cdc because the asynchronous mode requires at least version 9.2.0.6
    in synchronous mode I must generate views each time I want to capture the changes but in owb 11gR1 I can not import views in dynamic mode
    what can you suggest to me in this case?
    thank you
    tarek

    That's unfortunate.
    You'll probably have to write some PL/SQL that does one of two things. First, you could us a synonym to pull the view into OWB. You'll have to use some PL/SQL that drops and recreates the synonym every time you extend the window, to have the synonym point to the new name of the change view. You could do the same thing with a view if you are more comfortable with using a view. One of the parameters passed to the procedure would be the dynamic change view.
    The other thing you could do is have a PL/SQL procedure that selects all the rows out of the change view and inserts them to a regular staging table. Similar to the procedure above, you could pass the dynamic name of the change view but the staging table would always be constant. That way it could be brought into OWB and used successfully.
    Stewart Bryson

  • Module pool to create input field dynamically.

    Hi All,
    I have a requirement in module pool programming,
    Where I have one input field,based on the value given in this input I have to get the
    input fields dynamically in the screen.
    Is it possible to achieve this?
    If yes, please do tell me the solution to approach this requirement.
    With Regards,
    S.Asha.

    Hi,
    You can use IMPORT DYNPRO / EXPORT DYNPRO.
    Please check this URL: [Import/Export dynpro not working|Import/Export dynpro not working]
    [EXPORT DYNPRO or GENERATE DYNPRO|EXPORT DYNPRO or GENERATE DYNPRO]
    Cheers,

  • Programming dynamic abap code

    i want to build up a tree with te data of some internal tables.
    i have programmed the following coding:
    FORM build_node_and_item_table USING pt_node_table TYPE treev_ntab
                                         pt_item_table TYPE item_table_type.
      CLEAR l_index.
      LOOP AT lt_verfasser INTO ls_verfasser.
        l_key = ls_verfasser-key.
        CONCATENATE 'Root' l_key
                    INTO ls_text SEPARATED BY '/'.
        CONDENSE ls_text NO-GAPS.
        l_root = ls_text.
        ls_node-node_key = l_root.
        CLEAR ls_node-relatkey.      " Special case: A root node has no parent
        CLEAR ls_node-relatship.                " node.
        ls_node-hidden = ' '.                   " The node is visible,
        ls_node-disabled = ' '.                 " selectable,
        ls_node-isfolder = 'X'.                 " a folder.
        CLEAR ls_node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
        " use default.
        CLEAR ls_node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
        " use default
        CLEAR ls_node-expander.                 " see below.
        " the width of the item is adjusted to its content (text)
        APPEND ls_node TO pt_node_table.
        CLEAR ls_item.
        ls_item-node_key = ls_text.
        ls_item-item_name = '1'.
        ls_item-class = cl_gui_list_tree=>item_class_text. " Text Item
        " the with of the item is adjusted to its content (text)
        ls_item-alignment = cl_gui_list_tree=>align_auto.
        " use proportional font for the item
        ls_item-font = cl_gui_list_tree=>item_font_prop.
        CONCATENATE sy-datum
                    ls_verfasser-name
                    ls_verfasser-rolle
                    INTO ls_text SEPARATED BY space.
        ls_item-text = ls_text.
        APPEND ls_item TO pt_item_table.
    * Schmerz
        READ TABLE lt_schmerz INTO ls_schmerz WITH KEY ls_verfasser-key.
        IF sy-subrc = 0.
          CLEAR ls_node.
          l_key = l_index.
          CONCATENATE 'FO_Schmerz' l_key
                      INTO ls_text SEPARATED BY '/'.
          CONDENSE ls_text NO-GAPS.
          l_node_schmerz = ls_text.
    * Node with key 'Child1'
          CLEAR ls_node.
    * Achtung node_key darf nur 12 Zeichen lang sein!!!
          ls_node-node_key = l_node_schmerz.
          " Key of the node
          " Node is inserted as child of the node with key 'Root'.
          ls_node-relatkey = l_root.
          ls_node-relatship = cl_gui_list_tree=>relat_last_child.
          ls_node-isfolder = 'X'.
          APPEND ls_node TO pt_node_table.
    * Node with key 'Child1'
          CLEAR ls_item.
          ls_item-node_key = l_node_schmerz.
          ls_item-item_name = '1'.
          ls_item-class = cl_gui_list_tree=>item_class_text.
          ls_item-alignment = cl_gui_list_tree=>align_auto.
          ls_item-font = cl_gui_list_tree=>item_font_prop.
          ls_item-text = 'Schmerz'(004).
          APPEND ls_item TO pt_item_table.
          LOOP AT lt_schmerz INTO ls_schmerz
            WHERE key = ls_verfasser-key.
            l_tabix = sy-tabix.
            CLEAR ls_node.
            l_key = l_tabix.
            CONCATENATE 'IT_Schmerz' l_key
                        INTO ls_text SEPARATED BY '/'.
            CONDENSE ls_text NO-GAPS.
            ls_node-node_key = ls_text.
            ls_node-relatkey = l_node_schmerz.
            ls_node-relatship = cl_gui_list_tree=>relat_last_child.
            APPEND ls_node TO pt_node_table.
    * Items of node with key 'New1'
            CLEAR ls_item.
            ls_item-node_key = ls_text.
            ls_item-item_name = '1'.
            ls_item-class = cl_gui_list_tree=>item_class_text.
            CONCATENATE ls_schmerz-ort
                        ls_schmerz-wo
                        ls_schmerz-art
                        ls_schmerz-kommentar
            INTO ls_text SEPARATED BY space.
            l_length = STRLEN( ls_text ).
            ls_item-length = l_length.
            ls_item-ignoreimag = 'X'.               " see documentation of Structure
            " TREEV_ITEM
    *  ls_item-usebgcolor = 'X'.               " item has light grey background
    *  ls_item-t_image = '@01@'.               " icon of the item
            ls_item-text = ls_text.
            APPEND ls_item TO pt_item_table.
          ENDLOOP.
        ENDIF.
    ** Ernährung
    *    READ TABLE lt_ernaehrung INTO ls_ernaehrung WITH KEY ls_verfasser-key.
    *    IF sy-subrc = 0.
    *      CLEAR ls_node.
    *      l_key = l_index.
    *      CONCATENATE 'FO_Ern' l_key
    *                  INTO ls_text SEPARATED BY '/'.
    *      CONDENSE ls_text NO-GAPS.
    *      l_node_ern = ls_text.
    ** Node with key 'Child1'
    *      CLEAR ls_node.
    ** Achtung node_key darf nur 12 Zeichen lang sein!!!
    *      ls_node-node_key = l_node_ern.
    *      " Key of the node
    *      " Node is inserted as child of the node with key 'Root'.
    *      ls_node-relatkey = l_root.
    *      ls_node-relatship = cl_gui_list_tree=>relat_last_child.
    *      ls_node-isfolder = 'X'.
    *      APPEND ls_node TO pt_node_table.
    ** Node with key 'Child1'
    *      CLEAR ls_item.
    *      ls_item-node_key = l_node_ern.
    *      ls_item-item_name = '1'.
    *      ls_item-class = cl_gui_list_tree=>item_class_text.
    *      ls_item-alignment = cl_gui_list_tree=>align_auto.
    *      ls_item-font = cl_gui_list_tree=>item_font_prop.
    *      ls_item-text = 'Ernährung'(004).
    *      APPEND ls_item TO pt_item_table.
    *      LOOP AT lt_ernaehrung INTO ls_ernaehrung
    *        WHERE key = ls_verfasser-key.
    *        l_tabix = sy-tabix.
    *        CLEAR ls_node.
    *        l_key = l_tabix.
    *        CONCATENATE 'IT_Ern' l_key
    *                    INTO ls_text SEPARATED BY '/'.
    *        CONDENSE ls_text NO-GAPS.
    *        ls_node-node_key = ls_text.
    *        ls_node-relatkey = l_node_ern.
    *        ls_node-relatship = cl_gui_list_tree=>relat_last_child.
    *        APPEND ls_node TO pt_node_table.
    ** Items of node with key 'New1'
    *        CLEAR ls_item.
    *        ls_item-node_key = ls_text.
    *        ls_item-item_name = '1'.
    *        ls_item-class = cl_gui_list_tree=>item_class_text.
    *        CONCATENATE ls_ernaehrung-art
    *                    ls_ernaehrung-kommentar
    *                    ls_ernaehrung-hilfsmittel
    *                    ls_ernaehrung-bericht
    *        INTO ls_text SEPARATED BY space.
    *        l_length = STRLEN( ls_text ).
    *        ls_item-length = l_length.
    *        ls_item-ignoreimag = 'X'.               " see documentation of Structure
    *        " TREEV_ITEM
    **  ls_item-usebgcolor = 'X'.               " item has light grey background
    **  ls_item-t_image = '@01@'.               " icon of the item
    *        ls_item-text = ls_text.
    *        APPEND ls_item TO pt_item_table.
    *      ENDLOOP.
    *    ENDIF.
    * Index vor dem nächsten Durchlauf um 1 erhöhen
        l_index = l_index + 1.
      ENDLOOP.
    ENDFORM.   
    This works fine and the data is displayed in the alv-tree. I would like to programm this a little more dynamic because of lines of code. As you see, I commented the data filling of the tree with the data of the second internal table.
    I'd like to programm the coding so dynamic, that i would only use the coding i have posted, without copying the code for each internal table.
    Could you please help me how to do this.
    I thought about a internal table, where i collect the names of the tables which should be displayed in the alv tree.
    but how do i create the internal tables dynamicly. i would also use a work area for the loop of the internal tables. how could i create the work area dynamicly?
    I hope anyone could help my to spare some lines of code and make my posted coding dynamicly.
    Thanks very much!
    Greetings!

    You could try researching the way SAPLink works to import that kind of objects, it creates those (and other) kinds of objects based on data in XML files (nuggets and slinkees). You could adapt it to create them based on your kind of input instead.
    A word of caution though, I'm not sure it uses only SAP approved methods / APIs to achieve that. For instance, I know (from Thomas Jung's comments in other threads) that the APIs used in SAPLink to import Web Dynpro components are SAP internal and not intended to be used by customer developers; however to date there was no public API to do that.
    SAPLink's site: http://saplink.org/
    Regards
    Edited by: Alejandro Bindi on Aug 11, 2009 6:54 PM

Maybe you are looking for