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: 

I need to determine the fields on a selscreen at runtime

Former Member
0 Kudos

Hi Team ABAP,

I need to determine the fields on a selscreen at runtime.

That means FM´s like DYNPRO_FIELD_GET, are not doing the i need.

If a field is made inactive or invisible in PBO (at selection Screen Output) i dont Need/want this in my Analysis.

Maybe i better state what i want to achieve.

I want to rightclick a selscreen-field, and then use the upcoming context menue to make it dissappear.

For that i added a pf-status to that selscreen.

In sy-curow i get which row the user clicked on (for example take 5), so now i need to find out which selscreen field is displayed in row 5.

So i can create the customizing entry for this field.

Maybe someone has an idea for me, i dont need coding, i can do that myself.

Thanks for reading

regards

Florian Kemmer

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

Hi Florian,

I try to help you.

I think SAP could do this, because when you press F1, SAP know which field name you have selected.

The only things I have found, is the call of a kernel function : 'HELP_GET_FIELDS'

But I don't know if you could reuse it

good luck

Fred

9 REPLIES 9

FredericGirod
Active Contributor
0 Kudos

Hi Florian,

I try to help you.

I think SAP could do this, because when you press F1, SAP know which field name you have selected.

The only things I have found, is the call of a kernel function : 'HELP_GET_FIELDS'

But I don't know if you could reuse it

good luck

Fred

0 Kudos

Hey Fred thanks a lot.

unfortunateley we dont have this FM on our System, only HELP_GET_VALUES.

But you brought me on the right track.

I am right now Debugging what is happening when you press F1 on a selscreen-field.

Somehow they need to determine on which i have clicked as well, so there definiteley IS a solution, lets see if i can find it out, i will repost if so.

0 Kudos

it's not a Function Module

it's a kernel function  CALL '...'  

regards

Fred

0 Kudos

Well Anyway, it took me a Little but i figured it out.

following code does the trick for me:

[code]

Tables phelp.

IMPORT phelp FROM MEMORY ID 'PHELP'. [/code]

i do this in the Event AT_SELECTION_SCREEN OUTPUT.

Then in phelp-dynprofld i have the actual field i clicked on.

And even if i totally misunderstood you you helped me a lot focusing my thoughts on the right way.

Before your answer i didnt think about that while pressing F1 it works and i only have to find out how they do it.


0 Kudos

Maybe the data is populated with SAPMSYS (something like that), The code is protect and maybe SAP prefer to make an export of the result ..

Fred

raymond_giuseppi
Active Contributor
0 Kudos

May be silly, but did you try GET CURSOR, should be available, after all a context menu trigger a PAI no ?

Regards,

Raymond

0 Kudos

Well Raymond, thats not silly, as that was my first shot

Problem is that the Information it gets me doesnt help me.

I get the Information that i am on the 4th field for example.

But when i have deactivated a field in the selscreen pbo the index doesnt reflect that.

For example when i have 5 fields on selscreen, the third deactivated so it doesnt Show up, and then do a rightclick on the third displayed field i get back index 3. But 3 is the field i actually deactivated, so without additionally reading my deactivation customizing i have no Chance to find out on which field i actually clicked.

0 Kudos

And executing a LOOP AT SCREEN after the GET CURSOR, the screen attributes are not yet reset to dynpro definition values (that will happen just before PBO/AT SELECTION-SCREEN OUTPUT) so a LOOP AT SCREEN til N active fields read (SCREEN-ACTIVE) ?

Else did you find the MEMORY ID in SAPMSHLP ?

Regards,

Raymond

0 Kudos

Exactly in SAPMSHLP in the module

SAPHLP_PBO OUTPUT

There i found the Export of that Memory ID, tried it an Import in my program and it worked.