cancel
Showing results for 
Search instead for 
Did you mean: 

Can you change program symbols using PERFORM in SAPscript?

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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?).

former_member209818
Active Contributor
0 Kudos

By SAP Symbols, I think you mean Variable which SAP is passing from Driver program to SAP Script. If needed, you can very well Modify the contents of these varible. But make sure that by doing that, you are not hampering the further processing of the Scripts.

Former Member
0 Kudos

@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!