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

how to create function module for getting customer name

Former Member
0 Likes
1,375

Hi Experts,

How to create function module? when in import parameter kunnr values to be passed it must give name1 details according to the customer number...

how to write the logic in source code....

Regards,

Thiru. R

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
931

1. First of all create function group.

2. Create function module using this function group.

3. If only one kunnr is needed at a time, create import parameter for it. But if many kunnr to be entered at a time,use table.

4. Fetch name1 for each kunnr from KNA1 table.

"->> if many kunnr

if not t_kunnr[] is initial.

select kunnr as kunnr name1 as name1

into table t_kunnr_name1

from kna1

for all entried in table t_kunnr

where kunnr = t_kunnr-kunnr.

endif.

sort t_kunnr_name1 by kunnr name1.

delete adjacent duplicates from t_kunnr_name1 comparing kunnr name1.

table t_kunnr_name1 will contain kunnr and its name1.

I hope logic is clear for you now.

Regards,

Aparna

4 REPLIES 4
Read only

Former Member
0 Likes
932

1. First of all create function group.

2. Create function module using this function group.

3. If only one kunnr is needed at a time, create import parameter for it. But if many kunnr to be entered at a time,use table.

4. Fetch name1 for each kunnr from KNA1 table.

"->> if many kunnr

if not t_kunnr[] is initial.

select kunnr as kunnr name1 as name1

into table t_kunnr_name1

from kna1

for all entried in table t_kunnr

where kunnr = t_kunnr-kunnr.

endif.

sort t_kunnr_name1 by kunnr name1.

delete adjacent duplicates from t_kunnr_name1 comparing kunnr name1.

table t_kunnr_name1 will contain kunnr and its name1.

I hope logic is clear for you now.

Regards,

Aparna

Read only

Former Member
0 Likes
931

HI,

Check the FM BAPI_CUSTOMER_GETDETAIL...this will give the Kunnr Details

Edited by: avinash kodarapu on Dec 2, 2008 1:03 PM

Read only

Former Member
0 Likes
931

I think there is No need for FM, just use a select query for table KNA1 with KUNNR.

Regards

Karthik D

Read only

andreas_mann3
Active Contributor
0 Likes
931

use a search help like BBPH_DEBITOR_GENERAL

A.