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

function module(first name and last name as a parameter with table)

Former Member
0 Likes
1,601

hi,

i just want to know how i match input value in function module with the self created ztable first name and last name as a parameter in function module(import).

regards

Ankur

14 REPLIES 14
Read only

Former Member
0 Likes
1,512

hi,

if your ztable contains two fields namely first name and lastname.

then in the function module import param declare two param and give like ztable-fieldname.

regards,

Navneeth.K

Read only

0 Likes
1,512

actually in my ztable has three field fname lname or age and in function module i import two parameter first_name and last_name and export in one parameter fullname so i just want to know when i execute the function module i give the input as like wise ram in firstname and kumar is lastname but it is not matching my ztable if ram kumar is does not in table then it should showing error but its showing which i give a and b it showing ab.that's my question?????????

Read only

0 Likes
1,512

hi Ankur,

can you be clear with your query if possible provide an example.

regards,

Navneeth.K

Read only

0 Likes
1,512

hi,

can you show the source code of the FM.

regards,

Navneeth.K

Read only

0 Likes
1,512

thanks for your help actually i am concatename first_name last_name into full_name

import parameter

FIRST_NAME like ZANKUR-FNAME first name

LAST_NAME like ZANKUR-LNAME last name

export parameter

full_name like zankur full name

excaption

error if name not matched

source code

concatename first_name last_name into full_name

Read only

0 Likes
1,512

Hi Ankur,

I dont see any select query in your FM souce code wat you can do is first check the ztable in case there is any record with the provided firstname and last name.

then concatenate else come out without giving a value or raise exception.

regards,

Navneeth.K

Read only

0 Likes
1,512

hi Ankur,

u can write in this way

select single firstname

lastname

into ( var1, var2 )

from ztable

where firstname = param_firstname

and lastname = param_lastname.

if sy-subrc eq 0.

--then write concatenate stnmnt.

endif.

regards,

Navneeth.K

Read only

0 Likes
1,512

please give me code that how can i match in ztable with function module parameter.

thanks

ankur

Read only

0 Likes
1,512

Hi,

did the above code work.

regards,

Navneeth.K

Read only

0 Likes
1,512

hi,

thanks alot i got answer.

regards

Ankur

Read only

Former Member
0 Likes
1,512

Hi Ankur,

Declare your importing parameters referring to the type as ZTABLE-FIRST_NAME and ZTABLE-LAST_NAME.

Regards,

Ravi

Read only

Former Member
0 Likes
1,512

hi,

in addition to my above post in the import parameter column give like this:

parameter name type associated type

firstname like ztable-firstname

lastname like ztable-lastname

hope it solves your query

regards,

Navneeth.K

Read only

Former Member
0 Likes
1,512

Hi Ankur,

Is your query resolved.

regards,

Navneeth.K

Read only

0 Likes
1,512

no i have already did this but no result.