on 01-25-2010 11:28 AM
Hi Gurus,
Good Day,
I have 5 columns(fields) in my internal table. For example- Installment(TVTBT-TEBEZ), Amount(FPLT-FAKWR), Payment Date(FPLT-AFDAT). The rest of 2 fields I have to calculate i,e Paid Amount(4th field) should be (FPLT-FAKWR) only those values where (FPLT-FKSAF = 'C') and Dues Amount(5th field) should be deducted from Balance amount-Paid Amount. Balance Amount is in my header data which is not an internal table. Here is my code-
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_TAB FROM TVTBT AS TVTBT
INNER JOIN FPLT AS FPLT ON TVTBTTETBE = FPLTTETXT
INNER JOIN FPLA AS FPLA ON FPLAFPLNR = FPLTFPLNR
INNER JOIN VBAK AS VBAK ON VBAKVBELN = FPLAVBELN
WHERE VBAK~VBELN = SO
AND TVTBT~SPRAS = 'EN'
AND TVTBT~TETBE NE '0009'.
MOVE IT_TAB-PAID_AMOUNT TO PAYMENT. ////// Payment is a variable that i declared before.
SELECT SINGLE FAKWR INTO PAYMENT FROM TVTBT AS TVTBT
INNER JOIN FPLT AS FPLT ON TVTBTTETBE = FPLTTETXT
INNER JOIN FPLA AS FPLA ON FPLAFPLNR = FPLTFPLNR
INNER JOIN VBAK AS VBAK ON VBAKVBELN = FPLAVBELN
WHERE VBAK~VBELN = SO
AND TVTBT~SPRAS = 'EN'
AND FPLT~FKSAF = 'C'.
Now fields are showing in my internal table. But coming repeatedly i,e for 2 rows field are coming twice but it should come once.
Please tell me how can I do this.
Thanks,
Tripod.
Edited by: Tripod on Jan 25, 2010 5:28 PM
Hi,
My problem is solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't understand your question. If you want to understand why you get several lines, break your join into several requests. Moreover, if you select only a few lines, I don't see what is the interest of using joins (more difficult to tune programs).
> AND TVTBT~SPRAS = 'EN'
language is only on 1 character (SE11 on table T002), English = 'E'
> MOVE IT_TAB-PAID_AMOUNT TO PAYMENT. ////// Payment is a variable that i declared before.
>
> SELECT SINGLE FAKWR INTO PAYMENT FROM TVTBT AS TVTBT
> INNER JOIN FPLT AS FPLT ON TVTBTTETBE = FPLTTETXT
> INNER JOIN FPLA AS FPLA ON FPLAFPLNR = FPLTFPLNR
> INNER JOIN VBAK AS VBAK ON VBAKVBELN = FPLAVBELN
> WHERE VBAK~VBELN = SO
> AND TVTBT~SPRAS = 'EN'
> AND FPLT~FKSAF = 'C'.
what are they used for??? (is that part of the question? how is it related to the internal table?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandra,
Good Day,
Thanks for your reply. These joining are necessary because I have to give Sales Order number in the parameter and based on this number values will come to my internal table as well as header data. As Sales Order is from VBAK-VEBLN. ..I have to make this inner joins here. In my internal table there is a cell called Amount (FPLT-FAKWR). Now this is the amount of every installments in sales order. In my 4th cell I have to show those amounts(FPLT-FAKWR) that are paid i,e for which instalments
FPLT-FKSAF = 'C' , those values will be showed in 4th cell. And in 5th cell Paid Amount will be deducted from Balance Amount.
Balance Amount i have calculated in my header portion of smartform.
Please give me some idea how I can do this.
Thanks,
Tripod.
Hi All,
Here I found 1 mistake that I am taking the value in a variable. If I use internal table then data not comes, that's why i took variable but problem is that in this variable only 1field is showing repeatedly.
Please help me.
Thanks,
Tripod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.