0

I would like to draw a box dynamically in SAP Script, whereas the POSITION YORIGIN for the box will be changing constantly depending on the availability of data for print.

For more Detail , Please have a look on the pic. On page2 marked area, I want to display data on page3. Empty area on page2 is not fixed and vary depending on the data.Therefore , I have to display page3 data on empty space which is not fixed.

Sap Script page2

SAP Script Page3

regards,

Umar Abdullah

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Umar Abdullah
  • 1,282
  • 1
  • 19
  • 37
  • Question already asked multiple times in the SAP forum: [How to draw a dynamic box in sapscript?](https://archive.sap.com/discussions/thread/164701), [SAP-Script - Draw Table (Boxes) with variable number of lines](https://archive.sap.com/discussions/thread/108676), [Dynamic BOX in sapscript - Archived Discussions and Documents](https://archive.sap.com/discussions/thread/461772), [How to draw dynamic table in SAP Script !](https://archive.sap.com/discussions/thread/124650), etc. If none answers your question, then please give details. – Sandra Rossi Nov 13 '18 at 08:23
  • Question has been asked multiple times for drawing box only. I want to change position of box also which have not been address in sap forum. – Umar Abdullah Nov 13 '18 at 09:55
  • Do you mean that if you have for instance `BOX XPOS 16 CH WIDTH 0 MM HEIGHT 18 MM FRAME 10 TW,` but you want to assign the values at runtime, i.e. instead of XPOS 16, you want something like `XPOS VAR`, where var is a variable set at runtime ? – Sandra Rossi Nov 13 '18 at 10:29
  • 2
    I have updated the question, You might get better idea of the question.For my case, POSITION YORIGIN will be changing depending on the data for print. – Umar Abdullah Nov 13 '18 at 11:01

1 Answers1

0

You cannot specify the YORIGIN value dynamically, however here is one workaround how you can place box in a dynamic way. You can do this from print-program:

DATA: command TYPE c LENGTH 100.

command = 'BOX WIDTH ''17.5'' CM HEIGHT 5 CM FRAME 10 TW INTENSITY 15'.

CALL FUNCTION 'CONTROL_FORM'
 EXPORTING
  COMMAND = command
  EXCEPTIONS
  UNOPENED = 1
  UNSTARTED = 2
  OTHERS = 3.

This will insert new box on the form, and you can control the position by changing command string conditionally depending on the presence of data on page 2.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90