cancel
Showing results for 
Search instead for 
Did you mean: 

how to control records in the smartform output

Former Member
0 Kudos

Dear Freinds,

i have developed smartform , however i have one problem .... iam using the table option in the smartform .

iam getting data in the internal table(Itab) as below before sending to smartform

empno Empname Loantype Amount Designation Location

101 Raja 102 200 supervisor Delhi

101 Raja 103 300 supervisor Delhi

the output in the smart form iam getting as two pages

Empno : 101 Empname : Raja location : delhi

Loantype: 102 Amount 200 Designation : supervisor

Empno : 101 Empname : Raja location : delhi

Loantype: 103 Amount 300 Designation : supervisor

which is wrong

I want the loand type 102 and 103 and amount 200 & 300 should be come two values in the

same record (in one record) and not two records.

ie. the data should come as below:

Empno : 101 Empname : Raja location : delhi

Loantype: 102 Amount 300 Designation : supervisor

103 200

Please help me how i can restrict as one record and get displayed .

regards

madhuri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can control the records, but it depends on the values in the main internal table's data. Can you assure you self that the loan types will be always less than or equal to two.

So that you can fix the position of each data being displayed.

Main internal table

empno Empname Loantype Amount Designation Location

101 Raja 102 200 supervisor Delhi

101 Raja 103 300 supervisor Delhi

Fix another two fields in the main internal table which looks like

empno Empname Loantype Amount Designation Location loantype amount

101 Raja 102 200 supervisor Delhi 103 300

Now display it .

But one thing you need to know how many loan types will come

Regards,

Venkatesh

Former Member
0 Kudos

Dear Venkatesh,

I have checked with my Functional owner he said for this company code we have only two loan types fixerd, and we will not be getting any other loan types.

So could you please give me little bit more idea , to get the data displayed in smart form as

empno empname loantype Amount Designation place

101 Raja 102 200 supervisor Delhi

103 300

Regards

Madhuri.

Former Member
0 Kudos

Hi,

If your Functional guy says that there will be only 2 loan type. You can try this .

create a Global Variable V_flag = 'X' , V_empno.

Create a Loop node with internal table i_emp into w-emp.

create a Program line.

if v_empno = w_empno.

v_flag = ' '.

else.

v_empno = w_empo.

v_flag = 'X'.

endif.

Create Text element to Print empno empname loantype Amount Designation place with Condition V_flag = ' '.

create text element to Print loantype Amount with Condition v_flag = 'X'.

So for every New empolyee first text element gets printed, and while processing the next record,

it check if its the same employee ... if its same it will print the second text element ( loan type and Amount).

if its a new empolyee then first text element gets printed.

Note : You need to sort the table based on emp no .

Thanks

Naveen

Answers (0)