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

Field value truncating in script

former_member420959
Participant
0 Likes
1,050

hello all,

i need to print long text of accounting document  in a form with script.

i written as below in main window of script

DEFINE &V_TEXT& = &STRING&

PERFORM GET_ITEM_TEXT IN PROGRAM ZRF1_SUBROUTINE

USING &BSEG-BUKRS&

USING &BSEG-BELNR&

USING &BSEG-GJAHR&

USING &BSEG-BUZEI&

CHANGING &V_TEXT&

ENDPERFORM

im getting text value in the perform 200 + characters but when i come out of the perform the v_text value is having only 80 characters

i declared it as sting.

Please help

Ujwal

7 REPLIES 7
Read only

Former Member
0 Likes
860

Have you looked at ZRF1_SUBROUTINE to see how it is written?  You are getting what it returns.

Neal

Read only

0 Likes
860

no it is returning a 200+ character value but getting only 80 characters into v_text

Read only

0 Likes
860

Try changing it to

PERFORM GET_ITEM_TEXT IN PROGRAM ZRF1_SUBROUTINE

USING &BSEG-BUKRS&

USING &BSEG-BELNR&

USING &BSEG-GJAHR&

USING &BSEG-BUZEI&

CHANGING &V_TEXT1&

CHANGING &V_TEXT2&

CHANGING &V_TEXT3&

CHANGING &V_TEXT4&

ENDPERFORM

and carving the return value into 4 - 80 long values.  One would suspect that this is a limitation of sapscript.

Neal

Read only

0 Likes
860

Thanks Neal,

though i didnot get answer why sting variable value is truncating , your solution worked for me.

Read only

0 Likes
860

Ujwal,

Sapscript is a VERY old interface.  They've never updated it.  That's my expectation for the answer to why... 

I'd imagine that SAP would say for you to translate your form to Smartforms or Adobe.

Neal

Read only

Former Member
0 Likes
860

Check size of variable &STRING&

Read only

Pawan_Kesari
Active Contributor
0 Likes
860

You can directly print long text in sapscript using INCLUDE command. No need to call subroutine to retrieve text.

See link below for syntax.

Including Other Texts: INCLUDE

Regards,

Pawan.