on 10-26-2006 9:38 PM
Hello,
I've got a problem that I haven't seen anywhere on this forum. The Main window of our custom payment advice form is being called from driver program RFFOUS_T. We are occasionally seeing that the line item element is being called by the program and is being skipped over. I have watched in the sapscript debugger and can see that flow control goes to the first line, /E 625, and then immediately returns to the calling program without stepping into the element logic. What's supremely baffling, it sometimes will step into the logic, and I can see no indication of why it sometimes does and sometimes doesn't. In the test data I was given, the first line steps into the element and works fine and the second one does not. I've check the return code from the driver program's call to function 'WRITE_FORM', and it is 0 in both cases.
Here is the code in the driver:
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '625'
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
Here is the line item element in the main window:
/E 625
/* -
Line items -
/: PROTECT
T1 ,,®UP-XBLNR&,,®UP-BLDAT&,,®UP-BELNR&
= ,,®UD-WRBTR(13)&
= ,,®UD-WABZG(12)&,,®UD-WNETT(13)&
/* Change description based on first character of vendor field
/: IF ®UH-LIFNR(1)& = '9'
ZE ,,<I>®UP-SGTXT&</>
/: ELSE
/: PERFORM GET_SGTXT IN PROGRAM ZFI_CHECK_FOR_USA_FORM
/: USING ®UP-BUKRS&
/: USING ®UP-BELNR&
/: USING ®UP-GJAHR&
/: USING ®UP-BUZEI&
/: CHANGING &V_SGTXT&
/: ENDPERFORM.
ZE ,,<I>&V_SGTXT&</>
/: ENDPROTECT
Is there any reason any of you can think of why this would happen? I will explore all ideas.
Thanks,
Nathan Beeler
The solution (after working with an analyst): one section had an if/else statement that was missing its endif. So the following section that was getting skipped was doing so because it was being lumped into the non-used side of the else statement (until its own endif statement was hit). I still think this is an incredibly horrible way to handle an obvious syntax error by the sapscript transaction, but there you have it. Thanks for the suggestions, all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey all,
Perhaps I wasn't clear in what I'm asking for above - I'd just like to hear anyone's ideas about why this behaviour would exist at all. Does anyone know of any configuration setting or form setting or anything that would send flow control into the sapscript element only to immediately jump back out again? There is no visible difference I can see in why it would enter the element logic one time and not another, so I'm hoping that the community can give me ideas about where to look.
Thanks,
Nathan Beeler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nathan,
It could be because of the PROTECT command.
It is able to go into the text element for the first item because the system is able to protect the element from a page break.
For the second item maybe there is not enough space to protect it.
Please check that.
Hope it solves the problem.
Regards,
-Ramesh
Hello Ramesh,
Thanks for the reply. I have already tried removing the protect command, thinking it might be the problem, but it made no difference. It still doesn't step into the element the second time. Moreover, the protect command would create a second page if the combined length of the new text turned out to be too much to fit on the page. The program isn't even getting into the logic to find out if it's too much (nor is it sending it to a second page).
Thank you for the suggestion.
Nathan
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.