Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Domain length

Former Member
0 Kudos

Hi Experts,

What is the domain that i can use to hold a description of more than 300 -1000 chars? when i create zchar300 it is saying that max length is 1-255.

pls help.

14 REPLIES 14

former_member181962
Active Contributor
0 Kudos

HI dan,

There are data elements of lenght 1000 .

Eg:

CHAR1000SF

Regards,

Ravi

Former Member
0 Kudos

Hi Dan

If you need a field longer than 255 char u can use a field of LCHR type (for example LCHAR1000) but you need to insert a new field for the length of type INT2.

So you can create a your data element using the domain LCHAR1000, so your table will have two fields:

ZLEN TYPE INT2

ZSTRING TYPE LCHAR1000

Max

Former Member
0 Kudos

check dataelement CHAR1000SF which is of 1000 length

0 Kudos

Hi All,

Thanks! but it says that "CHAR1000SF is not active or does not exits"

if i give Text300<Field> is too long (Specify a length between 1 and 255)

Pls suggest.

0 Kudos

Hi Dan

Search a data element using a LCHR type, for example LCHAR1000

Max

0 Kudos

Hi All,

I am unable to activate the dataelement / table if i use CHARA1024 or LCHAR1000..etc.

"it generates warning occured during activation" and the log has

Field NOTES is too long (Specify a length between 1 and 255)

Output length (1024) larger than maximum output length (255) in screens

Pls suggest me experts. its urgent

0 Kudos

Hi Dan,

Why can't you use the FMs' that I indicated before instead of fields in the table?

Regards,

Gilberto Li

0 Kudos

Hi Gilberto Li,

But first i need to make an entry for the field description into my ztable & then i should read the data for that field from that table .

0 Kudos

Hi Dan,

No, you don't need to make an entry for the field description in your ztable.

The flow of the process would be something like this:

1. Save the data into the ztable, create and save the description with FM CREATE_TEXT, EDIT_TEXT and SAVE_TEXT:


        CALL FUNCTION 'CREATE_TEXT'
             EXPORTING
                  fid         = 'VBBK'
                  flanguage   = sy-langu
                  fname       = lv_name
                  fobject     = 'ZMAN'
                  save_direct = 'X'
                  fformat     = ' '
             TABLES
                  flines      = tlines
             EXCEPTIONS
                  no_init     = 1
                  no_save     = 2
                  OTHERS      = 3.
        v_header-tdobject   = id.
        v_header-tdname     = name.
        v_header-tdid       = 'TXT'.
        v_header-tdspras    = sy-langu.
        v_header-tdform     = 'SYSTEM'.
        v_header-tdlinesize = '072'.
        v_header-tdtxtlines = '00002'.

*       EDIT TEXT
        CALL FUNCTION 'EDIT_TEXT'
             EXPORTING
                  editor_title  = v_title
                  header        = v_header
                  save          = ' '
             IMPORTING
                  newheader     = v_header
                  result        = v_result
             TABLES
                  lines         = tlines
             EXCEPTIONS
                  id            = 1
                  language      = 2
                  linesize      = 3
                  name          = 4
                  object        = 5
                  textformat    = 6
                  communication = 7
                  OTHERS        = 8.


data : x_header TYPE thead.
to populate the data into SAVE_TEXT,you should know the values for the below fields.
  x_header-tdobject = 'VBBK'.  
  x_header-tdname   = lv_name . <--your material no
  x_header-tdid     = 'ZMAN'.
  x_header-tdspras  = 'E'.
 
 
LOOP AT IT_TEXT .
    IT_TLINES-TDFORMAT = '*'.
    IT_TLINES-TDLINE = IT_TEXT-LINE.
    APPEND IT_TLINES.
    CLEAR  IT_TLINES.
  ENDLOOP.
 
  CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
      CLIENT                = SY-MANDT
      HEADER                = X_HEADER
*       INSERT                = ' '
      SAVEMODE_DIRECT       = 'X'
*       OWNER_SPECIFIED       = ' '
*       LOCAL_CAT             = ' '
*     IMPORTING
*       FUNCTION              =
*       NEWHEADER             =
    TABLES
      LINES                 = IT_TLINES
     EXCEPTIONS
       ID                    = 1
       LANGUAGE              = 2
       NAME                  = 3
       OBJECT                = 4
       OTHERS                = 5
            .
  IF SY-SUBRC <> 0.
*--ERROR.
  ELSE.
*--SUCCESS.
  ENDIF.

2. If you want to retrieve your text description, use the same key you used to save the description:

   CALL FUNCTION 'READ_TEXT'
         EXPORTING
              id                      = 'ZMAN'
              language                = sy-langu
              name                    = 'lv_name'
              object                  = 'VBBK'
         TABLES
              lines                   = tlines
         EXCEPTIONS
              id                      = 1
              language                = 2
              name                    = 3
              not_found               = 4
              object                  = 5
              reference_check         = 6
              wrong_access_to_archive = 7
              OTHERS                  = 8.

The idea is to use the key of the record as the name. So for example the name for a PO item would be:

PO number + PO item

Hope this gives you an idea.

Regards,

Gilberto Li

Message was edited by:

Gilberto Li

Message was edited by:

Gilberto Li

0 Kudos

Hi Gilberto Li ,

Thanks a lot but i need to enter the descriotion of the field in SM30. This will be done by a func guys as & when required.

Could you pls help me in any other ways?

thanks

Dany

Former Member
0 Kudos

Hi,

Check the domain CHARA1024.

Regards,

Sruthi

Former Member
0 Kudos

Hi Dan,

To hold a description of 1000 chars you should use the FMs':

READ_TEXT

EDIT_TEXT

SAVE_TEXT

And use the key table so you can search for the description belonging to a specific row. This is usually a good practice, instead of creating a field of that size in the table.

Hope it helps.

Regards,

Gilberto Li

ferry_lianto
Active Contributor
0 Kudos

Hi Dan,

Have you looked domain STRING?

Regards,

Ferry Lianto

0 Kudos

Hi,

STRING is not allowed for maintenance (SM30).