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

Pop up button in module pool

Former Member
0 Likes
1,001

Hii,

I have come across a requirement in which i need to design a button and when user clicks on tht button he should get a pop up window in which he enter's the matrial displayed in the list on the screen and the material entered by the user should be sorted on top of the list.

I used function module POPUP_GET_VALUES but its not working..can anyone let me know what is the function module and what export and import parameters to be used.

Regards,

Venkat.

7 REPLIES 7
Read only

Former Member
0 Likes
853

hi,

call the FM for the popup under the function code of the button.

regards,

sirisha

Read only

Former Member
0 Likes
853

Hi,

try this Function Module...


    CALL FUNCTION 'HELP_VALUES_GET'
      EXPORTING
        fieldname    = 'MATNR'
        tabname      = 'MARA'
      IMPORTING
        select_value = w_mchb_matnr.

"Or try this..

  CALL FUNCTION 'POPUP_TO_GET_VALUE'
    EXPORTING
      fieldname = 'MATNR'
      tabname   = 'MARA'
      titel     = 'Enter material Number'
      valuein   = w_mchb_matnr
    IMPORTING
      answer    = p_answer
      valueout  = w_mchb_matnr.
  IF sy-subrc <> 0.
  ENDIF.

"or try this to select whole row..
  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'


Prabhudas

Read only

0 Likes
853

Hi Prabhu

Thanks for your reply now i able to get pop up and enter component in that.

CALL FUNCTION 'POPUP_TO_GET_VALUE'

EXPORTING

fieldname = 'IDNRK' "BOM COMPONENT

tabname = 'STPOX' " BOM ITEMS TABLE

titel = 'Enter Component'

valuein = I_500-IDNRK " INTERNAL TABLE

IMPORTING

answer = p_answer

valueout = I_500-IDNRK.

IF sy-subrc EQ 0.

ENDIF.

ENDIF.

ENDMODULE. "USER_COMMAND_0500 INPUT

The requirement is like when i click on button ,pop up should come and in that pop i will type the component displayed on the screen from the list of components..so, that component should be sorted on top of the list.

Read only

0 Likes
853

Hi

Check the below thread

For your info the Code is available here also

You need to implement amodal screen for this and a Find button above the table control.
or you can use POPUP_GET_VALUES FM
after you enter a value in the POP up screen.
" You need to put some effort to implement this, wish you to implement it successfully as this is possible
READ TABLE ITAB WITH KEY VBELN = FIND_VBELN. " FIND_VBELN is the field on your find screen.
if sy-subrc = 0.
tc-top_line = sy-tabix. " this makes the record visible in the First position
endif.

PROCESS AFTER INPUT.
  LOOP AT itab.
    MODULE find.
  ENDLOOP.
 
In Program
 
MODULE find INPUT.
  DATA : tab TYPE STANDARD TABLE OF sval WITH HEADER LINE.
  REFRESH tab.
  CASE ok_code.
    WHEN 'FIND'.
      clear ok_code.
      tab-tabname = 'VBAK'.
      tab-fieldname = 'VBELN'.
      APPEND tab.
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
*   NO_VALUE_CHECK        = ' '
          popup_title           = 'Find Sales Order'
   start_column          = '5'
   start_row             = '5'
* IMPORTING
*   RETURNCODE            =
        TABLES
          fields                = tab
 EXCEPTIONS
   error_in_fields       = 1
   OTHERS                = 2
                .
      IF sy-subrc = 0.
        READ TABLE itab WITH KEY vbeln = tab-value.
        IF sy-subrc = 0.
          tc-top_line = sy-tabix.
        ENDIF.
      ENDIF.
  ENDCASE.
ENDMODULE.                 " find  INPUT

Cheerz

Ram

Read only

0 Likes
853

Hi Ramz,

Thanks for your suggestion i have used to code which you suggested me..every thning is working fine which i checked in debugging also but still the component is not sorted on to top.

DATA : tab TYPE STANDARD TABLE OF sval WITH HEADER LINE.

REFRESH tab.

CASE ok_code.

WHEN 'SORT'.

clear ok_code.

tab-tabname = 'STPOX'.

tab-fieldname = 'IDNRK'.

APPEND tab.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

  • NO_VALUE_CHECK = ' '

popup_title = 'Enter Component'

start_column = '5'

start_row = '5'

  • IMPORTING

  • RETURNCODE =

TABLES

fields = tab

EXCEPTIONS

error_in_fields = 1

OTHERS = 2

.

IF sy-subrc = 0.

READ TABLE i_sb3 WITH KEY idnrk = tab-value. " in debuggin tab-value is coming the component which i selected to sort.

IF sy-subrc = 0. " here sy-subrc is 0

tc-top_line = sy-tabix.

ENDIF.

ENDIF.

ENDCASE.

ENDMODULE. "USER_COMMAND_0500 INPUT

Process After Input:

*code which i added

loop at i_sb3.

MODULE USER_COMMAND_0500. "module for button sort

endloop.

*code which was written prev

module exit at exit-command.

loop at i_500.

field: i_500-ind module checkind on input.

chain.

field: i_500-ind,

i_500-adj.

module bal_calc on chain-input.

endchain.

module gbal.

endloop.

module save_data_fnlcomp.

loop at i_sb3.

endloop.

module escreen.

getting error message like

Invalid field assignment: Field "I_500-IND" is assigned to another loop.

Read only

0 Likes
853

Hi Venkat,

Your Code must be within LOOP and ENDLOOP of PAI not MODULE USERCOMMAND_0500.

PROCESS AFTER INPUT.
  LOOP AT itab. " When Some one gives a response check it properly since it is very difficult to find where you went wrong
    MODULE find. " This has already resolved the issue of two other guys
  ENDLOOP.

Cheerz

Ram

Read only

0 Likes
853

Hi

I have written your code in between loop at end loop of PAI only...

In debugging i have found that

IF sy-subrc = 0.

READ TABLE i_sb3 WITH KEY idnrk = tab-value.

IF sy-subrc = 0.

tc-top_line = sy-tabix. " here tc-top_line is coming as 1 and sy-tabix as 17 in debgugging and when debugging comes out of that statment. tc_top_line value is coming as 17

ENDIF.

ENDIF.