cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms

Former Member
0 Kudos

Hi,

I am creating a Smartform in which I have a table of 4 fields.

Now I want to split the table depending on the value of 2nd field.

Means whenever the 2nd field's value is changed,then a blank row will be inserted into the table.

How can I proceed?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi;

1. Declare a flag and put the value 'X' by default

2. Store the value in an another value which would match under the condition in the table containing the blank like , then clear the variable and store with the new value

Regards

Shashi

Former Member
0 Kudos

Hi Mini,

Try it this way:

Create a table, in that loop the internal table, under that first create a program line and after that create two text, one for blank line another to display data. Now in the condition tab of the blank text give a condition as BLANK EQ 'X'. Do it as below:

TABLE (loop itab into wa)
    Header
    Main Area
        ROW1
          CELL1
              Program_lines
              TEXT1     (empty no data, give condition for blank line that is BLANK EQ 'X')
              TEXT2     (data)
    Footer

In the program lines write a code as below and firstly decalre to global variable, in this case:

BLANK  TYPE CHAR1
  CARRID TYPE SPFLI-CARRID

Pass FS_ITAB-CARRID & CARRID as Input Parameters in program lines and BLANK as Output Parameters

Clear blank.  
If carrid ne FS_ITAB-carrid.
  blank = 'X'.
  carrid = FS_ITAB-carrid.
Else.
  blank = Space.  
Endif.

With luck,

Pritam.

Former Member
0 Kudos

hi,

there are other ways.

this is also one.

first declare 2 fields

gv_first type c with default 'X' at start

gv_secfield type xxxxxxxx (you know the type of your second itab-field)

in the table loop of your smartform some program statements

*first thing in the loop.

if gv_first = 'X'.

gv_secfield = wa_itab-secfield.

clear gv_first.

endif.

just before the normal printing of your line.

print a empy line only if gv_secfield <> wa_itab-secfield. (output condition)

normal your line printing

just before the end in the loop.

progrma logic with statement

gv_secfield = wa_itab-secfield

hope this works.

Gr., Frank

Former Member
0 Kudos

HI Mini,

Create the event Begin on that particular field create the line type and create the text node and leave as blank and display as per your requirement.

Regards,

Sravanthi

Former Member
0 Kudos

Hi Sravanthi,

I am telling you what I have done step by step.

I have given a sort criteria with that field and check the check box Event On sort Begin.

Then on right clicking on the event, I create a table line and entered a blank text.

But it is not working.

Former Member
0 Kudos

Yea.... Thanks every one.It is working fine.

Former Member
0 Kudos

you can modfiy your internal table based on your requirement. where your filed got chnaged append the empty line your internal table...

AT NEW of second filed

you can prepare your internal table and pass it in smartform