Application Development 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: 

BDC Not able to press ok button.

former_member196331
Active Contributor
0 Kudos

hi,
Need suggestion, facing one issue. Tried some possible ways But still facing issue.

Need to call C223 Tcode.

I have one custom, report here i have material and plant displaying in the Matrix.
with respect to the line once click on the custom button at the application tool bar. Need to pass selected line material and plant.
First i tried Call transaction.

SET PARAMETER ID 'WRK' FIELD %%g00-mapl-werks.

SET PARAMETER ID 'MAT' FIELD %%g00-mapl-matnr.

CALL TRANSACTION 'C223'. "AND SKIP FIRST SCREEN.

I can call the transaction, but don't know Material no i am not able to pass. then decided to use BDC.

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,

messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,

lv_mode TYPE c VALUE 'A'.

REFRESH bdcdata.

CLEAR bdcdata.

CLEAR bdcdata.

bdcdata-program = 'SAPLCMFV'.

bdcdata-dynpro = '1000'.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

* CLEAR bdcdata.

* bdcdata-fnam = 'BDC_OKCODE'.

* bdcdata-fval = '=REFR'.

* APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'BDC_SUBSCR'.

bdcdata-fval = 'SAPLCMFV'.

APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'BDC_CURSOR'.

bdcdata-fval = 'MKAL-MATNR'.

APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'MKAL-WERKS'.

bdcdata-fval = %%g00-mapl-werks.

APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'MKAL-MATNR'.

bdcdata-fval = %%g00-mapl-matnr.

APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'BDC_SUBSCR'.

bdcdata-fval = 'SAPLCMFV'.

APPEND bdcdata.

CLEAR bdcdata.

bdcdata-fnam = 'BDC_OKCODE'.

bdcdata-fval = '/00'.

APPEND bdcdata.

CALL TRANSACTION 'C223'

USING bdcdata

MODE lv_mode MESSAGES INTO messtab.

Still pop up message is coming. once if i press ok then data will show. i need to press enter

i tried. =/Enter too.. nothing worked.

I need to call Foreground only 'A", User want to see the data... no need of background.

16 REPLIES 16

Sandra_Rossi
Active Contributor
0 Kudos

What did you get by recording the transaction with SHDB?

former_member196331
Active Contributor
0 Kudos

hi, sandra ... in recording shdb also i have same issue.

Sandra_Rossi
Active Contributor
0 Kudos

In fact, you can see it's "=ENTE", not "=/Enter" (see below). Could you show what happens if you "Process" the recording directly from SHDB?

 bdcdata-fnam = 'BDC_OKCODE'.
 bdcdata-fval = '=ENTE'.
 APPEND bdcdata.

FredericGirod
Active Contributor
0 Kudos

Did you record in background mode ?

Did you have an error message in this screenshot : c223day1.png (41.8 kB)?

former_member196331
Active Contributor
0 Kudos

hi, sandra...

If i process my recording in shdb.. below screen coming.. if i press ok then only showing data...Same steps calling in my program.. Same issue facing.

i tried below code. Same issue.

 bdcdata-fnam = 'BDC_OKCODE'.
 bdcdata-fval = '=ENTE'.
 APPEND bdcdata.

former_member196331
Active Contributor
0 Kudos

hi.frdric.girod

I am not getting error message. only thing is enter not able to call from my program.
i recorded with background and without background .both having same issue.
enter not able to pass. I mean asking Enter to show the data. i don't want enter pop up message while calling from my program. this is my requirement.

FredericGirod
Active Contributor
0 Kudos

Did you try :

bdcdata-fnam = 'BDC_OKCODE'.
bdcdata-fval = '=SHOW'.
APPEND bdcdata.

former_member196331
Active Contributor
0 Kudos

Tried.. Same issue.. again asking me to click on ok button(right symbol)...

FredericGirod
Active Contributor
0 Kudos

the pop-up window is due to this :

lv_mode TYPE c VALUE 'A'.

Try to replace with a 'E'

former_member196331
Active Contributor
0 Kudos

yeah.. Frederic...

Look like working.. i am checking..
but why 'E' It means...Screens displayed only if an error occurs

there is no error ....right...

Sandra_Rossi
Active Contributor

I don't get your point. The normal behavior with "A" display mode, is that you get a popup for each screen and that the user must press enter to execute the proposed action. Are you asking to remove this little normal popup? If you execute with "E" mode, the screens are not displayed, except if there is an error.

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

Regards,

Ramesh

former_member196331
Active Contributor
0 Kudos

venkatramesh.v

this one tried.. same issue. if i use Mode 'E' only issue got solved.

Sandra_Rossi
Active Contributor
0 Kudos

But if you use mode "E" you don't see the screens, so it doesn't answer your question, no ? (as you said: "User want to see the data")

former_member196331
Active Contributor

hi, Sandra.

Yes, once if click on the button, i want to see the screen like below.
I want to pass plant and material. (This is my requirement)

But if i Use mode 'A' ...Some pop up messages are coming. I should press enter button after call c223. to avoid popup message. but if i use 'E' , I did not face any message.

In the bdc. i even not calling bdc_code... "Enter" or any other code.
just calling and passing screen variables. like plant and Material.

without using bdc_code if i pass plant and Material and use Mode 'A'.
Values are passing and screen is calling. but I need to press enter then only
in the grid data is dispalying..

Sandra_Rossi
Active Contributor

Thanks, I understand now. So Frederic answer is the one you were expecting: mode "E" is to display the screen if an error occurs, and a side effect is that it displays the last screen if the end of BDCDATA is reached without having last step of BDCDATA leave the transaction (while mode "N" doesn't display any screen and mode "A" displays all the screens). See ABAP documentation for more information.