Skip to Content
-2
Aug 04, 2023 at 01:07 PM

BAPI - Funtion module

98 Views Last edit Aug 07, 2023 at 08:11 AM 2 rev

Hi Experrts ,

I am doing an function module to get an data with Import parameters to get an oiutput parameters .

Here, If data saved in table ( will display the output in ET_return_04) , but If data NOT saved in table 'Error message as NO DATA RECORD' .Here i am getting both output parameters.

My requirement was 'If Success need to show ET_return_04(data) only and if Error message show the 'Message' only

How to achieve it..

image.png

 IF foreign_country IS NOT INITIAL.

    SELECT zm_country_name FROM zmm_foreign_cou INTO TABLE @DATA(lt_foreign)
        WHERE zm_country_code EQ @foreign_country-zm_country_code.
    IF lt_foreign IS NOT INITIAL .
      MOVE-CORRESPONDING lt_foreign TO et_return_04.
    ELSEIF lt_foreign IS INITIAL.
      MESSAGE 'No data found' TYPE 'E'.
    ENDIF.
  ENDIF.<br>

Attachments

image.png (8.1 kB)