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: 

POPUP_GET_VALUES

Former Member
0 Kudos
5,011

Hi i am using POPUP_GET_VALUES fm

When i execute this fm,

amount field is in input disabled mode.

My requirement is i want it to be in input enabled mode.

Thanks,

Shilps

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,301

For the amount field u need to pass the currency key field attached with it. Pl. see this sample code...

REPORT z_sdn line-size 5.

TABLES VBRK.

DATA: RC TYPE C,

V_BNAME LIKE VBRK-LOGSYS,

V_TRDAT LIKE VBRK-MWSBK,

ITAB LIKE SVAL OCCURS 0 WITH HEADER LINE.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'LOGSYS'.

ITAB-VALUE = VBRK-LOGSYS.

ITAB-FIELDTEXT = 'Logical sys'.

ITAB-NOVALUEHLP = 'X'.

APPEND ITAB.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'MWSBK'.

ITAB-VALUE = VBRK-MWSBK.

ITAB-FIELDTEXT = 'Amount'.

ITAB-NOVALUEHLP = 'X'.

APPEND ITAB.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'WAERK'.

ITAB-VALUE = VBRK-WAERK.

ITAB-FIELDTEXT = 'Unit'.

ITAB-FIELD_ATTR = '04'.

APPEND ITAB.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

POPUP_TITLE = 'USERS LOGGED IN ON A DATE'

IMPORTING

RETURNCODE = RC

TABLES

FIELDS = ITAB.

IF RC NE 'A'. "USER CLICKED OK BUTTON

READ TABLE ITAB INDEX 1. "BNAME

V_BNAME = ITAB-VALUE.

READ TABLE ITAB INDEX 2. "TRDAT

V_TRDAT = ITAB-VALUE.

endif.

Regards,

joy.

5 REPLIES 5

Former Member
0 Kudos
1,301

Amount fields will be in disabled mode only .. U cannot change ..

Former Member
0 Kudos
1,302

For the amount field u need to pass the currency key field attached with it. Pl. see this sample code...

REPORT z_sdn line-size 5.

TABLES VBRK.

DATA: RC TYPE C,

V_BNAME LIKE VBRK-LOGSYS,

V_TRDAT LIKE VBRK-MWSBK,

ITAB LIKE SVAL OCCURS 0 WITH HEADER LINE.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'LOGSYS'.

ITAB-VALUE = VBRK-LOGSYS.

ITAB-FIELDTEXT = 'Logical sys'.

ITAB-NOVALUEHLP = 'X'.

APPEND ITAB.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'MWSBK'.

ITAB-VALUE = VBRK-MWSBK.

ITAB-FIELDTEXT = 'Amount'.

ITAB-NOVALUEHLP = 'X'.

APPEND ITAB.

ITAB-TABNAME = 'VBRK'.

ITAB-FIELDNAME = 'WAERK'.

ITAB-VALUE = VBRK-WAERK.

ITAB-FIELDTEXT = 'Unit'.

ITAB-FIELD_ATTR = '04'.

APPEND ITAB.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

POPUP_TITLE = 'USERS LOGGED IN ON A DATE'

IMPORTING

RETURNCODE = RC

TABLES

FIELDS = ITAB.

IF RC NE 'A'. "USER CLICKED OK BUTTON

READ TABLE ITAB INDEX 1. "BNAME

V_BNAME = ITAB-VALUE.

READ TABLE ITAB INDEX 2. "TRDAT

V_TRDAT = ITAB-VALUE.

endif.

Regards,

joy.

0 Kudos
1,301

Thanks Joyjit for the helpful code. It really saved my skin today.

0 Kudos
1,301

Hello Mr. Ghosh,

Thanks for your demo code. I am having the same requirement but with little change. I need the two filed in the popup for input. First will the 'name' and second for the 'password'.  I am using this code for my purpose. Just I need the password field invisible or with ****** . so that no one can view the password while entering to the field.

Please Let me know the process .Waiting for reply.

Former Member
0 Kudos
1,301

>

> Hi i am using POPUP_GET_VALUES fm

> When i execute this fm,

> amount field is in input disabled mode.

> My requirement is i want it to be in input enabled mode.

>

> Thanks,

> Shilps

>

> Hi i am using POPUP_GET_VALUES fm

> When i execute this fm,

> amount field is in input disabled mode.

> My requirement is i want it to be in input enabled mode.

>

> Thanks,

> Shilps

>

> Hi i am using POPUP_GET_VALUES fm

> When i execute this fm,

> amount field is in input disabled mode.

> My requirement is i want it to be in input enabled mode.

>

> Thanks,

> Shilps

Try this code...

u will understand how the 'popup_get_values' will help you to open a box wherein we can enter the file path.

