‎2014 Apr 16 6:30 AM
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.
‎2014 Apr 16 7:04 AM
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
‎2014 Apr 16 6:49 AM
Hi Vijay,
Is there any table where the relation bwtween the company code and Id is maintained?
Regards,
Vikas
‎2014 Apr 16 6:57 AM
‎2014 Apr 16 6:59 AM
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
‎2014 Apr 16 7:04 AM
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
‎2014 Apr 16 7:08 AM
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
‎2014 Apr 16 5:22 PM
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.