<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: output length problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706373#M1578595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i have taken the approach of  give up using D type and use C type, now the code works very much fine.&lt;/P&gt;&lt;P&gt;Thanks a lot for your suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code, where i have implemented C instead of D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT int INTO wa_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      descr_ref = cl_abap_elemdescr=&amp;gt;describe_by_name( wa_xx-char ). " Element description&lt;/P&gt;&lt;P&gt;      WRITE: / 'Typename:', descr_ref-&amp;gt;absolute_name.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Length  :', descr_ref-&amp;gt;length.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Decimals:', descr_ref-&amp;gt;decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      abap_typekind_l = descr_ref-&amp;gt;type_kind.&lt;/P&gt;&lt;P&gt;    CATCH cx_dynamic_check INTO exc_obj.&lt;/P&gt;&lt;P&gt;      abap_typekind_l = 'C'.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;  l_elem_descr ?= cl_abap_elemdescr=&amp;gt;describe_by_name( wa_xx-char ).&lt;/P&gt;&lt;P&gt;  output_len = l_elem_descr-&amp;gt;output_length.  " output length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF  abap_typekind_l  IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'C'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'N'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_n( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'D'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'T'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_comp-name = wa_xx-char.&lt;/P&gt;&lt;P&gt;  l_comp-type ?= l_elemtype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND l_comp TO lt_comp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i face a peculiar problem. See in SAP BI a characteristic info object can be with data type (c,n,d,t,UNIT, CUKY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my code works well for the data types c,n,d,t, but if the data type is either UNIT or CUKY then my code throws exception "type_not_found.". This is because the method "describe_by_name" does not create the data type. Also i cannot use try...end try, as the exception is not propagated to the code. otherwise i could catch the same and convert the type to 'C'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further investigation i have found the method "CREATE_ELEMDESCR_OBJECT" but i am not aware of how to use the same to attain my goal. Any help is much appreciated. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Mar 2011 14:45:35 GMT</pubDate>
    <dc:creator>lakshminarasimhan_n4</dc:creator>
    <dc:date>2011-03-10T14:45:35Z</dc:date>
    <item>
      <title>output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706370#M1578592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a dynamic structure and a dynamic internal table and I have populated the dynamic internal table with values.&lt;/P&gt;&lt;P&gt;For the above operations, I have used RTTS(Runtime Type Services). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see my code below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF xx,&lt;/P&gt;&lt;P&gt;  char(100) TYPE c,&lt;/P&gt;&lt;P&gt;  END OF xx.&lt;/P&gt;&lt;P&gt;DATA : wa_xx LIKE xx.&lt;/P&gt;&lt;P&gt;DATA : int LIKE STANDARD TABLE OF xx.&lt;/P&gt;&lt;P&gt; " The internal table 'int" contains all of the "data elements", upon which structure and table needs to be created&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:l_elem_descr  TYPE REF TO cl_abap_elemdescr,&lt;/P&gt;&lt;P&gt;l_struct_descr TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;l_table_descr TYPE REF TO cl_abap_tabledescr,&lt;/P&gt;&lt;P&gt;l_comp TYPE cl_abap_structdescr=&amp;gt;component,&lt;/P&gt;&lt;P&gt;lt_comp TYPE cl_abap_structdescr=&amp;gt;component_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;wa&amp;gt; TYPE ANY, &amp;lt;itab&amp;gt; TYPE STANDARD TABLE, &amp;lt;comp_trg&amp;gt; TYPE ANY,&amp;lt;comp_trg&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" looping through each value of internal table and creating a element of that type&lt;/P&gt;&lt;P&gt;LOOP AT int INTO wa_xx.&lt;/P&gt;&lt;P&gt;  l_elem_descr ?= cl_abap_elemdescr=&amp;gt;describe_by_name( wa_xx-char ). u201Cwa-char contains data elements&lt;/P&gt;&lt;P&gt;  l_comp-type = l_elem_descr.&lt;/P&gt;&lt;P&gt;  l_comp-name = wa_xx-char.&lt;/P&gt;&lt;P&gt;  WRITE : / l_elem_descr-&amp;gt;output_length. &lt;/P&gt;&lt;P&gt;  APPEND l_comp TO lt_comp.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Creating a structure from the list of elements available in the table lt_comp&lt;/P&gt;&lt;P&gt;u201C We have element name and its data type with size&lt;/P&gt;&lt;P&gt;u201C But we do not have its output length&lt;/P&gt;&lt;P&gt;IF  lt_comp IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      l_struct_descr  = cl_abap_structdescr=&amp;gt;create( lt_comp ).&lt;/P&gt;&lt;P&gt;      CREATE DATA dref TYPE HANDLE l_struct_descr.&lt;/P&gt;&lt;P&gt;      ASSIGN dref-&amp;gt;* TO &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_struct_creation INTO gcx_sy_struct_creation.&lt;/P&gt;&lt;P&gt;      gv_msg_txt = gcx_sy_struct_creation-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;      MESSAGE gv_msg_txt TYPE 'E'.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" ETK_ROW is a table which contains values for the dynamically created table&lt;/P&gt;&lt;P&gt;u201CThese values must be supplied to &amp;lt;wa&amp;gt; and later &amp;lt;wa&amp;gt; must be inserted to &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;LOOP AT etk_row INTO etk_wa. &lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT count OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;comp_trg&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;comp_trg&amp;gt; = etk_wa-chavlext.&lt;/P&gt;&lt;P&gt;   UNASSIGN &amp;lt;comp_trg&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I face is the "data elements" size is obtained in &amp;lt;wa&amp;gt; but not its output length.&lt;/P&gt;&lt;P&gt;For example, I have supplied a data element u201CABCu201D to the internal table "int".&lt;/P&gt;&lt;P&gt;The data element ABC contains domain DATUM, its size is 8 and output  length is 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data contained in the etk_wa-chavlext is 03/03/2011.&lt;/P&gt;&lt;P&gt;Which is assigned to &amp;lt;wa&amp;gt;. &lt;/P&gt;&lt;P&gt;But what is see in my &amp;lt;wa&amp;gt; is 03/03/20 (because size is only 8, not 10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is,  "l_comp" is of type  cl_abap_structdescr=&amp;gt;component.&lt;/P&gt;&lt;P&gt;when I checked its structure ( cl_abap_structdescr=&amp;gt;component), it contains,&lt;/P&gt;&lt;P&gt;Component Technical type&lt;/P&gt;&lt;P&gt;NAME 	CString&lt;SPAN __jive_macro_name="15"&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;* Name of the component&lt;/LI&gt;&lt;/UL&gt;  
