‎2008 Jun 11 11:45 AM
Hi ,
I had a requirment as follows.
In the Selection screen i have 4 blocks.
in the first block i have company code.
second block:
Customer ID
Industry key:
third block:
Posting document type:
posting date
clearing date
debit/credit indicator
offsetting account type
offsetting account
minimum amount.
I have designed above selection screen.
To featch the data there is two rules.
1)
SELECT Customer KNA1-KUNNR,
BP name KNA1-NAME1,
BP street address KNA1-STRAS,
BP post code KNA1-PSTLZ,
BP city KNA1-ORT01
BP country KNA1-LAND1
FROM KNA1
WHERE KNA1-KUNNR and KNA1-BRSCH correspond to values from u201Ccustomer master selectionu201D on selection screen.
for the above i have return the code as follows.
select kunnr
name1
stras
pstlz
ort01
land1
from kna1 into table it_kna1 where kunnr in kunnr and brsch in
brsch.
2)
For customers, selected in p.2, Select from BSAD payment items corresponding to selection criteria for payment documents from selection screen
Fields to select
Document type BSAD u2013 BLART
Document number BSAD-BELNR
Customer BSAD-KUNNR
Text BSAD-SGTXT (Contract nb)
Offsetting account (*see Rule 1)
Payment type (**see Rule 2)see
Payment amount (to get from offsetting GL account)
Posting date BSAD-BUDAT,
Clearing date BSAD-AUGDT,
Clearing document BSAD-AUGBL
Reference BSAD-XBLNR (bordereau)
Assignement BSAD-ZUONR (cheque nb)
Debit/credit indicator BSAD-SHKZG
Amount BSEG-DMBTR (*see Rule 1)
Sort by customer (BSAD-KUNNR) and payment type
for the above how to featch the data i am not getting.
Two rules to select the above off setting account and pament type.
Rule 1
SELECT offsetting account number BSEG-HKONT and BSEG-DMBTR from BSEG
WHERE BSEG-BELNR = BSAD-BELNR and BSEG-KOART = offsetting account type from selection screen and BSEG-DMBTR bigger then minimum amount from selection screen for payment documents.
Rule 2
IF ((document type = BT and offsetting account = 550000011) or (document type = ZF and offsetting account = 550000011)) THEN payment type = CASH
IF ((document type = ZF and offsetting account = 550##03 or 550##12) or (document type = DM)) THEN payment type = CHEQUE
IF (document type = BT and offsetting account = 550##06) THEN payment type = VIREMENT
IF (document type = DZ and offsetting account = 550##05) THEN payment type = PRELEVEMENT
.
Can you please help me how to get the data in the above case.
‎2008 Jun 11 1:48 PM
To the above questuion i am trying to write the query in the following format.
select kunnr
name1
stras
pstlz
ort01
land1
from kna1 into table it_kna1 where kunnr in kunnr and brsch in
brsch.
select blart belnr kunnr xblnr zuonr sgtxt budat augdt augbl shkzg from
bsad INTO CORRESPONDING FIELDS OF TABLE it_item1
FOR ALL ENTRIES IN it_kna1
where kunnr = it_kna1-kunnr.
But when it is comming to select for all entries it is going to dump,can any body help in this problem
‎2008 Jun 11 2:14 PM
check the first internal table if is initial or not. and then come up with a clear condtion in the where part of the query