Pop a Message to specific SAP users

*How to get a list of all the currently logged on users?

  • How to popup an instant message on a user's monitor?

  • How to get a specific user's details?

  • Usage of 'POPUP_GET_VALUES' function module to get data from user

  • without having to write GUI code

*

*

REPORT ZPOPUP NO STANDARD PAGE HEADING.

INCLUDE <ICON>.

DATA: BEGIN OF USR_TABL OCCURS 0.

INCLUDE STRUCTURE UINFO.

DATA: END OF USR_TABL.

DATA: L_LENGTH TYPE I,

T_ABAPLIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE,

BEGIN OF T_USER OCCURS 0,

COUNTER TYPE I,

SELECTION TYPE C,

MANDT LIKE SY-MANDT,

BNAME LIKE SY-UNAME,

NAME_FIRST LIKE V_ADRP_CP-NAME_FIRST,

NAME_LAST LIKE V_ADRP_CP-NAME_LAST,

DEPARTMENT LIKE V_ADRP_CP-DEPARTMENT,

TEL_NUMBER LIKE V_ADRP_CP-TEL_NUMBER,

END OF T_USER,

L_CLIENT LIKE SY-MANDT,

L_USERID LIKE UINFO-BNAME,

L_OPCODE TYPE X,

L_FUNCT_CODE(1) TYPE C,

L_TEST(200) TYPE C.

L_OPCODE = 2.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD L_OPCODE

ID 'TAB' FIELD USR_TABL-SYS.

CLEAR T_USER. REFRESH T_USER.

LOOP AT USR_TABL.

T_USER-MANDT = USR_TABL-MANDT.

T_USER-BNAME = USR_TABL-BNAME.

APPEND T_USER.

ENDLOOP.

SORT T_USER.

DELETE ADJACENT DUPLICATES FROM T_USER.

LOOP AT T_USER.

T_USER-COUNTER = SY-TABIX.

SELECT V~NAME_FIRST

V~NAME_LAST

V~DEPARTMENT

V~TEL_NUMBER

INTO (T_USER-NAME_FIRST,

T_USER-NAME_LAST,

T_USER-DEPARTMENT,

T_USER-TEL_NUMBER)

FROM USR21 AS U

JOIN V_ADRP_CP AS V

ON UPERSNUMBER = VPERSNUMBER AND

UADDRNUMBER = VADDRNUMBER

WHERE U~BNAME = T_USER-BNAME.

ENDSELECT.

MODIFY T_USER.

ENDLOOP.

SORT T_USER BY NAME_LAST NAME_FIRST.

PERFORM DISPLAY_LIST.

TOP-OF-PAGE.

PERFORM DISPLAY_MENU.

  • End of top-of-page

TOP-OF-PAGE DURING LINE-SELECTION.

PERFORM DISPLAY_MENU.

  • End of top-of-page during line-selection

AT LINE-SELECTION.

IF SY-CUROW = 2.

IF SY-CUCOL < 19.

T_USER-SELECTION = 'X'.

MODIFY T_USER TRANSPORTING SELECTION WHERE SELECTION = ''.

PERFORM DISPLAY_LIST.

ELSEIF SY-CUCOL < 36.

CLEAR T_USER-SELECTION.

MODIFY T_USER TRANSPORTING SELECTION WHERE SELECTION = 'X'.

PERFORM DISPLAY_LIST.

ELSEIF SY-CUCOL < 50.

PERFORM TRANSFER_SELECTION.

PERFORM POPUP_MSG.

ELSEIF SY-CUCOL < 67.

PERFORM TRANSFER_SELECTION.

SORT T_USER BY NAME_LAST.

PERFORM DISPLAY_LIST.

ELSEIF SY-CUCOL < 81.

PERFORM TRANSFER_SELECTION.

SORT T_USER BY NAME_FIRST.

PERFORM DISPLAY_LIST.

ELSEIF SY-CUCOL < 93.

PERFORM TRANSFER_SELECTION.

SORT T_USER BY MANDT.

PERFORM DISPLAY_LIST.

ENDIF.

ENDIF.

  • End of line-selection

&----


*& Form DISPLAY_LIST

&----


FORM DISPLAY_LIST.

SY-LSIND = 0.

FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

LOOP AT T_USER.

WRITE: / SY-VLINE, T_USER-SELECTION AS CHECKBOX,

SY-VLINE, T_USER-MANDT,

SY-VLINE, T_USER-BNAME,

SY-VLINE, T_USER-NAME_FIRST(15),

SY-VLINE, T_USER-NAME_LAST(15),

SY-VLINE, T_USER-DEPARTMENT(20),

SY-VLINE, T_USER-TEL_NUMBER(20), SY-VLINE.

