cancel
Showing results for 
Search instead for 
Did you mean: 

Using Drop down box in a table control

0 Kudos

Hi,

I'm new to ABAP. I'm trying to use drop down boxes as fields inside a table control.Im using 2 fields (f1 and f2). I want to dynamically populate values in f2 based on f1 i.e once i choose a value in f1 and click on f2 , it should give me a list of values in f2 based on the value of f1. f1 and f2 are from different tables.

what i have done : i am able to populate values in f2 (based on the value of f1)

Problem::

1. Once i choose a value in the field f1, the value is not remaining in the field. Once i choose, the value blinks for a while and goes off ! ... ( my guess :: PBO is clearing it )

2. After i choose a value in f1 in the first row, the corresponding values in f2 are getting populated in all the rows.

Accepted Solutions (0)

Answers (2)

Answers (2)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi!

For your first problem: Try to handle normal field (without table control) first.

In PAI, you have to move value from dynpro field to your program field. In case of tables, you have to modify corresponding line of internal table.

Then next PBO will read updated value and screen display doesn't loose any longer changes.

In case of identical naming of screen fields / global fields in program, some movements are done automatically by system based on this naming. That's of course not possible with internal tables, so try a global field with a name different to field on screen to see the behavior.

For your second problem: I guess, your struggling with a global work area of your internal table, which is not correctly filled with screen values for each time -> once filled, all lines changed.

Regards,

Christian

Former Member
0 Kudos

Hi,

Basically you need to loop thru the internal table that has the data in both PBO and PAI and moreover, in PBO, you need to loop thru the table with table control.

And can save the data to a database table in PAI by checking SY-UCOMM. Remember that you select the data from db table only once during the processing(PBO), because whenever the screen refreshes, the data is selected from dbtable(during every PBO) and eventhough there is some data before, as it selects data from db table during every PBO, you maynot see the previous values unless you save them.

I think this solves your problem

Former Member
0 Kudos

Hi,

This link will help you with dropdown box:

http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Regards,

Anjali