‎2013 Feb 16 3:26 AM
Hello all,
I have created one report where i want to give a validation condition...i want to compare the selection screen input value with my ZTABLE...
1] if the input value i.e. BELNR from BSAK table (my selection screen input) matches with my ZTABLE's BELNR then it should display a information message (Data alrady exist) with the BELNR number..!!! n conti with execution..
2] If the input value does not match with my ZTABLE then it should execute...
i tried it like this---->>> START-OF-SELECTION
SELECT SINGLE BELNR FROM ZREST INTO BELNR WHERE BELNR IN BELNR.
IF SY-SUBRC = 0.
MESSAGE 'DATA ALREADY EXIST' TYPE 'I'.
ENDIF.
the above code is working for only single BELNR value...but when i am giving the range of BELNR in input..then its not working..i want the particular BELNR number on mesaage box which matches the ZTABLE-BELNR, it may one or more than one..all BELNR shoulld be display on message box window..Is this possible? if yes then how to fix it? please help me with coding part...
(* my ZTABLE contains BELNR, GJAHR and Posting date,ztable entries are inserted thr this report only...when the report executes for new BELNR then these fields get stored in ZTABLE also...therefore i want to compare the alrady exist BELNR to the selection screen BELNR)
for your information the screen shots of selection will help you to understand more...
thnks n regards,
Amit.
‎2013 Feb 16 5:28 AM
Hi Amit,
1- in sql you have written SELECT SINGLE BELNR........ thst' why it is it is working only for single record. you can change your sql like SELECT F1 F2 F3 ........in to It_TAB (Internal Table) from........ and put into loop to validate.
2- for Multi line message try using FM - MESSAGE_STORE
hope this will help you.
Regards
‎2013 Feb 16 5:41 AM
THnku Radhashyam,
1] i want to campare the input with ZTABLE only..!! thats why i am not taking internal table in sql...
2] i dont want to display multiple hard coded messages in message window...i want to display BELNR numbers with message box which are not matching in validations...
‎2013 Feb 16 11:10 AM
Hello Amit,
When you are taking a select-option that meansyou are executing the report with multiple BELNR. So, automatically one internal range table has been generating with your all the values of BELNR from low to high .
Now if you want to check the BELNR with ZTABLE then you have to take one by one and then have to display your message.
In the function module MESSAGE_STORE pass your BELNR at msgv1 parameter.
Thanks,
Abhijit