Application Development and Automation 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: 
Read only

Problem regarding dynamic value of ok_code for find button

Former Member
0 Likes
1,470

Hi Gurus,

           I am facing a problem in dialog programming taht the value of ok_code(sy-ucomm) is dynammic it keep on changing.

I m not able to capture the value of ok_code in when case,value of ok_code is comming from standard class.

plz help.

<removed by moderator>

Message was edited by: Thomas Zloch

Hi Gurus,

           I am facing a problem in dialog programming taht the value of ok_code(sy-ucomm) is dynammic it keep on changing.

I m not able to capture the value of ok_code in when case,value of ok_code is comming from standard class.

plz help.

<removed by moderator>

Message was edited by: Thomas Zloch

13 REPLIES 13
Read only

Former Member
0 Likes
1,382

Hi,

mention senario where you not able to get OK_CODE,,,in PAI of your screen?,,,,,provide some light with code,,,,

thank and regards

Read only

0 Likes
1,382

Hi Lingaraj,

                In my scenario if I am on same session then the value of ok_code is same .

but If i logout of the server and logged in again its value is changed.

Its also happening in Standard SAP program - salv_demo_tree_functions

debug find button on ALV tree control and check out value of sy-ucomm.

then log out from the server and again check the value of sy-ucomm.

You can see from there that value of sy-ucomm is changed.

Read only

Former Member
0 Likes
1,382

Hi Abhinav,

Is your module pool program a custom one? If so, you can assign a function code to that FIND button and then use it as your ok_code. If not, try using the event on click for the FIND button.

Hope this helps you.

Regards,

Sindhu Pulluru.

Read only

Former Member
0 Likes
1,382

Hi Abhinov,

Can you explain the problem a bit clearly please.

And is your Module Pool a Custom Designed.

Regards.

Read only

0 Likes
1,382

Hi Rohan,

       Yes its a customised design and the value of ok_code is coming from sap standard functionality of find button.

And rest of scenario I have explained above.

Read only

0 Likes
1,382

HI Abhi,

First Make sure u have given Function Code for each Button,

also check in Element List Tab which is previous to Flow Logic tab  whether you have mentioned the OK_CODE. in last row.

Regards.

Read only

0 Likes
1,382

What function code?

Jake

Read only

0 Likes
1,382

Hi Jake,

      That Function code is dynamically changing i.e Sy-Ucomm.

Read only

0 Likes
1,382

Hey Jake,

Function Code is nothing but a code which represent a particular Button.

Read only

0 Likes
1,382

Hey Abhi,

Do like This,

Data ok_code like sy-ucomm.

in top include.

in PAI.

Case Ok_code.

When 'Function Code' (I hope you have checked it)

    Business Logic.

Read only

0 Likes
1,382

and

I think you don't get my question or my question is not clear?

What I mean is, what is the function code of the standard FIND button? Is it '%SC'?

Regards,

Jake

Read only

0 Likes
1,382

Hi Jake and Rohan,

The Possible values of Sy-Ucomm are as follows:

   when '%_GC 117 1' or '%_GC 131 1' or '%_GC 132 1' or '%_GC 133 1'
      or '%_GC 150 1' or '%_GC 152 1'.

I have put or condition but its value can again change and it would not work.

Also hardcoding is not good practice.

Hope u ppl got the thing right.

Read only

0 Likes
1,382

This message was moderated.