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 help..

vijay_kumar134
Participant
0 Likes
1,060

Hi,

In the selection screen i want company code , ID & etc..

Here the ID field is not from the standard table. This field was fetching from the custom global constant table. In my req: i have 4 company code, every company code have 4 ID like ca11,ca12.ca13.ca14. i want to validate comapy code with these 4 ID.

Please guide me. i have attached the selection screen screen shot.

Thanks in advance.

VJ.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
962

hi,

please write the logic in at selection screen event.

here you can write the logic base on company code.

Ex .    if ( cmp code = '1000' and ( id = 'a' or id = 'b' or id = 'c' or id = 'd'))

          elseif ( cmp code = '1001' and ( id = 'e' or id = 'f' or id = 'g' or id = 'h')) 

          elseif ( cmp code = '1002' and ( id = 'i' or id = 'j' or id = 'k' or id = 'l')) 

          elseif ( cmp code = '1003' and ( id = 'm' or id = 'n' or id = 'o' or id = 'p')) 

           else.

                      message

          endif.


this is the simple logic to validate. you can optimize the code as per your req.

Regards,

Satyen

6 REPLIES 6
Read only

vikas_mulay2
Participant
0 Likes
962

Hi Vijay,

Is there any table where the relation bwtween the company code and Id is maintained?

Regards,

Vikas

Read only

pavanm592
Contributor
0 Likes
962

Hi vijay,

Use AT SELECTION-SCREEN ON <Field id>.

*select the ID's from custom table based on company code here and check whether the input given is in the required entries.

if not then through an error message

Thanks,

Pavan

Read only

Former Member
0 Likes
963

hi,

please write the logic in at selection screen event.

here you can write the logic base on company code.

Ex .    if ( cmp code = '1000' and ( id = 'a' or id = 'b' or id = 'c' or id = 'd'))

          elseif ( cmp code = '1001' and ( id = 'e' or id = 'f' or id = 'g' or id = 'h')) 

          elseif ( cmp code = '1002' and ( id = 'i' or id = 'j' or id = 'k' or id = 'l')) 

          elseif ( cmp code = '1003' and ( id = 'm' or id = 'n' or id = 'o' or id = 'p')) 

           else.

                      message

          endif.


this is the simple logic to validate. you can optimize the code as per your req.

Regards,

Satyen

Read only

anubhab
Active Participant
0 Likes
962

Hi Vijay,

   If the company code and ID relation is maintained in any table, after entering the company code and ID, in the event AT SELECTION-SCREEN, you can cross check the same from table. If sy-subrc NE 0, you can throw an error message. Or else, if your company codes and IDs are fixed you can do as below:

IF NOT ( company_code = '1100'

              OR company_code = '1200'

              OR company_code = '1300'

              OR company_code = '1400' )

    AND ( id = 'CA11'

              OR id = 'CA12'

              OR id = 'CA13'

              OR id = 'CA14' ).

throw an error message.

ENDIF.

Regards,

Anubhab

Read only

0 Likes
962

Thak you for all .

AS per my request the validation issue is resolved, now my client want to filter the data based on app id with company code , date and pay run id.

Here the the app id is from global constan table, there is no key field, but we fetch the same app id in the form print using the below query, i dont know how to use this for selection.

     SELECT SINGLE high FROM zglobconstants INTO v_app_name
                 WHERE programname = 'ZFI_OK_FILEVALUE'
                 AND  low = v_file_name.

Once again thanks for all your help.

Vijay.