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

Multiple selection in Function Module

Former Member
0 Likes
2,664

Hi Experts,

Can we go for mutiple selection in our own Function Module? How we can go for mutiple selection in our own Function Module? Anyone help me.

Example:

we have to give multiple input values for company code when we execute the function module .

suppose import parameter are

company code 3000

4000

5000

6000

plant 3215

matnr 100002992

i have to select the records based on this multiple company codes.Here i want multiple selection for company code.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,699

Hi again,

1. Simple.

2.

REPORT abc.

PARAMETERS : a(30) TYPE c DEFAULT '1012345'.

PARAMETERS : num TYPE i DEFAULT 5.

DATA : l TYPE i.

DATA : pos TYPE i.

l = STRLEN( a ).

pos = l - num .

WRITE 😕 a+pos(num).

regards,

amit m.

14 REPLIES 14
Read only

suresh_datti
Active Contributor
0 Likes
1,699

Hi,

You can use the Tables parameter & pass mutiple values to the function module.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
1,699

Hi ,

I agree with Suresh.

It is my mistake I thought you are using standard function.

Lanka

Message was edited by: Lanka Murthy

Message was edited by: Lanka Murthy

Read only

Former Member
0 Likes
1,699

Hi Suresh,

can you explain me detaily with example?

Hi Lanka,

i want multiple selection for TCode. i can define TCode as a parameter. but i cant pass it to Function module.because there is no import parameter for Tcode in that function module(CHANGEDOCUMENT_READ_HEADERS).

Thats the problem.

Can anyone help me how to do?

Thanks

Silviya T

Read only

0 Likes
1,699

Silviya,

AREN'T YOU TALKING ABOUT YOUR own FUNCTION MODULE? You have control over the parameters. In SE37 define them on the tabs provided.

Read only

0 Likes
1,699

Hi Silvia,

As you mentioned it was a custom function module, create a Tables parameter with TSTC as the ref structure. You can then pass multiple values by filling each Tcode in the TCODE field of this table.

Regards,

Suresh Datti

Read only

0 Likes
1,699

Hi ,

Earlier I thought that you are using standard function.

It is a own Function Module. Then define a table parameter using T/code SE37 --> as TSTC reference to TSTC.

Then you can add multiple T/codes to this table.

Lanka

Read only

0 Likes
1,699

Hi Experts,

There is one input parameter No.of.days.

if we input 3 as a no.of.days.

it should calculate

date = sy-datum - 3.

output should be

sy-datum : 22.02.2006

date: 19.02.2006.

how we can get this format?

Read only

0 Likes
1,699

Hi Silvia,

Was your earlier question resolved? Anyway, you can use the following code for the latest Question..


parameters: p_days type i.
data: p_date type sy-datum

p_date = sy-datum - p_days.

write: / sy-datum mm/dd/yyyy, p_date mm/dd/yyyy.

Regards,

Suresh Datti

P.S. Pl reward helpful answers

Read only

0 Likes
1,699

hi,

you can do this..

data : dat1 like sy-datum  ,dat2 like sy-datum.
parameters : p type p.
dat1 = sy-datum.
p = dat1.
p = p - 3.
dat2 = p.

write : / sy-datum , dat2.

regards

satesh

Read only

0 Likes
1,699

Hi silviya,

1. U already have the answer.

2.

REPORT abc.

PARAMETERS : d TYPE sy-datum DEFAULT sy-datum.

DATA : mydate TYPE sy-datum.

mydate = d - 3.

WRITE mydate.

regards,

amit m.

Read only

0 Likes
1,699

HI silviya

you can use the functional module

RP_CALC_DATE_IN_INTERVAL which is used for Add/subtract years/months/days from a date

regards

kishore

Read only

0 Likes
1,699

Hi experts,

I have one input parameter as size in selection screen.when we input as 5 in size.

suppose 'A' has value 1012345

value B should be last 5 digit of value A according to the size value (5) in selection screen.

B should be 12345.

how can we do?

Thanks,

Silviya T

Read only

Former Member
0 Likes
1,699

Hi sivliya,

1. What is ur exact requirement ?

What i understand is :

-


2. There is a normal report,

and it has a parameter / select-option for TCODE.

3. Now the user enter some data in this

parametert / select -option for tcode

and u want to pass these values

to your FM ?

regards,

amit m.

Read only

Former Member
0 Likes
1,700

Hi again,

1. Simple.

2.

REPORT abc.

PARAMETERS : a(30) TYPE c DEFAULT '1012345'.

PARAMETERS : num TYPE i DEFAULT 5.

DATA : l TYPE i.

DATA : pos TYPE i.

l = STRLEN( a ).

pos = l - num .

WRITE 😕 a+pos(num).

regards,

amit m.