2017 Jun 13 4:59 PM
So i did an ALV where my matnr should be passed to my Select Screen into the Select-Options.
I can pass the value from the alv with this Code to my selection screen.
ELSEIF pv_ucomm EQ gc_history.
READ TABLE gt_list INTO sel_row
INDEX ps_selfield-tabindex.
o_matnr = sel_row-matnr.
But my problem is, if i change O_matnr to Select-Options e.g. Select-Options: matnr for ...
and the above code to
o_matnr-low = sel_row-matnr
the value is not passed anymore.
MY selection-screen:
SELECTION-SCREEN BEGIN OF SCREEN 0200 AS SUBSCREEN.
*SELECT-OPTIONS: o_matnr FOR zpplock-matnr.
PARAMETERS: o_matnr TYPE zpplock-matnr.
SELECT-OPTIONS: o_sernr FOR risa0-sernr.
SELECT-OPTIONS: o_user FOR zpplock-uname..
SELECT-OPTIONS: o_date FOR zpplock-datum.
PARAMETERS: o_zlock TYPE zpplock-zlock.
SELECT-OPTIONS: o_zreas FOR zpplock-zlock_reason.
SELECT-OPTIONS: o_time FOR zpplock-uzeit.
SELECTION-SCREEN END OF SCREEN 0200.
I let the debugger go over it and my matnr gets written in the o_matnr-low field but its never getting displayed
So i Hope you can help me thanks for your time and help !
2017 Jun 13 10:43 PM
Are you also setting "I" and "EQ" in your select options?
append value #( sign = 'I' option = 'EQ' low = sel_row-matnr ) to o_matnr.
2017 Jun 13 5:41 PM
AT Selection screen output, event is only place that let you show the field. Make sure its been called & when its called fields are updated.
Thanks
Anand
2017 Jun 13 10:43 PM
Are you also setting "I" and "EQ" in your select options?
append value #( sign = 'I' option = 'EQ' low = sel_row-matnr ) to o_matnr.
2017 Jun 14 9:10 AM
no im not setting in my select option 'I' and 'EQ' can u tell me maybe what i need to do
thanks
EDIT: okay thanks a lot mike really helped me with that now its working perfect !
2017 Jun 14 9:29 AM
I gave you the code above.
Please see Select Options in the online help for more detailed info.
2017 Jun 14 2:50 PM
okay i read it and its working for the first selection, but i go back and select another matnr it keeps giving me the first i selected.
1. time i select matnr = 1315.811.711 -> displays 1315.811.711
than i go back
2. time i select matnr = 1315.811.712 -> displays 1315.811.711
and in the debugger at sel_row.matnr-low gets passed the right value, but on the 2nd time the wrong value gets displayed ...
thank you or did i just miss something ?
2017 Jun 14 3:37 PM
Seems that you miss that select options are internal tables with header lines.
2017 Jun 14 3:54 PM
Yes i did i figured it out now 🙂
but i dont know how to delete the previous entry i tried Modify, Update value # (.....)
but it doesnt work like that.
Do i need to put a loop over the code and than delete it ?
ELSEIF pv_ucomm EQ gc_history.
READ TABLE gt_list INTO sel_row
INDEX ps_selfield-tabindex.
APPEND VALUE #( sign = 'I' option = 'EQ' low = sel_row-matnr ) TO o_matnr.
* LOCK Tabelle aufrufen
PERFORM add_history.
2017 Jun 14 3:58 PM
To clear a table, use:
REFRESH o_matnr. or alternatively you can assign the entire table instead of appending, this will overwrite existing contents:
o_matnr = VALUE #( ( sign = 'I' option = 'EQ' low = sel_row-matnr ) ).
2017 Jun 14 4:05 PM
2017 Jun 14 9:26 AM
hi kevin,
"o_matnr-low = sel_row-matnr" is wrong statement for while use select option ,just " o_matnr-low IN sel_row-matnr " type like that it will fetch record based on select option ( low an high).
regards,
Umayaraja.B
2017 Jun 14 3:06 PM
What is actually your requirement??
If you need the same select option like function you can opt for RANGES.
So that you can assign the values to the ranges and get the same functionality like the select-option
but you have to write code to fill the RANGES.
Else try playing with the memory to achieve your work.
2017 Jun 14 3:33 PM
what do u mean by playing with the memory ?
With mikes code it works but as soon as i go back and select another row it keeps displaying me the previous selected matnr from the previous selected row. So i just want the matnr to be copied to the selection screen and if i go back that the previous matnr gets overwritten with the new one .
i hope i explained it correctly
2017 Jun 15 6:49 AM