2009 Feb 12 11:26 AM
Hi Gurus,
Am new to ABAP..Similar kind of post was there but soln was not provided..Need help from you..In my code have written as
loop at gi_amt
select belnr gjahr dmbtr into table gi_bseg from bseg
endloop.
gi_amt is a table which contains the value of EKBE which has the details of invoice reciept ,goods reciept and service entry.From the old post it was given as VGABE has the value of 1 and 2 which helps to differenctiate the invoice reciept and Goods reciept.My pblm is also same as posted before ie)have to compare the amount of invoice reciept and goods reciept alone.How to do it.Please help in coding
Hi Gurus,
Am new to ABAP..Similar kind of post was there but soln was not provided..Need help from you..In my code have written as
loop at gi_amt
select belnr gjahr dmbtr into table gi_bseg from bseg
endloop.
gi_amt is a table which contains the value of EKBE which has the details of invoice reciept ,goods reciept and service entry.From the old post it was given as VGABE has the value of 1 and 2 which helps to differenctiate the invoice reciept and Goods reciept.My pblm is also same as posted before ie)have to compare the amount of invoice reciept and goods reciept alone.How to do it.Please help in coding
2009 Feb 12 11:29 AM
HI Divya,
Welcome to SCN.
First mistake. Select with in the LOOP is peformance wise very low.you should not use select with in the loop.
Can you please explain what you want exactly.
Thanks
2009 Feb 12 11:36 AM
Hi,
Thanks for ur quick response.
My scenario is have to compare the amount of invoice reciept and goods receipt and after that have perform some tasks.But in this 1st part itself am stuck up.
In the internal table have the values of table EKBE which consists of values of invoice reciept,service reciept and goods reciept.I have to compare only the GR and IR amount.If its same have perform some task else other task.
Hope now am clear..
2009 Feb 12 11:44 AM
Hello Divya,
To identify GR: EKBE-VGABE = '1' & EKBE-BEWTP = 'E'.
To identify IR: EKBE-VGABE = '2' & EKBE-BEWTP = 'R'.
And the corresponding amounts are stored in EKBE-DMBTR.
What do you want in addition to this?
BR,
Suhas
Edited by: Suhas Saha on Feb 12, 2009 5:16 PM
2009 Feb 12 11:54 AM
I need to know the coding logic how to compare the amount fields from the internal table.Please help
2009 Feb 12 12:36 PM
Hi Divya,
Check the below logic, it may help you.
TYPES: ty_ekbe TYPE ekbe.
DATA: it_ekbe TYPE TABLE OF ty_ekbe,
wa_ekbe TYPE ty_ekbe,
wa_ekbe1 TYPE ty_ekbe.
SELECT * UP TO 20 ROWS
INTO TABLE it_ekbe FROM ekbe. "For example i have selected 20 records, you can hv condn here
LOOP AT it_ekbe INTO wa_ekbe WHERE vgabe = 1. "only IR
"Read corresponding GR
READ TABLE it_ekbe INTO wa_ekbe1 WITH KEY ebeln = wa_ekbe-ebeln vgabe = 2.
IF wa_ekbe-dmbtr EQ wa_ekbe1-dmbtr. "Compare the amounts
WRITE: / 'Amounts are equal for Document: ', wa_ekbe-ebeln. "If equal do some action
ELSE.
WRITE: / 'Amounts are not equal for Document: ', wa_ekbe-ebeln.
ENDIF.
ENDLOOP.Revert in case of any help.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Feb 12, 2009 1:37 PM
Edited by: Manoj Kumar on Feb 12, 2009 1:43 PM
2009 Feb 12 3:30 PM
HI DIvya,
Manoj code will work for you.
Implement that llogic.
Thanks
2009 Feb 12 3:39 PM
I have the values in the table which is got using a FM.Am not able to write select query .It specifies the table is not present.Table is declared in the FM as gi_amt like ekbe occurs 0 with header line.
2009 Feb 12 4:00 PM
HI,
I think same question you asked in another forum also i think Just now i have answered to you.
You don't have the statement select * from itab.
YOu can't write select for the internal table.
Thanks,
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |