Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in form-routines

Hello ABAP gutus,

i am using 10 form-routines to get some data, in all subroutines code is same, but i am passing different internal tables to all form-routines with USING, CHANGING parameters.

for example

perform get_header1 using itab changing jtab.

perform get_header2 using itab1 changing jtab1.

FORM get_header1 USING P_ITAB

CHANGING P_JTAB.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = r_alvtab

CHANGING

t_table = itab[].

CALL METHOD r_alvtab->get_columns

RECEIVING

value = r_col.

CALL METHOD r_col->get

RECEIVING

value = r_cols.

loop at r_cols into wa_col.

ref_col = wa_col-r_column.

CALL METHOD ref_col->get_medium_text

RECEIVING

value = lv_text.

jtab-header = lv_text.

APPEND jtab.

endloop.

endform.

FORM get_header2 USING P_ITAB

CHANGING P_JTAB.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = r_alvtab

CHANGING

t_table = itab1[].

CALL METHOD r_alvtab->get_columns

RECEIVING

value = r_col.

CALL METHOD r_col->get

RECEIVING

value = r_cols.

loop at r_cols into wa_col.

ref_col = wa_col-r_column.

CALL METHOD ref_col->get_medium_text

RECEIVING

value = lv_text.

jtab1-header = lv_text.

APPEND jtab1.

endloop.

endform.

as above i used 10 form-routines.but i passed different internal tables.after these subrotines i am using those internal table in function modules.

now my client wants me to maintain one form-routine instead of 10 form-routines.

Is it possible that? please tell me . its urgent, Thanks in adavance.

Regards

Mahesh

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question