cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Tables through program line.

Former Member
0 Kudos

Hi All,

I have requirment in smart forms.

I need to execute smartforms in form itself. means no chance to run with driver program.

So i created program line which where write our logic for internal table. My question is how to pass created internal table from program line. i need to display the internal table data using loop.

Thanks,

Subbu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try this :

code

REPORT report2.

DATA: text TYPE c LENGTH 10,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ABAP'.

APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'H'.

APPEND range_line TO range_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'K'.

APPEND range_line TO range_tab.

SUBMIT report1 USING SELECTION-SCREEN '1100'

WITH SELECTION-TABLE rspar_tab

WITH selcrit2 BETWEEN 'H' AND 'K'

WITH selcrit2 IN range_tab

AND RETURN.

[/code]

Reward points if found helpful.....

Cheers,

Chandra Sekhar.

Former Member
0 Kudos

Hi Chardra Sekar,

I am not going to write the code logic in report programs. I have to write the logic (getting table data through select statement at program lines).

Answers (2)

Answers (2)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Say for eg., you want to pass the mara table data into an internal table.

Program linCreate a program line and write the below code.

select * from mara into table itab.

Then in input parameter tab, type MARA .

In output parameter tab, type itab.

Before that In Global definitions, declare

mara type mara

itab type standard table of mara

Former Member
0 Kudos

Hi Jayanthi,

I tried your method.

I used to try 1) Declared in Global definition area (initialization tab)

mara type mara

itab type standard table of mara

2) In input parameter tab "type MARA".

In output paramaters tab "type itab".

3) Below code in Program line,

select * from mara into table itab

But it is showing error like "type MARA" invalid.

Thanks,

Subbu

Former Member
0 Kudos

if you are goin to code in the smartform itself... then no need of passing the itab data...

just define the itab as a global field of smartform.. and populate the data into that itab.,..

while printing just drag n drop the fields in desired location