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

problem in smartform in fetching data

former_member187748
Active Contributor
0 Likes
430

Hi all,

i have a smartform, in which below codes are written, but it is not fetching values for some particular data.(for some values of "kunnr")

These fields are there in KNA1 table but for some sales order it is not picking values, please tell me what to do with this code.

(The same code is working properly for other sales order, but not giving output for particular data, eg, sales order no. 3033546) 

Please tell me what to change, i am not getting my data in debugging time, so tell me what to change in my code, so that i will get all these data.

select single vbpa~kunnr vbpa~parvw

        from vbpa

        into corresponding fields of wa_ca2

        where vbeln = vbeln

        and parvw = 'Z4'.

select single kna1~adrnr knvv~kdgrp knvk~adrnd knvk~adrnp_2

                    from kna1

                    inner join knvv on kna1~kunnr = knvv~kunnr

                    inner join knvk on kna1~kunnr = knvk~kunnr

                    into corresponding fields of wa_ca2

                    where kna1~kunnr = wa_ca2-kunnr.

select * from adrc into corresponding fields of wa_pa

                     where adrc~addrnumber = wa_ca2-adrnr.

endselect.

select * from adrc  into corresponding fields of wa_oa

                     where adrc~addrnumber = wa_ca2-adrnd.

endselect.

select * from adrc into corresponding fields of wa_prm

                     where adrc~addrnumber = wa_ca2-adrnp_2.

endselect.

1 ACCEPTED SOLUTION
Read only

guillaume-hrc
Active Contributor
0 Likes
386

Hi,

You are performing an INNER JOIN between 3 tables. This means there should be data for KUNNR in each and every of these 3 tables.

Is this true? For instance, do you have a contact person for every customer in KNVK?

Otherwise, I would suggest to perform OUTER JOIN instead. (e.g. LEFT OUTER JOIN on KNVK)

Best regards,

Guillaume

2 REPLIES 2
Read only

guillaume-hrc
Active Contributor
0 Likes
387

Hi,

You are performing an INNER JOIN between 3 tables. This means there should be data for KUNNR in each and every of these 3 tables.

Is this true? For instance, do you have a contact person for every customer in KNVK?

Otherwise, I would suggest to perform OUTER JOIN instead. (e.g. LEFT OUTER JOIN on KNVK)

Best regards,

Guillaume

Read only

0 Likes
386

Hi Guillaume,

thanks for your reply, i have fully deleted the inner join and separately written four lines of code in my select option in kna1 table, and my problem get resolved.