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

Former Member
0 Likes
1,122

hi to all

plz help me in this issue

i captured text in subroutine of the script as below

there the address field consits of standard text anmes for differnt comapny codes

select single * from zsd

where bukrs eq p_bukrs

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'ST'

LANGUAGE = 'EN'

NAME = ZSD-ADDRESS

OBJECT = 'TEXT'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = L_TEXT.

  • 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.

this standard text i need to pass to script layout notw it has captured in table as above l_text

how to pass this l_text to script assdress layout

Message was edited by:

kiran reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,086

hi u can use include

but if u r using write_form

u need to pass element name, window name .

11 REPLIES 11
Read only

Former Member
0 Likes
1,086

hi,

this code is in u r driverprogram right?

if yes,

then call u r script in driver program .define a text element for the address window call write_form and loop this function

loop at l_text into wa.

call function write_form.

endloop.

Read only

0 Likes
1,086

hi is there no need to do anything in the script layout other than this can i use include for this.

in write form what parametes we need to pass.

thanks & Regards

kiran reddy

Message was edited by:

kiran reddy

Read only

Former Member
0 Likes
1,086

Hi Kiran,

You don't need to use read_text if you want to include it in a sapscript/form.

Just use the following statement in your page/window:

 /:   INCLUDE ZSD-ADDRESS OBJECT TEXT ID ST 

Erwan

Read only

Former Member
0 Likes
1,086

Hi,

This will be in a perform in teh driver program right?

In SAPSCRIPT text editor

write

PERFORM ..... and specify program name like

PERFORM GET_VBAK_DATA IN PROGRAM  ZTEST            
                                USING    &VBDKA-VBELN(K)&  
                                USING   &VBDKA-LAND1(K)&   
                                CHANGING &TEXT1&           
                                CHANGING &CMIR_IND&        
ENDPERFORM

Read only

Former Member
0 Likes
1,087

hi u can use include

but if u r using write_form

u need to pass element name, window name .

Read only

0 Likes
1,086

Kiran,

In the window/page you want the text, just create a text element and put the above statement ( include .... )

In the "print" program just call the element in your write_form.

Erwan

Message was edited by:

Erwan LE BRUN

Read only

0 Likes
1,086

hi nakul,

i got data in internal table l_text from read_text fm then using write_form

looping l_text. to address window

but after that how to keep this l_text in address window in layout

how can we include internla table in address window.

thanks & Regards

Kiran reddy

Read only

Former Member
0 Likes
1,086

hi,

loop at itab into wa.

calll this wa in u r text editor &wa-<fieldname>&

Read only

0 Likes
1,086

hi nakul in text editor in an include command or same as ur code

tanks

kiran reddy

Read only

0 Likes
1,086

Hi Kiran,

To display the contents in your internal table in the script you can try the following. In the driver program use

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'ADDRESS'

EXCEPTIONS

UNOPENED = 1

UNSTARTED = 2

OTHERS = 3.

CALL FUNCTION 'WRITE_FORM_LINES'

EXPORTING

FUNCTION = 'SET'

HEADER = THEAD

TYPE = 'BODY'

WINDOW = 'MAIN'

TABLES

LINES = I_text

EXCEPTIONS

FUNCTION = 1

TYPE = 2

UNOPENED = 3

UNSTARTED = 4

WINDOW = 5

BAD_PAGEFORMAT_FOR_PRINT = 6

SPOOL_ERROR = 7

CODEPAGE = 8

OTHERS = 9.

If useful reward points.

Regards,

Kalpana.

Read only

Former Member
0 Likes
1,086

hi,

no need to use an include

under the text element u defined

just mention &wa-<fieldname>&

cheers!