Skip to Content
0
Sep 05, 2020 at 11:35 PM

How control to statement of if i didn't select rows in SALV table?

87 Views

I display the purchase order items information of the rows I select from an ALV table in smart form. I am using SALV's selected_row method. Thus, when I pushed print, I transfer the information of the lines I selected to Smartform. The button doesn't work when I don't select any lines. When I don't select any rows and when pushed button I want display the answer that I entered items as manuel in Smartform.

I added the code for this for this, but it doesn't work correctly:

IF sy-subrc IS INITIAL. 
  IF e_salv_function EQ '&YAZ'. 
    "Butona tıkladıktan sonra istediğim olay burada çağırılıyor. 
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' 
      EXPORTING 
        formname = 'ZSG_SF' 
      IMPORTING 
        fm_name = l_func.
    CALL FUNCTION l_func 
      TABLES 
        it_ekpo = gt_sf_kalem.
  ENDIF. 
  ELSE. 
    "If any rows is selected 
    wa_sf_kalem-ebeln = 'Merhaba'. 
    wa_sf_kalem-ebelp = 'Benim'.
    wa_sf_kalem-txz01 = 'Adım'. 
    wa_sf_kalem-matnr = 'Seher'. 

    APPEND wa_sf_kalem TO gt_sf_kalem. 
ENDIF.

What is the correct method?