2008 Mar 25 11:45 AM
hi
how do i implement POV and POH on a field in dialog programming
hi
how do i implement POV and POH on a field in dialog programming
2008 Mar 25 11:52 AM
HI,
write this after PAI..
PROCESS ON VALUE-REQUEST.
FIELD ifmtp-form_type MODULE fm_drop.
PROCESS ON HELP-REQUEST.
FIELD srno MODULE help_srn.
MODULE fm_drop INPUT.
CLEAR ifmtp.
REFRESH ifmtp.
ifmtp-form_type = 'C'.
APPEND ifmtp.
ifmtp-form_type = 'F'.
APPEND ifmtp.
ifmtp-form_type = 'H'.
APPEND ifmtp.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FORM_TYPE'
value_org = 'S'
TABLES
value_tab = ifmtp.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " fm_drop INPUT
here ifmtp-form_type is my field which i have taken as listbox on screen...
DATA : BEGIN OF ifmtp OCCURS 0,
form_type LIKE zform_track_mast-form_type,
END OF ifmtp.
for this,
i have taken one text field on screen 2000
and provide info about this field...
MODULE help_srn INPUT.
CALL SCREEN 2000 STARTING AT 10 5
ENDING AT 60 10.
ENDMODULE. " help_srn INPUT
MODULE user_command_2000 INPUT.
CASE sy-ucomm.
WHEN 'OK' OR 'CAN'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_2000 INPUT
reward if usefull...
2008 Mar 25 12:20 PM
Program your own. let me give a code sample just for the POV section. Here the F4 help is coded for the field "GV_USER" of screen 100 and "ADDR_TO" and "ADDR_CC" fields of your work area used for the table control's internal table.
DATA: BEGIN OF gt_mail OCCURS 0 ,
...
addr_to(255) TYPE c ,
addr_cc (255) TYPE c ,
...
END OF gt_mail .
DATA gv_user like sy-uname .
...
*--Screen 100:
...
PROCESS ON VALUE-REQUEST.
FIELD gv_user MODULE f4_user .
FIELD gt_mail-addr_to MODULE f4_addr_to .
FIELD gt_mail-addr_cc MODULE f4_addr_cc .
-
MODULE gv_user INPUT.
*--Branching to a form since the variables are defined
*-as global when you define here...
PERFORM f4_user CHANGING gv_user .
ENDMODULE .
*--
MODULE f4_addr_to INPUT.
PERFORM f4_user CHANGING gt_mail-addr_to .
ENDMODULE .
*--
MODULE f4_addr_cc INPUT.
PERFORM f4_user CHANGING gt_mail-addr_cc .
ENDMODULE .
-
FORM f4_user CHANGING ep_user LIKE sy-uname .
*You can have this internal table as you want
DATA: BEGIN OF lt_users OCCURS 1 ,
bname LIKE usr21-bname ,
kostl LIKE usr21-kostl ,
END OF lt_users .
DATA lt_return LIKE ddshretval OCCURS 0 WITH HEADER LINE .
*You can get the internal table content from any table
*you want. Here I use "USR21"
SELECT bname kostl FROM usr21
INTO TABLE lt_users .
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
*retfield must contain the name of the field of the
*internal table which will be assigned to your screen
*field in case you select it.
retfield = 'BNAME'
window_title = 'User Selection'
value_org = 'S' "Use this value
TABLES
value_tab = lt_users "your int. tab holding values to be selected
return_tab = lt_return "int table having your selection(s)
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0 .
READ TABLE lt_return INDEX 1 .
IF sy-subrc = 0 .
ep_user = lt_return-fieldval . "Here is the assignment
ENDIF .
ENDIF.
ENDFORM .
In fact, there is a FM "F4_USER" but it says that it is obsolete and recommends the usage of "USER_ADDR" search help object.
There is function module documentation for "F4IF_INT_TABLE_VALUE_REQUEST" .
If you apply both ways, SAP will execute the code in POV and ignore the search help object.
2008 Mar 25 12:23 PM
step by step procedure for POV is as follows:
1First write process on value-request in flow logic after process after input.
process on value-request.
field ztable-fieldname module rec_help.
2 Now double click on module rec_help for code.
3 module rec_help input.
data : begin of it_tmp occurs 2,
fieldname like ztable-fieldname
fieldname2 like ztable-fieldname2
data : end of it_tmp.
data: progname like sy-repid,
dynnum like sy-dynnr.
data : t_return like ddshretval occurs 0 with header line.
refresh it_tmp.
select * from ztable client specified
where mandt = sy-mandt
and fieldname2= ztable1-fieldname2.
move-corresponding ztable to it_tmp.
append it_tmp.
endselect.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'fieldname1'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'fieldname1'
value_org = 'S'
tables
value_tab = it_tmp
return_tab = t_return
endif.
if sy-subrc = 0.
read table t_return index 1.
ztable-fieldname1 = t_return-fieldval.
endif.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |