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 Selection

Former Member
0 Likes
888

Hi,

Can any body mail sample code to have a dynamic selection in my z program using FM's

Answers are Highly rewarded

Thanks in Advance

Raj

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
799

Hi raj,

i don't get your problem exactly -

you'll have same functionality like dynamic selection wehn including a logical database in a z-report (without ldb) ?

Andreas

7 REPLIES 7
Read only

Former Member
0 Likes
799

check this thread ..

vijay

Read only

0 Likes
799

I want to have dynamic selections button for example in transaction-s_alr_87012086 (small button on right) in my z program.

I want sample code using functional Modules -

FREE_SELECTIONS_INIT

FREE_SELECTIONS_DIALOG

Thanks

Raj

Read only

0 Likes
799

check this standard report <b>RLLT2700</b>

for the usage of these Funcation modules...

this will help you a lot...

regards

vijay

Read only

0 Likes
799

Have a look at RKPRZSEL.

Rob

Read only

andreas_mann3
Active Contributor
0 Likes
800

Hi raj,

i don't get your problem exactly -

you'll have same functionality like dynamic selection wehn including a logical database in a z-report (without ldb) ?

Andreas

Read only

0 Likes
799

Hi

I want to have dynamic selections button for example in transaction-s_alr_87012086 (small button on right) in my z program without logical database

I know these FM's can be used to get the functionality without ldb.

FREE_SELECTIONS_INIT

FREE_SELECTIONS_DIALOG

can you pass sample code how to use these FMs in my program

Read only

Former Member
0 Likes
799

Sample code for Dynamic selection

*******************************

REPORT ZUP_TEST8 .

data: p_tabnam type tabname,

lv_tabpointer type ref to data,

lv_tablinepointer type ref to data,

lv1_tabpointer type ref to line." of data.

field-symbols: <dyntab> type table, "Dynamic Table

<dyntab_line> type any, "Dynamic table record

<wa_dyn_line> type any.

parameters: P_tab(10) type c.

field-symbols:<wa_dyn> type any.

data:v_text(3000) type c.

concatenate 'T_' p_tab into p_tab.

*Create Dynamic internal table

perform dyn_int_table_create

using

p_tabnam

p_tab

lv_tabpointer.

assign lv_tabpointer->* to <dyntab>.

create data lv_tablinepointer type (p_tabnam).

assign lv_tablinepointer->* to <dyntab_line>.

select *

from

(p_tabnam)

into table

<dyntab>.

  • create data lv_tablinepointer type (p_tabnam).

assign lv_tablinepointer->* to <wa_dyn>.

*assign (p_tab) to <wa_dyn>.

loop at <dyntab> into <wa_dyn>.

write:/ <wa_dyn>.

endloop.

----


  • FORM dyn_table_create *

----


form dyn_int_table_create

using

  • Name of Reference Structure

struname type c

  • Table Name, This is required to create unique names for the

  • dynamic form and Dynamic table in the dynamic form

tabname type c

  • Pointer pointing to the dynamic table

tabpointer.

data:

begin of lt_source occurs 0,

line(128) type c,

end of lt_source.

data:

lv_repid like sy-repid,

lv_form_name(128),

lv_name like sy-repid,

lv_message(240) type c,

lv_line type i,

lv_word(72) type c.

concatenate

'CREAT_INT_TAB_FORM_' tabname into lv_form_name.

concatenate

'REPORT'

' CREAT_INT_TAB_' tabname '.' into lt_source-line.

append lt_source.

concatenate

'FORM' lv_form_name 'USING PTR.'

into lt_source-line

separated by space.

append lt_source.

struname = p_tab+2(4).

concatenate

'DATA' tabname

'LIKE' struname 'OCCURS 0.'

into lt_source-line separated by space.

append lt_source.

concatenate

'CREATE DATA PTR'

'LIKE' tabname into lt_source-line separated by space.

concatenate

lt_source-line '[].' into lt_source-line.

append lt_source.

move 'ENDFORM.' to lt_source-line.

append lt_source.

clear lt_source.

catch system-exceptions generate_subpool_dir_full = 9.

generate subroutine pool lt_source name lv_repid

message lv_message line lv_line word lv_word.

endcatch.

case sy-subrc.

when 0.

when 9.

raise generate_subpool_dir_full.

when others.

message x000(0k) with lv_message lv_line lv_word.

endcase.

perform (lv_form_name) in program (lv_repid) using tabpointer.

endform.

********************

Cheers,

Pramod