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: 

SAP SCRIPT

Former Member
0 Kudos

hi,

I have a SAP SCRIPT which displays values as shown below.

NAME ADDRESS PHONE

-


XYZ Andheri , Mumbai 988888888.

if the field used in PRINT PROGRAM for displaying address is the internal table field "itab-adr" .Maximum space for ADDRESS as per current SAP SCRIPT - FORM is 60 characters.

So if the address is more than 60 ( it varies from 60 to 180 as per data stored in SAP tables )then the Phone Number will be displaced as given below.

NAME ADDRESS PHONE

-


XYZ Andheri , umbai ,bdedbewudbwiduwbned 988888888.

The maximaum size of address is 180 characters.So anyone ples let me know how can i split the address field into 2 or 3 lines depending upon the size of the address so it can be displayed in more than one line, without Misplacing PHONE NUMBER.For example if the ADRRESS consists of 140 characters then it should come in 3 lines(140/60) , if it contains onely 100 (100/60) then it should come in 2 lines.

Thanks

Avi..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

What you can do is in the sapscript , first call a subroutine passing the address , in the subroutine check the length of the address and based on it split the address into components say C1 , C2, C3 ....

Once the subroutine call is executed print

NAME C1 PHONE

, next line check if C2 is initial or not , if it is not initial print C2 . apply the same logic for other components also.

So for this you will have to use tabs , so as to allign the components.

Please revert back in case you want more clarifications

Regadrs

Arun

4 REPLIES 4

Former Member
0 Kudos

Hi ,

What you can do is in the sapscript , first call a subroutine passing the address , in the subroutine check the length of the address and based on it split the address into components say C1 , C2, C3 ....

Once the subroutine call is executed print

NAME C1 PHONE

, next line check if C2 is initial or not , if it is not initial print C2 . apply the same logic for other components also.

So for this you will have to use tabs , so as to allign the components.

Please revert back in case you want more clarifications

Regadrs

Arun

Former Member
0 Kudos

Use offset

field+0(3)

use offset in layout ..

Former Member
0 Kudos

Hi,

one way you can do it is,

in first line display 60 chars

&ADRS+0(60)&

in 2nd line i.e. using the paragraph format

IF &ADRS+60(60) IS NOT INITIAL.

&ADRS+60(60).

ENDIF.

In 3rd line

IF &ADRS+120(60) IS NOT INITIAL.

&ADRS+120(60).

ENDIF.

Regards,

Raghavendra

Former Member
0 Kudos

Hi,

In first line display the first 60 characters.

Move the other charaters into a varible which will have the next 40 characters as for example.Check whether this value is not initial.

Create a new paragrph whose first tab will start after the end of you first field(name) .IF you width of printing the name is 30 character it will print the address after this.so your output will look like thiw way.

RAVI ADRESS1 989900

SPACE ADDRESS2 SPACE

Regards

Ravi Ranjan