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

Creating Z Program and Function Module

Former Member
0 Likes
2,361

Hello Dear Experts,

I need to create a Z Program which will get following Using PARAMETER statement:

Employee Number

Address 1

Address 2

City

State

ZIP

Then, create a Z Function Module (SE37), which will take all these fields as input, and use INSERT statement inside the function module to add this data into my Z Table which I have already created with above fields. Will anyone do this for me, I am in need of help!!!

Moderator message: please work on your requirements yourself.

Message was edited by: Thomas Zloch

3 REPLIES 3
Read only

former_member213851
Active Contributor
0 Likes
1,440

Hi Badar,

Please follow the below sequence:

1. Go to SE37 and create a z function module.

Inside Import tab ,  enter all input fields i.e.

Employee Number

Address 1

Address 2

City

State

ZIP

2.  Inside changing  tab, you need to add all the parameters:

Employee Number

Address 1

Address 2

City

State

ZIP

3..  Inside  code tab, yo need to add below lines to Update enteries from selection screen into Ztablesay ZKNA1.

ZKNA1-EMP_NO = P_EMP_NO. " P_EMP_NO is parameter entered from selection screen

ZKNA1-ADRNR1 = P_ADRNR1.

ZKNA1-ADRNR2 = P_ADRNR2.

ZKNA1-CITY = P_CITY.

MODIFY ZKNA1 FROM ZKNA1. "to write changes on database.

Now , inside report , design selection screen and call ZFunction module and process/display the values accordingly.

Best  regards,

Sachin

Read only

0 Likes
1,440

Hello,

Thanks alot..i'm working on it but why do I need to add PARAMETERS to Changing Tab? Also please tell me how to write a Z program in SE38 using PARAMETER statement which will get employeenumber, address1, address2, city, state and zip. Thanks much!

Read only

0 Likes
1,440

Hi Badar,

No need to add parameters inside Changing tab. Just ignore 2nd step.

You can define parameters as

PARAMETERS : p_ empno TYPE emp-wnpno.

also ensure taht Type of selection screen parameter and Import parameter type in Function module is same ,

else Type conflict error will occur

where emp is table name .