Application Development 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: 

Need help to do Perform

Former Member
0 Kudos
57

Hi ,

i have this code that return 7 times maybe i can do one perform

for all this code?

i new with this Topic

Regards

*---------first time-------*

  CONCATENATE : eff_per_begin+2(4)  eff_per_begin+0(2) INTO eff_per_begin,
                eff_per_end+2(4) eff_per_end+0(2)  INTO  eff_per_end.

  LOOP AT it_tab ASSIGNING <it_tab>
    WHERE dim0calmonth GE eff_per_begin
    AND   dim0calmonth LE  eff_per_end.
    APPEND <it_tab> TO efficiency_tab.
  ENDLOOP.

  LOOP AT efficiency_tab ASSIGNING <efficiency_tab>.
    MOVE-CORRESPONDING  <efficiency_tab> TO wa_eff_tmp.
    APPEND wa_eff_tmp TO eff_tmp.
    CLEAR wa_eff_tmp.
  ENDLOOP.

  LOOP AT eff_tmp INTO wa_eff_tmp.
    COLLECT wa_eff_tmp INTO eff_col.
  ENDLOOP.

*----------seconed-------*

  CONCATENATE : over_per_beg+2(4)  over_per_beg+0(2) INTO  over_per_beg,
                over_per_end+2(4) over_per_end+0(2)  INTO  over_per_end.

  LOOP AT it_tab ASSIGNING <it_tab>
    WHERE dim0calmonth GE over_per_beg
    AND   dim0calmonth LE over_per_end.
    APPEND <it_tab> TO overtime_tab.
  ENDLOOP.

  LOOP AT effi_tab ASSIGNING <effi_tab>.
    MOVE-CORRESPONDING  <effi_tab> TO wa_over_tmp.
    APPEND wa_over_tmp TO over_tmp.
    CLEAR wa_over_tmp.
  ENDLOOP.

  LOOP AT over_tmp INTO wa_over_tmp.
    COLLECT wa_over_tmp INTO over_col.
  ENDLOOP.

and so on.... 7 times

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
41

Hi,

Yes you can put this in a subroutine.

Any variable name that will be different each time it is called or any that is changed by the subroutine need to be defined as parameters of the subroutine.

Regards,

Nick

2 REPLIES 2

Former Member
0 Kudos
42

Hi,

Yes you can put this in a subroutine.

Any variable name that will be different each time it is called or any that is changed by the subroutine need to be defined as parameters of the subroutine.

Regards,

Nick

Former Member
0 Kudos
41

Hi,

1.Define a form like this.

Form form_name using tables it_tab type yours_table,

efficiency_tab type

eff_tmp type .

CONCATENATE : eff_per_begin2(4) eff_per_begin0(2) INTO eff_per_begin,

eff_per_end2(4) eff_per_end0(2) INTO eff_per_end.

LOOP AT it_tab ASSIGNING <it_tab>

WHERE dim0calmonth GE eff_per_begin

AND dim0calmonth LE eff_per_end.

APPEND <it_tab> TO efficiency_tab.

ENDLOOP.

LOOP AT efficiency_tab ASSIGNING <efficiency_tab>.

MOVE-CORRESPONDING <efficiency_tab> TO wa_eff_tmp.

APPEND wa_eff_tmp TO eff_tmp.

CLEAR wa_eff_tmp.

ENDLOOP.

LOOP AT eff_tmp INTO wa_eff_tmp.

COLLECT wa_eff_tmp INTO eff_col.

ENDLOOP.

Endform.

2.Call this form by perform form_name using tables it_tab

eff_effieciency

eff_tmp .

Regards,

Shiva.