2007 Jun 09 4:41 PM
hi all,
can anyone tell me how to code for a selection based on selection, that is i have taken suppose material document in the selection screen now when i look for a data in the field it should select based on the moment type displaying a popup window having moment type to be selected and accordingly dives the detail document number.can anyone tell me the sample code for this?urgent
abinash verma
hi all,
can anyone tell me how to code for a selection based on selection, that is i have taken suppose material document in the selection screen now when i look for a data in the field it should select based on the moment type displaying a popup window having moment type to be selected and accordingly dives the detail document number.can anyone tell me the sample code for this?urgent
abinash verma
2007 Jun 09 4:45 PM
You need to use At Selection-Screen event.
In which values for first selection will be available to you & then you can use this for second selection for fileteration.
Regards
Sushil
2007 Jun 09 4:50 PM
Hi,
I am not sure if i have understood your requirement correctly but would make an attempt to provide a solution.
After you have the material document obtained from the selection screen ( you would have it in the select options field s_<some> or if you are using a parameter then some p_<> ).
Then use POPUP_GET_VALUES_DB_CHECKED or POPUP_GET_VALUES etc (there are many such FM's for getting value(s).) to get the movement type.
Then use these data to select the detail document.
Regards,
Sharat
2007 Jun 09 5:00 PM
hi abhinash,
use event called,
at selection-screen on value request for <field>.
data: begin of l_tab occurs 0,
matnr type matnr.
data: end of l_tab.
select matnr from <db table> into table l_tab where movement type = parameter-movement type.
then u can use funtion module called,
f4if_int_table_value_request.
in this u can pass reference field 'matnr' and table 'l_tab' paramters ,
then u can related matnr no to selection screen for the particula movement type.
reward points if helpful,
regards,
seshu.
2007 Jun 11 8:39 AM
hi,
i have used as u said but i am getting runtime error, i understand dats becoz of the fm.can you just correct this plz.i am actually fetching mblnr value based on radiobutton selection. radi and rad2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MBLNR.
DATA: BEGIN OF I_MBLNR OCCURS 0,
MBLNR TYPE MSEG-MBLNR,
BWART LIKE MSEG-BWART,
END OF I_MBLNR.
IF RAD1 = 'X'.
SELECT MBLNR FROM MSEG INTO TABLE I_MBLNR
WHERE BWART = '541'.
ELSEIF RAD2 = 'X'.
SELECT MBLNR FROM MSEG INTO TABLE I_MBLNR
WHERE BWART = '551'.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = MBLNR
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = I_MBLNR.
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.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |