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

Pass Select-Options and Parameter to a FunctionModulw

Former Member
0 Likes
1,482

Hi Guys,

Have a situation as follows:

Have to pass both the "select-options" and "PARAMETERS" to a function Module.

The "Select-options" and "Parameter" are "so_msg" and "p_dir" as described below.

SELECTION-SCREEN BEGIN OF BLOCK IdocFilter WITH FRAME TITLE text-001.

select-options: so_msg for EDIDC-MESTYP.
PARAMETERS:   p_dir type EDIDC-DIRECT.

SELECTION-SCREEN END OF BLOCK IdocFilter.

The Function module to which I have to pass these things Looks as follows:

How to pass the select-option and parameter to the following Function Module?

FUNCTION zsd_find_error_idocs.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      OUTTAB STRUCTURE  ZCIDOC_OUT
*"      INTAB STRUCTURE  ZCIDOC_IN
*"----------------------------------------------------------------------

Iam calling this function as follows:

CALL FUNCTION 'ZSD_FIND_ERROR_IDOCS'
    DESTINATION space
    TABLES
      outtab    = z_outtab_orders_12
      intab     = z_intab
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.

Thanks

K

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,392

EFG_RANGES allows only select options , what about parameter then ?.

RSPARAMS can be used for both.

13 REPLIES 13
Read only

Former Member
0 Likes
1,392

Solved the problem by using EFG_RANGES.

Read only

0 Likes
1,392

It Compiles,but gives me an Dump on running.

The Error analysis says that Iam passing the right type but not the right length.

select-options: so_msg for EDIDC-MESTYP.

FUNCTION zsd_find_error_idocs.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" REFERENCE(DIRECTION) LIKE EDIDC-DIRECT

*" TABLES

*" OUTTAB STRUCTURE ZCIDOC_OUT

*" INTAB STRUCTURE ZCIDOC_IN

*" IDOC_TYPE STRUCTURE EFG_RANGES

  CALL FUNCTION 'ZSD_FIND_ERROR_IDOCS'
    DESTINATION space
    EXPORTING
    direction       = p_dir
    TABLES
      outtab    = z_outtab_orders_12
      intab     = z_intab
      idoc_type = so_msg[]
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.

Edited by: Kohinoor72 on Jan 31, 2011 1:32 PM

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,392

In your program before calling the function call RS_REFRESH_FROM_SELECTOPTIONS. This will hold all your selection screen values. Now create a parameter of type RSPARAMS_TT in your custom fm. Then pass the parameter SELECTION_TABLE of the function RS_REFRESH_FROM_SELECTOPTIONS to your custom fm. Later in your fm you can loop at it and use it. The select option and parameters will be differentiated in it using P and S.

Read only

0 Likes
1,392

But I want to pass it directly using the "EFG_RANGES" parameter.

The Dump says that so_msg has the right typee but not the right length.How to correct this...

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,393

EFG_RANGES allows only select options , what about parameter then ?.

RSPARAMS can be used for both.

Read only

0 Likes
1,392

Paramter Iam passing as an input parameter.

Read only

0 Likes
1,392

Dear,

The error you are getting is very basic . Please have close look into it .

Read only

0 Likes
1,392

Sorry Keshav:). I dont know how to fix this error.

Read only

0 Likes
1,392

Hi,

Check out this [LINK|http://abap.googlar.eu/viewtopic.php?f=5&t=28]

hope it helps..

EDIDC-MESTYP - lenght char 30

EFG_RANGES-LOW - lenght char 45..

Read only

0 Likes
1,392

No Sucesss with "EFG_RANGES".

It gives me still the dump saying field length incorrect.

Want to Use "EFG_RANGES" beacuse in my Function Module,I want to check

something as follows using the "IN" keyword.

SELECT * FROM edidc CLIENT SPECIFIED INTO CORRESPONDING FIELDS

OF table outtab WHERE mandt = '020'

and CREDAT = z_datum

AND mestyp in so_msg

Read only

0 Likes
1,392

check out the following structure EDM_MESTYP_RANGE and see if you can use that instead of EFG_RANGES

Read only

0 Likes
1,392

Hi Kohinoor,

define the it as IMPORTING parameter TYPE STANDARD TABLE.

The you can use it with IN.

Regards,

Clemens

Read only

0 Likes
1,392

Thanks Clemens....

It works Now......:)Thanks a lot...