Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can I put this code into a SAPscript form?

aris_hidalgo
Contributor
0 Likes
2,271

Hello experts,

can I put in a SAPscript window codes like read table, select statement, call function, etc?if not, where would I put conditions like if sy-subrc = 0? because I have a conditon that after calling function 'READ_TEXT' I would check if the sy-subrc = 0 else I would do another select statement and check again its sy-subrc. Thanks guys!

5 REPLIES 5
Read only

Former Member
0 Likes
968

u can not use code like read table or select in sap script form...

for select and all the coding driver program is present..

either u used perform statement ....

Message was edited by: kishan negi

Read only

Former Member
0 Likes
968

hi viray,

u can't use these codes like READ , CALL FUNCTIONS in sap script windows..

u can use these functions in a separate driver program in se38 and link to the sap script form using the function OPEN_FORM..

CALL FUNCTION 'OPEN_FORM'

EXPORTING

dialog = 'X'

form = '<form name>'

language = sy-langu.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

<b>reward if useful...</b>

Message was edited by: Ashok Kumar Prithiviraj

Read only

Former Member
0 Likes
968

Hi Vijay,

You can call performs inside your Script. inside the subroutine you can write what ever you want you can place. since the subroutine will be called from SAP SCRIPT only.

Regards

Vjay

Read only

claus_wallacher
Product and Topic Expert
Product and Topic Expert
0 Likes
968

Hi,

you can actually call form routines from your SAPscript window. Combined with IF statements (also available in SAPscript) you maybe able to accomplish what you need to do.

You can find information on all available SAPscript control commands in <a href="http://help.sap.com/saphelp_46c/helpdata/en/d2/cb3d07455611d189710000e8322d00/frameset.htm">help.sap.com</a>.

If you open <i>SAPscript Control Commands</i> you find the following 2 commands that may help you:

- Conditional Text: IF

- Call ABAP Subroutines: PERFORM

Regards,

Claus

Read only

0 Likes
968

Just to add to the previous comments slightly.

You can include text objects (rather than use the READ_TEXT FMs)to make your life easier, if you want to do calculations do them in your print program and remember that PERFORMS are done at runtime so can affect performance.

Hope this helps.

Rgds

Rosie Brent