cancel
Showing results for 
Search instead for 
Did you mean: 

sap script display

Former Member
0 Kudos

hi all .

i'm doin sap script i got an issue which i'm displaying BSIS-sgtxt field in sap script form .. as sgtxt is 50 char length i made for first line i displayed 20 and in secont line i displayed 30 . but i what happens is for example ' this is the invoice for the particular customer ' what happens is 'this is the invoice fo' is coming in first line and 'r the particular customer' coming in second line pls can anybody say how to make reslove this issue so that words should not get truncate inbetween . thanks . <<text removed by moderator>> . thanks again.

Moderator message: please read the Terms of Engagement - offering points is not allowed.

Edited by: Matt on Nov 6, 2008 10:38 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

create some charter format c1

and insert <c1>BSIS-sgtxt<c1>

Former Member
0 Kudos

hi , i have tried putting what u said even though it is truncating .. in debugging i gave 'this is the report for displaying the invoice for customer' . in output it is coming 'this is the report for di ' in first line

'or displaying the invoice for customer ' in second line pls let me know how to resolve this error ..thanks

Former Member
0 Kudos

Hi,

Check FM RKD_WORD_WRAP, this can split string and retain words.

Regards

Karthik D

Former Member
0 Kudos

hi thanks .. can u sat same thing to split numbers as same as words . thanks again

Former Member
0 Kudos

I didnt get you, explain with a example what you want?

Former Member
0 Kudos

actually i need to display bsis-sgtxt field in form . what i did as it is of 50 char length i displayed bsis-sgtxt(20) in first line and remaning length display in second line as bsis-sgtxt+20(30) but now whats the issue is , fo eg if bsis-sgtxt field as got 'this is the report to dispaly invoice for customer' in first line it is coming 'thisis the report t' and in second line it is coming ' o display invoice for customer' . but now i need it should come 'this is the report to' in first line and 'display invoice for customer' in second it should not get truncate . pls let me know hoe to reslove the issue . thanks . i hope u understood now

Former Member
0 Kudos

Hi use the below code in a Form routine and call that from the script. Dont ask me how to use perform in script, do a search in the forum and you will get lots of threads.

DATA : lv_text(50),lv_line1(20),lv_line2(20),lv_line3(20).

lv_text = 'This is the report to display invoice for customer'.
CALL FUNCTION 'RKD_WORD_WRAP'
  EXPORTING
    textline                  = lv_text
   DELIMITER                 = ' '
   OUTPUTLEN                 = 20 " Your line length
 IMPORTING
   OUT_LINE1                 = lv_line1
   OUT_LINE2                 = lv_line2
   OUT_LINE3                 = lv_line3
 EXCEPTIONS
   OUTPUTLEN_TOO_LARGE       = 1
   OTHERS                    = 2.

IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Write : / 'lv_text : ', lv_text,/ 'lv_line1: ', lv_line1,/ 'lv_line2: ' ,lv_line2,/ 'lv_line3: ', lv_line3.

Output:

lv_text :  This is the report to display invoice for customer
lv_line1:  This is the report
lv_line2:  to display invoice
lv_line3:  for customer

Regards

Karthik D

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

U have to to diaply 21chars in first line and 29 chars in 2nd line. OR 18chars in 1st line and 32chars in 2nd line.