cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in sap script

Former Member
0 Kudos

Hi All,

I want to print the dynamic text in the sap script with the position dynamically and also i want to draw the dynamic boxes with dynamic positions,

Please suggest the way How to do it.

Thanks in advance.

Regards

Sudhakar

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 15, 2009 11:37 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To dynamically postion the boxes you can use variables for providing x-origin, y-origin, height and width.

Dynamic positioning of text is not directly supported by SAPscript. You can do one thing, create different ELEMENTs in the

Sapscript window with different position of the text and then from your print program call the appropriate ELEMENT.

Regards,

Bhavesh.

Former Member
0 Kudos

Hi,

How can i pass the variables dynamically to create the box .

Regards

Sudhakar

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

for dynamic text you have to use elements in SAP SCRIPT

within that you can use box & variables..

*

Element in window in SAP SCRIPT

/E  E1
&VARIABLE1&     &VARIABLE2& 

*Call this element whenever you want to display through your calling program using 

CALL FUNCTION 'OPEN_FORM'
 EXPORTING
   FORM                              = ' '  " SAP SCRIPT name
.

CALL FUNCTION 'WRITE_FORM'
   EXPORTING
   ELEMENT                        = 'E1'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = ' '   " window name
.

CALL FUNCTION 'CLOSE_FORM'
.

Former Member
0 Kudos

Hi,

Define variables for x-origin y-origin, height and width in your print program.

In sapscript you can draw box as :-


/:BOX XORIGIN &xorigin& YORIGIN &yorigin&  WIDTH &width& CM HEIGHT &height& CM FRAME 10 TW INTENSITY 15

Here xorigin yorigin height and width are defined in the print program. There is no need to pass these variable to sapscript, just declare them as global variables and it will be automatically recognized in the print program.

Also go through this link for SAPscripts :-

[http://help.sap.com/saphelp_nw70/helpdata/en/d1/802d7d454211d189710000e8322d00/frameset.htm]

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

Thank you for providing the example . its working . and also please provide me the example for dynamic text printing with dynamic positions.

Thanks in adavnce

Regards

Sudhakar

Former Member
0 Kudos

Hi Sudhakar,

Just use the variable containing the text to be printed.

Eg.


  * &variable&

Here * is the default paragraph format, you can use any other paragraph format that is defined in the script.

When you call the window, where the above code is written, from the print program the value in the variable will be printed.

Only point is just use the variable name enclosed in & &.

Regards,

Bhavesh.

p244500
Active Contributor
0 Kudos

hi

This the which you have to used


/: BOX XPOS YPOS WIDTH HEIGHT FRAME INTENSITY
/: POSITION XORIGIN YORIGIN WINDOW PAGE
/: SIZE WIDTH HEIGHT WINDOW PAGE

BOX:

WIDTH
Width of the box. Default: WIDTH value of the SIZE command.

HEIGHT
Height of the box. Default: HEIGHT value of the SIZE command.

FRAME
Thickness of frame. Default: 0 (no frame).

INTENSITY
Grayscale of box contents as %.

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

regard

nawa

Former Member
0 Kudos

Hi,

Please provide me one example to create the dynamic box by passing the values of xpos ypos height width dynamically.

Thanks in adavnce

Regards

sudhakar

Former Member
0 Kudos

Hi

Use main window for displaying dynamic text and pass the dynamic text from the selection screen of drive program.

Regards

Srilaxmi