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

form perform

Former Member
0 Likes
853

Hi,

In my code i keep calling the same function module many times for different tables.

i want to write a perform changing parameter where i will have to call the form just by changing the table name.

thanks.

Gayatri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
821

u can code the perform lik:

PERFORM get_drp USING c_val.

n while call this u will hve this value c_val

c_val will be used in this FM and u can pass it here.

FORM get_drp USING p_c_id TYPE vrm_id. " p_c_id will get this value here

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = p_c_id

values = it_itab[]

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

7 REPLIES 7
Read only

Former Member
0 Likes
822

u can code the perform lik:

PERFORM get_drp USING c_val.

n while call this u will hve this value c_val

c_val will be used in this FM and u can pass it here.

FORM get_drp USING p_c_id TYPE vrm_id. " p_c_id will get this value here

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = p_c_id

values = it_itab[]

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

Read only

Former Member
0 Likes
821

Hi ,

FIELD-SYMBOLS <fs_tab> TYPE STANDARD TABLE.

all the places you want to pass the tab :

case 1

ASSIGN i_admin_chng TO <fs_final>.

  • ALV Display

PERFORM f_alv_display USING v_struct <fs_final> .

case 2.

ASSIGN i_ee_change TO <fs_final>.

  • ALV Display

PERFORM f_alv_display USING v_struct <fs_final> .

<<<<form

FORM f_alv_display USING

p_fs_final TYPE STANDARD TABLE .

then use the table p_fs_final

this will work...reply if helpful

Read only

Former Member
0 Likes
821

Hi,

Just check the code below...

DATA: it_pa0000 TYPE pa0000, it_pa0001 TYPE pa0001.

perform my_function CHANGING pa0000.

perform my_function CHANGING pa0001.

&----


*& Form MY_FUNCTION

&----


  • text

----


  • <--P_PA0000 text

----


FORM MY_FUNCTION CHANGING P_PA0000.

ENDFORM. " MY_FUNCTION

Read only

Former Member
0 Likes
821

Hi ,

Perform subroutine_name Changing tab_name1.


Perform subroutine_name Changing tab_name2.

Perform subroutine_name Changing tab_name3.

Perform subroutine_name Changing tab_name4.

Form Subroutine_name Changing p_itab.
Call  Function 'Function_Module_Name'
Exporting 
.
.
.
itab_name = p_itab
.
.
.
.
.
Exceptions
.
.
.

Endform.

This will help you.

Regards

Pinaki

Edited by: Pinaki Mukherjee on Feb 10, 2009 8:06 AM

Read only

Former Member
0 Likes
821

hi Gayatri,

chk this.....

perform <name> using itab.

form <name> using p_itab type index table.

u can also use the 'tables' addition

form <name> tables <itab>.

TYPE INDEX TABLE

The system checks whether the actual parameter is an index table (standard or sorted table). The formal parameter inherits all of the attributes (line type, table type, key) from the actual parameter.

TYPE STANDARD TABLE

The system checks whether the actual parameter is a standard internal table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.

TYPE SORTED TABLE

The system checks whether the actual parameter is a sorted table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.

TYPE HASHED TABLE

The system checks whether the actual parameter is a hashed table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.

Regards,

mdi.deeba

Read only

0 Likes
821

Are you clear now...

it the code working?if you still have doubts..plz post

Read only

Former Member
0 Likes
821

hi gaytri,

can you check this link it would helpful to you..

Thanks

durga.K