cancel
Showing results for 
Search instead for 
Did you mean: 

Display line items in Cells of a table- Smartform

Former Member
0 Kudos

Hello All,

Can any one help me achieving the below requirement.

I have a requirement of printing invoice with a smartform. I am displaying line items from a TABLE node by looping VBRP's internal table. There are 12 cells and the 5 th cell contains a number of Dicount rates.

I am displaying these discount rates from LOOP node by looping KONV's internal table within that CELL. The 7 th Cell has got 2 values which are required to be: one aligned to the TOP right corner of the cell and the other to the bottom right side of the cell.

Now the issue description is:

CELL-5: Contains unknown number of values for display within the cell to be positioned as MIDDLE justified for an item(POSNR) of the main item table.

CELL-7: Contains two fixed values :KWERT to be at Top right of the CELL-7and NETWR at the bottom right of CELL-7

I have managed to display the sub items in CELL-5 in the middle by giving values to SPACE BEFORE/SPACE AFTER sections of PARAGRAPH FORMAT in SMART STYLE.

Requirement: Irrespective of number of sub items in CELL-5 the 2 values in CELL- 7 to be aligned as one at the top right and the other to the bottom right cell flexibly . Same applies to other items(POSNR) of MAIN VBRP item table.

The ROWS of the MAIN Table to be flexible enough to shrink the space when then are less number of subitems in CELL-5.

Values in Cell-7 should be adjusted according to contents in CELL-5.

Thanks in advance for your valuable suggestions.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I have resolved the issue by creating a balnk line type (LINE2) under the line items LINE1 node wiith the same number of cells as that of line items (LINE1). I have added TEXT at the required CELLs (7 through 12 in my case) leaving others blank and adjusted paragraphs in smart styles.

Since I have required a particular pattern for the table, I have created a TEMPLATE for Table header above the TABLE node and appended line items just below with required PATTERN(Vertical lines in my case). I have selected each CELL and applied a Horizontal line like pattern.

Then the issue was with footer data for the TABLE where I had already created other blank line types . I have recreated and applied the required pattern.

Thanks for your response.

Cheers!

0 Kudos

Hi,

Do one thing while filling the 5th cell , count the number of values(counter) in it for each record and fill new internal table (Itab_cell7) as follws.

DATA : FLAG,

counter1 type n.

DO COUNTER TIMES.

counter1 = counter1 + 1.

CLEAR FLAG.

IF counter = 1.

WA_CELL7-VALUE = KWERT.

APPEND WA_CELL7 TO ITAB_CELL7.

FLAG = 'X'.

ENDIF.

IF counter1 = (counter1 - 1).

WA_CELL7-VALUE = KWERT.

APPEND WA_CELL7 TO ITAB_CELL7.

FLAG = 'X'.

EXIT.

ENDIF.

IF FLAG NE 'X'.

WA_CELL7-VALUE = ''.

APPEND WA_CELL7 TO ITAB_CELL7.

ENDIF.

ENDDO.

Adjust the code if need as per your data.

In cell 7 under loop node print ITAB_CELL7 values in a text. and prepare a paragragh for alingment.

if it does not work for send me the XML file for your smartform.

Regards,

Antim

che_eky
Active Contributor
0 Kudos

Sridhar,

When displaying discount rates in Cell 5 populate an internal table for use in Cell 7. Then use the internal table to print KWERT and NETWR at the correct positions in Cell 7.

For example say you display 3 discount rates (DR) in Cell 5:

dr1

dr2

dr3

For each DR displayed in cell 5 insert a blank line into internal table IT_CELL_7. In the above example IT_CELL_7 will contain three blank rows:

<blank row 1>

<blank row 2>

<blank row 3>

Now when displaying Cell 7 create Flow Logic Program Lines to insert KWERT into the first row of table IT_CELL_7 and NETWR into the last row of table IT_CELL_7:

<KWERT>

<blank row 2>

<NETWR>

Now create a loop over table IT_CELL_7 and print its contents in Cell 7. The above will ensure irrespective of number of sub items in CELL-5 the 2 values in CELL- 7 to be aligned as one at the top right and the other to the bottom right cell flexibly.

Che

Former Member
0 Kudos

hi,

create a dummy line type and place that in the column 7. and make the alignment as possible.

Regards,

Phani.