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

sapscript: how to align empty fields?

Former Member
0 Likes
1,864

I have this sample sapscript report. some fields are empty that it is why it wont align to the rest of the columns. how to fix that? <b>thanks. </b>

<b>screenshot:</b>

http://i150.photobucket.com/albums/s116/painkiller2007/SAP/sapscript21.jpg

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,492

Ok dawson,

perform debugging so that u can know from which field ur getting those values and after that remove or add period(,) depending on ur requirement.

Why i'm saying to debug is

all the values are coming from 3 r 4 fields but even the data is diturbed so if u go for debug u can know easily from where those values are coming.

generally these type of problem occurs when we apply IF condition to any statements as


IF &BSEG-PROJK& = ' '
IF &BSEG-AUFNR& <> ' '
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,,,
CHANGED BY PAVAN REMOVED &BSEG-DMBTR&
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&SKAT-TXT20&
&BSEG-KOSTL&,,&CSKT-LTEXT&
,,&BSEG-AUFNR&
,,,,& SKAT-TXT20&
ELSEIF &BSEG-PERNR& <> ' '
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&BSEG-KOSTL&,,&BSEG-PERNR&
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&SKAT-TXT20&
ENDIF.

in these conditions if refer to some conditions with the same value then we have to search for that term from it was coming

if not solved then i'll provide u another method

Regards,

Pavan

10 REPLIES 10
Read only

amit_khare
Active Contributor
0 Likes
1,492

instead of using spaces to align field use Tabs as given in Character formats to align the fields.

Check this link to learn about them.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRFORM/BCSRVSCRFORM.pdf

Regards,

Amit

Read only

Former Member
0 Likes
1,492

Hi

use the Paragraph attribute NO BLANK LINES

for the respective paragraphs used for that printing.

and define TAB settings for the columns

to display with proper format.

Reward points if useful

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,492

Hi

To overcome from the space problem,

instead of using spaces to align field use Tabs as given in Character formats to align the fields.

Define the Character and Paragraph formats properly and use them.

Regards,

Sreeram

Read only

Former Member
0 Likes
1,492

<b>AMIT:</b> im already using a tab. still the same.

<b>SREE:</b> im already using a tab. still the same.

<b>ANJI: </b>I tried "NO BLANK LINES" but still the same.

Read only

Former Member
0 Likes
1,492

I have not tested it but please try to specify the field length in the sap-script. Check if that helps to resolve your issue.

eg

&L_TEXT(20)&

Regards

Anurag

Read only

Former Member
0 Likes
1,492

Hi Dawson,

Can i have ur code plz

Regards,

Pavan

Read only

Former Member
0 Likes
1,492

<b>PAVAN:</b> pls see image below for the code. <b>thanks.</b>

http://i150.photobucket.com/albums/s116/painkiller2007/SAP/sapscript22.jpg

Read only

Former Member
0 Likes
1,493

Ok dawson,

perform debugging so that u can know from which field ur getting those values and after that remove or add period(,) depending on ur requirement.

Why i'm saying to debug is

all the values are coming from 3 r 4 fields but even the data is diturbed so if u go for debug u can know easily from where those values are coming.

generally these type of problem occurs when we apply IF condition to any statements as


IF &BSEG-PROJK& = ' '
IF &BSEG-AUFNR& <> ' '
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,,,
CHANGED BY PAVAN REMOVED &BSEG-DMBTR&
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&SKAT-TXT20&
&BSEG-KOSTL&,,&CSKT-LTEXT&
,,&BSEG-AUFNR&
,,,,& SKAT-TXT20&
ELSEIF &BSEG-PERNR& <> ' '
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&BSEG-KOSTL&,,&BSEG-PERNR&
,,&BSEG-BSCHL(Z)&,,&BSEG-HKONT&,,,,&SKAT-TXT20&
ENDIF.

in these conditions if refer to some conditions with the same value then we have to search for that term from it was coming

if not solved then i'll provide u another method

Regards,

Pavan

Read only

Former Member
0 Likes
1,492

thanks <b>PAVAN </b>and thank to all of you. im just a newbie to SAP. i hope u understand.

<b>thanks to all of u again.</b>

Read only

Former Member
0 Likes
1,492

Its ok yar if u r satisfied with our answers then plz provide points so that it will be a boost up for us

Regards,

Pavan