Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Pass a ranges as parameter in a form

Former Member
0 Kudos
10,708

I have this code:

ranges: it_table for table-field.

perform test1 TABLES it_table.

.....

.....

The question is: How can I define the parameter in the form ???

FORM test 1 TABLES it_table ??????

Thanks

1 ACCEPTED SOLUTION

Former Member
2,269

Hi , try this.

DATA : r_matnr TYPE RANGE OF matnr.

PERFORM range_check USING r_matnr[]. " Using/Changing

FORM range_check USING p_test like r_matnr[].

ENDFORM. "range_check

Hope it helps you

Rj

7 REPLIES 7

faisal_altaf2
Active Contributor
0 Kudos
2,269

Hi,

It is Simple Test the code Bellow

REPORT test NO STANDARD PAGE HEADING.

PARAMETERS: ptest TYPE string.

PERFORM test using ptest.

*&---------------------------------------------------------------------*
*&      Form  test
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->FTEST      text
*----------------------------------------------------------------------*
FORM test USING ftest.
  WRITE: ftest.
ENDFORM.                    "test

Best Regards,

Faisal

Former Member
0 Kudos
2,269

if u do an epc it will say ranges is obsolete.

use it as

DATA: it_table type range of table-field.

pass it as changing parameter.

кu03B1ятu03B9к

Former Member
0 Kudos
2,269

Hi,

pass it in this way...

RANGES: it_table FOR table-field.

PERFORM test1 CHANGING it_table[].

.....
.....

*The question is: How can I define the parameter in the form ???

FORM test1 CHANGING pv_it_table TYPE STANDARD TABLE.

  DATA fs_table LIKE it_table.
  LOOP AT pv_it_table INTO fs_table.
  " use fs_table to process the statements...
  ENDLOOP.
ENDFORM.                                                    "test1

Tables statement is obsolete try using this it really works

Regards,

Siddarth

Former Member
2,270

Hi , try this.

DATA : r_matnr TYPE RANGE OF matnr.

PERFORM range_check USING r_matnr[]. " Using/Changing

FORM range_check USING p_test like r_matnr[].

ENDFORM. "range_check

Hope it helps you

Rj

former_member156446
Active Contributor
0 Kudos
2,269

Hi try this way:

FORM test 1 TABLES it_table structure selopt.

Former Member
0 Kudos
2,269

Hi,

If need generic assignmet use field symbols :

   PERFORM set_range TABLES r_gbstk USING 'BT' 'A' 'B'.

   FORM set_range TABLES t_range
                USING    p_option
                         p_low
                         p_high
                .
  FIELD-SYMBOLS : <fs>.
  ASSIGN COMPONENT 'SIGN' OF STRUCTURE t_range TO <fs>.
  <fs> = 'I'.
  ASSIGN COMPONENT 'OPTION' OF STRUCTURE t_range TO <fs>.
  <fs> = p_option.
  ASSIGN COMPONENT 'LOW' OF STRUCTURE t_range TO <fs>.
  <fs> = p_low.
  ASSIGN COMPONENT 'HIGH' OF STRUCTURE t_range TO <fs>.
  <fs> = p_high.
  APPEND t_range.
ENDFORM.                    " SET_RANGE

Former Member
0 Kudos
2,269

Hi try this,

PERFORM test_1 USING date2 string2 number2 count2.

FORM test_1 USING now

                    txt TYPE c

                    value(num) TYPE p

                    int TYPE i.

perform podata TABLES it_ekko.

form podata tables it_ekko type ekko