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 query using abapsource

Former Member
0 Likes
721

Hi,

In function module /DSD/ME_GL_MATERIAL there is a select been used

SELECT * INTO TABLE ldt_material_hd FROM /dsd/me_mat_hd

UP TO i_max_reccnt ROWS

WHERE mat_type IN so_mat_type

AND (ldt_wa).

The value for ldt_wa been populate by

IF ldf_sel IS INITIAL.

CONCATENATE 'updflg = ' space '''' 'X' ''''

INTO lds_wa.

ldt_wa = lds_wa.

APPEND ldt_wa.

ELSE.

ldt_wa = ldf_sel.

APPEND ldt_wa.

ENDIF.

So the content of ldt_wa is coming as updflg = 'X'.

In the query if it coming as 'X' the select query is not picking data from the table. Can you please explain what is this field is doing in this select query.

Expecting the solution .

Ambrose

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
691

HI,

Try this way..

DATA: G_X type C Value 'X'.

IF ldf_sel IS INITIAL.
   CONCATENATE 'mat_type IN so_mat_type AND updflg = ' g_x  
                    INTO lds_wa SEPRATED BY SPACE.
   ldt_wa = lds_wa.
   APPEND ldt_wa.
ELSE.
   ldt_wa = 'mat_type IN so_mat_type'.
   APPEND ldt_wa.
ENDIF.


SELECT * INTO TABLE ldt_material_hd FROM /dsd/me_mat_hd
UP TO i_max_reccnt ROWS
WHERE (ldt_wa).

6 REPLIES 6
Read only

Former Member
0 Likes
692

HI,

Try this way..

DATA: G_X type C Value 'X'.

IF ldf_sel IS INITIAL.
   CONCATENATE 'mat_type IN so_mat_type AND updflg = ' g_x  
                    INTO lds_wa SEPRATED BY SPACE.
   ldt_wa = lds_wa.
   APPEND ldt_wa.
ELSE.
   ldt_wa = 'mat_type IN so_mat_type'.
   APPEND ldt_wa.
ENDIF.


SELECT * INTO TABLE ldt_material_hd FROM /dsd/me_mat_hd
UP TO i_max_reccnt ROWS
WHERE (ldt_wa).

Read only

0 Likes
691

Dear Avinash,

Thanks for your reply.But i need what this (ldt_wa) is doing the query .

Ambrose

Edited by: ambrose mohandoss on Mar 16, 2009 9:28 AM

Read only

0 Likes
691

It is a dynamically filled where clause.

Read only

former_member222860
Active Contributor
0 Likes
691

May be there's no records with that condition

WHERE mat_type IN so_mat_type
AND updflg = 'X'.

Pl. check the data.

Read only

Former Member
0 Likes
691

Hi,

Can you pleae check this link

Thanks and regrds

Durga.K

Read only

dev_parbutteea
Active Contributor
0 Likes
691

Hi,

The FM first tries to check if there is a user exit for material handling.

If yes,

It tries to retrieve a dynamic where clause to restrict selection

end if.

if no clause was retrieved.

lds_wa = updflg = 'X'.

endif.