Application Development and Automation 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: 
Read only

READ_TEXT not working

Former Member
0 Likes
862

Hi ,

I have an user exit coding for Sales order processing.

This code is in the FORM Userexit_save_document_prepare.

I have a READ_TEXT function module in the code. It works fin e in all cases. But when Iam trying to delete the Sales order the READ_TEXT function is not retrieving the value of the particular Object , ID and name.

While debugging i checked the value in another session executing the function module READ_TEXT it gives the value , but it is not picking the value during the delete process. Is there any specific reason why its not reading.

Iam thinking that probably as it is in the process of deleting the order it didn't find the order reference, But how come another session shows the same value.

Regards,

Ajai

Hi ,

I have an user exit coding for Sales order processing.

This code is in the FORM Userexit_save_document_prepare.

I have a READ_TEXT function module in the code. It works fin e in all cases. But when Iam trying to delete the Sales order the READ_TEXT function is not retrieving the value of the particular Object , ID and name.

While debugging i checked the value in another session executing the function module READ_TEXT it gives the value , but it is not picking the value during the delete process. Is there any specific reason why its not reading.

Iam thinking that probably as it is in the process of deleting the order it didn't find the order reference, But how come another session shows the same value.

Regards,

Ajai

5 REPLIES 5
Read only

Former Member
0 Likes
795

Hi,

while deleting ,you mean the order number is not getting picked up ,since the reference is deleted?

How are you passing this value ? some internal table or memory field.

Try using get parameter id statement.

Thanks.

Mark points if helpful.

Read only

0 Likes
795

Rushali,

The code is in Userexit_save_document_prepare, so there is no chance of misssing the order #. I have verified that in the debugging mode too..

Regards,

Ajai

Read only

0 Likes
795

Hi,

Can you paste abap code from exit to analyse what's wrong with delete process?

Thanks.

Read only

0 Likes
795

Dude,

The code has been working since an year. Generally we never get a requirement to delete an order. So we never encountered this situation till now.

IF sy-tcode = c_value_va01 OR

sy-tcode = c_value_va02.

v_ttextid = 'Z200'.

v_ttextobject = c_value_vbbk.

v_ttextname = vbak-vbeln.

IF sy-tcode = c_value_va01.

v_ttextname = c_val_xxxxxxxxxx.

ENDIF.

REFRESH : i_tlines,

i_long_text.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = v_ttextid

language = sy-langu

name = v_ttextname

object = v_ttextobject

TABLES

lines = i_long_text

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

OTHERS = 7.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DESCRIBE TABLE i_long_text LINES v_lines.

*--- Customer Depart Number is not Exist.

IF v_lines IS INITIAL.

v_flag = 'X'.

  • message w003(znsd) with text-m02. "Commented by Anjan

  • vbak-lifsk = c_value_z9.

  • else.

ENDIF.

.........

..........

IF v_flag = 'X'.

MESSAGE w003(znsd) WITH text-m02.

vbak-lifsk = c_value_z9.

CLEAR v_flag.

ENDIF.

(***** The above warning message is the Culprit of my error while deleting the order.

Even though the value exists in that text Id Z200 READ_TEXT doesn't returns SY-SUBRC as 0.

Regards,

Ajai

Read only

0 Likes
795

Hi,

what's the value of sy-subrc in delete process for read_text ?

Thanks.