Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How do I dynamically "INCLUDE......" depending on condition

Former Member
0 Likes
649

Hello all,

In order to be able to transport a program from DEV to QAS to PROD (and not getting errors), in my program I would like to be able to do the following:

IF SY-SYSID = PROD.

include /1BCDWB/IQG000000000118DAT. "Generated by SAP QUERY. exists in PROD only

.

.

IF SY-SYSID = QAS.

include /1BCDWB/IQG000000000222DAT. "Generated by SAP QUERY. exists in QAS only

.

.

IF SY-SYSID = DEV.

include /1BCDWB/IQG000000000777DAT. "Generated by SAP QUERY. exists in DEV only

.

.

Syntax check errors prevent me from generating the program as all "include" arguments must exist beforehand.

So I need a way of selecting the right INCLUDE argument dynamically depending on some condition without getting syntax errors.

Your help is greatly appreciated.

Hello all,

In order to be able to transport a program from DEV to QAS to PROD (and not getting errors), in my program I would like to be able to do the following:

IF SY-SYSID = PROD.

include /1BCDWB/IQG000000000118DAT. "Generated by SAP QUERY. exists in PROD only

.

.

IF SY-SYSID = QAS.

include /1BCDWB/IQG000000000222DAT. "Generated by SAP QUERY. exists in QAS only

.

.

IF SY-SYSID = DEV.

include /1BCDWB/IQG000000000777DAT. "Generated by SAP QUERY. exists in DEV only

.

.

Syntax check errors prevent me from generating the program as all "include" arguments must exist beforehand.

So I need a way of selecting the right INCLUDE argument dynamically depending on some condition without getting syntax errors.

Your help is greatly appreciated.

2 REPLIES 2
Read only

rainer_hbenthal
Active Contributor
0 Likes
558

include can never be dynamic. Either you include something or not.

Read only

JozsefSzikszai
Active Contributor
0 Likes
558

hi,

to determie query generated program name dynamically you have to use FM RSAQ_REPORT_NAME in your pogram.

On the other hand why do you want to include a query source code into your program? It does not make any sense (at least for me)...

ec