cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when switching tabs in ME21N and fields not exists yet.

0 Kudos

Hello,

I have an issue in ME21N.

I created a script button that clicks on the "Organisationnal datas" tab (from header tabstrip) and then, copy fields value in variables, to populate specific fields on the main screen.

It works fine if i'm already in this tab, but if i'm, for example, in the first tab, i have a script error that tells me a control does not exist (in this case it's a field from the destinion tab screen) and then, no action have been done (i stay in the first tab).

If i only let the push of the tab button in the script, no problem, the tab switching is done fine.

but if i make any reference of a field from the destination tab, the error message occurs.

I verified the name of the fields and they have the same name (i know that sometime the name change, depending of the tabstrip state)

I think it's because that the tab screen have not been completly loaded when the script tries to access the fields, so that these fields does not exists yet.

Is there a way to wait the complete load of the tab screen, before making reference to its fields ?

Or maybe do you have a better solution for problem ?

Thank in advance for your answers.

Accepted Solutions (1)

Accepted Solutions (1)

former_member105930
Active Participant
0 Kudos

Hi,

Without seeing the script its difficult to say, but one thought did occur to me, have you got a Refresh Screen action in the script after you copy the variables?

it may help others if you could screenshot the script so we can gain an understanding of what the script is doing?

Kind Regards,

Ian

0 Kudos

Hello Ian,

I did not make a screen shot of my script because it is too long to be included.

But your answer seems to be the solution.

I tried to put a refresh screen, just after pressing the tab button (and just before copying the fields values), and it seems to work now.

Doing that way, my custom fields have been populated.

Thanks a lot for your answer

PS : i will confirm this post after a few tries, in case of i'm wrong, and the issue is till present, but i think it's ok.

former_member105930
Active Participant
0 Kudos

Glad it helped. I have fallen foul of the Refresh Screen many times. Its so easy to forget it.

all the best

0 Kudos

After some tries, i think it's ok and it completly solved my problem

Thanks again.

Answers (0)