2008 Nov 18 2:32 PM
Hello,
There is Selection Screen where it allows to enter KUNNR, LAND1 and VBELN.
I want to display below fields from table specified.
VBELN, FKART, FKDAT WAERK, KUNRG, KUNWE from VBRK Table, BSTNK, VBELN, AUART from VBAK Table, POSNR, MATNR, FKIMG, WAVWR from VBRP Table, KBETR from KOMV and MWSBP from KOMP.
So i need to find out query to display above fields data as output as per input in selection screen. default values if nothing entered in Selection screen are all data.
Please help me with Program or Query to retrieve above data.
Thanks,
2008 Dec 04 9:38 AM
KONV table has field KBETR, and you can find MWSBP in VBRK (MWSBK). since they are not transparent tables. you need some common fields to fetch data frm konv. Field "knumv" is common to them.
regarding query, create internal table separately for each table.
At item level, fetch data from VBRP.
then proceed with other table with keyword "FOR ALL ENTRIES IN i_vbrp".
once you done with that, move ur data final internal table will have all details.
Thank You,
Pintoo D
Hello,
There is Selection Screen where it allows to enter KUNNR, LAND1 and VBELN.
I want to display below fields from table specified.
VBELN, FKART, FKDAT WAERK, KUNRG, KUNWE from VBRK Table, BSTNK, VBELN, AUART from VBAK Table, POSNR, MATNR, FKIMG, WAVWR from VBRP Table, KBETR from KOMV and MWSBP from KOMP.
So i need to find out query to display above fields data as output as per input in selection screen. default values if nothing entered in Selection screen are all data.
Please help me with Program or Query to retrieve above data.
Thanks,
2008 Nov 18 2:38 PM
hi New
lets see what you can write first.. If you have any question then get back to forum..
2008 Nov 18 2:52 PM
If there was single table, i could have done that
for eg. Select vbeln fkart fkdat waerk from vbrk into table <internal table name> where kunrg in <selection screen parameter name>
But i m not sure of joining more than one tables and then fetching.
I would rather look for syntax not complete solution though.
2008 Nov 18 3:00 PM
Well... you seem to be new to ABAP.. hope this helps.....
select VBELN, FKART, FKDAT WAERK, KUNRG, KUNWE
from vbrk
into table t_vbrk
where vbeln = s_vbeln. " given in selection screen
if sy-subrc = 0.
endif.
select BSTNK, VBELN, AUART
from vbak
into table t_vbak
where vbeln = s_vbeln.
if sy-subrc = 0.
endif.
Similarly write the other select queries as well.
Its very useful if you pass the key fields while selecting from the database. Helps in faster processing.
Regards.
2008 Nov 18 3:01 PM
Make sure that the order of the fields is same as in the data base table, and in the internal table.
And remove the commas as well.
Regards.
2008 Nov 18 3:03 PM
Hi ,
First make an internal table as it_final having all the req fields
second make it_vbrk, it_vbak, it_vbrp, it_komv, it_komp internal tables with required fields.
third, Open ddic tables & find out relations among all the tables,
fourth, now select data from tables into internal tables based on conditions,
and use for all entries to fill it_final table...
Try this, your logic will enhance........
Thanks & Regards,
Krishna..
2008 Nov 18 3:03 PM
Hi ,
First make an internal table as it_final having all the req fields
second make it_vbrk, it_vbak, it_vbrp, it_komv, it_komp internal tables with required fields.
third, Open ddic tables & find out relations among all the tables,
fourth, now select data from tables into internal tables based on conditions,
and use for all entries to fill it_final table...
Try this, your logic will enhance........
Thanks & Regards,
Krishna..
2008 Nov 18 3:07 PM
Hi,
I'm not going to help you with the code as Jay rightly said. for that you can use F1 on select queries. Once you find how to join tables, you can join tables VBRK and VBRP, then in the VBRP-AUBEL you will get the Sales order order number, using that you can fetch data from VBAK.
And KOMP is not a transparent table. So you might need to use some other table.
regards,
Advait
2008 Dec 04 9:14 AM
Any suggestion or idea as what needs to be done ??
jusst logic.
2008 Dec 04 9:18 AM
If you want to find the prices of the sales order,using the VBAK-KNUMH you can fetch data from KONV table.
regards,
Advait
2008 Dec 04 9:38 AM
KONV table has field KBETR, and you can find MWSBP in VBRK (MWSBK). since they are not transparent tables. you need some common fields to fetch data frm konv. Field "knumv" is common to them.
regarding query, create internal table separately for each table.
At item level, fetch data from VBRP.
then proceed with other table with keyword "FOR ALL ENTRIES IN i_vbrp".
once you done with that, move ur data final internal table will have all details.
Thank You,
Pintoo D
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |