about the bdc_field perform?

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Posts: 137
Joined: Wed Nov 06, 2002 3:50 am
Location: China

about the bdc_field perform?

Post by digitalife » Fri Nov 15, 2002 2:38 am

for exmaple:

perform bdc_field using 'BDC_OKCODE' '/00'.

perform bdc_field using 'BDC_OKCODE' '=BU'.

perform bdc_field using 'BDC_OKCODE' '=NPE'.

perform bdc_field using 'BDC_OKCODE' '=NLE'.

perform bdc_field using 'BDC_OKCODE' '=ENTE'.

what's the meaning of the options '/00'...'/=ENTE'


perform bdc_field using 'BDC_CURSOR' 'RM07M-LGORT'.

Is it mean,when leave the current screen,put the cursor at Screen field

If not,please teach me.

I Like SAP

Posts: 929
Joined: Tue Oct 22, 2002 3:19 am
Location: The Hague

Post by ocvantol » Fri Nov 15, 2002 3:24 am

These are codes representing the funtion the user performed (or the BDC preforms on behalf of the user).

=BU: Save (in German: Buchen)
/00: Enter key
=ENTE: Enter key

There are a lot of these codes (user commands, SY-UCOMM). As you will find out there are a lot of UCOMMS that have the same meaning. However, they may not be randomly used.

To find the UCOMM for a certain button: press F1 AND HOLD, push the button and release F1.

You were right about BDC_CURSOR.

Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Post by Rich » Fri Nov 15, 2002 3:43 am

The BDC OKCODE field is used to simulate the user clicking a GUI button on the screen.

In the top left hand corner of your gui there is a command line field, where you normally enter transaction codes.

Once you are in a transaction this field can be used to give the transaction commands. For example in an accounting program you might press the 'SAVE' button to post you entries. Typing '=BU' in the command field has the same effect. In another program the key word '=SICH' will do the same thing.

Each button on the GUI has it's own code, and this can be found in the system variable sy-ucomm.

So, on the BDC side of things, you can use these codes to programatically click buttons on the GUI.

These OK codes are different in a lot of cases from transaction to transaction. Common actions such as 'Post' (BU) can be the same but others will not be. To find out what these codes are, call up the transaction and enter '/H' in the command line and press return. Then click the button you are interested in. When the debug screen appears, enter 'SY-UCOMM' in one of the variable fields and press return. This will show you the OK code for the button you have just clicked.

When programming your own interactive reports, these codes are used in the 'AT USER-COMMAND.' event. Using transaction SE41 allows you to create your own GUI, and here you can create your own OK codes. Using the standard OK codes used by SAP in reports provides standard functionality, additional codes provided by yourself are used to trigger actions within your report program:

Code: Select all

At User-Command.
   Case sy-ucomm.
        When 'UPRN'. Perform Print_Report.
        When 'SELA'. Perform Select_All.
        When 'DSEL'. Perform Dsel_All.
        When 'BSEL'. Perform Select_Block.
        When 'SAVE'. Perform Manual_Download tables t_bsis
                                              using p_freq.
        When 'UPCK'. Perform Show_Document tables t_bsis
                                            using p_bukrs.
        When 'UHLP'. Perform Prg_Doc_Help.
Other BDC codes that can be used with care:

/nxxxx This terminates the current transaction, and starts transaction xxxx

/n This terminates the transaction. This generally corresponds to pressing F15 to go back.

/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff

/nex This terminates all separate sessions and logs off immediately (without any warning!).

/oxxxx This opens a new session and starts transaction xxxx in This session.

/o This lists existing sessions and allows deletion or opening of a new session.

/i This terminates the current session (corresponds to System End

/i1, /i2,... This terminates the session with the number given.

.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).

/n This terminates the current batch input transaction and characterizes it as

/bdel This deletes the current batch input transaction.

/bend This terminates batch input processing and sets the session to Failed

/bda This switches from Display errors only to Process in foreground

/bde This switches from Process in foreground to Display errors only

/h This switches into debugging mode.

/hs This switches into debugging mode and activates the debugging of system functions.

/$SYNC This resets all buffers of the application server

/$CUA This resets the CUA buffer of the application server

/$TAB This resets the TABLE buffers of the application server

/$NAM This resets the nametab buffer of the application server

/$DYNP This resets the screen buffer of the application server




Post by Guest » Fri Nov 15, 2002 10:33 am

thank ocvantol & Rich!

you are very kind man!hehe :D

Posts: 137
Joined: Wed Nov 06, 2002 3:50 am
Location: China

Post by digitalife » Fri Nov 15, 2002 10:36 am

the guest is me.

i didn't login at home just now. :oops:
I Like SAP


Post by Guest » Tue Nov 19, 2002 5:53 am

how about
perform bdc_field using 'DKACB-FMORE' 'X'.
what's the meaning of this?

Posts: 6197
Joined: Mon Oct 21, 2002 3:04 am
Location: Darlington

Perform bdc_field using.....

Post by RosieBrent » Tue Nov 19, 2002 6:37 am

Okay at it's very simplest level:

Perform = call subroutine
bdc_field = name of subroutine
using = parameters to pass
'xxxxx' 'xx' = values to be passed (these may be variables, and in that case do not require quotes).

At a slightly higher level:

This routine allows you to fill the BDCDATA table with the appropriate information for filling information into a field for the purposes of BDC (either through creation and processing of a session or call transaction method),

Hope this helps.

Post Reply