cancel
Showing results for 
Search instead for 
Did you mean: 

can we get the item data in smart form

Former Member
0 Kudos

i have a header table with 3 records and item with 10 records.. i am passing both of them to the function module ( fm_name) and then in the smartform i have to get 3 pages output. but right now i am getting only one page..

to display the header data i am using secondary windows and for displaying the item data i am using tables node in the main window ( in the data tab of the tables node i am giving it as loop it_item1 into wa_item1 ). before the header row of that table node i have created a table node and in that i am prearing the item table it_item..as

describe table i_hdr line h_lines.

if h_idx LE h_lines.

READ TABLE i_hdr into wa_hdr index h_idx.

if sy-subrc eq o.

loop at it_item into wa_item where belnr = wa_item-belnr.

move wa_item to wa_item1.

append wa_item1 to i_item1.

clear wa_item1.

endloop.

endif.

this is what i am doing it right now.. and at the last row in the footer of table node i have created a command node and in that i have selected the option go to page : first page.

please correct me if my approach is wrong

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 29, 2009 12:03 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You try ur logic in

do ---endo.

after describing the table .

Do the loop for the number of records available.

i.e. as per your logic.



describe table i_hdr line h_lines.

do h_lines times.

------
-----
put your above code and enddo.



Hope this will work.

Answers (2)

Answers (2)

Former Member
0 Kudos

In the footer section of the line item table you just need to put the command line for go to new page and that to pointing on next page. I guess that will be enough to break the page for next header data.

Former Member
0 Kudos

I didn't get clear idea about what u did in the code but we can get item data in smartform.

I think what u did is correct. i.e



READ TABLE i_hdr INTO wa_hdr INDEX h_idx.
IF sy-subrc EQ o.
  LOOP AT it_item INTO wa_item WHERE belnr =  wa_hdr-belnr

  MOVE wa_item TO wa_item1.
    APPEND wa_item1 TO i_item1. 
    CLEAR wa_item1.
  ENDLOOP.

Former Member
0 Kudos

Hi..Mr.Pravin..

i tried..that way..i am not getting that...so..plzz...give the approach