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

Message table type strcture bdcmcgcoll problem

Former Member
0 Likes
870

Hi experts,

I have done recording for sm 62 screen for creating events.

i have created events for that using "create" button from screen sm 62.

after recording i have created a functionmodule using recorded bdc.

In that i have used one

TABLES

*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL.

In output i am getting thios error.

Message id:00.

Message NO:255.

Message :Function code cannot be selected.

Can you tell me how to solve this one.

Thanks.

Sailu

7 REPLIES 7
Read only

Former Member
0 Likes
854

I think there is a problem with your recording... It is not able to identify a user command. Please check your recording..

Read only

former_member229729
Active Participant
0 Likes
854

Hi,

It looks like probs in your recording.

Please record the transaction once again.

Please do not manipulate recorded coding and have them as given by SAP recorded coding.

Incase the problem persists, probable you can share your coding also with us.

We would check and revert you back.

Rgds,

Ramani N.

Read only

Former Member
0 Likes
854

Hi Sailu ,

Rerecord that and create the program .

I think there might be problem with screen no.

Because some time recording screen no and original screen no differs.

So please after recording check all the screen no with the original screen no.

Any way if the message issue does not solve then please share the code .

Regards

Pinaki

Read only

Former Member
0 Likes
854

Hi,

1. Might be mistake in recording

2. Might be not passing the required value to the screen field

Test it in all screens display mode... then you came to know where the problem is...

Regards

Ramesh.

Read only

0 Likes
854

*"----


""Local interface:

*" IMPORTING

*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'

*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'

*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'

*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL

*" VALUE(USER) LIKE APQI-USERID OPTIONAL

*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL

*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL

*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'

*" VALUE(EDIT_SYSEV_001) LIKE BDCDATA-FVAL DEFAULT ''

*" VALUE(SHOW_SYSEV_002) LIKE BDCDATA-FVAL DEFAULT '.'

*" VALUE(EDIT_USREV_003) LIKE BDCDATA-FVAL DEFAULT 'X'

*" VALUE(SHOW_USREV_004) LIKE BDCDATA-FVAL DEFAULT '.'

*" VALUE(EVENTID_005) LIKE BDCDATA-FVAL

*" DEFAULT 'Eventid'

*" VALUE(DESCRIPT_006) LIKE BDCDATA-FVAL

*" DEFAULT 'Description'

*" EXPORTING

*" VALUE(SUBRC) LIKE SYST-SUBRC

*" TABLES

*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL

*"----


subrc = 0.

perform bdc_nodata using NODATA.

perform open_group using GROUP USER KEEP HOLDDATE CTU.

perform bdc_dynpro using 'SAPLBTCH' '1080'.

perform bdc_field using 'BDC_CURSOR'

'BTCH1080-EDIT_USREV'.

perform bdc_field using 'BDC_OKCODE'

'=DOIT'.

perform bdc_field using 'BTCH1080-EDIT_SYSEV'

EDIT_SYSEV_001.

perform bdc_field using 'BTCH1080-SHOW_SYSEV'

SHOW_SYSEV_002.

perform bdc_field using 'BTCH1080-EDIT_USREV'

EDIT_USREV_003.

perform bdc_field using 'BTCH1080-SHOW_USREV'

SHOW_USREV_004.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=NEW'.

perform bdc_dynpro using 'SAPLBTCH' '1090'.

perform bdc_field using 'BDC_CURSOR'

'BTCH1090-DESCRIPT'.

perform bdc_field using 'BDC_OKCODE'

'=SAVS'.

perform bdc_field using 'BTCH1090-EVENTID'

EVENTID_005.

perform bdc_field using 'BTCH1090-DESCRIPT'

DESCRIPT_006.

perform bdc_transaction tables messtab

using 'SM62'

CTU

MODE

UPDATE.

if sy-subrc <> 0.

subrc = sy-subrc.

exit.

endif.

perform close_group using CTU.

ENDFUNCTION.

Read only

0 Likes
854

Can any body tell me the wrong where i done in this recording.

i didnt change any thing.i put sap code as well.

Read only

Former Member
0 Likes
854

Hi Sailu ,

Instead of going SESSION METHOD if you try the call transaction method also.

You can proceed like the following code (Copy paste the code and execute it once ).

DATA : T_BDC TYPE TABLE OF BDCDATA,
       FS_BDC TYPE BDCDATA ,
       T_MESSAGES TYPE TABLE OF BDCMSGCOLL.


START-OF-SELECTION.

  PERFORM BDC_DYNPRO      USING 'SAPLBTCH' '1080'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'SYSTEMEVENTIDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=BACK'.
  PERFORM BDC_FIELD       USING 'BTCH1080-EDIT_SYSEV'
                                'X'.
  PERFORM BDC_FIELD       USING 'BTCH1080-SHOW_SYSEV'
                                '.'.
  PERFORM BDC_FIELD       USING 'BTCH1080-EDIT_USREV'
                                '.'.
  PERFORM BDC_FIELD       USING 'BTCH1080-SHOW_USREV'
  
  
                                '.'.
  CALL TRANSACTION 'SM62' USING T_BDC MESSAGES INTO T_MESSAGES.
*&---------------------------------------------------------------------*
*&      Form  bdc_dynpro
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0013   text
*      -->P_0014   text
*----------------------------------------------------------------------*
FORM BDC_DYNPRO  USING    VALUE(P_0013)
                          VALUE(P_0014).
  CLEAR FS_BDC .
  FS_BDC-PROGRAM = 'P_0013'.
  FS_BDC-DYNPRO = 'P_0014'.
  FS_BDC-DYNBEGIN = 'X'.
  APPEND FS_BDC TO T_BDC.


ENDFORM.                    " bdc_dynpro
*&---------------------------------------------------------------------*
*&      Form  bdc_field
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0018   text
*      -->P_0019   text
*----------------------------------------------------------------------*
FORM BDC_FIELD  USING    VALUE(P_0018)
                         VALUE(P_0019).
  CLEAR FS_BDC .
  FS_BDC-FNAM = 'P_0018'.
  FS_BDC-FVAL = 'P_0019'.
  APPEND FS_BDC TO T_BDC.
ENDFORM.                    " bdc_field

Regards

Pinaki