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

Program for Sub Routinues

Former Member
0 Likes
464

can any one send me the subroutine program ie passing internal table Using the key words using and changing.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

Check sample programs: demo_mod_tech_example_1

demo_mod_tech_example_2

demo_mod_tech_example_3

demo_mod_tech_example_4

demo_mod_tech_example_5

demo_mod_tech_example_6

3 REPLIES 3
Read only

Former Member
0 Likes
433

To pass internal table, we need to use TABLES statement. If we need to pass WORK AREA we can use USING AND CHANGING.

Below example can give you some idea:

PERFORM save_text_tn TABLES it_tline

USING thead 'X'

CHANGING sy-subrc.

FORM save_text_tn TABLES p_tline STRUCTURE tline

USING p_thead STRUCTURE thead

p_flag TYPE c

CHANGING p_subrc LIKE sy-subrc.

ENDFORM

Read only

Former Member
0 Likes
433

Hi,

please fing the sample subroutine which reads the TVARVC entries in to ranges.

data: r_kunnr for mseg-kunnr.

perform u1000_get_tvarvc tables r_kunnr

using 'XYZ.

*subroutine

*______________

form u1000_get_tvarvc tables range_table

using variable.

data: u1000_layout type ref to data.

field-symbols: <fs_table> type any,

<fs_comp> type any.

select low as low high as high opti

as option sign as sign from tvarvc

into corresponding fields of table range_table

where name = variable.

if sy-subrc eq 0.

*Check that the data is consistent for a RANGE table

create data u1000_layout like range_table.

assign u1000_layout->* to <fs_table>.

loop at range_table assigning <fs_table>.

do.

assign component sy-index of structure <fs_table> to <fs_comp>.

if sy-subrc ne 0.

exit.

else.

case sy-index.

when 1.

if <fs_comp> is initial.

move 'I' to <fs_comp>.

endif.

when 2.

if <fs_comp> is initial.

move 'EQ' to <fs_comp>.

endif.

endcase.

endif.

enddo.

endloop.

endif.

endform."u1000_get_tvarv

Read only

Former Member
0 Likes
434

Check sample programs: demo_mod_tech_example_1

demo_mod_tech_example_2

demo_mod_tech_example_3

demo_mod_tech_example_4

demo_mod_tech_example_5

demo_mod_tech_example_6