Skip to Content

Error type y0bs_Dev is unknown in read_text and save_text FM.

Hello all i am using a container and want to save its text by se75 (text object and ID)

by using a FM of read text and save text I am getting this error type y0bs_dev is unknown below is the code which i am using . Also tell me is this code correct?

FORM get_comments

USING p_Devobjid TYPE y0bs_Dev-objid.

DATA: e_header TYPE thead.

DATA: i_tline TYPE STANDARD TABLE OF tline.

e_header-tdobject = 'ZCHD_OBJ'.

e_header-tdid = 'Y0B1'.

e_header-tdspras = sy-langu.

e_header-tdlinesize = 72.

CONCATENATE p_Devobjid e_header-tdid INTO e_header-tdname.

CALL FUNCTION 'READ_TEXT'

EXPORTING client = sy-mandt

id = e_header-tdid

language = e_header-tdspras

name = e_header-tdname

object = 'ZCHD_OBJ'

TABLES lines = i_tline

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

ENDFORM.

FORM save_comments

DATA: e_header TYPE thead,

i_header TYPE STANDARD TABLE OF thead,

w_tline TYPE tline,

i_tline TYPE STANDARD TABLE OF tline WITH HEADER LINE.

e_header-tdobject = 'ZCHD_OBJ'.

e_header-tdid = 'Y0B1'.

e_header-tdspras = sy-langu.

e_header-tdlinesize = 72.

CONCATENATE y0bs_Dev-objid e_header-tdid INTO e_header-tdname.

APPEND 'DevComments for Obj 1" to i_tline-tdline.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

client = sy-mandt

header = e_header

savemode_direct = 'X'

TABLES

lines = i_tline

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

IF sy-subrc <> 0.

ENDIF.

ENDFORM.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 09 at 07:24 AM

    Hi Syed.

    "y0bs_dev is unknown below is the code which i am using

    The error clearly showing the variable name which is used is wrong. Always do check the line number and error clearly before creating the thread. In concatenate statement instead of y0bs_Dev-objid variable(which is not declared) use p_Devobjid variable.

    "Old Statement
    CONCATENATE y0bs_Dev-objid e_header-tdid INTO e_header-tdname.
    "New statement
    CONCATENATE p_Devobjid-objid e_header-tdid INTO e_header-tdname.
    Add comment
    10|10000 characters needed characters exceeded

    • "1) error that "y0bs_Dev" is unknown.

      Error is clear, datatype y0bs_Dev is unknown. Declare it and use it.

      2) error TDLINE is not an internal table?

      Again it is clear TDLINE is not internal/deep table. Why are you using append statement then.

      Use help.sap.com for ABAP statement. .

      MOVE 'DevComments for Obj 1" to w_tline-tdline.
      APPEND W_TLINE TO i_tline