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

Question reg. message on selection screen

Former Member
0 Likes
483

Hi,

On selection screen, I want to display a status message if the data is not found from the values the user entered. I wrote the following coding. I am able to get the message but it is coming out in the output rather than on the selction screen itself. Can you tell me what correction I can make to get the desired result?

IF p_vbeln IS not INITIAL.

SELECT vbeln erdat FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab_vbeln

WHERE vbeln = p_vbeln.

endif.

IF sy-subrc <> 0.

MESSAGE s004(zer) WITH 'No data found'.

ENDIF.

Thank you very much,

Krishen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
454

Hi,

Add leave list-processing after the success message..

IF p_vbeln IS not INITIAL.

SELECT vbeln erdat FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab_vbeln

WHERE vbeln = p_vbeln.

endif.

IF sy-subrc <> 0.

MESSAGE s004(zer) WITH 'No data found'.

<b>LEAVE LIST-PROCESSING.</b>

ENDIF.

Thanks,

Naren

Hi,

On selection screen, I want to display a status message if the data is not found from the values the user entered. I wrote the following coding. I am able to get the message but it is coming out in the output rather than on the selction screen itself. Can you tell me what correction I can make to get the desired result?

IF p_vbeln IS not INITIAL.

SELECT vbeln erdat FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab_vbeln

WHERE vbeln = p_vbeln.

endif.

IF sy-subrc <> 0.

MESSAGE s004(zer) WITH 'No data found'.

ENDIF.

Thank you very much,

Krishen

2 REPLIES 2
Read only

Former Member
0 Likes
455

Hi,

Add leave list-processing after the success message..

IF p_vbeln IS not INITIAL.

SELECT vbeln erdat FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab_vbeln

WHERE vbeln = p_vbeln.

endif.

IF sy-subrc <> 0.

MESSAGE s004(zer) WITH 'No data found'.

<b>LEAVE LIST-PROCESSING.</b>

ENDIF.

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
454

Please do your coding in the AT SELECTION-SCREEN event.

AT Selection-Screen.

IF p_vbeln IS not INITIAL.
SELECT vbeln erdat FROM vbak
INTO CORRESPONDING FIELDS OF TABLE itab_vbeln
WHERE vbeln = p_vbeln.
endif.

IF sy-subrc <> 0.
MESSAGE s004(zer) WITH 'No data found'.
ENDIF.

Regards,

Rich Heilman