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

condition

Former Member
0 Likes
497

Moderator message: please use a more informative subject in future

Hi

I want to add a condition in the below mentioend code :

If po_box is equal to blank then we need to check the zip code and if we have zip code data then print zip code .

if po_box is not equal to blank then print the po_box. and if both po_box and zip code has data then also print po_box .

That is PO_BOX will be dominating .

wa_bp-name = partner-xname.

wa_bp-fax_num = partner-fax_number.

wa_bp-fax_num_ext = partner-fax_extens.

IF wa_address-house_num1 IS INITIAL

AND wa_address-street IS INITIAL.

wa_bp-house_num = 'PO Box'.

wa_bp-street = wa_address-po_box.

ELSE.

wa_bp-house_num = wa_address-house_num1.

wa_bp-street = wa_address-street.

ENDIF.

wa_bp-city1 = wa_address-city1.

wa_bp-region = wa_address-region.

wa_bp-post_code = wa_address-post_code1.

CLEAR wa_bp-int.

Please suggest me how to go ?????

Thanks

Shweta

Edited by: Matt on Nov 24, 2008 4:45 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
476

Hi Shweta,

If not po_box is initial. (as we need po_box in whatever condition)

print po_box.

else. (when po box is initial)

if not zip code is initial. (check whether zip code is available)

print zip code.

endif.

endif.

3 REPLIES 3
Read only

Former Member
0 Likes
477

Hi Shweta,

If not po_box is initial. (as we need po_box in whatever condition)

print po_box.

else. (when po box is initial)

if not zip code is initial. (check whether zip code is available)

print zip code.

endif.

endif.

Read only

naimesh_patel
Active Contributor
0 Likes
476

Since you have the PO Box has high preference on the Zip Code, try like this:


DATA: W_PRINT TYPE CHAR15.

IF ZIP_CODE IS NOT INITIAL.
  W_PRINT = ZIP_CODE.
ENDIF.

IF PO_BOX IS NOT INITIAL.
  W_PRINT = PO_BOX.
ENDIF.

Instead of printing PO_BOX or ZIP_CODE print the W_PRINT.

Regards,

Naimesh Patel

Read only

matt
Active Contributor
0 Likes
476

Please use a more informative subject in future