TYPE          	Reference   * its type (data element)
AS_INCLUDE C(1)            *  Boolean type 
SUFFIX          CString&lt;/SPAN&gt;  * String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above structure does not contain output length. It contains only name and data type.&lt;/P&gt;&lt;P&gt;I am filling only the name and type as per the structure via the lines&lt;/P&gt;&lt;P&gt;  l_comp-type = l_elem_descr.&lt;/P&gt;&lt;P&gt;  l_comp-name = wa_xx-char. u201Cdata element&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this structure is appended to the  lt_comp and which is of type cl_abap_structdescr=&amp;gt;component_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now a structure is created based on the componenet table lt_comp,&lt;/P&gt;&lt;P&gt;l_struct_descr  = cl_abap_structdescr=&amp;gt;create( lt_comp ).&lt;/P&gt;&lt;P&gt;CREATE DATA dref TYPE HANDLE l_struct_descr.&lt;/P&gt;&lt;P&gt;ASSIGN dref-&amp;gt;* TO &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field-symbol &amp;lt;wa&amp;gt; is of type any and its structure is same as that of cl_abap_structdescr=&amp;gt;component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen that the there is a element u201Coutput_lengthu201D in the class  cl_abap_elemdescr.&lt;/P&gt;&lt;P&gt;When I checked it it contains the correct output length and this output length must be supplied to &amp;lt;wa&amp;gt; so that it accepts 03/03/2011. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way of doing it? I need my &amp;lt;wa&amp;gt;  to accept the incoming data, as per the output length mentioned in the domain of that data element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 10:57:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706370#M1578592</guid>
      <dc:creator>lakshminarasimhan_n4</dc:creator>
      <dc:date>2011-03-09T10:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706371#M1578593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no length option possible for elemdescrs get_d method .&lt;/P&gt;&lt;P&gt;But why are you passing char fields to date fields.Here your etk_wa-chavlext should be 20110303 and not 03/03/2011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to pass 03/03/2011 then your domain should be char 10 and not DATUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that first you get the elemdescr  and then use get&lt;/P&gt;&lt;P&gt;la_comp-type = cl_abap_elemdescr=&amp;gt;get_p(&lt;/P&gt;&lt;P&gt;                      p_length   = lo_element-&amp;gt;length&lt;/P&gt;&lt;P&gt;                      p_decimals = lo_element-&amp;gt;decimals ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 11:21:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706371#M1578593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-09T11:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706372#M1578594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As noticed above, the internal length for these fields are always shorter then its external one (output length). You can't therefore insert external value i.e. 31/01/2011 to field which accepts only its internal representation 20110131.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the same as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data my_date type d.

"correct
my_date = '20110131'.

