Application Development 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: 

Problem with select query

Former Member
0 Kudos

Hi All,

i_dfkkko-xblnr

IF NOT i_dfkkko[] IS INITIAL .

SELECT opbel

belnr

FROM erchc

INTO TABLE i_erchc1

FOR ALL ENTRIES IN i_dfkkko

WHERE opbel EQ i_dfkkko-xblnr.

ENDIF.

I am using the above select query.problem is when i put the value

of i_dfkkko-xblnr by going to the table erchc i am getting the record.But this qury is not resulting any value.

i have checked in debug mode copied the value of xblnr of i_dfkkko

and went to erchc table and passed to opbel of erchc i got the reords.

can anybody pls help..

Rgds,

Sai

8 REPLIES 8

vallamuthu_madheswaran2
Active Contributor
0 Kudos

Hi,

IF NOT i_dfkkko[] IS INITIAL .

SELECT opbel

belnr

FROM erchc

INTO CORRESPONDING FIELDS OF TABLE i_erchc1

FOR ALL ENTRIES IN i_dfkkko

WHERE opbel EQ i_dfkkko-xblnr.

ENDIF.

Thanks & Regards,

Vallamuthu.M

0 Kudos

Hi,

I tried using 'corresponding fields of' ,that is also not working..

Rgds,

Sai

Former Member
0 Kudos

Hi,

IF NOT i_dfkkko[] IS INITIAL .

SELECT opbel
              belnr
   FROM erchc
     INTO *CORRESPONDING FIELDS OF* TABLE i_erchc1
FOR ALL ENTRIES IN i_dfkkko
*WHERE opbel = i_dfkkko-xblnr.*

ENDIF.

Please reward points if it helps

Thanks

Vikranth

Former Member
0 Kudos

Hi,

OPBEL and XBLNR both have different lengths. So FOR ALL ENRIES will fail .

0 Kudos

Hi,

I have defined i_dfkkko like below.

TYPES : BEGIN OF ty_dfkkko,

opbel LIKE dfkkko-opbel,

xblnr(12),

herkf LIKE dfkkko-herkf,

budat LIKE dfkkko-budat,

END OF ty_dfkkko.

Rgds,

Sai

Former Member
0 Kudos

HI,

The fields XBLNR and OPBEL or not having same length, please check once. Try to change the field declaration in temp internal table for field XBLNR and move i_dfkkko values to temparary table then use for all entries addition on temp table and also check the below code

SELECT belnr

LFDNR

OPBEL

FROM erchc

INTO TABLE i_erchc1

FOR ALL ENTRIES IN i_dfkkko

WHERE opbel = i_dfkkko-xblnr.

ENDIF.

When ever you want to use for all entries addition then try to retrieve all primary keys, because the for all entries addition would work like select and delete adjacent duplicates.

Rgds,

Bujji

former_member223537
Active Contributor
0 Kudos

Hi,

The database would be having the value with leading zeroes.

Use FM "CONVERSION_EXIT_ALPHA_INPUT" to conver the values & then pass to select query.

_dfkkko-xblnr

IF NOT i_dfkkko[] IS INITIAL .

loop at i_dfkkko.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
VALUE(INPUT) = i_dfkkko-xblnr
IMPORITNG
VALUE(OUTPUT) = i_dfkkko-xblnr.
modify i_dfkkko.
endloop.


SELECT opbel
belnr
FROM erchc
INTO TABLE i_erchc1
FOR ALL ENTRIES IN i_dfkkko
WHERE opbel EQ i_dfkkko-xblnr.
ENDIF.

0 Kudos

Hi,

I have deleted the leading zeroes,but still the same problem...

Rgds,

Sai