Discriminator and dynamic table selection

Is there a way (in DSP 3.0) to use a discriminator to dynamically determine a related table to join in a select or update? On the java client I have a base class with extended class that I would like to model in related tables.
Thanks,
Jeff
Edited by jhoffmanme at 02/08/2008 4:09 AM

Ok - so you want something like
<CASE>
<BASE_CASE>
<BASE_CASE>
<LAB_CASE>
</LAB_CASE>
<CASE>
<CASE>
<BASE_CASE>
<BASE_CASE>
<CS_CASE>
</CS_CASE>
<CASE>
So you will need to define a CASE schema element that contains a BASE_CASE, and optionally a LAB_CASE, CS_CASE etc. element.
your queries will look like :
function getLABCases()
for $base_case in BASE_CASES()
return
<CASE>
{$base_case}
{for $lab_case in LAB_CASES()
            where $lab_case/ID eq $case/ID
            return
              $lab_case
</CASE>
function getCSCases()
for $base_case in BASE_CASES()
return
<CASE>
{$base_case}
{for $cs_case in CS_CASES()
            where $cs_case/ID eq $case/ID
            return
              $cs_case
</CASE>
getAllCases()
( getLABCases(),
getCSCases() )
Use the nested for's as I have shown above rather than...
for $base_case in BASE_CASES()
for $lab-case in LAB_CASES()
where $lab_case/ID eq $base_case/ID
as the second way forces LAB_CASE table to be read even when it is not required in the output.
For updates, you will need visit the update template documentation to see how you tell DSP that a CASE with a LAB_CASE came from the LAB_CASES table.

Similar Messages

  • What does mean You can include static and dynamic tables into a Smart Form?

    Hi guys,
    If you check the official documentation for Smart forms in the Internet you will read that the initial pharagraphs of the text tell you "Tables - You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed". The link is the following: http://help.sap.com/saphelp_nw04/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    I was wondering if this means that I can use field symbols with dynamical number of columns to print a smart form. Because it would be great since the customer wanted a dynamical report depending on the week day it was (If Monday, there was only 12 columns, but if Friday, it will be 52 columns (1 column more for every day elapsed in the current week)). I had to create 5 different forms, but I think using field symbols I had spent less effort. Do you know if it is really possible? If not, then what does mean "You can include static and dynamic tables into a Smart Form"?
    Thank you in advance

    Hi ,
    The concept of static and dynamic tables in smartforms, means you can use template- ( static table as no of rows and columns is fixed). Also you can use table- dynamic as the no of rows will depend on your line items.
    Hope this will help you to close this thread.
    Also, try to find this answer in posted forums. Creating a new forum everytime just increases the network traffic. So please try to avoid it.
    Regards,
    Vinit

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • 3 Tier Relational DB's and Dynamic Tables

    I have three tables which I shall, for ease, call A, B and C.
    B is relational to A
    C is relational to B
    A1 - B1 - C1
    C2
    B2 - C3
    C4
    A2
    A3 - B3 - C5
    B4
    B5 - C6
    C7
    C8
    I have no trouble creating recordset links for one or the
    other
    SELECT A.*, B.*
    FROM A INNER JOIN B ON A.AID = B.BAID
    WHERE etc... etc......
    Similarly, I can create a recordset for the secondary link..
    SELECT B.*, C.*
    FROM B INNER JOIN C ON B.BID = C.CBID
    WHERE etc... etc......
    What I am trying to acheive however is a recordset with a 3
    tier relationship and I can't figure the syntax.
    Somthing like...
    SELECT A.*, B.*, C.*
    FROM A INNER JOIN B ON A.AID = B.BAID, B INNER JOIN C ON
    B.AID = C.BAID
    WHERE etc... etc...... (This doesn't work!)
    This would then result in a dynamic table with (B and C) in
    the same row as it propogates.
    Eventually, what I want to achieve is a simple attachment
    symbol on each row of B, based on something like....
    <?php if (C,TotalRecords <> NULL) { ?>
    <a href="/linkedattachments.php?BID=<?php echo
    $row_recordsetB['BID']; ?>" target="_blank">
    <img src="fileicon.gif" alt="Click to see
    attachments"></a>
    <?php } ?>
    Am I going about this the right way? Is this even clear?
    lol

    "RichardODreamweaver" <[email protected]>
    wrote in message
    news:[email protected]...
    > I have three tables which I shall, for ease, call A, B
    and C.
    >
    > B is relational to A
    >
    > C is relational to B
    >
    > A1 - B1 - C1
    > C2
    > B2 - C3
    > C4
    > A2
    > A3 - B3 - C5
    > B4
    > B5 - C6
    > C7
    > C8
    >
    >
    > I have no trouble creating recordset links for one or
    the other
    >
    > SELECT A.*, B.*
    > FROM A INNER JOIN B ON A.AID = B.BAID
    > WHERE etc... etc......
    >
    > Similarly, I can create a recordset for the secondary
    link..
    >
    > SELECT B.*, C.*
    > FROM B INNER JOIN C ON B.BID = C.CBID
    > WHERE etc... etc......
    >
    > What I am trying to acheive however is a recordset with
    a 3 tier
    > relationship
    > and I can't figure the syntax.
    >
    > Somthing like...
    >
    > SELECT A.*, B.*, C.*
    > FROM A INNER JOIN B ON A.AID = B.BAID, B INNER JOIN C ON
    B.AID = C.BAID
    > WHERE etc... etc...... (This doesn't work!)
    that's almost right
    SELECT A.*, B.*, C.*
    FROM ((A INNER JOIN B ON A.AID = B.BAID) INNER JOIN C ON
    B.AID = C.BAID)
    WHERE etc... etc......
    I've added parentheses to show how the next join will operate
    on the first,
    the first join results in a relation of table a and b,
    you then join this "virtual table" to the third.
    > This would then result in a dynamic table with (B and C)
    in the same row
    > as it
    > propogates.
    >
    > Eventually, what I want to achieve is a simple
    attachment symbol on each
    > row
    > of B, based on something like....
    For the count to work with records that have no children you
    have to employ
    a LEFT join to return records from the RIGHT table even if no
    record on the
    LEFT side matches.
    SELECT A.*, B.*, COUNT(c.CAID) AS CAID_COUNT
    FROM ((A INNER JOIN B ON A.AID = B.BAID) LEFT JOIN C ON B.AID
    = C.BAID)
    WHERE etc... etc......
    > <?php if (C,TotalRecords <> NULL) { ?>
    > <a href="/linkedattachments.php?BID=<?php echo
    $row_recordsetB['BID']; ?>"
    > target="_blank">
    > <img src="fileicon.gif" alt="Click to see
    attachments"></a>
    > <?php } ?>
    >
    > Am I going about this the right way? Is this even clear?
    lol
    >

  • I am stuck in FIELD-SYMBOLS and dynamic tables.

    Hi guys,
                I am trying to create dynamic table. My requirement is as follows--
    I have to display grid layout report in depending on given input.
    In input i have fields for DC and STORE.
    In output i have to display columns depending on number of DC and STORE paased in input.
    For example if in input, i have 2 DCs DC01 and DC02 and in STs i have say 1 input - ST01
    then in outpt grid report there will be 3 columns.
    So my columns to be displayed depends on number of input values given while running it.
    I am trying to use dynamic table.
    My output report contains fields from different table...so i cant use
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE
    instead i m trying to use
    FIELD-SYMBOLS: <DYN_TABLE> LIKE T_ARTMAS  "T_ARTMAS is declared as types : begin of....end of .... .
    but it is giviing an error in following form
    FORM CREATE_DYNAMIC_ITAB.
    Create dynamic internal table and assign to FS
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = IFC
        IMPORTING
          EP_TABLE        = DY_TABLE.
      ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    Create dynamic work area and assign to FS
      CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>........error on this line.
      ASSIGN DY_LINE->* TO <DYN_WA>.
    ENDFORM.                    "create_dynamic_itab
    saying "<DYN_TABLE>" is not an internal table - the "OCCURS n" specification is missing.          
    Kindly help me...
    thx in advance...

    Hi
    .FIELD-SYMBOLS: <DYN_TABLE> LIKE T_ARTMAS "T_ARTMAS is declared as types : begin of....end of .... .
    but it is giviing an error in following form.....
    Just as Sasha wrote, the problem could be you've defined a flat structure and u need a table, but now just a little a question: why do u want to use a dynamic table but your field-symbol is like a certain type?
    That means u know how the table is so u don't need to use a dynamic table, your issue seems not to make sense.
    Max

  • Linksys WRT-1900AC and Dynamic Frequency Selection(DFS)

    Hello All
    Does anybody know if the Linksys Router WRT-1900AC will support Dynamic Frequency Selection(DFS) by a newer Firmwareupdate?
    I don't understand why this feature has not been added yet
    Second why does i have to set the 5GHZ WLAN to mixed to use AC. for me it is better when there is a Mode AC only.
    thanks for your help

    http://en.wikipedia.org/wiki/Channel_allocation_schemes
    Your best bet would be to phone contact your regional Linksys support office and ask them about this. Ask them if this model doesn't support it, which one does, if any. Let us know how it goes please.

  • Help with ecomerce and dynamic table link

    I am new to dynamic pages. I am trying to build or use a
    template to display my tables.
    Here is an example of what I want to do.
    http://www.snaz75.com/ if you
    click on any of the links on the left side, it brings up the
    products on the right. I know this is done through tables. I have
    the website built and the tables built, but don't know how to get
    the product to display dynamically without manually adding each
    item.
    I am using yahoo e-commerce and have downloaded their table
    formats. I have all the tables created and uploaded to my hosting.
    I am trying to use these tables to display my product in a simple
    way. Yahoo has a site builder where you can build tables and upload
    them and your product is displayed, but I am extremely limited on
    the actual design of their website builder. I want to use my
    website, but do essentially the same thing. How can I get the built
    tables display my products. I have 1000's of products and I know
    there must be a way display the item through a table using
    template.. I can't imagine someone adding one item at a time to
    their website. Any idea's where to start.

    I have checked with method GET_ATTRIBUTE_VALUEHELP_TYPE of interface IF_WD_CONTEXT_NODE_INFO, on an attribute which i know to have a search help (Foreign key of a check table).
    The method returns 'N', that is the constant IF_WD_VALUE_HELP_HANDLER~CO_VH_TYPE_NO_HELP. So, the framework was not able to find a suitable search help.
    Using method GET_ATTRIBUTE_VALUE_HELP of the same interface, on the same attribute, returns me '111', which is constant C_VALUE_HELP_MODE-AUTOMATIC.
    Therefore, the WD framework knows it has to automatically detect a value help, but fails to find one.
    Also, this means in my opinion that the ALV and the dynamic external mapping are not the culprits: since node creation, no help is detected for any attribute but the date. Honestly, I don't have a clue on what's happening.

  • User Entered - Required and dynamic table

    Hi all,
    I am using LiveCycle Designer 7.1, and I need a little help with scripting. In my form I have a page with three major questions. underneath each questions I have the sentence "If the answer is YES:" and some questions that relate to major question above them. My task is if the user choose YES in the major question all the questions that related to the major should become "User Entered - Required". How can I do That?
    Secondly, In the same form I have a page with dynamic table. The last column of the table is percentage, and I need that column values won't cross the 100%. Please help me
    Thanks in advance
    Idan

    I believe the intent is to warn instead of annoy the user with repeated notices that a required field hasn't been filled (which is why it doesn't fire on subsequent tabbing).
    The Empty Message should be displayed whenever the value of the required field goes from something to nothing (e.g. the value is currently set to "asdf" and you remove the value and tab out) which means that simply tabbing in and out of the required field without changing its value (whether or not it had a value in the first place) wouldn't trigger the Empty Message to be displayed. It should
    always be displayed, however, whenever you attempt to
    submit the form if the required field has no value (and Acrobat won't let you submit the form until all required fields have been filled).
    Stefan
    Adobe Systems

  • Dynamic Table selection

    Hi All,
    Please help me to resolve this Issue.
    Internal table - IT which has table name like
    KOTH600 
    KOTH601 
    KOTH602 
    KOTH603   , All these table has field KNUMH.
    Loop at IT into WA. ( which has table name in it )
    select * from (WA-TABNAME) into (New_WA)
                where KNUMH = '100010'.
    write:/ New_WA - NAME.
    Endloop.
    Here issue is table name is dynamic and depending upon this New_WA will change. How can I give both table name and work-area dynamic.  ( I do not wish to define 4 new work-area, one for each to handle this situation as number of tables will increase going further ).
    Thanks in advance,
    Regards,
    Mayank Rajguru.

    In this example you have what you are looking for. Create dinamyc tables.
    REPORT Z_DUMMY_ATG NO STANDARD PAGE HEADING MESSAGE-ID SAPLWOSA.
    *=======================================================================
    Variables*
    *=======================================================================
    DATA DESCR_STRUCT_REF TYPE REF TO CL_ABAP_STRUCTDESCR.
    DATA WA_FCAT TYPE LVC_S_FCAT.
    DATA IT_FIELDCATALOG TYPE LVC_T_FCAT.
    DATA DATAREF TYPE REF TO DATA.
    DATA: ONE  LIKE PCFILE-DRIVE,
          TWO  LIKE PCFILE-PATH,
          LONG TYPE I,
          FLAG TYPE C,
          FILEPATH(128) TYPE C,
          FILE_TAB TYPE STRING,
          TABNAME LIKE DD02L-TABNAME.
    *=======================================================================
    Field-Symbols.*
    *=======================================================================
    FIELD-SYMBOLS:
                  <ROW> TYPE ANY TABLE,
                  <TABLE> TYPE STANDARD TABLE,
                  <COMPONENT> TYPE ABAP_COMPDESCR,
                  <FS>  TYPE ANY.
    *=======================================================================
    Selection screen*
    *=======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK DATA WITH FRAME TITLE TEXT-T01.
    PARAMETERS:
        TABNAM(128) TYPE C,
        FUNCTION(1) TYPE C OBLIGATORY,
        LISTNAME LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK DATA.
    *=======================================================================
    At Selection screen*
    *=======================================================================
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR LISTNAME.
      PERFORM GET_FILENAME CHANGING LISTNAME.
    *=======================================================================
    Start-of-selection*
    *=======================================================================
    START-OF-SELECTION.
      CLEAR FLAG.
      PERFORM LOAD_DATA USING TABNAM.
      PERFORM VERIFY_TABLE USING TABNAM CHANGING FLAG.
      IF FLAG NE 'X'.
        IF FUNCTION EQ 'D'.
          PERFORM CREATE_TABLE USING TABNAM.
          PERFORM DOWNLOAD_TABLE USING TABNAM.
        ELSE.
          PERFORM CREATE_TABLE USING TABNAM.
          PERFORM UPLOAD_TABLE USING TABNAM.
        ENDIF.
      ELSE.
        MESSAGE S000 WITH 'The proposed table doesn''t exist.'.
      ENDIF.
          FORM GET_FILENAME                                             **
          Name of the directory.*
    FORM GET_FILENAME CHANGING LISTNAME.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_FILENAME     = LISTNAME
                DEF_PATH         = 'C:\downloads\list'
                MASK             = ',.,.. '
                MODE             = 'S'
                TITLE            = 'Save as'
           IMPORTING
                FILENAME         = LISTNAME
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
    ENDFORM.
          FORM LOAD_DATA                                                **
          Specifies the path and table name*
    FORM LOAD_DATA USING MY_TAB.
      DATA: W_FILE LIKE PCFILE-PATH.
      W_FILE = LISTNAME.
      CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
           EXPORTING
                COMPLETE_FILENAME = W_FILE
           IMPORTING
                DRIVE             = ONE
                PATH              = TWO
           EXCEPTIONS
                INVALID_DRIVE     = 1
                INVALID_EXTENSION = 2
                INVALID_NAME      = 3
                INVALID_PATH      = 4
                OTHERS            = 5.
      CONCATENATE ONE ':' TWO INTO FILEPATH.
      CONCATENATE FILEPATH MY_TAB '.txt' INTO FILE_TAB.
    ENDFORM.
          FORM DOWNLOAD_TABLE                                           **
          Downloads the table data.*
    FORM DOWNLOAD_TABLE USING MY_TAB.
      *SELECT **
      INTO TABLE <ROW>
      FROM (MY_TAB).
      ASSIGN <ROW> TO <TABLE>.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
                FILENAME                = FILE_TAB
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = <TABLE>
           EXCEPTIONS
                FILE_WRITE_ERROR        = 1
                NO_BATCH                = 2
                GUI_REFUSE_FILETRANSFER = 3
                INVALID_TYPE            = 4
                NO_AUTHORITY            = 5
                UNKNOWN_ERROR           = 6.
      IF SY-SUBRC EQ 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Successful Download'
                  TXT1  = 'All the data from the table'
                  TXT2  = 'was correctly downloaded.'.
      ELSE.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Download Error!'
                  TXT1  = 'The data of the table'
                  TXT2  = 'couldn''t be downloaded.'.
      ENDIF.
    ENDFORM.
          FORM UPLOAD_TABLE                                           **
          Table Upload.*
    FORM UPLOAD_TABLE USING MY_TAB.
      ASSIGN <ROW> TO <TABLE>.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                FILENAME                = FILE_TAB
                FILETYPE                = 'ASC'
           IMPORTING
                FILELENGTH              = LONG
           TABLES
                DATA_TAB                = <TABLE>
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_READ_ERROR         = 2
                NO_BATCH                = 3
                GUI_REFUSE_FILETRANSFER = 4
                INVALID_TYPE            = 5
                NO_AUTHORITY            = 6
                UNKNOWN_ERROR           = 7.
      MODIFY (MY_TAB) FROM TABLE <TABLE>.
      IF SY-SUBRC EQ 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Successful Upload'
                  TXT1  = 'All the data from the table'
                  TXT2  = 'was correctly uploaded.'.
      ELSE.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  TITEL = 'Upload Error!'
                  TXT1  = 'The data of the table'
                  TXT2  = 'couldn''t be uploaded.'.
      ENDIF.
    ENDFORM.
          FORM CREATE_TABLE                                             **
          Creates a dynamic internal table.*
    FORM CREATE_TABLE USING MY_TAB.
      CREATE DATA DATAREF TYPE (MY_TAB).
      ASSIGN DATAREF-> TO <FS>.*
      DESCR_STRUCT_REF ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <FS> ).
      LOOP AT DESCR_STRUCT_REF->COMPONENTS ASSIGNING <COMPONENT>.
        WA_FCAT-FIELDNAME     = <COMPONENT>-NAME.
        WA_FCAT-REF_TABLE     = MY_TAB.
        WA_FCAT-REF_FIELD     = <COMPONENT>-NAME.
        APPEND WA_FCAT TO IT_FIELDCATALOG.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
         EXPORTING
           IT_FIELDCATALOG           = IT_FIELDCATALOG
         IMPORTING
           EP_TABLE                  = DATAREF
         EXCEPTIONS
           GENERATE_SUBPOOL_DIR_FULL = 1
           OTHERS                    = 2.
      ASSIGN DATAREF-> TO <ROW>.*
    ENDFORM.
    *&      Form  VERIFY_TABLE
          The table must exist!*
    FORM VERIFY_TABLE USING TABNAM CHANGING FLAG.
      SELECT SINGLE TABNAME
      INTO (TABNAME)
      FROM DD02L
      WHERE TABNAME EQ TABNAM.
      IF SY-SUBRC NE 0.
        FLAG = 'X'.
      ENDIF.
    ENDFORM.

  • Dynamic Table Selection function module

    Dear Friends,
      We have got critical requirement on Custom BAPI function module :
         we have to pass one field name of table and table name : Eg (Matnr and MARC).
         we have to get table contents w.r.t field name of table and table : Has to display MARC based on Matnr.
    (It is something like we display table contents in SE11 and SE16, Our requirement is to get the data by giving  random field name of table and table name ).
    My View : Imports Tab of F.M of is static
                   Tables Tab of F.M could be dynamic....if so how to achieve or any other approach?
    Note :  Eg1 : Matnr and MARA  (Input to F.M) -
    > Get MARA contents (Table from F.M)
               Eg2 : Matnr and MARC (Input to F.M) -
    > Get MARC contents (Table from F.M)
               Eg3 : Lifnr and LFA1 (Input to F.M)  -
    > Get LFA1 contents (Table from F.M)       
               Eg1 : Ebeln and EKKO (Input to F.M)  -
    > Get EKKO contents (Table from F.M)
    Awaiting for positive and quick views.
    Regards
    Sekhar

    Dear Sarcevic,
       I have created zfunction module with imports and tables.
      I'm able to manage import parameters as dynamical, but tables declaration gives fuzzy.
      How do we make tables tab declaration in function module as dynamic? any other views?
    Regards
    Sekhar

  • Dynamic table  selection from database

    Hi ;
    I want to create  variable field that I will use at database selection.I tried to do it with   select *  from ( tabname )..... but I couldn't do it how you any offer fot this issue.

    Hi,
    DATA FCAT1 TYPE LVC_T_FCAT."fieldcat of type internal table
    DATA:DYN_ITAB TYPE REF TO DATA,"holding the dynamic internal table
    WA TYPE REF TO DATA."holding the wa for dynamic internal table
    FIELD-SYMBOLS: <DISP_TABLE> TYPE TABLE,
    <WA> TYPE ANY.
    SELECT SINGLE tab_name FROM table INTO DB_TABLE.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
            EXPORTING
              I_STRUCTURE_NAME = DB_TABLE
            CHANGING
              CT_FIELDCAT      = FCAT1[].
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE"creating dynamic internal table using fieldcat
        EXPORTING
        IT_FIELDCATALOG = FCAT1[]
        IMPORTING
        EP_TABLE = DYN_ITAB.
        ASSIGN DYN_ITAB->* TO <DISP_TABLE>."creating internal table by refering the dynamically generated internal table structure
        CREATE DATA WA LIKE LINE OF <DISP_TABLE>."creating work area for the internal table
        ASSIGN WA->* TO <WA>.
        SELECT * FROM (DB_TABLE) INTO <WA> UP TO MAX_HITS ROWS."filling the internal table
        APPEND <WA> TO <DISP_table>.
        ENDSELECT.
    <b>REWARD ALL HELPFUL ANSWERS.</b>
    rgds,
    bharat.
    Message was edited by:
            Bharat Kalagara

  • Finding column count with dynamic columns and dynamic tables

    I've done some PL/SQL for awhile now but was trying to devise a solution for the following problem:
    I wish to find the number of times a specific value for a column exists in all the tables that contain the field and I have access to see with the current user. The column name and value will be passed in via parameters.
    I was hoping to use something like
    select table_name from all_tab_columns where column_name = <variable table name>;
    then use the results from this to create a select statment based off the tables from the select above. I know the difference between dba_tab_columns and all_tab_columns - I want to make sure that I only retrieve the values i have access to.
    Can anyone point me to some guide / website / reference material I can read to catch up on the idea of creating this statment?
    Thank you.

    Hi,
    it's a test version.
    You can naturally tune it, but it seemed to work:
    declare
    pi_column VARCHAR2(30) := 'DEPTNO';
    pi_value VARCHAR2(4000) := '20';
    v_count NUMBER := 0;
    v_count_tab NUMBER;
    BEGIN
    FOR I IN (select owner, table_name from dba_tab_columns
              where column_name = pi_column
    LOOP
        EXECUTE IMMEDIATE 'SELECT count(*) FROM '||i.owner||'.'||i.table_name||
                          ' WHERE '||pi_column||' = :pi_value'  INTO v_count_tab USING pi_value; 
        v_count := v_count + v_count_tab;
    END LOOP;                   
    dbms_output.put_line(v_count);
    END;Regards

  • Dynamic Table Selection in Forms?

    Hi,
    In form creation the options available are,
    1. Selecting schema name(only one)
    2. Selecting table name(only one).
    My requirement is we are having same table in many schemas. We need to create a form on this table but user should be given with a list to select the schema name they want so the form should point to table from the selected schema.
    Is it possible?
    Thanks,
    karthick
    Actually we dont even have separate schemas in Apex. We are connectin to different schemas using DBLINK's feature of oracle.
    But if it possible to switch between schemas present in the Apex means then that will be fine for me as of now

    Anyone faced this issue before?
    Please help
    Edited by: kart on Jun 16, 2010 3:58 PM
    Edited by: kart on Jun 17, 2010 12:30 PM

  • SAPScript and dynamic tray selection

    Hi,
    A customer of mine has 2 identical SAPScript layout sets defined with 1 minor difference - within the page attributes a different printer tray has been defined (attribute called resource name) in order to choose a different printer tray ...
    I was wondering wether this value could not be dynamically set by the SAPScript output program (when opening the layout set or using a specific command) ?
    I didn't really find any special function or parameter in the open_form function module ... I find it a shame that only for the tray functionality we have to maintain 2 layout sets ...
    Or can this be achieved in a total different way?
    Thanks,
    Steven

    I am not sure if you can change Tray attribute on a page dynamically from print program.
    But I have a suggestion, Why don't you create two pages identical in one single SAPScript just with the Tray different on each one. And call appropriate page while printing dynamically from your program using Function "CONTROL_FORM".
    Advantage in this approach is, you do not need to maintain two different SAPScripts. And all code maintenance in SAPScript is common to both the pages, so do not need to make changes twice.
    Limitation is if you resize any window in one page need to do the same on the other page too. This is still OK because usually you do not resize as often as you make changes in the code.
    Shashi Reddy

  • MVC: Where to find the model and the table select in standard BSP apps?

    Hello!
    We are going to use MSS with the appraisal-application
    which is written in BSP and 'e-recruiting'. Both applications use the MVC-design pattern. We are going to do some modifications, but are struggling a bit since MVC is a new topic for us. How is the best way to get an overview of the controllers and views and call sequences in an existing application? We have done this by debugging, but are there other ways to find the 'starting controller', etc. ?
    Where can we find the model-code which reads the table-values into the internal table?
    We have read a lot about how nice MVC is - how the design gives you a better overview of the application. But without any docuemtation of the design we are quite lost. What are others experiences on this?
    regards Tine

    Hi Tine,
    let's see if I can answer your questions (at least partially).
    The main controller is the one you normally call directly in your browser (or after some introduction pages like login etc.). It's typically called start.do or main.do (but can differ). So if you call in the browser:
    http://myhost.domain:4711/sap/bc/bsp/sap/myappl/start.do,
    just call se80, choose the application myappl and double-click on start.do. There you can get the name of the controller class (just double-click on the class name).
    The standard model class is called CL_BSP_MODEL. The model classes from the application inherit from this class.
    For a complete documentation please have a look at the online docu:
    http://aiokeh.wdf.sap.corp:1080/SAPIKS2/contentShow.sap?_SCLASS=IWB_STRUCT&_SLOIO=EDBB153AAB4A0C0EE10000000A114084&TMP_IWB_TASK=PREVIEW2&RELEASE=640&LANGUAGE=DE&_SEQNUM=106&_LOIO=0FAB3A3C9CA75402E10000000A114084&_CLASS=IWB_EXTHLP
    There are also some weblogs written by Craig Cmehil where you can get examples.
    Hoping this helps a little bit.
    Regards,
    Rainer

Maybe you are looking for