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

OK_CODE for Enter

Former Member
0 Likes
2,710

Hi

What is the OK_CODE for enter?

I have ALV Grid Report with one fld in edit mode. If I enter wrong input it should goto selection screen.

I have ONLI/ENTR/ENTE/space but not working.

Please help me

9 REPLIES 9
Read only

Former Member
0 Likes
1,585

It might be different for different transactions.

Try looking into the GUISTATUS of the screen for which you want to identify the ok_code. Check under the Function keys section what has been assigned to the Green OK button.

In some cases it might be 'ENTE'.

Read only

Former Member
0 Likes
1,585

Hi,

its

'ENTR'.

Regs

Manas Ranjan Panda

Read only

Former Member
0 Likes
1,585

hi

do like this

go to se80.

give function group name SALV.

in guistatus of that copy STANDARD status to ZSTANDARD for your program.

now assign the gui status in the program for alv assign the OK CODE for ENTER

because in STANDARD GUI status no fn code is assign to save and enter button.

regards

shiba dutta

Read only

Former Member
0 Likes
1,585

ok code for enter is

ok_code = '/00'

Read only

Former Member
0 Likes
1,585

Hi,

I think the best thing ia to check out what is the User command that is being triggered for enter in Debug mode and use that in your program. It may differ for different purposes. Check out SY-UCOMM field in Debug mode and try to use that in your code.

Regards,

Vijay

Read only

Former Member
0 Likes
1,585

HI

if u using report program

ex :

REPORT ZOKCODE .

AT USER-COMMAND .

CASE SY-UCOMM .

WHEN 'DISP' .

WRITE : / ' JJDJDJ' .

WHEN 'EXIT' .

WRITE : /' JHGUU '.

ENDCASE .

suppouse u using module pool program

u can not declare in editr AT USER-COMMAND .

Read only

andreas_mann3
Active Contributor
0 Likes
1,585

Hi,

better use event DATA_CHANGED for your validation

A.

Read only

Former Member
0 Likes
1,585

if u want control over selection if u give wrong I / P..

i don't know whether it is useful but,we use like this.

when ever YOUR using 2 blocks ,based on first block selection,2nd has to enable or disable.

like

after parameters:...

<b>AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF VAL = 1 .

SCREEN-INPUT = O.

  • SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ELSE.

VAL = 2 .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.</b>

after AT SELECTION-SCREEN ON P_KUNNR(OR ANY OTHER)

SELECT SINGLE * FROM KNA1 WHERE KUNNR = P_KUNNR.

<b>IF SY-SUBRC <> 0.

MESSAGE I000(0) WITH ' ENTER CORRECT I/P '.

EXIT.

ELSE.

VAL = 2.

ENDIF.

(HERE CONTROL GOES TO SCREEN-INPUT = 1 )</b>

Read only

Former Member
0 Likes
1,585

Hi,

Then try checking the OK_CODE and implement the same in your PAI module in the case endcase branching.

Regards,

vijay