"incorrect
my_date = '31/01/2011'. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How would you get this issue resolved? You wouldn't change &lt;EM&gt;my_date&lt;/EM&gt; length to accept 31/01/2011, would you? If you persisted to have it like this, you would have to use different type (character type of length 10). So either give up using &lt;STRONG&gt;D&lt;/STRONG&gt; type and use &lt;STRONG&gt;C&lt;/STRONG&gt; type of correct output length or stick to &lt;STRONG&gt;D&lt;/STRONG&gt; type and provide value's internal representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The advantage of the latter is that system takes care of any conversion for you. Therefore I would recommend to use standard FM like &lt;STRONG&gt;CONVERT_DATE_TO_INTERNAL&lt;/STRONG&gt; before passing the value to your field. Then you will have it in correct internal format and during display will convert to its external form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 12:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706372#M1578594</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-03-09T12:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706373#M1578595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i have taken the approach of  give up using D type and use C type, now the code works very much fine.&lt;/P&gt;&lt;P&gt;Thanks a lot for your suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code, where i have implemented C instead of D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT int INTO wa_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      descr_ref = cl_abap_elemdescr=&amp;gt;describe_by_name( wa_xx-char ). " Element description&lt;/P&gt;&lt;P&gt;      WRITE: / 'Typename:', descr_ref-&amp;gt;absolute_name.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Length  :', descr_ref-&amp;gt;length.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Decimals:', descr_ref-&amp;gt;decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      abap_typekind_l = descr_ref-&amp;gt;type_kind.&lt;/P&gt;&lt;P&gt;    CATCH cx_dynamic_check INTO exc_obj.&lt;/P&gt;&lt;P&gt;      abap_typekind_l = 'C'.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;  l_elem_descr ?= cl_abap_elemdescr=&amp;gt;describe_by_name( wa_xx-char ).&lt;/P&gt;&lt;P&gt;  output_len = l_elem_descr-&amp;gt;output_length.  " output length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF  abap_typekind_l  IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'C'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'N'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_n( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'D'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF abap_typekind_l EQ 'T'.&lt;/P&gt;&lt;P&gt;      l_elemtype =  cl_abap_elemdescr=&amp;gt;get_c( p_length = output_len ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_comp-name = wa_xx-char.&lt;/P&gt;&lt;P&gt;  l_comp-type ?= l_elemtype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND l_comp TO lt_comp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i face a peculiar problem. See in SAP BI a characteristic info object can be with data type (c,n,d,t,UNIT, CUKY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my code works well for the data types c,n,d,t, but if the data type is either UNIT or CUKY then my code throws exception "type_not_found.". This is because the method "describe_by_name" does not create the data type. Also i cannot use try...end try, as the exception is not propagated to the code. otherwise i could catch the same and convert the type to 'C'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further investigation i have found the method "CREATE_ELEMDESCR_OBJECT" but i am not aware of how to use the same to attain my goal. Any help is much appreciated. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 14:45:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706373#M1578595</guid>
      <dc:creator>lakshminarasimhan_n4</dc:creator>
      <dc:date>2011-03-10T14:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706374#M1578596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUKY is  Char data type of length 5 and UNIT contains domain MEINS which is of CHAR 3 .&lt;/P&gt;&lt;P&gt;So when this exception occurs you could safely create elem descr objects of the above type .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to make sure that this dataelements are available &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use  methods get_complete of class cl_reca_ddic_dtel and cl_reca_ddic_doma&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 21:00:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706374#M1578596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-10T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706375#M1578597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you have said &amp;amp; i quote, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;" The internal table 'int" contains all of the "data elements", upon which structure and table needs to be created&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't have to worry about handling UNIT or CUKY explicitly. Let's have a look at the following example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: go_elem_descr TYPE REF TO cl_abap_elemdescr,
      gs_comp       TYPE cl_abap_structdescr=&amp;gt;component.

* 'MEINS' is a data element of domain 'UNIT'
go_elem_descr ?= cl_abap_elemdescr=&amp;gt;describe_by_name( 'MEINS' ).

CHECK go_elem_descr IS NOT BOUND.

* Check the data type kind (For MEINS data type will be 'C' &amp;amp; not 'UNIT')
CASE go_elem_descr-&amp;gt;type_kind.
  WHEN cl_abap_elemdescr=&amp;gt;typekind_char.
    gs_comp-type ?= cl_abap_elemdescr=&amp;gt;get_c( go_elem_descr-&amp;gt;output_length ).
  WHEN cl_abap_elemdescr=&amp;gt;typekind_num.
*   Your Custom Logic
  WHEN cl_abap_elemdescr=&amp;gt;typekind_date.
*   Your Custom Logic
  WHEN cl_abap_elemdescr=&amp;gt;typekind_time.
*   Your Custom Logic
ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you've mentioned, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Also i cannot use try...end try, as the exception is not propagated to the code. otherwise i could catch the same and convert the type to 'C'. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because the method DESCRIBE_BY_NAME does not propagate class-based exceptions. So if you want to capture the exception you've to restore to old exception handling techniques! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: go_type_descr TYPE REF TO cl_abap_typedescr,
      go_elem_descr TYPE REF TO cl_abap_elemdescr.

cl_abap_elemdescr=&amp;gt;describe_by_name(
  EXPORTING
    p_name         = 'MEINS'
  RECEIVING
    p_descr_ref    = go_type_descr
  EXCEPTIONS
    type_not_found = 1
    OTHERS         = 2 ).
IF sy-subrc &amp;lt;&amp;gt; 0.
* Put your custom logic here to use 'C' instead of 'UNIT'
ELSE.
  go_elem_descr ?= go_type_descr.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still wondering why 'UNIT' or 'CUKY' should be bothering you &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 04:53:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706375#M1578597</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-03-11T04:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: output length problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706376#M1578598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 13:52:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/output-length-problem/m-p/7706376#M1578598</guid>
      <dc:creator>lakshminarasimhan_n4</dc:creator>
      <dc:date>2011-03-14T13:52:42Z</dc:date>
    </item>
  </channel>
</rss>

