Application Development 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: 

Select Single question, getting Postal code for user entered Plant Number

Former Member
0 Kudos

Hi.

The following is my requirement:

On the selection screen, the user enters a plant number.

What I'd like to do is to retrieve the postal code (PSTLZ) for that plant number, into a data object/variable that will hold the postal code for the plant number that the user entered on the selection screen. I believe that the info is stored in table T001W.

What program code would I need to accomplish this?

Thanks,

John

1 REPLY 1

suresh_datti
Active Contributor
0 Kudos

unless Iam missing something, this is straighforward..

parameters:p_weks type werks,
                          w_pstlz typepstlz.

select single pstlz into w_psltz
                           from t001w
                           where werks = p_werks.
if sy-subrc eq 0.
write:/ w_pstlz.
else.
write:/ 'Postal code not found for :'(m01),p_werks.
endif.

~Suresh