09-25-2017 7:22 AM
Hi,
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.
regards,
Syed Tayab Shah
09-25-2017 10:16 AM
Hello,
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 :
https://blogs.sap.com/2016/08/01/accessing-master-page-field-on-body-page/
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.
(EDIT)
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.
ENDLOOP.
Best regards
Bertrand
09-25-2017 10:16 AM
Hello,
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 :
https://blogs.sap.com/2016/08/01/accessing-master-page-field-on-body-page/
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.
(EDIT)
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.
ENDLOOP.
Best regards
Bertrand
09-26-2017 11:27 AM
Dear Bertrand,
Thanks for your response, above links are showing how to call different logo according to company code or user input.
I am exploring my question more, in below image can I set variable as user input in highlighted area? Obviously no, so how to handle it?
09-26-2017 1:04 PM
Hello,
Paste this code into your Global definition/ 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.
ENDLOOP.
I tried, it works. But if you want to do this into a page (not in initialization phase) it's more tricky.
Best regards
Bertrand
09-27-2017 6:18 AM
Dear Bertrand,
Thanks I got your point now and issue has resolved from your response.
Thanks again.
09-25-2017 10: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.
09-26-2017 11:28 AM
Dear Rossi,
Thanks for your response, above links are showing how to call different logo according to company code or user input.
I am exploring my question more, in below image can I set variable as user input in highlighted area? Obviously no, so how to handle it?
09-26-2017 1:12 PM
I understood your question, and I answered "the best you can do is ..." Again, as a workaround, as I said, you can use paragraph formats (in your screen capture, that would correspond to do it inside the text %TEXT3)
09-26-2017 2:03 PM
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.
regards,