Dynamic type method

i basically want to make a method which can return any type of variable, string, char, int, double, etc.
i've heard that you can use the type 'object' to represent anything, but is there a certain way of doing this?
thank you

Flosculus wrote:
i basically want to make a method which can return any type of variable, string, char, int, double, etc.You mean, such as Map.get() for example? Well, look at that method and you'll see.
Not that Object can represent String, Character, Integer, Double, ... but not int, char, double. Those are the primitive data types and since they are not objects, you need to wrap them in their Wrapper classes (Integer, Character, ...) to be able to handle them as if they where.

Similar Messages

  • Xml conversion of data refs with dynamic type

    Hi Colleagues,
    I have to create an XML from a TYPE REF TO DATA, where this data is created using a dynamic internal table. By dynamic internal table i mean that the internal table is created dynamically using the class method cl_alv_table_create=>create_dynamic_table.
    Now the problem that i face is when i use the statement:
    CALL TRANSFORMATION id
          SOURCE jsag_data = im_context_b64
          RESULT XML lv_xml
          OPTIONS data_refs = 'embedded'
                  value_handling = 'move'.
    to generate the XML i get a dump of type CX_XSLT_SERIALIZATION_ERROR saying "The ABAP data cannot be serialized."
    I found a solution to avoid the dump by adding the additional option " TECHNICAL_TYPES = 'ignore' " to the  CALL TRANSFORMATION statement, like
    CALL TRANSFORMATION id
          SOURCE jsag_data = im_context_b64
          RESULT XML lv_xml
          OPTIONS data_refs = 'embedded'
                  value_handling = 'move'
                  TECHNICAL_TYPES = 'ignore'.
    But, using this addition the dynamic type ref to data part is totally ignored from the XML generation.
    If I use a specific DDIC table type to create the data, we do not face this issue and the XML is generated as desired
    Does anyone have a solution to this problem as it has become a sort of blockade for our development?
    Thanks and Cheers,
    Gaurav.

    Hello,
    I reached same problem with dynamic data references, the only solution I got is to used global DDIC types (also for table types !!) when creating data which needs to be serialized.
    The options technical_types = 'ignore' doesn't solve the problem - it just instructs the parser to skip data references without global ddic type. The options value_handling = 'move' is very helpful as XML serialization is very picky about values beeing serialized.
    Here is summary of my observations:
    - Global DDIC type has to be associated with data reference, otherwise only technical type is there and this is not supported (you can use OPTIONS TECHNICAL_TYPES = u2018IGNOREu2019 but this will just skip the data to be serialized to XML) u2026
    - The above means that if you are serializing data reference to table then you have to have also global DDIC type for the table-type !! Unfortunatelly there is no default table type available for transparent tables u2026. They are treated as structures not as table-types u2026 thus:
    - CREATE DATA lr_data TYPE <global_ddic_structure> - can be serialized
    - CREATE DATA lr_data TYPE STANDARD TABLE OF <global_ddic_structure> - cannot be serialized
    - CREATE DATA lr_data TYPE <global_ddic_table_type> - can be serialized
    - !! Unfortunatelly !! CREATE DATA lr_data TYPE <type_pool_ddic_structure/ type_pool_table_type> - also cannot be serialized u2013 this is pitty u2026 this should be supported u2026.

  • Dynamic Type casting

    Can we dynamically type-cast an object reference passed to Object Clss to that specific class?
    Here is what I want to do.
    I am going to pass an object reference to a method, which has Object class as parameter to it, as shown below. Using getClass() or some other way, I want to dynamically typecast this reference to the original Class and call some method of this Class.
    void test (Object ref1){
    ((ref1.getClass())ref1).writeLog();
    By doing this, am I violating the basic Object Orineted rules?

    I mean, consider an hypothetical case (which is wrong
    from OO point of view) that there are suppose 10
    classes in my system. None of them related to each
    other, all are independent classes. But each one has a
    method called, writeLog(). Now I want to write one
    method which will be called by each of these classes
    (in some 11th class), which will have "Object" as a
    parameter. Now using the actual reference I want to
    call the corresponding writeLog() method.
    1 - Point out to management that the design is now officially broken.
    2 - Point out that if the design is not fixed then any solution that impliments the changes will cost more to maintain in the future and will likely lead to instabilities in the system (due to complexity.)
    3 - Implement one of the suggested solutions and make sure that you put in a lot of error checking and logging in the hacked solution.
    4 - Produce extensive documentation about the impact of changing any of the objects that you are relying on. Push it to anyone and everyone that might ever touch or even suggest changes to the code.
    Doing all of the above allows you to live stress free when the next revision breaks because someone didn't understand the implications of your hacked solution. You will be able to find the problem quickly and point out that it had nothing to do with your code but rather because someone else did not follow the complete documentation that you produced. And then when they complain that your solution was a hack you can point out that you explained that previously as well.

  • Dynamic Type Checking... Is this possible?

    I want to do a dynamic check for objec types in a datastructure. Something very similar to instanceof but using dynamic type parameter.
    Syntactically speaking...
    Instead of writing several methods like
    public boolean isOfTypeXYZ( )
    return ( this instanceof XYZ);
    public boolean isOfTypeABC()
       return ( this instanceof ABC);
    ...I want one single method like
    public isOfType ( Class a_type)
       return (this ***isoftype**** a_type);
    }Where isoftype can somehow dynamically figure out if the object is of given type (class)
    For those who want to know why I'd need this kind of contrived behaviour let me give a simple example (similar to my real issue).
    Suppose I have a swing GUI application which has several laid out components like Containers, JPanels, JToolBars, JMenuItems, JButtons, JToggleButtons, JRadioButtons etc.
    Now starting from the JFrame in this containment hierarchy, I want to find all instances of JButtons or say all instances of JRadioButtons or say all instances of JMenuItem or all instances of JComponents ...
    I do not want to write a special method for each possible type I might encounter.
    I want a more generic method like
    searchComponents( Class a_class) that I can invoke by just changing its argument to convey the type.
    Unfortunately getClassName() will not work as that gives the most derived type of the object. I want something very much like instanceof wherein I can check for an intermediate super class as well. (eg. All RadioButtons are AbstractButton and should return true for either type).
    I tried to search for this in the forums but couldn't find something close to this. (There are several discussions about dynamic type casting which are different).

    Is this what you want?
    searchComponents( Class a_class) {
    // browse components
    if (a_class.isInstance(component)) {
    // do something
    }

  • SC BRF WF Dynamic type conflict when assigning references

    I have activated the process controlled workflow framework and
    activated the SAP provided SC BC set. When I try to create shoppping
    cart(while save or check) I get the following short dump.
    The URL
    https://usil0c20.ca.com:8343/sap/bc/webdynpro/sapsrm/wda_l_fpm_gaf was
    not called due to an error.
    Note
    The following error text was processed in the system CS2 : Dynamic type
    conflict when assigning references
    The error occurred on the application server usil0c20_CS2_00 and in the
    work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: INIT_BRF_TRACE of program /SAPSRM/CL_WF_BRF_MSG=========CP
    Method: CONSTRUCTOR of program /SAPSRM/CL_WF_BRF_MSG=========CP
    Method: INITIALIZE_BRF_MSG of program /SAPSRM/CL_WF_BRF_MSG=========CP
    Method: /SAPSRM/IF_WF_RULE_CONNECTOR~EVALUATE of
    program /SAPSRM/CL_WF_BRF_CONNECTOR===CP
    Method: /SAPSRM/IF_WF_RULE_CONNECTOR~EVALUATE of
    program /SAPSRM/CL_WF_SCHEME_PROVIDER=CP
    Method: GET_SCHEME of program /SAPSRM/CL_WF_SCHEME_PROVIDER=CP
    Method: GET_PROCESS_SCHEME of program /SAPSRM/CL_WF_CONFIGURATION===CP
    Method: CREATE_PROCESS_LEVEL_SEQUENCE of
    program /SAPSRM/CL_WF_CONFIGURATION===CP
    Method: CREATE_PROCESS_INSTANCE of
    program /SAPSRM/CL_WF_PROCESS_MANAGER=CP
    Method: CREATE_PROCESS_FORECAST of
    program /SAPSRM/CL_WF_APV_FACADE======C

    Hi,
    The dump either happens because the BRF Object SRM_WF is missing in the system or
    in  the object SRM_WF at BRF the correct trace class /SAPSRM/CL_WF_BRF_TRACE is not used on it.
    thus please check.
    Thanks,
    Melina

  • Dynamic type conflict when assigning references - Dump

    Hi All,
    I am getting the dump "Dynamic type conflict when assigning references". In my application I have used a table control inside which I have  input field, text view and text edit.
    I guess the text edit is creating the issue. The error analysis report is below :
    If anyone have any idea about the issue, please help.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_MOVE_CAST_ERROR', was not
         caught in
        procedure "IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT" "(METHOD)", nor was it
         propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        It was tried to assign a reference to a rereference variable using the
        'CAST' operation ('?=' or 'MOVE ?TO').
        However, the current content of the source variable does not fit into
        the target variable.
        source type: "\CLASS-POOL=/1WDA/L0STANDARD\CLASS=CL_TEXT_EDIT"
        target type: "\INTERFACE=/1WDA/VTABLE_CELL_EDITOR"
    Information on where terminated
        Termination occurred in the ABAP program "/1WDA/L3STANDARD==============CP" -
         in "IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT".
        The main program was "SAPMHTTP ".
        In the source code you have the termination point in line 2290
        of the (Include) program "/1WDA/L3STANDARD==============CCIMP".
        The termination is caused because exception "CX_SY_MOVE_CAST_ERROR" occurred in
        procedure "IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT" "(METHOD)", but it was
         neither handled locally nor declared
        in the RAISING clause of its signature.
        The procedure is in program "/1WDA/L3STANDARD==============CP "; its source
         code begins in line
        2034 of the (Include program "/1WDA/L3STANDARD==============CCIMP ".
    2265       if va__CONTENT_READONLY is bound and
    2266          va__CONTENT_READONLY->IFUR_NW5__CONTROL~_IID <> ifur_nw5_invisible=>_iid_invisible.
    2267         IFUR_NW5_SAPTABLECELL~HASCONTENT = abap_true.
    2268       else.
    2269         IFUR_NW5_SAPTABLECELL~HASCONTENT = abap_false.
    2270       endif.
    2271     endif.
    2272
    2273 *    >> ProvideCONTENT
    2274
    2275     IF mv_CONTENT_READONLY <> va__CONTENT_READONLY.
    2276       finalize_adapter( mv_CONTENT_READONLY ).
    2277       mv_CONTENT_READONLY ?= va__CONTENT_READONLY.
    2278     ENDIF.
    2279
    2280 *   >> property-Aggregation mv_CONTENT_EDITABLE
    2281     DATA va__CONTENT_EDITABLE TYPE REF TO /1WDA/VTABLE_CELL_EDITOR. "#EC NEEDED
    2282 *   >> UCA STANDARD|TABLE_CELL|CONTENT_EDITABLE
    2283     data adp_uielement type ref to /1WDA/VUIELEMENT. "#EC NEEDED
    2284     if mv_CONTENT_READONLY is not bound and
    2285        mv_WD_TABLE_CELL_EDITOR is bound.
    2286           va__CONTENT_EDITABLE ?= mv_CONTENT_EDITABLE.
    2287     IF va__CONTENT_EDITABLE is bound and va__CONTENT_EDITABLE->m_view_element = mv_WD_TABLE_
    2288     ELSE.
    2289
    >>>>>     va__CONTENT_EDITABLE ?= create_by_view_element(
    2291                          view_element = mv_WD_TABLE_CELL_EDITOR
    2292                          parent       = me
    2293     ).

    Hi Everyone,
    Thanks for your replies.
    We raised an OSS call for the same and got the below response.
    Dear Customer,
    I've analized your actual problem and found out that you are using a notallowed combination of text edit as cell editor within table for
    clasical Web Dynpro ABAP rendering. The text edit as cell editor work in701 releases when the lightspeed rendering is enabled. However in case
    that you want to used
    lightspeed rendering, I would suggest to upgrade on a higher
    SP level than SP4 as for technical reason we can only deliver
    corrections for Unified Rendering first from SP04.

  • CLOBs and Dynamic SQL method 4

    We have just added CLOBs ( select_dp->T == 112 ) to our applications. We have a application tier server that is a Pro*C program that reads and iterprets some "extended" .sql files. We this server uses dynamic sql method 4, with host arrays, etc. The docs say you cannot do a FETCH FOR <value> with CLOBs, but you can ALLOCATE and FREE the clobLocator with a FOR clause. What good is the ALLOCATE and FREE "FOR" if you can't FETCH with a FOR ?? Can you really select clobs along with typical varchars??

    Can you tell me exactly where are you going to use the Dynamic SQL method 4 ? so that i can help you in using the method.
    Thiagu.

  • How can I fix a xquery resulting error ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence  - got multi-item sequence

    Hello,
    How can I improve the XQuery below in order to obtain a minimised return to escape from both errors ORA-19279 and ORA-01706?
    XQUERY for $book in  fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy  where  $cont   [ora:contains(text(), "(near((The,power,Love),10, TRUE))") > 0] return $book
    ERROR:
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence
    - got multi-item sequence
    XQUERY for $book in  fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy  where  $cont   [ora:contains(., "(near((The,power,Love),10, TRUE))") > 0] return $book//bdy
    /*ERROR:
    ORA-01706: user function result value was too large
    Regards,
    Daiane

    below query works for 1 iteration . but for multiple sets i am getting following error .
    When you want to present repeating groups in relational format, you have to extract the sequence of items in the main XQuery expression.
    Each item is then passed to the COLUMNS clause to be further shredded into columns.
    This should work as expected :
    select x.*
    from abc t
       , xmltable(
           xmlnamespaces(
             default 'urn:swift:xsd:fin.970.2011'
           , 'urn:swift:xsd:mtmsg.2011' as "ns0"
         , '/ns0:FinMessage/ns0:Block4/Document/MT970/F61a/F61'
           passing t.col1
           columns F61ValueDate                Varchar(40) Path 'ValueDate'
                 , DebitCreditMark             Varchar(40) Path 'DebitCreditMark'
                 , Amount                      Varchar(40) Path 'Amount'
                 , TransactionType             Varchar(40) Path 'TransactionType'
                 , IdentificationCode          Varchar(40) Path 'IdentificationCode'                 
                 , ReferenceForTheAccountOwner Varchar(40) Path 'ReferenceForTheAccountOwner'
                 , SupplementaryDetails        Varchar(40) Path 'SupplementaryDetails'       
         ) x ;

  • Dynamic type conflict during the assignment of references. - Error while generating proxy in the backend

    Hi All,
    I get a short dump while generating a proxy in the backend.I give the package and the prefix and end up with a short dump.
    Does any one know why this mught come up
    "Dynamic type conflict during the assignment of references."
    background: I imported a WSDl provided by legacy into PI and created service interfaces and then trying to generate a proxy class while i get this error.
    Thanks.

    Hi Shyamsundar,
    I will explain a problem that I usually see in some developments:
    XSD originally:                                  XSD transformed:
    Root                                                     -> Root
    Tag 1 type int                                    -> Tag 1 type int
    Tag2 type string                               -> Tag2 type string
    Tag3 type  any                                  - Tag3 type  string
    Normally the tag3 should have a XML inside. Then the ABAPers have to construct the tag3 with  a CDATA structure (CDATA is used to put in an XML tag more XML tags inside like a text and no to be interpreted).
    Later in SAP PI you can extract the cdata with an XSL, you can find some examples in the SCN.
    I don’t like to convert the whole XML in only one string tag, because this makes difficult the develop for the ABAPers, although the work inside the PI is very easy because with an XSL you can extract the whole message easily. (You can find some examples in the SCN)
    Regards.

  • Error Dynamic type conflict when assigning references in EHP4

    Hi Experts,
    We are facing problem while customizing application wizard in EHP4.
    Based on our requirement, we need to create one more tab named "Notes" to add instructions for applicants while applying for Job. It contains only instruction. To achieve this, we have done below set up.
    1. We have created new WD component (WD window), OTR Alias
    2. Created one more additional steps in T77RCF_RM_STEP called "Notes" and maintained step 1 information
    3. In table T77RCF_RM_SEQ, under Application wizard (employee), we have added notes in sequence 1.
    Now our new tab "Notes" is reflecting in application wizard. But while cliking on send application, we are getting error "The following error text was processed in the system GEG : Dynamic type conflict when assigning references".
    Error Details:-
    u2022     The following error text was processed in the system GEG : Dynamic type conflict when assigning references
    u2022     The error occurred on the application server sapgeg_GEG_59 and in the work process 0 .
    u2022     The termination type was: RABAX_STATE
    u2022     The ABAP call stack was:
    Can anybody guide what we are doing wrong?
    It would be great help.
    Regards,
    purnima

    Hi Rajasekhar,
         Facing the same issue, can you please let me know how you solved the above issue.
    Best Regards,
    Laxman

  • How do you turn off larger dynamic type on the iphone4 when your screen orientation is locked (vertically)?

    So I have the iphone 4 with the latests update ios7.
    So I went on settings > general > accessibility > larger type.
    And I clicked "on" for "larger dynamic type"
    Now my font is so big I can't even see apps that I have and such
    I want to turn it "off" but my screen orientation is locked! (I can't move my phone horizontally) I think if I can move my phone horizontally I'll be able to see the on/off button for larger dynamic type.
    I tried sliding the bottom upwards to turn off screen lock orientation but it's not on my screen because my font is set to a really big size that the "screen orientation lock button" didn't make it to the screen

    Turning on Dynamic type and increasing it shold not have that effect.
    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset.

  • ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence

    Hi ,
    I executed the below query in database version 11.2.0.3.0, it throws the error like "ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
    with PAYMENT_XML as (
          select XMLTYPE(
            '<Document>
            <pain.002.001.02>
                <GrpHdr>
                      <MsgId>CITIBANK/20091204-PSR/4274</MsgId>
                      <CreDtTm>2009-12-04T09:36:00</CreDtTm>
               </GrpHdr>
                <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10002</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>20</OrgnlNbOfTxs>
                <OrgnlCtrlSum>7000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
              <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10001</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>202</OrgnlNbOfTxs>
                <OrgnlCtrlSum>9000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
          </pain.002.001.02>
      </Document>') as OBJECT_VALUE1
       from dual
      select R.*
      from PAYMENT_XML,
           XMLTABLE(
           'for $COMP in $COMPANY/Document/pain.002.001.02
              for $DEPT at $DEPTIDX in $COMP/OrgnlGrpInfAndSts
               return <RESULT>
                        <NAME>{fn:data($COMP/GrpHdr/MsgId)}</NAME>
                          $DEPT/OrgnlMsgId,
                          $DEPT/OrgnlNbOfTxs,
                          $DEPT/OrgnlCtrlSum,
                          $DEPT/GrpSts,
                          $DEPT/StsRsnInf/AddtlStsRsnInf
                      </RESULT>'
           passing OBJECT_VALUE1 as "COMPANY"
           columns
             NAME            VARCHAR(10)  path 'NAME',
             OrgnlMsgId      VARCHAR2(24) path 'OrgnlMsgId',
             ORGNLNBOFTXS    VARCHAR2(24) path 'OrgnlNbOfTxs',
             ORGNLCTRLSUM    NUMBER       path 'OrgnlCtrlSum',
             GRPSTS          VARCHAR2(24) path 'GrpSts',
             ADDTLSTSRSNINF  VARCHAR2(40) path 'AddtlStsRsnInf'
         ) r
    Errors comes this part :
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
    if i put the single statement for this xml element <AddtlStsRsnInf> it works fine if more than one element comes it raised the error.
    i want the output like the below format : want to merge the element value with (, comma)  delimiter with single coloumn value
    NAME
    ORGNLMSGID
    ORGNLNBOFTXS
    ORGNLCTRLSUM
    GRPSTS
    ADDTLSTSRSNINF
    CITIBANK/2
    10002
    20
    7,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL
    CITIBANK/2
    10001
    202
    9,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL, Formated
    Thanks is advance for reply
    Thanks,
    Chidam

    Try with XQuery string-join() function :
    ADDTLSTSRSNINF  VARCHAR2(40) path 'string-join(AddtlStsRsnInf, ", ")'

  • Dynamic type variable creation

    I want to create a variable with a pre-defined TYPE, but the latter will only be known at runtime.
    For instance:
    Consider that I my DEFINITIONS1 include file is:
    TYPES: BEGIN OF type1,
                    field1 TYPE i,
                    field2 TYPE i,
                    field3 TYPE i,
                END OF type1,
                  BEGIN OF cust_type_A,
                       INCLUDE TYPE type1.
    TYPES:       erdat TYPE vbak-erdat,
                  END OF cust_type_A,
                 BEGIN OF cust_type_B,
                       INCLUDE TYPE type1.
    TYPES:       fkdat TYPE vbrk-fkdat,
                  END OF cust_type_B.
    Than I have the following code (assume "letter" is a character parameter I receive, either 'A' or 'B'):
    INCLUDE definitions1.
    DATA: z TYPE REF to data.
    FIELD-SYMBOLS: <fs> TYPE ANY.
    DATA str type string.
    CONCATENATE 'MY_CUST_TYPE_' letter INTO str.
    CREATE DATA z TYPE (str).
    *  ASSIGN z->* TO <fs>.
    Why is that that the CREATE DATA z TYPE (str) statement fails ?
    How, then, I create a variable/field symbol from a specific type, which will only be known at runtime ?
    Thanks
    Avraham

    Check this code to create a dynamic type at run time using the RTTS - Run Time Type Services.
    DATA: lo_struct   TYPE REF TO cl_abap_structdescr,
          lo_element  TYPE REF TO cl_abap_elemdescr,
          lo_new_type TYPE REF TO cl_abap_structdescr,
          lo_data     TYPE REF TO data,
          lt_comp     TYPE cl_abap_structdescr=>component_table,
          lt_tot_comp TYPE cl_abap_structdescr=>component_table,
          la_comp     LIKE LINE OF lt_comp.
    DATA: lc_num TYPE char10.
    * field symbols to access the dynamic table
    FIELD-SYMBOLS: <f_line>  TYPE ANY,
                   <f_field> TYPE ANY.
    PARAMETERS: p_a RADIOBUTTON GROUP rd1,
                p_b RADIOBUTTON GROUP rd1.
    START-OF-SELECTION.
      DO 3 TIMES.
        lc_num = sy-index.
        CONDENSE lc_num.
    *   Element Description
        lo_element ?= cl_abap_elemdescr=>describe_by_name( 'INT4' ).
    *   Field name
        CONCATENATE 'FIELD' lc_num INTO la_comp-name.
    *   Field type
        la_comp-type = cl_abap_elemdescr=>get_p(
                          p_length   = lo_element->length
                          p_decimals = lo_element->decimals ).
    *   Filling the component table
        APPEND la_comp TO lt_tot_comp.
        CLEAR: la_comp.
      ENDDO.
      IF p_a = 'X'.
    *   Element Description
        lo_element ?= cl_abap_elemdescr=>describe_by_name( 'ERDAT' ).
    *   Field name
        la_comp-name = 'ERDAT'.
    *   Field type
        la_comp-type = cl_abap_elemdescr=>get_p(
                          p_length   = lo_element->length
                          p_decimals = lo_element->decimals ).
    *   Filling the component table
        APPEND la_comp TO lt_tot_comp.
        CLEAR: la_comp.
      ELSEIF p_b = 'X'.
    *   Element Description
        lo_element ?= cl_abap_elemdescr=>describe_by_name( 'FKDAT' ).
    *   Field name
        la_comp-name = 'FKDAT'.
    *   Field type
        la_comp-type = cl_abap_elemdescr=>get_p(
                          p_length   = lo_element->length
                          p_decimals = lo_element->decimals ).
    *   Filling the component table
        APPEND la_comp TO lt_tot_comp.
        CLEAR: la_comp.
      ENDIF.
    * 3. Create a New Type
      lo_new_type = cl_abap_structdescr=>create( lt_tot_comp ).
    * 5. data to handle the new table type
      CREATE DATA lo_data TYPE HANDLE lo_new_type.
    * 6. New internal table in the fieldsymbols
      ASSIGN lo_data->* TO <f_line>.
    Regards,
    Naimesh Patel

  • How to create dynamically a method of a class??

    I would like to create dynamically a method of a class. Is this possible?
    By means of a report I would like to choose a class, to which the defined method should be added and after that I would like to define the name of the method and its parameters. The result should be, that the method is added to the selected class.
    How to do this?
    Regards
    Christian

    Christian,
    looks like an interesting development project. Though I share the doubts Rich has.
    Anyway, what you could possibly do is, start a runtime analysis for SE24, open an existing class, create a new method including desired interface parameters.
    Then analyze it and see what functions/methods are used.
    But It might be more complex than expected.
    Regards,
    Clemens

  • Dynamic Type Support (or in app text size)

    Hey Claudius! After perusing the reviews for you, a main request is gaining support for dynamic type. Or having the option to change text size in app. Some consumers are straining their eyes to see small text. After Changing my app to support Dynamic Type, consumers with eye issues greatly appreiciated the changes. It didnt take very long, should be easy (hopefully) to accomplish.Thanks(hopefully this helps) Redwave Studios

    In iOS there a global setting called dynamic type;  There are API's from apple to help you if you are confused. Dynamic Type is an accessbility feature for visually challenged.

Maybe you are looking for