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: 

Smartforms-Text not printing completely

Former Member
0 Kudos
1,484

Hi!

In my invoice printing one of the item columns which shows the text for the material description is getting trunctaed. Those ar elong texts but when we print it only 70 caharactrs appear and the rest gets cut and dosent show on the form . The text is stored in a variable g_kdmat whose associated type is TDLINE whose lenght is 132 but I dont understnd why only 70 characters appear in my invoice printing. Can anyone help me out with this please. Urgent please.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
362

Hi,

Check out the column width where the material description is to be printed.

Thanks.

Swati.

16 REPLIES 16

Former Member
0 Kudos
362

Hi,

You can create it in s010 transaction, which doesn't have any restriction. Later you can include the standard text in the smartform.

Thanks

Virkanth

Former Member
0 Kudos
363

Hi,

Check out the column width where the material description is to be printed.

Thanks.

Swati.

0 Kudos
362

well the column width is 7 cm and if the text is longer than that it flows into the second line and thrid subsequently , but as a matter of fact its not taking more than 70 characters.

Help

Thanks

0 Kudos
362

Hi..

Try increasing the width of the coloumn in smartform..

Former Member
0 Kudos
362

Hi Aarav,

Check the width & height of the window containing the text, to check whether the window is big enuogh to hold the long text.

If you are using smartforms then why are you calling READ_TEXT function to read long text.Just use Include text option available for text, its very easy.

Create a text in smartform & Change the text type to INCLUDE TEXT from the selection in General attributes of the text.

Then provide the following text key, which you are passing to READ_TEXT function:

Text name, Object, ID and Language.

Check the checkbox : No error if no text exists, so that it will not give you error if it doesn't find any text for the selection given.

Hope this will solve your problem.

Regards,

Ravi K

Former Member
0 Kudos
362

hi,

i think you should first give the text element as included text and then put the attributes such as text-objects ,text Id etc.

And also look for the window size where you are printing the text.

Regards.

0 Kudos
362

My coding for extracting the text is as folows:

data: l_werks like vbrp-werks,

l_hlmat type ZHLMAT,

l_kunnr like vbak-kunnr,

  • l_vbeln like vbrp-vbeln,

  • l_posnr like vbrp-posnr,

l_product_key type TDOBNAME,

lt_lines type table of tline,

ls_lines type tline.

  • Get kdmat, not exist then get material sales text, not exists then Material

  • description

*

**get from kdmat

  • fill g_hlmat

if gs_gen_del-uepos = '000000'. "BOM Main

g_hlmat = gs_gen_del-material.

l_hlmat = ' '.

else.

l_hlmat = g_hlmat.

endif.

  • get g_kdmat, g_kdmtx

select single werks into l_werks from vbrp

where

vbeln = gs_vbap-vbeln and

posnr = gs_vbap-posnr.

  • get sold to

select single kunnr into l_kunnr from vbak where

vbeln = gs_vbap-vbeln.

  • select kdmat kdmtx into (g_kdmat, g_kdmtx) from zcustmat

  • where

  • parvw = ' ' and

  • kunnr = l_kunnr and "sold to

  • matnr = gs_gen_del-material and

  • werks = l_werks and

  • hlmat = l_hlmat.

*

  • endselect.

  • check sy-subrc <> 0.

    • get material sales text

concatenate gs_gen_del-bil_number gs_gen_del-itm_number into l_product_key.

call function 'READ_TEXT'

exporting

name = l_product_key

object = 'VBBP'

id = '0001'

language = sy-langu

tables

lines = lt_lines

exceptions

not_found = 1

ohters = 2.

if sy-subrc = 0.

read table lt_lines into ls_lines index 1.

move ls_lines-tdline to g_kdmat.

  • Remove sapscript special characters

replace: '<(>' in g_kdmat with ' ',

'<)>' in g_kdmat with ' '.

exit.

endif.

    • get Material description

select single arktx into g_kdmat from vbrp where

vbeln = gs_gen_del-bil_number and

posnr = gs_gen_del-itm_number.

  • vbeln = gs_vbap-vbeln and

  • posnr = gs_vbap-posnr.

if sy-subrc <> 0.

g_kdmat = 'No Product service !!!!!'.

endif.

I fail to understand why the entire text is not coming , when the window size is ok and text has place to flow into subsequent lines. Is it something to do with the associated type in global data or somet8ing else.

Thanks

Former Member
0 Kudos
362

Check whether the column width is enough to accommodate all 132 characters.

0 Kudos
362

Yes teh column width is godd enough to accommodate 132 characters

0 Kudos
362

I tried changing the column width too , by increasing it by another 2 cm but still I see only 70 characters appearing on my invoice print , Please can anyone help me out finding why is it only 70 characters and not getting extended.

Thanks

0 Kudos
362

ANy help please?

Former Member
0 Kudos
362

keep break point in smart forms...and see the value of g_kdmat just before it is printing...

especially see these offspring values

g_kdmat+72(35)

g_kdmat+100(32) etc.... to make sure these positions has some values...

also would like to know, what type of window it is...? is it a column in a main window and so and so..

0 Kudos
362

Hi!

I will try what you said and yes its a column in the main window and the column width is 7 cm .

Thanks

0 Kudos
362

The problem is that LT_lines is taking in only 70 characters , as per the debugging , its noting any longer than 70 cm so that is what it passes to g_kdmat awhich reads the same text and hence restricrts.

Thanks

0 Kudos
362

HI!

I tried it this way and it seems its working . Just wanted to show what I did . Actually I looped ita nd I used the DO statement 3 times , as one line conatins 70 characters so by doing it 3 times it takes in all the characters of the text from the following lines too.

Kindly suggest if I am right or wrong.

Attached is the code

    • get material sales text

concatenate gs_gen_del-bil_number gs_gen_del-itm_number into l_product_key.

call function 'READ_TEXT'

exporting

name = l_product_key

object = 'VBBP'

id = '0001'

language = sy-langu

tables

lines = lt_lines

exceptions

not_found = 1

ohters = 2.

if sy-subrc = 0.

do 3 times. "DEVK908672

read table lt_lines into ls_lines index sy-index.

if sy-subrc <> 0.

exit.

endif.

move ls_lines-tdline to g_kdmat+l_pos.

l_pos = 70 * sy-index.

enddo.

  • Remove sapscript special characters

replace: '<(>' in g_kdmat with ' ',

Thanks

Former Member
0 Kudos
362

..