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

Problems with range parameter

Former Member
0 Likes
761

Hi @ all,

my problem is that I need a selection mask with a range parameter but without doing this with select-options because under the mask there should appear the SALV Table(in a container).

I did this:

Report test.

TYPES: gs_matnr TYPE RANGE OF mara-matnr. 
DATA: p_matnr TYPE gs_matnr.

method data_select. "selects p_matnr from a table

..

endmethod.

method fill_output_list. "fills the results into a SALV Table

...

endmethod.

On my Dynpro I created two fields: p_matnr-low and p_matnr-high

The user fills out the mask and the parameter will given to data_select method. After that it'll be processed in fill_output_list. Eventually the SALV Table is shown by: "objectreference->ino_salv_table->refresh( )" in PAI module .

My question is how to send the range parameter to both methods?

I did following but it doesn't work properly:

CALL METHOD objectreference->data_select
                         IMPORTING 
                         ipf_matnr = p_matnr.

Cheers,

Tuncay

5 REPLIES 5
Read only

Former Member
0 Likes
700

HI,

You can use this structure SELOPT or

DATA: p_matnr TYPE STATNDARD TABLE OF RANGE_MATNR.

Read only

0 Likes
700

Hi Avinash,

Thanks for your fast response!

I implemented your suggestion but it doesn't works because of an error:

Report test.
 
TYPES: gs_matnr TYPE RANGE OF mara-matnr. 
DATA: p_matnr TYPE STANDARD TABLE OF gs_matnr.
 

CLASS lcl_mat_liste DEFINITION.
  PUBLIC SECTION.
    METHODS: data_select
                         IMPORTING
                              ipf_matnr TYPE gs_matnr,
                      fill_out.
   ENDCLASS.

MODULE status_7000 OUTPUT.
  SET PF-STATUS 'SALV_TABLE_STANDARD'.
  SET TITLEBAR '7000'.

  IF ( go_mat_liste IS INITIAL ).
    CREATE OBJECT go_mat_liste.
  go_mat_liste->ino_salv_table->display( ). "Gib erst leere Tabelle aus
  ENDIF.
ENDMODULE.

MODULE user_command_7000 INPUT.
  CASE ok_code.
    WHEN 'BACK' OR 'LEAVE' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'ENTER'.

     CALL METHOD go_mat_liste->data_select
                 EXPORTING
                  ipf_matnr = p_matnr.   "*ERROR: Data type of ipf_matnr does not fit to p_matnr!* 
      
     CALL METHOD go_mat_liste->fill_out( ).
     go_mat_liste->ino_salv_table->refresh( ).

ENDMODULE.

Edited by: Tuncay Zaya on Jun 3, 2009 2:27 PM

Read only

0 Likes
700

You need to specify

p_matnr[]

rather than

p_matnr

because the method is looking for a table, not the header line of the table.

Read only

0 Likes
700

Hello Tuncay

There is still an error in your coding:


TYPES: gs_matnr TYPE RANGE OF mara-matnr.  " <<< already a table type w/o header line
DATA: p_matnr TYPE STANDARD TABLE OF gs_matnr.  " <<< presumably complex type

" Better:
TYPES: ty_rng_matnr    TYPE RANGE OF matnr.
DATA:
  gt_rng_matnr               TYPE ty_rng_matnr.

...
CLASS lcl_mat_liste DEFINITION.
  PUBLIC SECTION.
    METHODS: data_select
                         IMPORTING
                              ipf_matnr TYPE ty_rng_matnr,
                      fill_out.
   ENDCLASS.
...
CALL METHOD go_mat_liste->data_select
                 EXPORTING
                  ipf_matnr = gt_rng_matnr. 
...

Regards

Uwe

Read only

Former Member
0 Likes
700

Hi,

thanks for your solutions but I took another way to solve it.

Now I'm using SUBSCREENS as my Inputfield so I can use SELOPT. So I don't need TYPE RANGE OF or other stuff. SELOPT is building for me ranges of matnr.

Listing:

SELECTION-SCREEN BEGIN OF SCREEN 7500 AS SUBSCREEN.
*SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS: p_lgnum LIKE mlgn-lgnum OBLIGATORY,
            p_werks LIKE mard-werks OBLIGATORY,
            pa_mtart TYPE mtart OBLIGATORY DEFAULT 'ZMB',
            pa_mstav TYPE mstav.
SELECT-OPTIONS p_matnr FOR gs_matnr.
PARAMETERS: pa_meinh TYPE lrmei.

*SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 7500.

PROCESS BEFORE OUTPUT.
MODULE STATUS_7000.
CALL SUBSCREEN SELECT INCLUDING sy-repid '7500'.
MODULE SALV_7000.

PROCESS AFTER INPUT.
 CALL SUBSCREEN SELECT.
 MODULE USER_COMMAND_7000.

Cheers

Tuncay