Skip to Content

Dynamic position of windows in smartforms/SAP Script


Is there any way where I can pass position(example topmargin and leftmargin) of window object to smartforms/SAP script and able to print the window into the position. The value of topmargin and leftmargin may vary depending on user input.


Syed Tayab Shah

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 25, 2017 at 09:16 AM


    It's probably not a big deal to do that with SFP with 1 line of javascript to change position. So if you are not obliged to use Smartforms or... Sap Script (really?) just enjoy SFP powers.

    You can have some overviews there :

    In smartforms I guess it can be done using field-symbols in an added flow code. You have to find the (dynamic) name of your block.


    Here is an example in order to change window '%WINDOW1' position. It have to be pasted into Initialization tab :

    FIELD-SYMBOLS <docstruc> TYPE tsfdocstrc.
    FIELD-SYMBOLS <docstruc_line> TYPE ssfdocstrc.
    CONSTANTS c_docstruc_name(40) VALUE '%DOCSTRUC'.
    ASSIGN (c_docstruc_name) TO <docstruc>.
    LOOP AT <docstruc> ASSIGNING <docstruc_line>
                       WHERE tdwindow = '%WINDOW1'.
      <docstruc_line>-wleft = 15.
      <docstruc_line>-wtop = 15.

    Best regards


    Add comment
    10|10000 characters needed characters exceeded

  • Sep 25, 2017 at 09:59 AM

    The best you can do is creating many paragraph formats with predefined margin values, and as a text can be dynamic with any paragraph format, you may select the closest paragraph format corresponding to the margin values you need.

    Add comment
    10|10000 characters needed characters exceeded

    • Again Thanks Rossi for your reply.

      This may closest solution that you provided. It can not be print the object at exact user provided location. It can not handle by smartforms function module even copy it to z....function. I just want to clear my doubt of posiblities.