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

User-command

moniabap_moni
Explorer
0 Likes
525

Hi Experts,

I am selecting spoolnumber,Descrip,date, from TSP01 into itab and displaying output with a checkbox,and i have a user-command button 'click' and when i select the checkbox against the spoolnumbers in output...i need to capture spoolnumber and pass it to parameter for spoolno in RSTXPDFT4 program... how i need to do this? i have itab internal table (example)

data: begin of itab occurs 0,

rdident type tsp01-rdident,"spoolno

date type tsp01-rd......,

descrip type tsp01-rd.....

xbox, " Checkbox.

end of itab.

case sy-ucom.

when 'click'

submit RSTXPDFT4 USING SELECTION-SCREEN '1000'

WITH selscreen_tab.

endcase.

how i need to do..... please guide me.

rewarded if helpful.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
496

Check the demo program, to see how to capture the Check Boxes in interactive lists:

DEMO_LIST_READ_LINE

Regards,

Ravi

2 REPLIES 2
Read only

Former Member
0 Likes
497

Check the demo program, to see how to capture the Check Boxes in interactive lists:

DEMO_LIST_READ_LINE

Regards,

Ravi

Read only

Former Member
0 Likes
496

check out the same code using ALV:


*&---------------------------------------------------------------------*
*& Report  ZTEST8
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest8.
TYPE-POOLS: slis.
TYPES:
BEGIN OF x_tsp01.
        INCLUDE STRUCTURE tsp01.
TYPES: check TYPE char1,
END OF x_tsp01.

DATA:i_tsp01 TYPE STANDARD TABLE OF x_tsp01 INITIAL SIZE 0,
     i_fieldcat TYPE slis_t_fieldcat_alv.

DATA: v_time1 TYPE rspocrtime,
      v_time2 TYPE rspocrtime,
      wa_layout TYPE slis_layout_alv.

PARAMETERS:
p_date1 TYPE datum DEFAULT '20080101',  " Start Date
p_time1  TYPE syuzeit DEFAULT '000000', " Start Time
p_date2 TYPE datum DEFAULT sy-datum,    " End Date
p_time2  TYPE syuzeit DEFAULT sy-uzeit. " End Time

AT SELECTION-SCREEN.
  IF p_date1 > p_date2.
    MESSAGE e001(00) WITH 'Invalid date range'.
  ELSEIF p_date1 = p_date2.
    IF p_time1 > p_time2.
      MESSAGE e001(00) WITH 'Invalid time range'.
    ENDIF.
  ENDIF.

START-OF-SELECTION.
  CONCATENATE p_date1 p_time1 '00' INTO v_time1.
  CONCATENATE p_date2 p_time2 '00' INTO v_time2.

  SELECT * FROM tsp01 INTO TABLE i_tsp01
    WHERE rqcretime BETWEEN v_time1 AND v_time2.
  IF sy-subrc <> 0.
    MESSAGE i001(00) WITH 'No data found'.
    LEAVE LIST-PROCESSING.
  ENDIF.

END-OF-SELECTION.

  DATA: l_repid TYPE syrepid VALUE sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = l_repid
      i_internal_tabname           = 'I_TSP01'
      i_structure_name             = 'TSP01'
      i_client_never_display       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = i_fieldcat
 EXCEPTIONS
   inconsistent_interface       = 1
   program_error                = 2
   OTHERS                       = 3
            .
  IF sy-subrc = 0.
    wa_layout-zebra = 'X'.
    wa_layout-box_fieldname = 'CHECK'.
    wa_layout-box_tabname = 'I_TSP01'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
*   I_INTERFACE_CHECK              = ' '
*   I_BYPASSING_BUFFER             =
*   I_BUFFER_ACTIVE                = ' '
    i_callback_program             = l_repid
    i_callback_pf_status_set       = 'SUB_PF_STATUS'
    i_callback_user_command        = 'SUB_USER_COMMAND'
*   I_STRUCTURE_NAME               =
    is_layout                      = wa_layout
    it_fieldcat                    = i_fieldcat
*   IT_EXCLUDING                   =
*   IT_SPECIAL_GROUPS              =
*   IT_SORT                        =
*   IT_FILTER                      =
*   IS_SEL_HIDE                    =
*   I_DEFAULT                      = 'X'
*   I_SAVE                         = ' '
*   IS_VARIANT                     =
*   IT_EVENTS                      =
*   IT_EVENT_EXIT                  =
*   IS_PRINT                       =
*   IS_REPREP_ID                   =
*   I_SCREEN_START_COLUMN          = 0
*   I_SCREEN_START_LINE            = 0
*   I_SCREEN_END_COLUMN            = 0
*   I_SCREEN_END_LINE              = 0
*   IR_SALV_LIST_ADAPTER           =
*   IT_EXCEPT_QINFO                =
*   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER        =
*   ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = i_tsp01
 EXCEPTIONS
   program_error                  = 1
   OTHERS                         = 2
              .
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.

*&---------------------------------------------------------------------*
*&      Form  sub_pf_status
*&---------------------------------------------------------------------*
*       Set PF Status
*----------------------------------------------------------------------*
FORM sub_pf_status USING rt_extab TYPE slis_t_extab.
*Copy of PF-STATUS 'STANDARD' from FunctionGroup SALV with added Fcode
*for "CLICK"
  SET PF-STATUS 'ZALV' EXCLUDING rt_extab.
ENDFORM.                    "sub_pf_status
*&---------------------------------------------------------------------*
*&      Form  sub_user_command
*&---------------------------------------------------------------------*
*       Get User Command
*----------------------------------------------------------------------*
FORM sub_user_command USING r_ucomm TYPE syucomm
                            rs_selfield TYPE slis_selfield.
  DATA: l_i_tsp01 TYPE STANDARD TABLE OF x_tsp01 INITIAL SIZE 0,
        l_lines TYPE i,
        l_wa_tsp01 TYPE x_tsp01,
        l_spool_no(10) TYPE n.

  CASE r_ucomm.
    WHEN 'CLIK'.

      l_i_tsp01[] = i_tsp01[].
      DELETE l_i_tsp01 WHERE check <> 'X'.
      l_lines = LINES( l_i_tsp01 ).
      IF l_lines = 0.
        MESSAGE i001(00) WITH 'No line Selected'.
        EXIT.
      ELSEIF l_lines GT 1.
        MESSAGE i001(00) WITH 'More than one line selected'.
        EXIT.
      ELSEIF l_lines = 1.
        DATA: l_i_selection_table TYPE STANDARD TABLE OF rsparams INITIAL SIZE 0,
              l_wa_selection_table TYPE rsparams.
        READ TABLE i_tsp01 INTO l_wa_tsp01
        INDEX rs_selfield-tabindex.
        IF sy-subrc = 0.
          REFRESH l_i_selection_table.
          l_wa_selection_table-selname = 'SPOOLNO'.
          l_wa_selection_table-kind    = 'P'.
          l_wa_selection_table-sign    = 'I'.
          l_wa_selection_table-option  = 'EQ'.
          l_spool_no = l_wa_tsp01-rqident.
          l_wa_selection_table-low     = l_spool_no.
          l_wa_selection_table-high    = ''.
          APPEND l_wa_selection_table TO l_i_selection_table.
          SUBMIT rstxpdft4 WITH SELECTION-TABLE l_i_selection_table
          AND RETURN.
        ENDIF.
      ENDIF.
  ENDCASE.
ENDFORM.                    "sub_user_command