cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms : Repeation of data on the smartforms, but in ABAP is correct.

subhash_verma
Explorer
0 Kudos

Hi all,

I am fetching the data on the smartforms by ABAP program, but when it is comming on the smartforms, it is repeat.

In the ABAP program, i have a internal table which is contain the some fields, and in the smartforms, i am using the table ->Program lines ->Text to show the data. so how am i correct it.?

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Check your loop in the TABLE, it may make the text repeat.

subhash_verma
Explorer
0 Kudos

Hi,

I have not done the loop under the table in smartforms. actually i have a internal table with 3 records and this internal table, i have used in smart forms. but when i have execute the ABAP program then system only fetch the top 1 records and shows the 3 times on the smartforms.

regards,

Former Member
0 Kudos

Hi,

How many text elements you have created to display your internal table data?

Thanks,

Archana

Former Member
0 Kudos

Hi,

If data is gone the way that you said, please check your internal table before pass to form interface.

subhash_verma
Explorer
0 Kudos

Hi,

There are seven text element under the single row under the table.

regards,

Former Member
0 Kudos

Can you tell me how many columns your table contains?

And how many you actually want to display?

Thnaks,

Archana

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

use the Loop in the table node and pass your internal table name and work are to the loop. and print the internal table fields in the text elements based on your condition..

Hope this will help you..

Regards,

Kiran

subhash_verma
Explorer
0 Kudos

Hi,

i have already done but the same problem comes.

regards,

Former Member
0 Kudos

Hi Subhash,

In smartform, when you want to display a table, in data tab of the table, you need to give your table name and work area name.

So, whatever data you want to display in that tablw will be displayed using the work area and text elements.

First of all, loop on the table, inside the table, you must have created some line types to display your data.

So, in main area of tha table, create a table line, in that table line create a text element.

In that text elemnt you need to give your work area variable name.

So, your data will be displayed correctly.

You don't need to write any logic inside table using program lines as you are fetching all the data in your print program itself.

Thnaks,

Archana

subhash_verma
Explorer
0 Kudos

Hi,

Actually i have done the same as you are saying, i want to show the data on the smartforms with some conditions. like if posgint_key = 31 then variable_name = amount elseif .............................endif. like that.

regards,

Former Member
0 Kudos

Hi,

You can achieve this using 'Conditions' tab in the table.

You can insert your condition there, if you want to display your table only when this condition is true.

posgint_key eq 31.

And if you want to restrict your text based on this condition then , youy can insert codition only for partcular row of the table.

Like, consider you have 2 rows in the table,

if posgint_key eq 31 then you can display amount and

if posgint_key ne 31 then you can display other variable as per your requirement.

Hope this helps.

Thanks,

Archana

subhash_verma
Explorer
0 Kudos

Hi,

I have a internal table with data as:

doc no ref. no posting_key amount

1002 po/0012 31 15000

1002 po/0012 40 1000

1002 po/0012 50 500

and i have a four variable as: netamt, grsamt, tdsamt & othamt.

then i have a condition as :

IF WA_FINAL-BSCHL = '31'.

NETAMT = WA_FINAL-DMBTR.

ENDIF.

-


IF WA_FINAL-BSCHL = '40'.

GRSAMT = WA_FINAL-DMBTR.

ENDIF.

-


IF WA_FINAL-BSCHL = '50'.

TDSAMT = WA_FINAL-DMBTR.

ENDIF.

-


READ TABLE T_FINAL INTO WA_FINAL

WITH KEY BELNR = WA_FINAL-BELNR.

OTHAMT = WA_FINAL-DMBTR.

alter this conditon i want to show the data on the smartforms as:

srno. docno refno netamt(net amt) grsamt(gross amt) tdsamt(tds amt) othamt (other amt)

Regards,

Former Member
0 Kudos

In this case,

You can create a loop in your window. In that use your internal table and work area.

Inside this loop, add program lines and in program lines write your below code.

IF WA_FINAL-BSCHL = '31'.
  NETAMT = WA_FINAL-DMBTR.
ENDIF.

IF WA_FINAL-BSCHL = '40'.
  GRSAMT = WA_FINAL-DMBTR.
ENDIF.

IF WA_FINAL-BSCHL = '50'.
  TDSAMT = WA_FINAL-DMBTR.
ENDIF.

READ TABLE T_FINAL INTO WA_FINAL
  WITH KEY BELNR = WA_FINAL-BELNR.
  OTHAMT = WA_FINAL-DMBTR.

Then after the loop, create a template and in that create text elements for 'srno. docno refno netamt(net amt) grsamt(gross amt) tdsamt(tds amt) othamt (other amt)' and then pass your variable in the program line to these text elements.

Your issue will be resolved.

Thanks,

Archana

Former Member
0 Kudos

Or you can put code node in your item of table node. But clear your variables after every loop:


CLEAR: netamt, grsamt, tdsamt, othamt.
IF wa_final-bschl = '31'.
  netamt = wa_final-dmbtr.
ELSEIF wa_final-bschl = '40'.
  grsamt = wa_final-dmbtr.
ELSEIF wa_final-bschl = '50'.
  tdsamt = wa_final-dmbtr.
ENDIF.

othamt = wa_final-dmbtr.

put your code node upper the text node.

regards,

Former Member
0 Kudos

Hi,

Do you know how to use table node to display in smartforms?

regards,