‎2009 Jan 06 8:49 AM
Hi All,
A warning message is displayed if the select query fails as below.
DO.
READ DATASET dataset INTO record.
IF sy-subrc <> 0. EXIT. ENDIF.
SELECT kunnr parvw FROM knvp INTO TABLE lt_knvp
WHERE kunnr = p_record-sold_to_party
AND vkorg = p_record-sales_org
AND vtweg = p_record-dist_channel
AND spart = p_record-division.
IF sy-subrc <> 0.
MESSAGE w000(zz) WITH
'No p.f. exist for:' p_record-sold_to_party
'Partner functions will default from customer master.'.
endif.
ENDDO.
But as per my understanding if a warning message is displayed it should not exit the program but it should continoue with processing the next record. In my case it is exiting from the program. Kindly suggest.
Neslin.
‎2009 Jan 06 8:54 AM
Hi,
As per ur code its executing the program even after the warning message. u just put a break point at the read data set. and check the sy-subrc. if it equals to zero then it will be exit from the loop.
Regards,
Naresh
‎2009 Jan 06 8:59 AM
Hi,
try this .
Here write the warning message in the selection screen
then it will not leave the screen.
But when you write the same in start-of-selection it will leave the screen.
data: itab like mara occurs 0 with header line.
parameters: it(10) type c.
at selection-screen.
do 10 times.
refresh: itab.
select mandt matnr from mara into table itab up to 10 rows.
message w000 with 'NO data'.
enddo.
regards,
Venkatesh
‎2009 Jan 06 9:03 AM
Hi Neslin,
I thing The control is coming out of the program becasue of the EXIT at the top.
please look into the debugging mode.
Thanks
‎2009 Jan 06 9:05 AM
Hi
If u want to use it as it is better to use Information message than changing the events to at selection screen.
information message allows to proceed .
and one more point .
see the exit at the top and and also keep a break point before warning message and check it.
reg
Ramya
‎2009 Jan 06 9:07 AM
hi,
you cantry the below code
DO.
READ DATASET dataset INTO record.
IF sy-subrc 0.
EXIT.
Else .
SELECT kunnr parvw FROM knvp INTO TABLE lt_knvp
WHERE kunnr = p_record-sold_to_party
AND vkorg = p_record-sales_org
AND vtweg = p_record-dist_channel
AND spart = p_record-division.
IF sy-subrc 0.
MESSAGE w000(zz) WITH
'No p.f. exist for:' p_record-sold_to_party
'Partner functions will default from customer master.'.
endif.
endif.
ENDDO.
thanks