‎2007 Jun 25 9:57 PM
hi all, i'm trying to get the values in selection screen by the program, but i was unable to get the values in selctions screen, i'm getting no values found, please correct my program thanks
report zpos.
tables: mkpf.
parameters: p_mblnr like mkpf-mblnr.
data: begin of itab occurs 0,
sud like mkpf-mblnr,
kav like mkpf-mjahr,
end of itab.
at selection-screen on value-request for p_mblnr.
select mblnr mjahr from mkpf into table itab where mblnr = p_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'mblnr'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_mblnr'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = itab
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
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.
‎2007 Jun 25 10:04 PM
you can just use a single select option statement:
tables: mkpf.
select-option: p_mblnr for mkpf-mblnr.
this will solve your issue.
Please reward the helpful entries.
Regards,
Raman.
‎2007 Jun 25 10:04 PM
you can just use a single select option statement:
tables: mkpf.
select-option: p_mblnr for mkpf-mblnr.
this will solve your issue.
Please reward the helpful entries.
Regards,
Raman.
‎2007 Jun 25 10:18 PM
Please see the sample program
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_REVNR-LOW.
PERFORM GET_REVISION_NUMBER USING 'S_REVNR-LOW' 'REVNR'.
FORM GET_REVISION_NUMBER USING
VALUE(FIELD_NAME) LIKE HELP_INFO-DYNPROFLD
VALUE(FIELD_TYPE) LIKE DFIES-FIELDNAME.
DATA: I_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF I_REV OCCURS 0,
REVNR LIKE T352R-REVNR,
END OF I_REV.
DATA: V_S TYPE C VALUE 'S'.
IF I_REV[] IS INITIAL.
SELECT REVNR
INTO TABLE I_REV
FROM T352R.
SORT I_REV BY REVNR.
DELETE ADJACENT DUPLICATES FROM I_REV COMPARING REVNR.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = FIELD_TYPE
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = FIELD_NAME
VALUE_ORG = V_S
TABLES
VALUE_TAB = I_REV
RETURN_TAB = I_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " GET_REVISION_NUMBER
‎2007 Jun 25 10:53 PM
You have issues at 2 places:
1) Change the names in internal table to table fieldnames.
data: begin of itab occurs 0,
mblnr like mkpf-mblnr,
mjahr like mkpf-mjahr,
end of itab
2) In select statement you are selecting only one MBLNR which is entered on screen. so if screen parameter is empty, it will not display anything.
You should write something like:
select mblnr mjahr from mkpf into table itab upto 200 rows.
or you can define it a select option and allow user to write a pattern in the select option field and then you can write select like:
select mblnr mjahr from mkpf into table itab where mblnr in s_mblnr upto 200 rows.
or you can create a search help and attach it to the parameter
http://help.sap.com/saphelp_nw04s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/frameset.htm
tables: mkpf.
parameters: p_mblnr like mkpf-mblnr.
<b>data: begin of itab occurs 0,
sud like mkpf-mblnr,
kav like mkpf-mjahr,
end of itab.</b>
at selection-screen on value-request for p_mblnr.
<b>select mblnr mjahr from mkpf into table itab where mblnr = p_mblnr.</b>
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'mblnr'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_mblnr'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = itab
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
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.