cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table in smartforms

former_member308418
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member308418
Participant
0 Kudos

Hi,

My problem is solved.

Sandra_Rossi
Active Contributor
0 Kudos

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?)

former_member308418
Participant
0 Kudos

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.

former_member217544
Active Contributor
0 Kudos

Hi Tripod,

Can you explain:


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.

Which field is coming twice?

And is that happening for all rows?

Regards,

Swarna Munukoti

former_member308418
Participant
0 Kudos

Hi , Swarna Munukoti,

My problem is solved.

Thanks,

Tripod.

Former Member
0 Kudos

Hi,

Please close the thread, if solved with the proper comments and solution.

Regards,

Aditya

former_member308418
Participant
0 Kudos

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.