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: 

syntactically incorrect?

Former Member
0 Kudos

Actually this isn't my program. I was tasked to debug it. im not so familiar using bdc. Can you help me out? Thank u!

FUNCTION Z_BAPI_UNBLOCK_SO.

*"----


""Local interface:

*" IMPORTING

*" VALUE(LV_SESSION) TYPE FLAG OPTIONAL

*" VALUE(LV_SO_NO) TYPE VBELN OPTIONAL

*" EXPORTING

*" VALUE(LT_RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2

*" TABLES

*" LT_ERRORS STRUCTURE BDCMSGCOLL OPTIONAL

*" LT_ERROR_MESSAGES STRUCTURE ZSD_SYSTEM_MESSAGE OPTIONAL

*CODES

IF lv_session = 'X'.

PERFORM open_group.

ENDIF.

  • First Screen

PERFORM bdc_dynpro USING 'RVKRED04'

'1000'.

PERFORM bdc_field USING: 'VBELN-LOW'

lv_so_no.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ONLI'.

  • Second Screen

PERFORM bdc_dynpro USING 'SAPMSSY0'

'0120'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=FREI'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SAVE'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=&F03'.

  • Third Screen

PERFORM bdc_dynpro USING 'SAPLSPO1'

'0100'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

  • Fourth Screen

PERFORM bdc_dynpro USING 'RVKRED04'

'1000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/EE'.

PERFORM bdc_transaction TABLES lt_errors

lt_error_messages

USING lv_session

'VKM3'

'N'

lt_return.

IF session = 'X'.

PERFORM close_group.

ENDIF.

ENDFUNCTION.

6 REPLIES 6

Former Member
0 Kudos

Hi,

This looks alright.

This is a BDC to unblock a sales order written in the BDC session method.

1. Opening the BDC group

2. Building the BDCDATA table

3. Call the BDC_INSERT function

4. finally closing the group.

This is what the program is doing.

Not sure what exactly are you looking for.

Regards,

Ravi

Note : Please mark the helpful answers

former_member186741
Active Contributor
0 Kudos

are you getting a syntax error? if so, what is it?

Former Member
0 Kudos

HI

GOOD

THIS IS NOT A COMPLETE BDC PROGRAM , SO YOU GET YOUR COMPLETE BDC PROGRAM AND TRY TO DEBUG IS BY PUTTING THE THE BREAKPOINT INTO IT AND SEE WHERE R U GETTING THE ERROR ,THAT WILL HELP YOU TO GET THE CLEAR IDEA ABOUT THE ERROR AND THEN I THINK I CAN GIVE YOU SOME MORE DETAILS TO SOLVE YOUR ERROR.

THANKS

MRUTYUN

0 Kudos

Error:

Different number of parameter in FORM and PERFORM (routine: BDC_FIELD, number of formal parameters: 3, number of actual parameters:2).

On this code:

IF lv_session = 'X'.

PERFORM open_group.

ENDIF.

  • First Screen

PERFORM bdc_dynpro USING 'RVKRED04'

'1000'.

>>> PERFORM bdc_field USING 'VBELN-LOW'

lv_so_no.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ONLI'.

*----


FORM bdc_field TABLES bd STRUCTURE bdcdata

USING fnam fval.

bd-fnam = fnam.

bd-fval = fval.

APPEND bd.

CLEAR bd.

ENDFORM.

0 Kudos

you have to pass something for the table 'bd':

change the performs to look like:

PERFORM bdc_field tables your_bd_table USING 'BDC_OKCODE'

'=ONLI'.

This variable will include structure BDCDATA so look for that in the source code.

0 Kudos

Hi ,

Ur Form should be like this...

<b>For screen:::</b>

FORM bdc_tab_fill1 USING progname dynpro.

CLEAR bdcdata.

bdcdata-program = progname.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM.

For Fillind data Fields.

FORM bdc_tab_fill2 USING fnam fval.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDFORM.

Just check it out..

Cheers,

Simha.