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: 

ALV selection screen

Former Member
0 Kudos

Hi,

Iam new to A.L.V and have few queries.please tell me the coding for the below.

At selection screen:

Process the following validations for selection screen fields and display the appropriate error messages.

1. Validate the Date From (SAP Transaction Date ) against VEKP –Created-On Date .

2. Validate the Date From (SAP Transaction Date ) against VEKP –Created-On Date .

3. Validate the Plant From (Transaction Source Location ) against VEKP – Shipping Point.

4. Validate the Plant To (Transaction Destination Location ) against VEKP – Shipping Point.

5. Validate the Pallet ID against VEKP – Handling Unit.

6. If Date From field is blank, display an appropriate error message.

7. If Plant From field is blank, display an appropriate error message.

Kindly send me the coding for this.

Regards,

Tanya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi srilakshmi,

just try this,

at selection-screen.

date: l_plant type werks.

select single werks from <dbtable> into l_plant where werks = p_plant.

if sy-subrc NE 0.

message e001(message class).

exit.

endif.

this is for one field,like this u can write all your fields.

regards,

seshu.

2 REPLIES 2

Former Member
0 Kudos

hi srilakshmi,

just try this,

at selection-screen.

date: l_plant type werks.

select single werks from <dbtable> into l_plant where werks = p_plant.

if sy-subrc NE 0.

message e001(message class).

exit.

endif.

this is for one field,like this u can write all your fields.

regards,

seshu.

Former Member
0 Kudos

Hi,

the code is :

*For VEKP-Created-on-date :

AT SELECTION-SCREEN ON s_erdat.

IF NOT s_erdat[] IS INITIAL.

SELECT erdat FROM VEKP INTO VEKP-ERDAT

WHERE ERDAT IN s_erdat.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE 'Enter a valid created date' Type E.

ENDIF.

Else ( for question 6& 7)

MESSAGE 'Enter a date in the Date From field' Type E.

ENDIF.

from 1 to 2, the above was the code.. and from 3 to 5 - the else paart is not requried..