‎2006 Sep 08 12:50 PM
Hi frinedz,
plz help me any one .
briefly explain how to select and how to link one table with another with loops and inner joins depending on below requirements
selection screen fields:company code
sales org
plant :from-to
invoice no:from-to
date range; from-to
1 take the plant code of the billing documents selected from VBRP-WERKS and refer table T001W, where VBRP-WERKS=T001W-WERKS.
GET adress number from T001W-ADRNR and refer table ADRC, WHERE:T001W-ADRNR=ADRC-ADDRNUMBER.
get the name of the plant from ADRC-NAME1.
get the T001W-LAND1 and T001W-REGIO, and get the satte code by refering table T005U.
2.FROM THE INVOICE NUMBERS GENERATED out of the selection parametres,take up the billing document numbers from table VBRK with the following parameters.
VBRK-FKDAT
VBRK-FKART=F2(BILLING TYPE)
THE BILLING DOCUMENT SHOULD BE OF THE EQUIPMENTS MATERILAS.
3.TAKE the billing document creation date from tableVBRP,for the given document number being populated in the report
4.the material level details are required ,goto table VBRP.the table would be referenced with the VBRK-vbelen field,where VBRK-VBELN=VBRP-VBELN.
5.TAKE THE value of the material from VBRP only
6.take the delivering plants region code from table VBRP.VBRP-WERKS-PLANT CODE.since the description of the region is required, goto table TOO1W.input the following:
VBRP-WERKS=T001W-WERKS
7.since the customer name is required. take from KNA1.table KNA1 is referenced from using the customer code from table VBRP-KUANG, where VBRP-KUNAG=KNA1-KUNNR
8. ship to customers region is required , we need to identify FROM kna1
9.LR number from VTTK
10.LR date , transporter no from VTTK table
‎2006 Sep 08 1:00 PM
selection screen fields:company code
sales org
plant :from-to
invoice no:from-to
date range; from-to
1 take the plant code of the billing documents selected from VBRP-WERKS and refer table T001W, where VBRP-WERKS=T001W-WERKS.
GET adress number from T001W-ADRNR and refer table ADRC, WHERE:T001W-ADRNR=ADRC-ADDRNUMBER.
get the name of the plant from ADRC-NAME1.
get the T001W-LAND1 and T001W-REGIO, and get the satte code by refering table T005U.
-->
SELECT VBRP-WERKS T001W-ADRNR T001W-LAND1 T001W-REGIO
into table itab
FROM VBRP inner join T001W on VBRP~WERKS = T001W-WERKS.
Loop at itab.
SELECT NAME1 into ITAB-NAME1 FROM ADRC WHERE
ADDRNUMBER = ADRNR.
SELECT BEZEI into ITAB-BEZEI from T005U WHERE
spras = sy-langu and land1 = itab-land1 and
regio = itab-regio.
modify itab.
endloop.
-->
Message was edited by: Anurag Bankley