cancel
Showing results for 
Search instead for 
Did you mean: 

Table within a table in smartforms

Former Member
0 Kudos

Hi everyone-

Sorry for creating the question in ABAP development forum and not in the one for smartforms but I couldnt find one for scripts and smartforms.

Coming to the question, I have a requirement wherein I need to print line item data(EKPO) and below each line item scheduled delivery data(EKET) via a smartform. I can loop at ekpo into an internal table and use that table in a smartform and print it out but what about scheduled delivery data. Is it possible to declare a table inside another table?

To make it a little bit clear this is how it should eventually look

Line Item   | Material | Material Desc | Qty | UOM | Unit Cost

0010          | 123       | Box Spring     |   5   | EA    | 450

Scheduled Delivery | Qty | Components | Unit Cost | Delivery Date

                             |    2 |  Box Spring  |   450        | 8/1/2012

                             |    3 | Box Spring   |   450        | 10/1/2012

Line Item   | Material | Material Desc | Qty | UOM | Unit Cost

0020          | 125       | Box               |   3   | EA    | 150

Scheduled Delivery | Qty | Components | Unit Cost | Delivery Date

                             |    3 |  Box            |   450        | 8/1/2012

Thanks,

Aneesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try the output management space

http://scn.sap.com/community/output-management

Rob

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

you can create a node Table inside the smartform and set EKPO in DATA (you mark the Internal Table flag and put EKPO INTO WA_EKPO). Then you create a row with your EKPO header and one with EKPO data.

Inside the table you create a node LOOP and set the EKET table as the Internal Table. In the WHERE Condition of the LOOP put

EBELN = WA_EKPO-EBELN

EBELP = WA_EKPO-EBELP

You can sort by ETENR if you need.

Former Member
0 Kudos

Try to manage this situation in the program, you can create an output table with generic fields type char and append it as you want to show including the headers. In the smartforms you'll just need to loop the output table and print the values managing the page breaks.

Regards,
Felipe

SharathSYM
Contributor
0 Kudos

try this approach,

  DATA:

    lw_print TYPE ssfctrlop.           " Smart Forms: Control structure

loop at ekpo into an internal table

        lw_print-no_close = 'X'.

         AT LAST.

           lw_print-no_close = ' '.

         ENDAT.

          Call Smartform FM,

          ( in smartform use table for scheduled delivery data )

          lw_print-no_open = 'X'.

  ENDLOOP.