‎2009 Jan 19 5:16 PM
I need to modify some SAP code. To make it easier for upgrades, I have decided to put this modification into a Z-include. However, I need to pass some data into this include. It tried the following but it is giving me an error in the include:
export document to MEMORY ID 'RET'.
include zretention_LRWCLF01.The code in the include is as follows:
import document from MEMORY ID 'RET'.Here it is giving me an error saying that "Document is unknown". What am I doing wrong?
Regards,
Davis
‎2009 Jan 19 5:20 PM
Hi,
Check whether Document is globally declared or not. if not you need to decalre in the indclude .
‎2009 Jan 19 5:20 PM
Hi,
Check whether Document is globally declared or not. if not you need to decalre in the indclude .
‎2009 Jan 19 5:24 PM
It isn't global to the include (SAP's include). It is local to the form inside the include. Is this the issue?
Davis
‎2009 Jan 19 5:26 PM
‎2009 Jan 19 5:26 PM
Hi Davis,
Please let me know whether you are calling your local program from SAP standard program using any user-exit?.
Best Regards,
Krishna
‎2009 Jan 19 5:38 PM
I am doing this call from a standard SAP include. I am having to do this in order to get a user-exit to work as we need it.
When I added the data statements, it told me that "Document is already declared". I am now in a loop with it as I can't declare it yet I can't "not declare it". I also get an error saying: "Statement is not accessible" on the Import statement.
Regards,
Davis
‎2009 Jan 19 5:40 PM
Can you post your custom include and also note where you call it from the SAP include?
Rob
‎2009 Jan 19 5:51 PM
Sure.
Right now my include only has a few lines:
import document from MEMORY ID 'RET1'.
import t_accit from MEMORY ID 'RET2'.
t_accit[] = document-item[].This include is located in form Document_Change in include LRWCLF01 (line 1037) just after the BADI calls.
Below is the code I have added to the SAP Include:
* Begin Modification for Retention
export document to MEMORY ID 'RET1'.
export t_accit to MEMORY ID 'RET2'.
include zretention_LRWCLF01.
* End Modification for RetentionRegards,
Davis
Edited by: Davis on Jan 19, 2009 12:51 PM
‎2009 Jan 19 5:58 PM
Rather than just the three statements in your include, try making it a form with using and changing. Then call the form where you currently have the include. You can put the include statement at the top of the SAP include.
Rob
‎2009 Jan 19 6:07 PM
Rob,
That is such an obvious idea that I never thought of it. That should fix the issue.
Thanks,
Davis
‎2009 Jan 19 5:20 PM
Hi Davis,
Please check whether your EXPORT command was successful first, check SY-SUBRC when export is done.
EXPORT.. IMPORT works if program session is same, make sure you are calling IMPORT.. EXPORT in the same session (sequence of programs in one go.. like batch program).
Best Regards,
Krishna
‎2009 Jan 19 5:49 PM
Hi,
When do you get this error ? Probably when you tried to do a syntax check or activate the include.
Since the variable document is not global, the visibility of this variable will only be limited to the subroutine ( form ...endform) . Therefore you will need to declare a variable with the name document in the include zretention_LRWCLF01 in order to get this working.
I think an include is loaded only at runtime hence it is not recognizing the document variable which is why you get this error.
Second option is to declare it in a global user exit include.
regards,
Advait