cancel
Showing results for 
Search instead for 
Did you mean: 

perform a form routine within a sap script form

Former Member
0 Kudos

Hi!

How can I

perform a form routine within a sap script form.

Regards

sas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use like :

/: PERFORM (PERFORMNAME) IN PROGRAM (SE38 PROGRAM NAME)

/: USING VAR1

/: USING VAR2.

/: CHANGING OUTPUT

/: ENDPERFORM

CALL FORM ROUTINE IN SE38

FORM NAME tables in_tab structure itcsy

out_tab structure itcsy.

USE YOUR CODE HERE.

ENDFORM.

Reward Points if it is helpful

Thanks

Seshu

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Basically any way u can loop at ... . using perform or simply in the driver prg that will not affect any performance.

My way of doing this is the second one.. it all depends upon ur decision.

Sathish

former_member196280
Active Contributor
0 Kudos

In Form

PERFORM <sub routine name> IN PROGRAM <program name>

USING <var1>

CHANGING<var>.

ENDPERFORM.

In Include or program( <program name>)

FORM <sub routine name> TABLES in_tab structure itcsy

out_tab structure itcsy.

READ TABLE ................

*etc,.

*I guess you can do it from here

ENDFORM.

Don't forget to reward points.

SaiRam

Former Member
0 Kudos

OK,

many thanks for your kindly reply.

But basically there is a matter which I don't understand.

Which way is the better way to loop at internal table:

Solution1:

FORM xxx.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DEVICE = 'PRINTER'

FORM = 'ZSD_PACKING_LIST'

LANGUAGE = SY-LANGU .

LOOP AT gt_versand_plan INTO gw_versand_plan.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'SHELEM'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN' .

ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.

ENDFORM.

Solution 2:

Having the LOOP within the sapscript form -> 'ZSD_PACKING_LIST'

Regards

sas

Former Member
0 Kudos

Perform SUB_FRM_NAME In Program <PROGRAM_NAME>

Using <Using_Parameters>

Changing<Changing_parameters>.

EndPerform.

in the above program

Form SUB_FRM_NAME Tables Out_tab structure itcsy

In_tab structure itcsy.

EndForm.

santhosh