HIDE: T_USER-COUNTER, T_USER-SELECTION.

ENDLOOP.

FORMAT COLOR OFF.

WRITE: /(108) SY-ULINE.

ENDFORM. " DISPLAY_LIST

&----


*& Form DISPLAY_MENU

&----


FORM DISPLAY_MENU.

FORMAT COLOR COL_HEADING HOTSPOT.

WRITE: (91) SY-ULINE,

/ SY-VLINE NO-GAP, (4) ICON_SELECT_ALL NO-GAP, 'Select All',

SY-VLINE NO-GAP, (4) ICON_DESELECT_ALL NO-GAP, 'Deselect All',

SY-VLINE NO-GAP, (4) ICON_SHORT_MESSAGE NO-GAP, 'Send Popup',

SY-VLINE NO-GAP, (4) ICON_SORT_UP NO-GAP, 'Last Name' NO-GAP,

SY-VLINE NO-GAP, (4) ICON_SORT_UP NO-GAP, 'First Name' NO-GAP,

SY-VLINE NO-GAP, (4) ICON_SORT_UP NO-GAP, 'Client' NO-GAP,

SY-VLINE,

/(91) SY-ULINE,

/(108) SY-ULINE.

FORMAT HOTSPOT OFF.

WRITE: / SY-VLINE, ' ',

SY-VLINE, 'Cli',

SY-VLINE, 'User ',

SY-VLINE, 'First Name ',

SY-VLINE, 'Last Name ',

SY-VLINE, 'Department ',

SY-VLINE, 'Telephone ',

SY-VLINE,

/(108) SY-ULINE.

FORMAT COLOR OFF.

ENDFORM. " DISPLAY_MENU

&----


*& Form TRANSFER_SELECTION

&----


FORM TRANSFER_SELECTION.

DO.

READ LINE SY-INDEX FIELD VALUE T_USER-SELECTION.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

MODIFY T_USER TRANSPORTING SELECTION

WHERE COUNTER = T_USER-COUNTER.

ENDDO.

CLEAR T_USER.

ENDFORM. " TRANSFER_SELECTION

&----


*& Form POPUP_MSG

&----


FORM POPUP_MSG.

DATA: L_MSG LIKE SM04DIC-POPUPMSG VALUE 'Experimental Message',

L_LEN TYPE I,

L_RET TYPE C.

LOOP AT T_USER WHERE SELECTION = 'X'.

PERFORM GET_MESSAGE CHANGING L_MSG L_RET.

EXIT.

ENDLOOP.

IF L_RET = 'A'. "User cancelled the message

EXIT.

ENDIF.

  • Get the message text

L_LEN = STRLEN( L_MSG ).

LOOP AT T_USER WHERE SELECTION = 'X'.

CALL FUNCTION 'TH_POPUP'

EXPORTING

CLIENT = T_USER-MANDT

USER = T_USER-BNAME

MESSAGE = L_MSG

MESSAGE_LEN = L_LENGTH

  • CUT_BLANKS = ' '

EXCEPTIONS

USER_NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

WRITE: 'User ', T_USER-BNAME, 'not found.'.

ENDIF.

ENDLOOP.

IF SY-SUBRC <> 0.

  • Big error! No user has been selected.

MESSAGE ID 'AT' TYPE 'E' NUMBER '315' WITH

'No user selected!'.

EXIT.

ENDIF.

ENDFORM. " POPUP_MSG

&----


*& Form GET_MESSAGE

&----


FORM GET_MESSAGE CHANGING P_L_MSG LIKE SM04DIC-POPUPMSG

P_RETURNCODE TYPE C.

DATA: BEGIN OF FIELDS OCCURS 1.

INCLUDE STRUCTURE SVAL.

DATA: END OF FIELDS,

RETURNCODE TYPE C.

FIELDS-TABNAME = 'SM04DIC'.

FIELDS-FIELDNAME = 'POPUPMSG'.

FIELDS-FIELDTEXT = 'Message :'.

CONCATENATE ' - Msg from' SY-UNAME '.' INTO FIELDS-VALUE SEPARATED

BY ' '.

APPEND FIELDS.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING POPUP_TITLE = 'Supply the popup message'

IMPORTING RETURNCODE = P_RETURNCODE

TABLES FIELDS = FIELDS.

IF P_RETURNCODE = 'A'.

EXIT.

ELSE.

READ TABLE FIELDS INDEX 1.

P_L_MSG = FIELDS-VALUE.

ENDIF.

ENDFORM. " GET_MESSAGE

*-- End of Program

Edited by: Rama Krishna. G on Apr 23, 2010 1:10 PM

Edited by: Rama Krishna. G on Apr 23, 2010 1:11 PM