cancel
Showing results for 
Search instead for 
Did you mean: 

SAP SCript info req??

Former Member
0 Kudos

hi

i had developed an script,with FIRST page only,but as I need to display the records from an ITAB,so the pages are incresing on nos. of records,currenlt my data is displying in 2 pages,now I need to display an footer only on last page,but problem is like this that,its displaying on both FIRST & Second page.

Please tell me how to make it available only for last page only.

secondaly i am displaying the data with follow filds :

/E LOOP

P5 &itab2-MAKTX(40)&&quan(3)&,,&itab2-charg(10)&,,&itab2-menge(13)&

= ,,&wa1_RATE(13)&,,&itab2-exnum(10)&,,&itab2-exdat(10)&,,&wa_duty(4)&.

the data is displying correctly,but when the MAKTX is less that 40 CHAR,all data is shifting towards LEFT,please tell how to correct.

my TAB is for 00.16 mm,in this P5.

I am new to scripts,please tell me how to do this.

Regds

Vipin Sharama

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

The easy way to do this is by modifiying your driver program.

Example:

LOOP AT....

*WRITE_FORM 'MAIN'

AT END OF. "This will help you to print footer on last page

*WRITE_FORM "FOOTER'

END AT.

ENDLOOP.

OR

try to place conditions inside your script, example,

If nextpage EQ currentpage.

**footer.

Close the thread once your question is answered.

Regards,

SaiRam

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

To display data only on last page use the following command

/: IF &NEXTPAGE& EQ 0

whatever footer you want.

/: ENDIF

Regarding your MAKTX you said that if this is less than 40 char data is shifting left. I think you defined tabs correctly but why you are not placing tab between MAKTX and QUAN i.e., &itab2-MAKTX(40)&&quan(3)&. Place the correct tab position between these two fields also so that your data will not shift irrespective of MAKTX length.

Hope this will solve your problem.

Regards,

Aswini.

Former Member
0 Kudos

Hi Vipin,

This is regarding your second question.

1. First of all condense that maktx value if you have a custom program.

2. Define the tab positions at the paragraph level and use that to display

3. Inaddition to the tabs also use this option &symbol(IZC).

Let me know if you are still facing the problem

Allot points if this info is helpfull

Former Member
0 Kudos

Please tell me how to use &symbol(IZC)& in text elements.

Former Member
0 Kudos

hi vipin,

,,&itab-maktx(IZC)&,,

Former Member
0 Kudos

There may not be enough space in the window to display the variable, either increase the window dimensions or condense the spaces using &SFSY-FORMPAGES(C)&

eg&SFSY-FORMPAGES(3ZC)&---outputlen,c-condense,z-

What are the various text formatting options in Smartforms?

&symbol(Z)& Omit Leading Zeros

&symbol(S)& Omit Leading Sign

&symbol(<)& Display Leading Sign to the Left

&symbol(>)& Display Leading Sign to the Right

&symbol(C)& Compress Spaces

&symbol(.N)& Display upto N decimal places

&symbol(T)& Omit thousands separator

&symbol(R)& Right justified

&symbol(I)& Suppress output of the initial value

Former Member
0 Kudos

Vipin,

First part of your question: Create a footer window and use the folllowing code.

/: IF &NEXTPAGE& EQ 0

whatever footer you want.

/: ENDIF

Second part:

It looks you have used 6 tabs( 6 times ,, ). But only one tab is defined with value 0.16MM. So the first tab is 0.16MM, so if the text is less than 40 characters, then other values after this will be shifted to LEFT.

To overcome this define tabs one by one. First define the tab

&itab2-MAKTX(40)&&quan(3)&,,&itab2-charg(10)&

so first tab should start after printing MAKTX(40) and quan(3). Do trail and error by increasing or decreasing the number of characters in MAKTX upto max 40.

itab2-charg(10) shold be printed constantly at one place. If it is printing to LEFT when you decrease the number of characters in MAKTX, increase the tab value. Just give a small try, you will understand.

Hope this helps you.

Thank you,

Surya.