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

Reg: Subroutine stmt

Former Member
0 Likes
1,086

Hi Experts,

I have a code which is standard include RPUAUDFR. Now some part of code in this include is used in my code. I have bit confusion....

* groesste und kleinste PerNr finden:
  PERFORM get_min_max_from_range_tab TABLES persnr USING 'P'
                          CHANGING lowpernr higpernr sy_subrc.

This is the perform, in which they used

TABLES

statement. this is obsolete now. Now i am using like this.

PERFORM get_min_max_from_range_tab USING s_persnr
                                            'P'
                          CHANGING v_lowpernr v_higpernr sy_subrc.

and form statement is

FORM get_min_max_from_range_tab
            USING fp_range_tab STRUCTURE s_DATUM
                                    value(fp_flag)
                               CHANGING fp_min
                                        fp_max
                                        fp_subrc.

  SORT fp_range_tab BY sign DESCENDING.
* NUR 'E'XCLUDE?
  READ TABLE fp_range_tab INDEX 1.

Is this valid statement? If yes, i got this error

"FP_RANGE_TAB" is not an internal table "OCCURS n" specification is missing

Please remember one point all are without header line.

Plase help me in this regard. This delivery date is today. Please help me....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,033

Hi,

Use this way...

FORM get_min_max_from_range_tab
            USING fp_range_tab type BAL_R_DATE       " Change
                                    value(fp_flag)
                               CHANGING fp_min
                                        fp_max
                                        fp_subrc.
  " You need to decalre the work area to access the records because fp_range_tab is table without header line.

DATA : l_range_tab like BAL_S_DATE.        " Add this line

  SORT fp_range_tab BY sign DESCENDING.
* NUR 'E'XCLUDE?
  READ TABLE fp_range_tab INTO l_range_tab INDEX 1.

Edited by: Avinash Kodarapu on Feb 2, 2009 3:03 PM

Hi Experts,

I have a code which is standard include RPUAUDFR. Now some part of code in this include is used in my code. I have bit confusion....

* groesste und kleinste PerNr finden:
  PERFORM get_min_max_from_range_tab TABLES persnr USING 'P'
                          CHANGING lowpernr higpernr sy_subrc.

This is the perform, in which they used

TABLES

statement. this is obsolete now. Now i am using like this.

PERFORM get_min_max_from_range_tab USING s_persnr
                                            'P'
                          CHANGING v_lowpernr v_higpernr sy_subrc.

and form statement is

FORM get_min_max_from_range_tab
            USING fp_range_tab STRUCTURE s_DATUM
                                    value(fp_flag)
                               CHANGING fp_min
                                        fp_max
                                        fp_subrc.

  SORT fp_range_tab BY sign DESCENDING.
* NUR 'E'XCLUDE?
  READ TABLE fp_range_tab INDEX 1.

Is this valid statement? If yes, i got this error

"FP_RANGE_TAB" is not an internal table "OCCURS n" specification is missing

Please remember one point all are without header line.

Plase help me in this regard. This delivery date is today. Please help me....

8 REPLIES 8
Read only

Former Member
0 Likes
1,034

Hi,

Use this way...

FORM get_min_max_from_range_tab
            USING fp_range_tab type BAL_R_DATE       " Change
                                    value(fp_flag)
                               CHANGING fp_min
                                        fp_max
                                        fp_subrc.
  " You need to decalre the work area to access the records because fp_range_tab is table without header line.

DATA : l_range_tab like BAL_S_DATE.        " Add this line

  SORT fp_range_tab BY sign DESCENDING.
* NUR 'E'XCLUDE?
  READ TABLE fp_range_tab INTO l_range_tab INDEX 1.

Edited by: Avinash Kodarapu on Feb 2, 2009 3:03 PM

Read only

0 Likes
1,033

Hi I used this way, but i got error like

In PERFORM or CALL FUNCTION "GET_MIN_MAX_FROM_RANGE_TAB", the actual parameter "S_PERSNR" is incompatible with the formal parameter "FP_RANGE_TAB".

The code is

PERFORM get_min_max_from_range_tab USING s_persnr[]
                                            'P'
                          CHANGING v_lowpernr v_higpernr sy_subrc.

Form:

FORM get_min_max_from_range_tab
            USING fp_range_tab type BAL_R_DATE
                                    value(fp_flag)
                               CHANGING fp_min
                                        fp_max
                                        fp_subrc.
DATA : l_range_tab like BAL_S_DATE.
  CLEAR: fp_subrc.
  SORT fp_range_tab BY sign DESCENDING.
  READ TABLE fp_range_tab INTO l_range_tab INDEX 1.

Please help me any inputs in this regard..........

Read only

0 Likes
1,033

Hope this helps:

start-of-selection.

data: it_t001 type standard table of t001.

select * into table it_t001 from t001.

perform write_itab using it_t001.

*&---------------------------------------------------------------------*
*&      Form  WRITE_ITAB
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_IT_T001[]  text
*----------------------------------------------------------------------*
form WRITE_ITAB using p_it_t001.

field-symbols: <fs> type standard table.
field-symbols: <fs1> type T001.

assign p_it_t001 TO <fs>.

loop at <fs> ASSIGNING <FS1>.
WRITE: <FS1>-BUKRS.

endloop.

endform.                    " WRITE_ITAB

regards,

S. Chandramouli.

Read only

Former Member
0 Likes
1,033

Hi,

You can try creating a data type in your se11 screen for your table and then create

type1 TYPE demo_dt "demo_dt-data type name

type1 will have a structure similar to the table now.

Hope this helps.

Regards,

Deepthi.

Read only

Former Member
0 Likes
1,033

Hi,

When declaring fp_range_tab(formal parameter) in form statement, use a table type in stead of structure s_datum

FORM get_min_max_from_range_tab

USING fp_range_tab type ty_DATUM

where ty_datum is a table type of structure s_datum.

With Regards,

Dwaraka.S

Read only

Former Member
0 Likes
1,033

Hi,

Check this exmaple, it is the correct way :


TYPES: BEGIN OF line,
        col1(1) TYPE c,
        col2(1) TYPE c,
      END OF line.

DATA: wa TYPE line,
      itab TYPE HASHED TABLE OF line WITH UNIQUE KEY col1,
      key(4) TYPE c VALUE 'col1'.

wa-col1 = 'X'. INSERT wa INTO TABLE itab.
wa-col1 = 'Y'. INSERT wa INTO TABLE itab.

PERFORM demo USING itab.

FORM demo USING p_table TYPE ANY TABLE.  " You can give the type here.
  ...
sort p_itab by ....
  READ TABLE p_table index 1
  ...
ENDFORM.

regards,

Advait

Read only

0 Likes
1,033

Sorry it is not working. I does not taking Sign, option, low and high....

Read only

Former Member
0 Likes
1,033

Answered