08-04-2014 8:32 AM
Hello experts,
I have an issue here. When the function module F4IF_INT_TABLE_VALUE_REQUEST is used in my program for displaying the PSTYV field values on the selection screen upon value request. Now, when the popup opens there are 53 number of item categories, i.e., from VBRP table. If any one of them is selected and double clicked, they should be selected as per the conventional idea, but nothing is being selected after double clicking. How to achieve this ? The following is my code.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_PSTYV-LOW.
SELECT DISTINCT PSTYV
FROM VBRP
INTO TABLE GT_PSTYV.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PSTYV'
VALUE_ORG = 'S'
tables
value_tab = GT_PSTYV
RETURN_TAB = GT_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks and regards,
Ambareesh J.
08-04-2014 8:53 AM
Try passing parameters dynpprog dynppr and dynprofield as below:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PSTYV'
value_org = 'S'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'SO_PSTYV-LOW'
TABLES
value_tab = gt_pstyv
return_tab = gt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards
08-04-2014 8:53 AM
Try passing parameters dynpprog dynppr and dynprofield as below:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PSTYV'
value_org = 'S'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'SO_PSTYV-LOW'
TABLES
value_tab = gt_pstyv
return_tab = gt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards
08-04-2014 9:18 AM
Thank you Mehwish,
I was actually trying with sy-repid in dynpprog instead of sy-cprog. Very helpful. I appreciate your help.
Thanks and regards,
Ambareesh J.
08-04-2014 8:56 AM
Hello Ambaressh,
Please add the below piece of code after "endif".
READ TABLE gt_return INTO wa_return INDEX 1.
CHECK sy-subrc = 0.
READ TABLE gt_pstyv WITH KEY pstyv = wa_return-fieldval.
CHECK sy-subrc = 0.
SO_PSTYV-LOW = wa_return-fieldval.
Thanks
08-04-2014 8:59 AM
Check the following code.
TABLES: VBAK.
DATA: BEGIN OF T_VBELN OCCURS 0,
VBELN TYPE VBAK-VBELN,
END OF T_VBELN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
SELECT-OPTIONS: S_SCREEN FOR VBAK-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_screen-low.
SELECT VBELN FROM VBAK INTO TABLE T_VBELN.
IF SY-SUBRC = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'VBELN'
DYNPPROG = 'ZTRIAL'
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_SCREEN'
VALUE_ORG = 'S' "Mandatory
tables
value_tab = T_VBELN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
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.
08-04-2014 9:07 AM
You haven't mentioned to which field the selected data to be get assigned.
For the system to identify the particular field in screen, you must provide the details below.
dynpprog = SY-CPROG
dynpnr = SY-DYNNR
dynprofield = 'G_FIELD' "Screen filed, to which F4 attached
08-04-2014 9:20 AM
I appreciate all your help. Thank you so much.
Regards,
Ambareesh J.