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: 

Error type y0bs_Dev is unknown in read_text and save_text FM.

former_member554223
Participant
0 Kudos

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.

3 REPLIES 3

rajkumarnarasimman
Active Contributor

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.

0 Kudos

Hi Raj thank you for your response

it gives me error in the start line

FORM get_comments USING p_Devobjid TYPE y0bs_Dev-objid.

1) error that "y0bs_Dev" is unknown.

another error it is giving me in this line APPEND 'DevComments for Obj 1' to i_tline-tdline.

2) error TDLINE is not an internal table?

pls help.

0 Kudos
"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