‎2012 Jun 03 4:52 AM
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
‎2012 Jun 03 3:18 PM
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
‎2012 Jun 03 3:42 PM
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!
‎2012 Jun 03 4:02 PM
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 .