Application Development and Automation 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: 
Read only

Passing range to form

h_senden2
Active Contributor
0 Likes
3,925

Hi,

how can i pass a range to a form ?

example :

types: tt_data type table of ty_data,
data: i_data type tt_data,
      r_data type range of matnr.
...   
perform send_data using    i_data 
                  changing r_data.
...
...
form send_data using    pi_data type tt_data
               changing pr_data type ???????

Which type must i use in the form declaration ?

regards,

Hans

1 ACCEPTED SOLUTION
Read only

Former Member
2,081

REPORT YRT_TEST4.

data: r_range type range of matnr.

perform test changing r_range.

&----


*& Form test

&----


form test changing p_r_range like r_range.

endform. " test

REgards,

Ravi

Hi,

how can i pass a range to a form ?

example :

types: tt_data type table of ty_data,
data: i_data type tt_data,
      r_data type range of matnr.
...   
perform send_data using    i_data 
                  changing r_data.
...
...
form send_data using    pi_data type tt_data
               changing pr_data type ???????

Which type must i use in the form declaration ?

regards,

Hans

6 REPLIES 6
Read only

Former Member
0 Likes
2,081

hi,

declare a global table and use it has reference in form

that is in top include or before include statement

git_matnr type ranges of matnr.

form send_data tables lit_tab like git_matnr.

example

 


lit_switchnum    TYPE RANGE OF eideswtdoc-switchnum.....
     declared globally


 PERFORM f4000_switchdoc_summary TABLES
*                                        lit_swtch_sum
                                         lit_swt_mprn_det
                                         lit_lt_act_date
                                         s_crdate
                                         s_swtdoc

FORM f4000_switchdoc_summary
                      TABLES
                             yt_swt_mprn_det STRUCTURE ls_swt_mprn_det
                             yt_lt_act_date  STRUCTURE ls_lt_act_date
                             xt_crdate       LIKE      lit_create_date
                             xt_swtdoc       LIKE      lit_switchnum

Message was edited by: Manoj Gupta

Read only

dani_mn
Active Contributor
0 Likes
2,081

types: tt_data type table of ty_data,

data: i_data type tt_data.

RANGES: r_data FOR vbap-matnr.

...

perform send_data using i_data

changing r_data.

...

...

form send_data using pi_data type tt_data

changing pr_data type ???????

Regards,

Wasim Ahmed

Read only

Former Member
2,082

REPORT YRT_TEST4.

data: r_range type range of matnr.

perform test changing r_range.

&----


*& Form test

&----


form test changing p_r_range like r_range.

endform. " test

REgards,

Ravi

Read only

Former Member
0 Likes
2,081

Hi hans,

1. we have to use TABLES (and not using)

2. like this.

...

...

form send_data

<b>tables mytable structure i_data</b>

using pi_data type tt_data

where i_data should be a data variable declared

3. eg.

report abc.

tables : mara.

ranges : myrange for mara-matnr.

PERFORM ABC TABLES MYRANGE.

FORM ABC TABLES RG STRUCTURE MYRANGE.

ENDFORM.

regards,

amit m.

Read only

Former Member
0 Likes
2,081

Hi again,

1. If we pass using LIKE,

p_r_range like r_range

then the whole data of range

(range is nothing but an internal table)

<b>WILL NOT BE PASSED</b>

to the subroutine.

(syntax would be ok, no problem in that)

2. if we want <b>to pass the FULL RANGE AND ITS DATA</b>,

we should pass using TABLES only.

regards,

amit m.

Read only

Former Member
0 Likes
2,081

This message was moderated.