Application Development 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: 

Select-options

Former Member
0 Kudos
259

Hello.

I am making a program where, in the selection-screen, I ask for a table name and a field name to be able to update some data in the table using those. I have too a criteria section where you enter the name of the field of the restriction where you want to change datas in your table and a select-options to write the infos about the restrictions.

For example: I want to change data X in field Y in table Z where the field "name" into table Z is between L and S.

Though, my problem actually is when I write my select-options, I don't have yet the table name and its field in and it becomes really problematic when it comes to write the "for" in "select-options so_crit for (here)".

I tried with field-symbol but it doesn't work considerating that the user has to enter a table and a field name first unless there is something tricky that I don't understand...

Or maybe there is a way to not use the "for" and make the select-options usable for any kind of datas?

Any suggestions?

Thank you

Edited by: SBenoit on Nov 1, 2010 2:51 PM

Edited by: SBenoit on Nov 1, 2010 2:56 PM

Moderator message: please use more descriptive subject lines.

Edited by: Thomas Zloch on Nov 1, 2010 3:42 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
175

Hi,

I think you can dynamically give the table and field name for select-options,


SELECT-OPTIONS : S_FLD FOR (DYNFLD).

it will create a generic select-option for these dynamic fields.

Thanks,

ANmol.

5 REPLIES 5

Former Member
0 Kudos
176

Hi,

I think you can dynamically give the table and field name for select-options,


SELECT-OPTIONS : S_FLD FOR (DYNFLD).

it will create a generic select-option for these dynamic fields.

Thanks,

ANmol.

Former Member
0 Kudos
175

HI

Yuo need a parameter fir the table name and a select-option for the field name, but I don't understand if you need a selecti-option tio insert the criteria for selecting the record to be updated.

Max

0 Kudos
175

Max:

What I have in my selection-screen is this:

Parameter for table

Parameter for the field of the table used for the criteria

Select-options for the datas used to fill the criteria (like the equivalent of the "where" in a "Select" from a table).

Parameter for the field of the table the modification will be done.

Parameter for the new data.

And ANmol, I have to go to a meeting but I'll try your solution and I'll give you an update.

ThomasZloch
Active Contributor
0 Kudos
175

This sounds like a very dangerous weapon in the hand of the wrong people. Will you block SAP standard tables from being updated with your tool?

As for your actual question, almost all Open SQL statements allow dynamic field lists, table names and where-conditions, you might be able to solve this by studying ABAP online help.

Thomas

Former Member
0 Kudos
175

Yes Thomas, there are serious validations made to only change the Z tables. And don't worry, I have a supervisor knowing SAP way more than me that is watching to be sure that everything is made properly. Also, I'm sorry for not having been clear on the subject line.

And ANmol, I have tried what you suggested and it works Thank you very much for your help