‎2009 Feb 10 6:53 AM
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
‎2009 Feb 10 6:58 AM
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.
‎2009 Feb 10 6:58 AM
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.
‎2009 Feb 10 6:59 AM
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
‎2009 Feb 10 6:59 AM
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
‎2009 Feb 10 7:06 AM
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
‎2009 Feb 10 7:16 AM
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
‎2009 Feb 10 10:01 AM
Are you clear now...
it the code working?if you still have doubts..plz post
‎2009 Feb 10 10:14 AM