Application Development 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: 

need a popup

Former Member
0 Kudos

i need a popup that have data from it table

and have the option to choose by checkbox or else

i can choose more then 1 row

thanks

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

you can use alv fm REUSE_ALV_POPUP_TO_SELECT or else you can use ALV GRID/LIST function check this code..

REPORT  ZTEST_ALV_CHECK     message-id zz           .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      L_LAYOUT type slis_layout_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.

DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      POSNR LIKE VBAP-POSNR,
      CHK(1),
     END OF ITAB.

SELECT VBELN
       POSNR
       FROM VBAP
       UP TO 20 ROWS
       INTO TABLE ITAB.

X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-window_titlebar = 'Popup window'.

  x_events-NAME = SLIS_EV_END_OF_PAGE.
  x_events-FORM = 'END_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
  x_events-NAME = SLIS_EV_TOP_OF_PAGE.
  x_events-FORM = 'TOP_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM       = SY-REPID
    IS_LAYOUT                = L_LAYOUT
    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
    IT_FIELDCAT              = IT_FIELDCAT
    it_events                = it_events
    I_SCREEN_START_COLUMN    = 10
    I_SCREEN_START_LINE      = 1
    I_SCREEN_END_COLUMN      = 50
    I_SCREEN_END_LINE        = 20
  TABLES
    T_OUTTAB                 = ITAB
  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.

FORM TOP_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'TOP_OF_PAGE'.
ENDFORM.

FORM END_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'END_OF_PAGE'.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  STATUS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_EXTAB    text
*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
  SET PF-STATUS 'STATUS'.
ENDFORM.                 " STATUS
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.
      leave to screen 0.
    when '&IC1'.
      message i000 with 'clicked on SO#' rs_selfield-value.
*      set parameter id 'AUN' field rs_selfield-value.
*      call transaction 'VA03' and skip first screen.
  endcase.
ENDFORM.                    "USER_COMMAND

Regards

vijay

10 REPLIES 10

Former Member
0 Kudos

REUSE_ALV_POPUP_TO_SELECT should solve your problem.

Regards,

Ravi

Note : Please mark the helpful answers

former_member181962
Active Contributor
0 Kudos

Hi rani,

You can use REUSE_ALV_POPUP_TO_SELECT FM.

REgards,

Ravi

abdul_hakim
Active Contributor
0 Kudos

design a screen using table control and call it using STATRING AT & ENDING AT option to the CALL SCREEN statement.This will fulfill your requirement..

Cheers,

Abdul Hakim

Former Member
0 Kudos

... or have a look at FM POPUP_TO_DECIDE_LIST...

vinod_gunaware2
Active Contributor
0 Kudos

Hi

POP_UP_CONFIRM

RV_DOCUMENT_COPY_NO_POPUP

TMS_ALT_POPUP_MESSAGE

SWW_WI_POPUP_FOR_COMPLETION

SWU_POPUP_WITH_3_OPTIONS

SWO_POPUP_TO_CONFIRM

SWD_POPUP_SELECT_WORKFLOW_TASK

SWD_POPUP_SELECT_ELEMENT

SWD_POPUP_ASK_FOR_UPDATE

LC_POPUP_TO_CONFIRM_STEP

LC_POPUP_TO_CONFIRM_STEP_JNA

POPUP_WITH_TABLE_DISPLAY

FI_F4_ZTERM

RH_ASK_FOR_SELECTION_DATE

POPUP_GET_VALUES_DB_CHECKED

COPO_POPUP_TO_DISPLAY_TEXTLIST

POPUP_TO_CONFIRM_LOSS_OF_DATA

POPUP_TO_CONFIRM_STEP

POPUP_TO_CONFIRM_WITH_MESSAGE

POPUP_TO_CONFIRM_WITH_VALUE

POPUP_TO_DECIDE

POPUP_TO_DECIDE_WITH_MESSAGE

POPUP_WITH_TABLE_DISPLAY

TH_POPUP

POPUP_TO_DISPLAY_TEXT

POPUP_TO_SELECT_MONTH

regards

vinod

former_member188685
Active Contributor
0 Kudos

Hi,

you can use alv fm REUSE_ALV_POPUP_TO_SELECT or else you can use ALV GRID/LIST function check this code..

REPORT  ZTEST_ALV_CHECK     message-id zz           .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      L_LAYOUT type slis_layout_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.

DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      POSNR LIKE VBAP-POSNR,
      CHK(1),
     END OF ITAB.

SELECT VBELN
       POSNR
       FROM VBAP
       UP TO 20 ROWS
       INTO TABLE ITAB.

X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-window_titlebar = 'Popup window'.

  x_events-NAME = SLIS_EV_END_OF_PAGE.
  x_events-FORM = 'END_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
  x_events-NAME = SLIS_EV_TOP_OF_PAGE.
  x_events-FORM = 'TOP_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM       = SY-REPID
    IS_LAYOUT                = L_LAYOUT
    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
    IT_FIELDCAT              = IT_FIELDCAT
    it_events                = it_events
    I_SCREEN_START_COLUMN    = 10
    I_SCREEN_START_LINE      = 1
    I_SCREEN_END_COLUMN      = 50
    I_SCREEN_END_LINE        = 20
  TABLES
    T_OUTTAB                 = ITAB
  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.

FORM TOP_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'TOP_OF_PAGE'.
ENDFORM.

FORM END_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'END_OF_PAGE'.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  STATUS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_EXTAB    text
*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
  SET PF-STATUS 'STATUS'.
ENDFORM.                 " STATUS
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.
      leave to screen 0.
    when '&IC1'.
      message i000 with 'clicked on SO#' rs_selfield-value.
*      set parameter id 'AUN' field rs_selfield-value.
*      call transaction 'VA03' and skip first screen.
  endcase.
ENDFORM.                    "USER_COMMAND

Regards

vijay

0 Kudos

I HAVE A PROBLEM WITH

I_callback_program

VIJAY- I PUT IT IN pRINT PROG THERE I NEED TO CHOOSE NUMBER OF ROWS TO PRINT

0 Kudos

VIJAY I SOLVE IT

BUT IT STUCK I CANT GO BACK OR FORWARD WHY

0 Kudos

hi Rani,

check if u had designed ur Pf-status

double click on STATUS and give FCODES for BACK , CANCEL and EXIT

Former Member
0 Kudos

Hi rani,

try like this..

DATA: BEGIN OF spoplist OCCURS 15.
INCLUDE STRUCTURE spopli.
DATA: END OF spoplist.
DATA: antwort TYPE c.
data : itab like table of vbak with header line.

select * from vbak into table itab up to 10 rows.

loop at itab.
 spoplist-varoption = itab-vbeln.
APPEND spoplist.

endloop.



CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
titel = 'Questions'
textline1 = ''
textline2 = ''
textline3 = ''
mark_max = 3
mark_flag = 'X'
IMPORTING
answer = antwort
TABLES
t_spopli = spoplist
EXCEPTIONS
too_much_answers = 1
too_much_marks = 2.

IF sy-subrc = 2.
WRITE: 'Too many answers chosen.'.

ENDIF.
IF antwort = 'A'.
WRITE: 'Popup canceled.'.
ELSE.
WRITE: 'Options chosen:'.
LOOP AT spoplist WHERE selflag = 'X'.
WRITE / spoplist-varoption.
ENDLOOP.
ENDIF.

regards

satesh