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: 

SY-SUBRC value is coming as 1001...

Former Member
0 Kudos

I am not expert in BDC...

I am using the below coding where

GC_MODE value is 'N'

GC_CHARS value is 'S'

however SY-SUBRC value is coming as 1001...

what does it mean ?

  • Call transaction.

CALL TRANSACTION P_TCODE USING GT_BDCDATA

MODE GC_MODE

UPDATE GC_CHARS

MESSAGES INTO GT_MESSTAB.

P_SUBRC = SY-SUBRC.

Means BDC is not successful

Thanks in advance

Edited by: Sam Kumar on Sep 10, 2008 6:38 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Change GC_MODE value is 'N' to GC_MODE value is 'E'. You will see errors and will be easier to fix.

a

3 REPLIES 3

former_member585060
Active Contributor
0 Kudos

Make your code like this

CALL TRANSACTION p_tcode USING gt_bdcdata MODE gc_mode UPDATE gc_chars MESSAGES INTO gt_messtab.

IF sy-subrc <> 0.

PERFORM get_error.

WRITE:/ itab , v_text.

ENDIF.

*********************************************************

FORM get_error.

LOOP AT gt_messtab.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = i_bdcmsgcoll-MSGID

LANG = sy-langu

NO = i_bdcmsgcoll-MSGNr

V1 = i_bdcmsgcoll-MSGV1

  • V2 = SY-MSGV2

  • V3 = SY-MSGV3

  • V4 = SY-MSGV4

IMPORTING

MSG = v_text

  • EXCEPTIONS

  • NOT_FOUND = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

ENDFORM. " get_error

*********************************************************************

Regards

Bala Krishna

Former Member
0 Kudos

Change GC_MODE value is 'N' to GC_MODE value is 'E'. You will see errors and will be easier to fix.

a

Former Member
0 Kudos

incase of BDC sy-subrc = 1001 means BDC is not successfully executed.

To know the error pl. check the content message table GT_MESSTAB in debug mode.

CALL TRANSACTION P_TCODE USING GT_BDCDATA

MODE GC_MODE

UPDATE GC_CHARS

MESSAGES INTO GT_MESSTAB.

P_SUBRC = SY-SUBRC.