Skip to Content
avatar image
Former Member

HELP IN PERFORM

HI,

I Do this perform like below and i have to do the same perform exactly except the structre name that is cahnging.

do i have to build another Perform or i can avoid that with some technique ?

this is my perform :

PERFORM add_nodid TABLES node_tab pr_table cost_id.

*&---------------------------------------------------------------------*
*&      Form  ADD_NODID
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_NODE_TAB  text
*      -->P_PREVIOS_TABLE  text
*      -->P_COST_ID  text
*----------------------------------------------------------------------*
FORM add_nodid  TABLES   p_node_tab TYPE  zco_level2_ttype
                         p_pr_table STRUCTURE   zhr_level_2_month_str
                         p_cost_id LIKE  cost_id .

  FIELD-SYMBOLS: <fs_id> LIKE LINE OF cost_id ,<fs_node> LIKE LINE OF p_node_tab.
  DATA: wa_cost_id LIKE LINE OF cost_id.
  FIELD-SYMBOLS: <fs_add> TYPE zhr_level_2_month_str.


  LOOP AT p_node_tab ASSIGNING <fs_node>.
    SELECT SINGLE *
      FROM /bi0/hctcenter
      INTO CORRESPONDING FIELDS  OF wa_cost_id
      WHERE nodename = <fs_node>-znodename .
    IF sy-subrc = 0.
      APPEND wa_cost_id TO p_cost_id.
      CLEAR wa_cost_id.
    ENDIF.
  ENDLOOP.



  SORT p_previos_table BY dim0calmonth nodeid.
ENDFORM.    

What is changing is the :STRUCTURE zhr_level_2_month_str**

i wont to change it to zhr_level_2_quarter_str

and not build other perform.

Regards

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 31, 2008 at 01:12 PM

    may be you can try this...

    types: cost_t_id type standard table of cost_id,
              zhr_level_2_t_month_str type standard table of  zhr_level_2_t_month_str.
    
    FORM add_nodid  USING   p_node_tab TYPE  zco_level2_ttype
                                            p_cost_id  type  cost_t_id            <====create a table type
                             changing p_pr_table  type   zhr_level_2_t_month_str.
                               "<=========table type 
    
    
    
    
    ENDFORM.

    Add comment
    10|10000 characters needed characters exceeded

    • ok, in that case inside routine implementation how you going to handle differently the same internal table.

      FORM add_nodid TABLES p_node_tab TYPE zco_level2_ttype
                                             p_pr_table         "Don't refer any structure here..
                                             p_cost_id LIKE cost_id .
      
      
      endform.