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

DOUBT IN A BOX

Former Member
0 Likes
1,093

HI

am doing a script in which i need to put a smaal box at the right hand side corner ..now my doubt is i need to print the document number and the date inside the box which i need to retrive from the respective tables and also one more doubt how to have blank spaces in betwenn...like on a line am printing the document text

the next line there shouldnt be anything it should be a gap and after i want to print sometingg.please help

vijay

HI

am doing a script in which i need to put a smaal box at the right hand side corner ..now my doubt is i need to print the document number and the date inside the box which i need to retrive from the respective tables and also one more doubt how to have blank spaces in betwenn...like on a line am printing the document text

the next line there shouldnt be anything it should be a gap and after i want to print sometingg.please help

vijay

7 REPLIES 7
Read only

Former Member
0 Likes
1,049

hi

Use BOX command to create box and write your statement after BOX command.

BOX: These commands are used for drawing boxes and are used only during creating output.

Syntax:

/: BOX [Xpos] [Ypos] [Width] [Height] [Frame] [Intensive]

X & Y – Upper left corner of the box.

Width – Width of the box

Ht – Height of the box

Frame – Thickness of the box (Default is full black)

Units used for Width, Height and Thickness are TW, PT, IN, CM, CH, LN.

/: BOX WIDTH ‘20’ CM HEIGHT 1 IN FRAME 10 TW INTENSIFY 15

/: 'MATERIAL: ' &V_MATNR&

/: 'DESC:' &V_DESC&

See the sample to create a box

change the numbers as per the size

/: POSITION WINDOW

/: POSITION XORIGIN '-0.5' CH YORIGIN '-0.25' LN

/: SIZE WIDTH '+0.4' CH HEIGHT +1 LN

/: BOX FRAME 10 TW

/: BOX HEIGHT '1.7' LN INTENSITY 20

and if u want blank use tab

regards

Praeen

Read only

0 Likes
1,049

HI

I GOT IT REGADING THE WAT U SAID ABOUT USING TABS YA IT CAN BE USED BUT I DONT WANT WRITE ANYTHING ON DAT LINE AND TELL ME WAT SHOULD BE USED IN THE COMMAND PROMPT LIKE I USED * AND /...BUT D GAP IS NOT COMMING

Read only

0 Likes
1,049

Hi Vijay,

In order to get the gap between lines, just doone thing.

In the script, before going to editor, we find <b>configure editor</b>, there itself we can find the hard-coded form of the code which we want to dispaly.

There itself you can give the space whereever desired, and later check the print preview.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
1,049

Hai

For BAX in SAP SCRIP syntax is

/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]

example:

/: BOX WIDTH ’17.5’ CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15

/: BOX WIDTH ’17.5’ CM HEIGHT ’13.5’ CM FRAME 10 TW

/: BOX XPOS ’10.0’ CM WIDTH 0 TW HEIGHT ’13.5’ CM FRAME 10 TW

/: BOX XPOS ’13.5’ CM WIDTH 0 TW HEIGHT ’13.5’ CM FRAME 10 TW

After that write any thing its diaply on that box only

**Please reward suitable points***

With Regards

Navin Khedikar

Read only

Former Member
0 Likes
1,049

Hi Vijay,

Setting default parameters for a box:

You can use the POSITION and SIZE commands to set default parmeters for a box.

Instead of:

/: BOX XPOS '11.21' MM YPOS '5.31' MM HEIGHT '10' MM WIDTH '20' MM INTENSITY 10 FRAME 0 TW

You can write:

/: POSITION XORIGIN '11.21' YORIGIN '5.31' MM

/: SIZE HEIGHT '2' MM WIDTH '76' MM

/: BOX FRAME 10 TW INTENSITY 10

This can be usefull if you gave several boxes that share the same parameters.

If you want to set the position realtively to the window use POSITION WINDOW

to set the position to the top/left start of the window. Then use POSITION

to set the current position relatively to the start of the Window.

Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.

/: POSITION WINDOW

/: POSITION XORIGIN '5' MM YORIGIN '10' MM

the position is now 5 MM from the left and 10 MM from the top of the window

NOTE: After using the position command you can move the current position

realtively to the last used position

/: POSITION XORIGIN '10' MM YORIGIN '20' MM

Now the position will be X = 15 and Y = 30

Drawing a line. You can draw a line by setting the Height or Weidth to 0

and add a frane. E.g. a horizontal line:

/: SIZE HEIGHT '0' MM WIDTH '200' MM

/: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100

SAP Printer commands in SAPScripts

The command line in the editor must be as follows:

/: PRINT-CONTROL xxxxx

or

/: PRINT-CONTROL 'xxxxx'

where xxxxx stands for the five-character name of the print control.

Example:

/: PRINT-CONTROL ZM100

The complete printer command normally resides in the print control.

If characters belonging to the print command follow after the print control in the text (only useful for the HPL2 printer driver for PCL-5 printers), the text line following after the PRINT-CONTROL command should begin with an equals sign (=) in the format column.

Example:

/: PRINT-CONTROL SESCP = *c5G

If you do not use the equals sign, a space character is inserted between the print control SESCP and the character *c5G.

Different font on the same line

You can have different font on the same line by defining a character format.

For example B for bold text and U for Underline.

In your SAPScript apply like this :

<U>Underline Text</> <B>Bold Text</>

Print Footer notes only on the last page

Command to used in your sapscripts :-

/: IF &NEXTPAGE& EQ 0

whatever footer you want.

/: ENDIF

SAPscripts How to calculate Totals and Subtotals

I have some doubs in BDC and SMART FORMS. I want to change the material number using the transaction code MM02 through BDC.

In scripts and smartforms how to calculate totals and subtotals?

To calculate totals and sub totals in sap scripts you have to use subroutines.

Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine

/: DEFINE &TOT_PRICE&

/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM

Then write the variable where ever you want it to be printed (mostly it will be in footer window)

Then create subroutine pool program and you have to write the code.

FORM F_GET_PRICE tables int_cond structure itcsy

outt_cond structure itcsy. data : value type kbert.

statics value1 type kbert.

Read int_cond table index 1.

value = int_cond-value.

value1 = value1 + value.

Read outt_cond table index 1.

outt_cond-value = value1.

Modify outt_cond index 1.

ENDFORM.

I have given a rough outline, please be aware of the variable conversions as Int_cond-value and outt_cond-value are characters.

Rewards some points,

Rgds,

P.Nag

Read only

former_member673464
Active Contributor
0 Likes
1,049

hi..

Define a window over the area where you want to give box.In the window Use box command to display box on it .You can retrive program in drive program use those variables to display data in it .In para graph format use fields sapce before ,line sapcing and space after to display blankes in script.

regards,

veeresh

Read only

Former Member
0 Likes
1,049

hh