cancel
Showing results for 
Search instead for 
Did you mean: 

How to write select statement into SCRIPT editor

former_member181995
Active Contributor
0 Kudos

hello,

i build a sap script for purchase order printing for exporting.

now after all po order print fine then our client want some more should be print into layout regarding po header.

At the soul my q is can i write select query into script editor itself.

thanks and regards

amit.

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

You cannot write your select statement inside your SAPscript, to overcome this SAP has provided us an option of calling sub-routines.. go through the below example

Go through this example

Ex. SAPSCRIPT

/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>

/:USING &<field name>&

/:CHANGING &<field name1& "It will be returned back from sub-routine

/:ENDPERFORM

Then create subroutine pool program(of your own name) and you have to write the code.

FORM ><subroutine name> tables int_cond structure itcsy

outt_cond structure itcsy.

data : value(20), value1(20). "do your own declarations

Read int_cond table index 1.

value = int_cond-value.

value1 = value1 + value.

*****Write your select statement

Read outt_cond table index 1.

outt_cond-value = value1.

Modify outt_cond index 1.

ENDFORM.

Just rough idea given above.

Regards,

SaiRam

Answers (1)

Answers (1)

Former Member
0 Kudos