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

Generate fields on the selection screen automatically

Former Member
0 Likes
1,658

Hi,

I'd like create some fields on my selection screen automatically using an information filled in the selection screen too.

For instance : I enter a table name, and my selection screen is autommatically filled with all the primary key fields of this table.

Do know, how i can do that?

Thx in advance.

5 REPLIES 5
Read only

former_member195383
Active Contributor
0 Likes
1,134

u have to write the code under the event..

AT SELECTION-SCREEN OUTPUT.

there u can make some fields invisible or invisible, based on any value entered on the selection screen.

u can write the same in the below way..

if pa_char eq 'X'.

LOOP AT SCREEN.

if screen-name = 'FILED_NAME'.

screen-invisible = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

else.

LOOP AT SCREEN.

if screen-name = 'FILED_NAME'.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

wat this will do is when u enter value 'X' in the parameter pa_char, the screen field with name FIELD_NAME will become visible..

Hope this idea helps u out...

Read only

0 Likes
1,134

My problem is not to switch an existing field from invisible to visible...

As I said, the fields don't exist, I have to create these fields dynamically on the selection screen.

When I enter a table name, I'd like that all the primary key fields will be created automatically on my selection screen.

The solution may be to call an other selection screen? But how?

Edited by: Mathieu Eylert on Aug 6, 2008 11:25 AM

Read only

0 Likes
1,134

In At selection-screen output use CALL SELECTION-SCREEN <sel screen number>.

You will need to define multiple selection screen in your program / include and call it accordingly.

If you are asking for dynamic code to define selection-screen and it's component, i doubt if that can be done with conventional ABAP.

Regards,

Mohaiyuddin.

Read only

Former Member
0 Likes
1,134

hi do like this..

get the data from the table DD03L give input tablename...and write select for that to get the keyfields by the field KEYFLAG= 'X'.

REPORT Ztest.

tables:dd03l.

data: begin of itab occurs 0,

TABNAME like dd03l-TABNAME,

FIELDNAME like dd03l-FIELDNAME,

KEYFLAG like dd03l-KEYFLAG,

end of itab .

parameters:p_tab like dd03l-tabname.

select tabname

fieldname

keyflag

from dd03l

into table itab

where tabname = p_tab.

loop at itab where keyflag = 'X'.

write:/ itab-tabname,

itab-fieldname.

endloop.

Read only

former_member368216
Participant
0 Likes
1,134

Hi Mathieu ,

I have exactly the same requirement. If your issue is resolved, can you please help me with the approach/solution.

Thanks and Regards,

Ashok