‎2008 Aug 06 9:59 AM
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.
‎2008 Aug 06 10:12 AM
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...
‎2008 Aug 06 10:24 AM
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
‎2008 Aug 06 10:37 AM
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.
‎2008 Aug 06 10:40 AM
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.
‎2010 Feb 01 7:37 PM
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