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: 

user exit logic problem

Former Member
0 Kudos

Hello Experts,

This is regarding to the user exit problem IN VA01.

we are having a ztable with 3 filds. when ever a sales order is

created then the header text in the sales order text type acceptance number

should be populated into this 3 filds ie 3lines of header text into 3 filds

each line into each field. We have written a code in include MV45AFZZ.

our code is like this..

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = '0001'

language = sy-langu

name = sname "sales doc is given here

object = 'VBBK'

TABLES

lines = tlines.

LOOP AT tlines.

CASE sy-tabix.

WHEN 1.

ztable-field1 = tlines-tdline.

WHEN 2.

ztable-field2 = tlines-tdline.

WHEN 3.

ztable-field3 = tlines-tdline.

ENDLOOP.

UPDATE ztable SET field1= ztable-field1

field2= ztable-field2

field3 = ztable-field3

WHERE vbeln = vbak-vbeln.

ENDIF.

this code is working fine when the user is giving the header text

when creating the order , suppose if he wont

give the header text it is giving the error message while

saving the order like "Text id 103039900.. language EN not found".

so please tell me how to handle this, ie when ever the

user gives the header text then only the

ztable should be populated if the user wont give the text

the sales order should be saved without giving this message , it means we need to

bypass the function module .

please give the answers.

Thank you so much for all the replies.

4 REPLIES 4

Former Member
0 Kudos

hi

just use

if sy-subrc = 0.

endif.

condition or check data

like if itlines[] is not initial.

endif.

with Regards

Rohan Shetty

Former Member
0 Kudos

Hi,

Check the code below:

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = '0001'

language = sy-langu

name = sname "sales doc is given here

object = 'VBBK'

TABLES

lines = tlines.

if not tlines is initial.

LOOP AT tlines.

CASE sy-tabix.

WHEN 1.

ztable-field1 = tlines-tdline.

WHEN 2.

ztable-field2 = tlines-tdline.

WHEN 3.

ztable-field3 = tlines-tdline.

ENDLOOP.

UPDATE ztable SET field1= ztable-field1

field2= ztable-field2

field3 = ztable-field3

WHERE vbeln = vbak-vbeln.

ENDIF.

endif.

Regards

Kannaiah

Former Member
0 Kudos

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = '0001'

language = sy-langu

name = sname "sales doc is given here

object = 'VBBK'

TABLES

lines = tlines.

LOOP AT tlines.

CASE sy-tabix.

WHEN 1.

ztable-field1 = tlines-tdline.

WHEN 2.

ztable-field2 = tlines-tdline.

WHEN 3.

ztable-field3 = tlines-tdline.

ENDLOOP.

if tlines[] is not initial.

UPDATE ztable SET field1= ztable-field1

field2= ztable-field2

field3 = ztable-field3

WHERE vbeln = vbak-vbeln.

ENDIF.

Former Member
0 Kudos

Hi,

While calling the function module READ_TEXT use the exceptions

(There are exceptions for the FM READ_TEXT)

ID Text ID invalid

LANGUAGE Invalid language

NAME Invalid text name

NOT_FOUND Text not found

OBJECT Invalid text object

REFERENCE_CHECK Reference chain interrupted

WRONG_ACCESS_TO_ARCHIVE

Archive handle invalid for access

also check if the table TLINES is not initial before looping it...

Regards,

lavanya