cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORM Assumption

Former Member
0 Kudos

When converting SAPSCRIPT to a SMARTFORM, the loops/endloops, ifs, endifs, etc. that occur prior to calling the old SAPSCRIPT will now have to be done in the SMARTFORM logic....True?

I don't see any other way to convert. So for each call from the Print Program to the old SAPSCRIPT, one, or more calls are made to the SMARFORM, only the logic preceding the call now must be done in the SMARTFORM?

Thank-You.

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

LOOP .. ENDLOOP should be replaced by the LOOP node or the TABLE node in the Smartform.

IF .. ENDIF depends on the requirement.

E.g. You want to print the 1 for condition A, and 2 for Condition 2 and this field is avaliable in your FM parameters, than you can Modify this field before calling the Smartform or You can add the Program node in yoru TABLE to calculate inside the Smartforms.

There should be only one call to the Smartform for one document.

E.g. You are converting the Sales Order confirmation SAPScript to the Smartforms. Your driver program for SAPScript it like:


WRITE_FORM for HEADER
LOOP AT T_VBAP.
  WRITE_FORM for ITEM
ENDLOOP.
WRITE_FORM for FOOTER

For Smartforms, This should be changed to:


CALL FUNCTION SMATFORM_FM
  exporting
    IA_VBAK = VBAK
    IT_VBAP = T_VBAP.

Design of the Smartform should be:


PAGE1
.. WINDOW HEADER
.... TEXT1
.. WINDOW MAIN
.... TABLE
....... HEADER
.......... TEXT for column labels
....... MAIN
.......... VBAP fields
....... FOOTER
.......... TEXT for TOTALs
.. WINDOW FOOTER
..... TEXT

I would suggest you to go this help: [Smartforms|http://help.sap.com/saphelp_nw04/helpdata/EN/a5/de6838abce021ae10000009b38f842/frameset.htm]

Regards,

Naimesh Patel

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

To display line items in SAPSCRIPT we are writing the logic with loop and endloop in driver program where as we can achieve it in Smartform by TABLE NODE for this we can just providing the input as internal table from Driver program to TABLE node of smartform Via Form interface of Smartform.

We didnt call any function modules like WRITE_FORM,OPEN_FORM,START_FORM etc for Samrtform except calling SSF_FUCNTION_MODULE_NAME with necessary inputs on Form interface of Smartform.

We can achieve CONTROL_FORM functionality by using COMMAND node in Smartform.