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

select statement with condition = and (diaufk_where).

former_member317781
Active Participant
0 Likes
981

hi Good day,

i dint understand the meaning of the select statement when it is like this

   SELECT * FROM viaufks
             INTO CORRESPONDING FIELDS OF TABLE h_viaufks
             WHERE iphas      IN stat
             and (diaufk_where).

can i please know what and (diaufk_where) means?

your valueble info is highly appriciated.

thank you,

jacob.kata.

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
926

It means dynamically specifyying where clause.

for example your varriable may have

diaufk_where = ' BUKRS EQ '1000' and WERKS eq '2000' .'

Check where used list of this variable or in debugging you will see how it is filled

6 REPLIES 6
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
927

It means dynamically specifyying where clause.

for example your varriable may have

diaufk_where = ' BUKRS EQ '1000' and WERKS eq '2000' .'

Check where used list of this variable or in debugging you will see how it is filled

Read only

former_member221372
Participant
0 Likes
926

Hi,

Pls do debug,you will get solution.

Read only

former_member209120
Active Contributor
0 Likes
926

Hi   jacob kata

You can find this type of statement in Standard Program SAPDBAFI

Just debug... for solution...

Read only

Former Member
0 Likes
926

This is dynamic where condition..

please check this link for more info..

http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_DYNAMIC.htm

Read only

Former Member
0 Likes
926

Hi Jacob,

This is a condition syntax. It is used to write dynamic queries.

IF you notice this is a string structure.

During program execution this string variable  diaufk_where will have a conditions like field1 = value1, or logical expression using AND, OR, NOT etc.

When the select query is executed during run time, the condition or logical expression inside the string diaufk_where will also be checked. diaufk_where could be a structure or internal table. If its an internal table the conditions can extend across different rows.

If there is no value in diaufk_where, the logical expression result would be true.

Any syntax error in the cond_syntax can be caught using the try catch end try statements.

Read only

former_member317781
Active Participant
0 Likes
926

thanks a lot for the valuble input and much appriciated ,