Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic parameter dictionary reference behavior

former_member378471
Discoverer
0 Likes
1,726

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 .

8 REPLIES 8
Read only

former_member184158
Active Contributor
1,626

Hi,

could you explain more whe it does not wrok and have u tried this event At Selection Screen?

Read only

former_member564522
Active Participant
1,626

Hi,

your question is not clear. What you want to achieve?

CNT is always set to initial value whenever you execute the program.

Read only

matt
Active Contributor
1,626

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.

Read only

0 Likes
1,626
Hi Matthew .

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 ?

Read only

Sandra_Rossi
Active Contributor
1,626

Longjie Jin Please explain the whole scenario at once, don't add new context each time there is a new answer.

Read only

111111E24
Discoverer
0 Likes
1,626

For examaple, You can use POPUP_GET_VALUES, for generate popup.

Updated...

Also You can try to use FREE_SELECTIONS_INIT + FREE_SELECTIONS_DIALOG

Read only

0 Likes
1,626

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

Read only

0 Likes
1,626

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.