Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8150

At Selection-screen query

$
0
0


I have a requirement with which on entering the table name, i got to check if any data exists or not.

I have to return OK if table has data and return NG if it doesnt.

I am querying the table using Select stmt. The question is how to check the sy-subrc count inside the At selection screen event and then display the OK and NG? If I keep the sy-subrc check within END-OF-SELECTION, the write o/p doesnt display. If i put it outside the event, sy-subrc value gets changed after coming out of the event. How to resolve this? Any ideas please?

 

AT SELECTION-SCREEN.
SELECT COUNT(*) FROM  dd02l INTO v_cnt WHERE TABNAME = p_tabnam.
END-OF-SELECTION.

 

  IF SY-SUBRC EQ 0.
    IF v_cnt <> 0.
      WRITE: 'OK'.
    ELSE.
      WRITE: 'NG'.
    ENDIF.
  ELSE.
    MESSAGE 'Invalid Table Name' TYPE 'S' DISPLAY LIKE 'E'.
  ENDIF.

 


Thanks.


Viewing all articles
Browse latest Browse all 8150

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>