‎2019 May 06 4:43 AM
Hi Expert
I am using dnynamic parameter dictionary reference to make dynamic selection screen as below .
data w_addr type char20 .
data cnt type i .
parameters : p_val like (w_addr).
at SELECTION-SCREEN output .
cnt = cnt + 1 .
if cnt mod 2 = 0 .
w_addr = 'MARA-MATNR'.
else .
w_addr = 'KNA1-KUNNR'.
endif .<br>
but it is only work once when the screen shows up at first, I had debuged program and checked variance W_ADDR had suceccfully passed value during every times PBO, is there have any way I can make it work? Thanks advance for your helps .
‎2019 May 06 5:24 AM
Hi,
could you explain more whe it does not wrok and have u tried this event At Selection Screen?
‎2019 May 06 6:07 AM
Hi,
your question is not clear. What you want to achieve?
CNT is always set to initial value whenever you execute the program.
‎2019 May 06 6:43 AM
Create two parameters. One for MATNR, one for KUNNR. Give them a screen group. LOOP AT SCREEN and switch the visibility according to cnt.
Any other way is unnecessarily complicated.
‎2019 May 06 6:57 AM
Thanks a lot for your answer, but my requirement for the parameter is not only fixed two variation, it depends on user selections at selection screen, the smaple code is only objective to explain my issues . do you have any better ideas ?
‎2019 May 06 12:54 PM
Longjie Jin Please explain the whole scenario at once, don't add new context each time there is a new answer.
‎2019 May 06 7:22 AM
For examaple, You can use POPUP_GET_VALUES, for generate popup.
Updated...
Also You can try to use FREE_SELECTIONS_INIT + FREE_SELECTIONS_DIALOG
‎2019 May 06 12:35 PM
Hi.
thanks a lot for your comment .
I tried that way before,but it is not work at all, even you get return value from pop up either other function modules, the paramter that you difiend reference would not be changed from first assignment .
Regards,
LJ
‎2019 May 06 1:41 PM
Sorry, may be I did't understand you clear. I mean like that (of course it is not standard sel screen 1000)
report ztesti_mi2.
parameters iv_table type dd02l-tabname obligatory.
parameters iv_field type char30 obligatory.
data: lt_fields type standard table of sval.
data: ls_fields like line of lt_fields.
ls_fields-tabname = iv_table.
ls_fields-fieldname = iv_field.
ls_fields-fieldtext = iv_field.
append ls_fields to lt_fields[].
call function 'POPUP_GET_VALUES'
exporting
* NO_VALUE_CHECK = ' '
popup_title = '1'
* START_COLUMN = '5'
* START_ROW = '5'
* IMPORTING
* RETURNCODE =
tables
fields = lt_fields
* EXCEPTIONS
* ERROR_IN_FIELDS = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.