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

BDC

Former Member
0 Likes
746

What is the mean by ok_code

& bdc_cursor inbdc BDC?

What is the purpose of ok_code & bdc_cursor in BDC?

explain briefly.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
715

Hi,

BDC_CURSOR: You can set the cursor and enter as a corresponding field value the name of the field on which the cursor is to be positioned .

For example, while recording VA01, the cursor is positioned at the Sales Order Type, then VBAK-AUART value is passed to the BDC_CURSOR.

BDC_OKCOE: This is a command field which stores the value whenever a command is executed.

For example, when user presses Enter, the value /00 is stores in the BDC_OKCODE.

Hope it helps u.

Thanks,

Ruthra

5 REPLIES 5
Read only

Former Member
0 Likes
716

Hi,

BDC_CURSOR: You can set the cursor and enter as a corresponding field value the name of the field on which the cursor is to be positioned .

For example, while recording VA01, the cursor is positioned at the Sales Order Type, then VBAK-AUART value is passed to the BDC_CURSOR.

BDC_OKCOE: This is a command field which stores the value whenever a command is executed.

For example, when user presses Enter, the value /00 is stores in the BDC_OKCODE.

Hope it helps u.

Thanks,

Ruthra

Read only

Former Member
0 Likes
715

OK_CODE: In bdc recording whenever you press enter or save some function codes will trigeer in the form of OK_CODE.

example: OK_CODE for save = /11 , for enter = /00 or =entr

BDC_CURSOR: In bdc recording whenever you enter in perticular screen ..where the cursor is positioned at the time of recording.

Regards,

Dara.

Read only

prasanth_kasturi
Active Contributor
0 Likes
715

hi

ok_code is a variable which contain the fct code(sy-ucomm). i.e it contains user interactions with the screen like clicking of push buttons , enter etc.

using ok_code you can get the user interactions and in the PAI evet of the screen you can write the necessary code

ok_code acts just as a temporary variable that stores the value of sy-ucomm.

When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.

In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:

In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.

bdc_cursor contains the position of starting cursor on the screen .

using it you can position the cursor at the required field on your screen

You can set the cursor and enter as a corresponding field value the name of the field on which the cursor is to be positioned .

regards

prasanth

Read only

Former Member
0 Likes
715

Ok_code R those codes which r defiened in PF_status it is used for press ENTER , BACK and many much more

and Cursor is used to place the cursor position

Read only

Former Member
0 Likes
715

BDC_CURSOR is to place the cursor in the field where u want.

BDC_OKCODE is the command to trigger the particular action.

OK_Code is a variable used to keep the system user command values , which is nothing but sy-ucomm. BDC_OKCODE will store all the ok codes in the BDC program. When you pass the fields to a screen, after filling the fields we need to click any button to move other screens, so here the button will be have a OK_CODE. This OK_CODE is for knowing this, when we do the recording of the Program. After that we will store this OK code in the BDC_OKCODE field to trigger the next operation.

Please have a look at below thread:

I hope it helps.

Best Regards,

Vibha

Please mark all the helpful answers