ABAP: How to Use the read_text function of Function

Source: Internet
Author: User

InSAPIn the system, there are sometimes large text content to be saved, such as: Sales and delivery(Vl03n), In the document overview , There is[Text]Item, where can I enter the text description of the large section of the document?

The first response is to find the corresponding table fields, so you may be disappointed. InSAPIn the system, the maximum length of database fields that can be used is255Text characters(Note: This may be incorrect ),For a long text, it must not be saved directly to a table field.(Note: You need to ask where to store the data.). Therefore, we need to use system functions.Read_textTo read, the following is the method of calling the function:

Data: il_tline like tline occurs 0 with header line.

Vl_tdname like thead-tdname.

Call function 'read _ text'

Exporting

Client= Sy-mandt

ID= 'Z001'

Language = '1'

Name= Vl_tdname

Object= 'Vbbk'

 

*Archive_handle= 0

*Local_cat=''

*Importing

*Header=

Tables

Lines= Il_tline

Exceptions

ID= 1

Language= 2

Name= 3

Not_found= 4

Object= 5

Reference_check= 6

Wrong_access_to_archive= 7

Others= 8

.

If sy-subrc <> 0.

*Message ID SY-MSGID type SY-MSGTY number SY-MSGNO

*With SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

Endif.

 

 

Example aboveCodeIn, the red font part is the input and output parameters. The key to calling this function is how to find the content that each input parameter should be filled in. Next we will deliver the product in sales/out-of-sales mode.(Vl03n)For example, this section describes how to query the corresponding parameters in the [planner Remarks] text.

 

1,InputTcode:Vl03n, Displays a credential

 

 

2,In[Overview]Of[Text]Enter the modification status, and enter the corresponding paragraph text,Double-clickText Content.

 

 

3,Go to the text content line editor page and click the menu[Go to] -->[Header]

 

 

4,See, the above four rows are the parameters to be entered, where:

 

Text name:' 011000218' , CorrespondingNameParameters

Language:ZHBut here the parameter type isC (1), Cannot be used directlySY-LANGUVariable, used in my system according to different system configurations1, CorrespondingLanguageParameter,

Mark:Z001, Which is identifiedSAPSystem configuration, correspondingIDParameters

Text object:Vbbk, CorrespondingObjectParameters

Compared with the read_text function, there is a save_text that is used to write text fields in the system. The specific user and read_text are basically similar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.