This website is not affiliated with, sponsored by, or approved by SAP AG.

Problem calling subroutine from Script Form

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Problem calling subroutine from Script Form

Postby shails81 » Wed Mar 28, 2012 5:27 am

Hello All,
I added a variable &PO_USD1& to a subroutine in a Script Form. But while calling the subroutine from Script form, the OUT_TAB[] doesn't contain the new variable. The code is attached below, am I missing something?

While debugging the program, SY-SUBRC is 4 for the statement -> READ TABLE OUT_TAB INDEX 3.

Script Form code
Code: Select all
/: DEFINE : &AMT_IN_WORDS&
/: DEFINE : &AMT_IN_WORDS1&
/: DEFINE : &PO_USD1&
/: PERFORM AMT_WORDS IN PROGRAM ZMMB_PO_FUNCTIONS
/: USING &PEKKO-NETWR&
/: USING &EKKO-WAERS&
/: CHANGING &AMT_IN_WORDS&
/: CHANGING &AMT_IN_WORDS1&
/: CHANGING &PO_USD1&
/: ENDPERFORM


Program - ZMMB_PO_FUNCTIONS
Code: Select all
FORM AMT_WORDS TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
...........
...........
READ TABLE OUT_TAB INDEX 1.          "SY-SUBRC is 0

READ TABLE OUT_TAB INDEX 2.          "SY-SUBRC is 0

READ TABLE OUT_TAB INDEX 3.          "SY-SUBRC is 4
............
............
ENDFORM.


OUT_TAB[] contains only 2 records:
1. &AMT_IN_WORDS&
2. &AMT_IN_WORDS1&
shails81
 
Posts: 14
Joined: Mon Sep 07, 2009 3:11 am

Re: Problem calling subroutine from Script Form

Postby VLozano » Wed Mar 28, 2012 7:14 am

You are missing the SAPScript forum... anyways, I don't see nothing "wrong" in your code (in a first sight). Are you testing your form and program in the same development system and client?

If you must do the tests in a different client (as I must do), you must remember to copy your form from the original client to the test one.
Tuly Idiots
Because we know we are part of the problem
VLozano
 
Posts: 5140
Joined: Mon Sep 13, 2004 8:17 am
Location: Idiocity

Re: Problem calling subroutine from Script Form

Postby shails81 » Wed Mar 28, 2012 7:34 am

Yes, I am testing the form and program in the same client. To me the code seems fine. I tried renaming the variable also. But still the same result. Is there anyway i can put a break-point in the script form to test the subroutine call????
shails81
 
Posts: 14
Joined: Mon Sep 07, 2009 3:11 am

Re: Problem calling subroutine from Script Form

Postby Gothmog » Wed Mar 28, 2012 8:03 am

Moved from ABAP.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1943
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Problem calling subroutine from Script Form

Postby VLozano » Wed Mar 28, 2012 9:09 am

There is a way to debug a SAPScript form, but I cannot remember it, sorry (too much time without working with them, I guess). Anyways, I think you can add a BREAK sentence to your "normal" ABAP and check the tables by yourself in execution time.
Tuly Idiots
Because we know we are part of the problem
VLozano
 
Posts: 5140
Joined: Mon Sep 13, 2004 8:17 am
Location: Idiocity

Re: Problem calling subroutine from Script Form

Postby Sharpshooter » Wed Mar 28, 2012 9:22 am

VLozano wrote:There is a way to debug a SAPScript form, but I cannot remember it, sorry (too much time without working with them, I guess). Anyways, I think you can add a BREAK sentence to your "normal" ABAP and check the tables by yourself in execution time.


Activate form debugging from the initial screen in SE71 under menu path "Utilities".
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Problem calling subroutine from Script Form

Postby shails81 » Wed Mar 28, 2012 12:06 pm

I debugged the form, the following highlighted lines are missing. Although in se71 the newly added changes are still shown. How come the changes are not reflected????
The changes in form were made in development client, activated and then transported to Quality for testing.

/: DEFINE : &AMT_IN_WORDS&
/: DEFINE : &AMT_IN_WORDS1&
/: DEFINE : &PO_USD1&
/: PERFORM AMT_WORDS IN PROGRAM ZMMB_PO_FUNCTIONS
/: USING &PEKKO-NETWR&
/: USING &EKKO-WAERS&
/: CHANGING &AMT_IN_WORDS&
/: CHANGING &AMT_IN_WORDS1&
/: CHANGING &PO_USD1&
/: ENDPERFORM
shails81
 
Posts: 14
Joined: Mon Sep 07, 2009 3:11 am

Re: Problem calling subroutine from Script Form

Postby Sharpshooter » Wed Mar 28, 2012 12:23 pm

Have you:
Checked the transport logs for any clues?
Verified that the current version in QA is active?
Checked the "Changed on" date in QA compared to the transport date?
Restarted the test transaction from the beginning after the transport was finished with import?

Is the client in QA where you are testing the same as the target client of the transport?

Just some thoughts.......
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Problem calling subroutine from Script Form

Postby shails81 » Wed Mar 28, 2012 11:28 pm

Checked the transport logs for any clues?
Verified that the current version in QA is active?
Checked the "Changed on" date in QA compared to the transport date?
Restarted the test transaction from the beginning after the transport was finished with import?

Is the client in QA where you are testing the same as the target client of the transport?


Thanks for the reply,
Answer to all of the above is Yes. All are matching. There were some other additional conditions I made in the form and those are getting reflected except these few lines. I tried re-transporting the form, but still no success.
shails81
 
Posts: 14
Joined: Mon Sep 07, 2009 3:11 am

Re: Problem calling subroutine from Script Form

Postby YuriT » Wed Mar 28, 2012 11:39 pm

If all you said is true then this is indeed a strange hiccup. Only way out I see is to take a tambourine and dance around a camp fire.
I would delete the form and recreate it again. maybe even section by section. If may suddenly work. Or you will pinpoint exactly at what stage this bug starts appearing.
YuriT
 
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: Problem calling subroutine from Script Form

Postby Sharpshooter » Thu Mar 29, 2012 6:53 am

YuriT wrote:If all you said is true then this is indeed a strange hiccup. Only way out I see is to take a tambourine and dance around a camp fire.


Or wave a dead chicken above your head....
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Problem calling subroutine from Script Form

Postby SHS » Thu Mar 29, 2012 9:25 am

Are there more active versions of your SAPScript, e.g. different languages?
If the form is active in different languages, then you might have to add this particular code in every language version of your SAPScript.
SHS
 
Posts: 483
Joined: Mon Mar 06, 2006 3:57 am


Return to SAPscript/Smartforms

Who is online

Users browsing this forum: No registered users and 3 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.