Skip to Content
author's profile photo Former Member
Former Member

Can you change program symbols using PERFORM in SAPscript?

Hello All:

We have a situation where some of the standard SAP fields/values (program symbols) being passed to the SAPscript form are initial. For example, when multi-level packaging is used (Progam SDPACKDR), LVBPLP-VBELN, POSNR, and VEMNG are initial. These same fields are populated when single-level packaging is used. A large number of SAPscript forms have PERFORM statements that pass these values to ABAP routines in order to get other values needed for the HU labels. Now that some plants are using multi-level packaging, their labels are not printing with all of the necessary data.

I have added code to one of our SAPscript forms that checks the values of these 3 fields. If they are initial (zero, null, etc.), a PERFORM statement is executed that calls an ABAP subroutine that gets the appropriate values for these fields (to be used in the subsequent pre-existing PERFORM). I have verified that the ABAP subroutine is working properly and that the values are being stored in the table passed back to the SAPscript. However, when control is passed back to the SAPscript, the values of these program symbols are still initial. The really interesting part is that if a print preview is done first and the output is issued immediately afterwards without backing out of transaction VL74, the values are populated correctly for the labels to be printed.

Does SAP allow the values of program symbols to be changed like I have done or do I have something wrong in my ABAP and/or SAPscript? I have provided code samples below. Any and all help will be greatly appreciated. Thanks in advance!

SAPscript.jpg (55.6 kB)
ABAP.jpg (140.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2012 at 12:51 PM

    I would have used /: DEFINE &VARIABLE_NAME& for the 'changing' parameters, and output those variable names, instead of trying to overlay the "real" table-fieldname variables. I expect that you are calling the perform in the main window (or the window where the data will be displayed?).

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Harshad Bhingarkar

      @Break Point - Yes, the PERFORM is being called from the MAIN window. I was trying to avoid declaring additional variables as there is another PERFORM after the one I added that uses the same names as the ones I am trying to update. I can and will declare additional variables if necessary, but doing so will require more SAPscript and additional ABAP changes. I was trying to minimize the number of changes required as there are multiple SAPscript forms that need to be updated on an SAP system that is being phased out over the next year or so.

      @Harshad - I debugged the process more thoroughly yesterday and discovered that the updated values are being placed in the outbound table by the ABAP subroutine. It appears that SAP is determining that the variable names being placed in the table by the ABAP routine are not CHANGING parameters and does not write them to the table being passed back to the SAPscript. As I mentioned in my original message, the values are present in the SAPscript if I do a print preview followed immediately by issuing the output in transaction VL74. I am guessing that they are still in memory from the print preview as they are populated with the correct values as soon as the debugger starts. Do you have any ideas how I can get SAP to recognize that I did include the variables as CHANGING parameters or do I need to do something else?

      Thank you both for your responses!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.