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

creating a query

Former Member
0 Likes
425

hi folks,

Anyone who can help me in this query?? Thanks a lot in advance.

I have two tables

Table 1 : jhak

Table 2 : Konv (cluster table)

The selection is based on the field customer number -(kunnr) in jhak table The common field between the two tables is 'knumv' and I need to extract data fields kwert,kawrt, kbetr from konv for the customer (the customer number data will be entered by the end user in the parameter-options field p_custid.

I cannot create views or use join statement to create the query. How can I create a linke between the two tables and extract data?

Thank you very much in advance.

santhosh

2 REPLIES 2
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
360

Hi,

Try the following.

declare i_konv ,i_jhak,i_output according to your requirement.

select knumv kwert kawrt kbetr into table i_konv from konv where kunnr = p_custid.

if sy-subrc ne 0.

select knumv kunnr ..... into table i_jhak from jhak for all entries in i_konv where knumv = i_konv-knumv and kunnr = p_custid.

endif.

loop at i_konv into w_konv.

move-corresponding w_konv to w_output.

...

loop at i_jhak into w_jhak where knumv = w_konv-knumv.

move-corresponding w_jhak to w_output.

append w_output to i_output.

endloop.

endloop.

Hoipe this helps.If so,reward points.Otherwise get back.

Read only

0 Likes
360

thanks Jayanti.

I really appreciate your help. The requirements have changed but it certianly helps I will implement it. If I have any questions I will get back to you on that.

I will reward the points to it.

But the field issue in the form is not solved yet.

Santhosh