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

selection screen validation

Former Member
0 Likes
821

Hi i am developing a report where in i have 3 blocks for selection criteria..1st block has drop down menu for carrier service(UPS,FEDEX etc) second one has delivery number and third block has 5 tracking number input ..

PARAMETERS:P_XSITD LIKE ZTRK_PAK-XSITD,

P_SHPACT LIKE ZTRK_PAK-SHIPACCT.

SELECTION-SCREEN:END OF BLOCK B1.

SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS:P_VBELN LIKE ZTRK_PAK-VBELN.

SELECTION-SCREEN:END OF BLOCK B2.

SELECTION-SCREEN:BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

PARAMETERS:P_TRACN1 LIKE ZTRK_PAK-TRACKN,

P_TRACN2 LIKE ZTRK_PAK-TRACKN,

P_TRACN3 LIKE ZTRK_PAK-TRACKN,

P_TRACN4 LIKE ZTRK_PAK-TRACKN,

P_TRACN5 LIKE ZTRK_PAK-TRACKN.

SELECTION-SCREEN:END OF BLOCK B3.

i need to validate firstly the delivery number..if delievery number is entered validate the tracking number 1.

if tracking number 1 or 2 or 3 or 4 or 5 is entered validate delivery number is not blank.

how can i do it..i am new to ABAP..someone help me please.

6 REPLIES 6
Read only

Former Member
0 Likes
773

Hi,

Try this..

AT SELECTION-SCREEN.

  • CHeck if one the tracking number is given then the delivery number is mandatory.

IF NOT P_TRACN1 IS INITIAL OR

NOT P_TRACN2 IS INITIAL OR

NOT P_TRACN3 IS INITIAL OR

NOT P_TRACN4 IS INITIAL OR

NOT P_TRACN5 IS INITIAL.

IF P_VBELN IS INITIAL.

MESSAGE E208(00) WITH 'Delivery is mandatory if tracking number is entered'.

ENDIF.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
773

write code in screen-validations.

if delivery is not initial..check tracking number 1 is valid or not.

if tracking 1,2,3,4,5 are not space then check delivery is not initial.

if not p_del is initial.

validate tracking 1.

endif.

if not p_tr1 is initial and

not p_tr2 is initial and

not p_tr3 is initial and

not p_tr4 is initial and

not p_tr5 is initial and

check delivery is not initial

endif.

Read only

Former Member
0 Likes
773

Make the delivery no P_VBELN a mandatory parameter . So whether tracking number 1 or 2 or 3 or 4 or 5 is entered then by default system will check that P_VBELN is not blank. So no need to write any specific code to check P_VBELN not blank.

below is the code for tracking no.

at selection-screen.

write the validation rules for TRACKING NUMBERS.

regards,

barath.

Read only

Former Member
0 Likes
773

Hi,

You Can validate your delivery number and Tracking number on the event.

For Delivery Number.

At selection-screen on field P_VBELN.

Write the select query for validation.

For Tracking Number.

At selection-screen on field P_TRACN1.

If P_VBELN is not initial.

Write the select query for validating Tracking Number.

endif.

Regards,

Aman

Read only

Former Member
0 Likes
773

thanks for the feedbacks..also validating i need to verify delivery number and each of 5 tracking numbers against a custom table i wud be developing(for ex say ITAB)..if there is a matching betrween a delivery num and a tracking number i need to display image..how can i do it.

Read only

0 Likes
773

Hi,

Use a select query to read all the matching entries specified in Where clause into an internal table.

Then use a Read Table..statement to check if the entry is existing and then do the processing.

Regards

Subramanian