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 in query help me

laxman_sankhla3
Participant
0 Kudos

hi

i m having problem in query please help me

here data is not coming

SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR WHERE

ZBUKR = P_BUKRS

AND UBHKT IN (P_OHKONT).

loop at int_payr.

OUT_HBKID = int_payr-W_hbkid .

MODIFY INT_PAYR.

endloop.

give me advice.

thanks .

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This example will help you ...

data: begin of i_mara occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

end of i_mara.

data: wa_maktx type maktx.

select matnr into table i_mara from mara where matnr =

'000000000000000001'.

select maktx into wa_maktx from makt

for all entries in i_mara where matnr = i_mara-matnr.

endselect.

loop at i_mara.

i_mara-maktx = wa_maktx.

modify i_mara transporting maktx .

endloop.

Regards,

Jayant

Please award if helpful

6 REPLIES 6

Former Member
0 Kudos

Hi

SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR WHERE

ZBUKR = P_BUKRS

AND UBHKT <b>IN (P_OHKONT).</b> Is p_ohkont a parameter or select option. If it is a parameter instead of 'IN' give '=' and also remove the braces.

Regards

Haritha.

Former Member
0 Kudos

use....

Modify int_patr transporting w_hbkid index sy-tabix..

will work fine..

Regards,

Jyant

Former Member
0 Kudos

Hi

What's your problem?

Where data is not coming?

What is P_OHKONT? is it Ranges or select-options field?

SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR WHERE

ZBUKR = P_BUKRS

AND UBHKT IN <b>P_OHKONT</b>.

This is wrong below?

What you are doing.

You got the field value HBKID into INT_PAYR internal table. Where you have to modify this.

Something wrong in the below code. check it.

<b>loop at int_payr.

OUT_HBKID = int_payr-W_hbkid .

MODIFY INT_PAYR.

endloop.</b>

Reward points if useful

Regards

Anji

Former Member
0 Kudos

Hi,

If P_OHKONT is a parameter

SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR WHERE

ZBUKR = P_BUKRS

AND UBHKT = P_OHKONT.

If P_OHKONT is a Select-options then

SELECT HBKID FROM PAYR INTO CORRESPONDING FIELDS OF TABLE INT_PAYR WHERE

ZBUKR = P_BUKRS

AND UBHKT in P_OHKONT.

Regards

Sudheer

Former Member
0 Kudos

Hi,

I think P_OHKONT is delared as parameter but refered in selection screen as select options.

Try to evalueate contains of P_OHKONT before running select stmt trhrough debugging...

ur loop statement seems to be incorrect: what are u doing here, nothing and modifying int_payr table.

Former Member
0 Kudos

This example will help you ...

data: begin of i_mara occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

end of i_mara.

data: wa_maktx type maktx.

select matnr into table i_mara from mara where matnr =

'000000000000000001'.

select maktx into wa_maktx from makt

for all entries in i_mara where matnr = i_mara-matnr.

endselect.

loop at i_mara.

i_mara-maktx = wa_maktx.

modify i_mara transporting maktx .

endloop.

Regards,

Jayant

Please award if helpful