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: 

syntax error

Former Member
0 Kudos

Hi All

I am doing an outbound interface and getting the following errors:

1)Get details from previous status records with status 26

2)EDI: Syntax error in IDoc (segment cannot be identified)

Can anybody help me on this.

Thanks in advance

Kumar

3 REPLIES 3

former_member181966
Active Contributor
0 Kudos

Could you please post the "CODE", So we can look into it and see why its giving syntax error ?

Thanks

Bye

0 Kudos

HI KHAN

I AM GIVING THE CODE BELOW :

FUNCTION ZPAI15_CATSOUT.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(LSTAR) LIKE CATSDB-LSTAR

*" REFERENCE(S_APDAT_LOW) LIKE CATSDB-APDAT

*" REFERENCE(S_APDAT_HIGH) LIKE CATSDB-APDAT

*" EXPORTING

*" REFERENCE(OBJECT_TYPE) LIKE WFAS1-ASGTP

*" EXCEPTIONS

*" ERROR_MESSGAE_RECEIVED

*"----


&----


*& DATABASE TABLES

*&

&----


  • APPLICATION DATA TABLES

TABLES:CATSDB,CSLT,PA0002,EDP13.

&----


*& CONSTANTS

*&

&----


CONSTANTS : C_MESTYP LIKE EDIDC-MESTYP VALUE 'CATS_INSERT',

C_CATSSTATUS LIKE CATSDB-STATUS VALUE '30',

C_RCVPRT LIKE EDIDC-RCVPRT VALUE 'LS',

C_RCVPOR LIKE EDIDC-RCVPOR VALUE 'XD1_200',

C_SNDPOR LIKE EDIDC-SNDPOR VALUE 'SAPED1',

C_SNDPRT LIKE EDIDC-SNDPRT VALUE 'LS',

C_RCVPRN LIKE EDIDC-RCVPRN VALUE 'XD1_200',

C_SNDPRN LIKE EDIDC-SNDPRN VALUE 'ED1_200'.

*IDOC-Status values.

CONSTANTS: C_IDOC_STATUS_OK LIKE EDI_DS-STATUS VALUE '53',

C_IDOC_STATUS_OK_INCOMPLETE LIKE EDI_DS-STATUS VALUE '52',

C_IDOC_STATUS_ERROR LIKE EDI_DS-STATUS VALUE '51',

C_IDOC_STATUS_APPL_IN LIKE EDI_DS-STATUS VALUE '62',

C_IDOC_STATUS_ERR_IDOC_TO_APPL LIKE EDIDC-STATUS VALUE '63',

C_IDOC_STATUS_READY_POST LIKE EDIDC-STATUS VALUE '64',

c_idoc_status_in_queue like edidc-status value '75',

C_IDOC_STATUS_POSTPONED LIKE EDIDC-STATUS VALUE '66',

C_IDOC_STATUS_DELETE LIKE EDI_DS-STATUS VALUE '68',

C_IDOC_STATUS_EDITED LIKE EDI_DS-STATUS VALUE '69'.

&----


*& DATA DECLARATIONS

*&

&----


  • SEGMENT NAMES

DATA : C_HEADER_SEGMENT LIKE EDIDD-SEGNAM VALUE 'E1BPCATS1',

C_EXTENDED_SEGMENT LIKE EDIDD-SEGNAM VALUE 'ZE1BPCATS1',

  • IDoc TYPE

C_CATS_REPORT_IDOC_TYPE LIKE EDIDC-CIMTYP VALUE 'ZCATS_INSERT02'.

&----


*& DATA DECLARATIONS

*&

&----


  • IDoc CONTROL RECORD

DATA : CONTROL_RECORD_OUT LIKE EDIDC.

  • CATS HEADER DATA

DATA : FS_CATSHEADER_DATA LIKE E1BPCATS1.

  • CATS HEADER DATA1

DATA : FS_CATSHEADER1_DATA LIKE E1BPCATS2.

  • CATS EXTENDED SEGMENT DATA

DATA : FS_CATSEXTENDED_DATA LIKE ZE1BPCATS1,

LOGSYS LIKE T000-LOGSYS,

SENT TYPE C,

IDOC_CONTROL TYPE EDIDC,

XEDIDC TYPE TABLE OF EDIDC.

&----


*& INTERNAL TABLES

*&

&----


DATA:

  • HEADER

I_CATSDB LIKE CATSDB OCCURS 0 WITH HEADER LINE,

IT_CATSHEADER LIKE E1BPCATS1 OCCURS 0 WITH HEADER LINE,

  • EXTENDED SEGMENT

IT_CATSEXTENDED LIKE ZE1BPCATS1 OCCURS 0 WITH HEADER LINE,

  • DATA RECORDS

IT_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE,

  • COMMUNICATION IDOCS GENERATED

IT_COMM_IDOCS LIKE EDIDC OCCURS 0 WITH HEADER LINE,

IT_EDP13 LIKE EDP13 OCCURS 0 WITH HEADER LINE,

wa_edp13 like edp13 occurs 0 with header line,

WA_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF I_FINTAB OCCURS 0,

PERNR LIKE CATSDB-PERNR,

APDAT LIKE CATSDB-APDAT,

LSTAR LIKE CATSDB-LSTAR,

LTEXT LIKE CSLT-LTEXT,

CATSHOURS LIKE CATSDB-CATSHOURS,

BEGUZ LIKE CATSDB-BEGUZ,

ENDUZ LIKE CATSDB-ENDUZ,

PBHRPAYROLLNO LIKE PA0002-PBHRPAYROLLNO,

PBHRPAYROLLSYS LIKE PA0002-PBHRPAYROLLSYS,

PBHRPAYROLLINS LIKE PA0002-PBHRPAYROLLINS,

NACHN LIKE PA0002-NACHN,

VORNA LIKE PA0002-VORNA,

WORKDATE LIKE CATSDB-WORKDATE,

END OF I_FINTAB.

*

&----


*& PROGRAM LOGIC

*&

&----


***********************SELECT APPLICATION DATA************************

SELECT * FROM CATSDB INTO TABLE I_CATSDB WHERE LSTAR = LSTAR AND APDAT

BETWEEN S_APDAT_LOW AND S_APDAT_HIGH.

LOOP AT I_CATSDB WHERE STATUS = C_CATSSTATUS.

I_FINTAB-PERNR = I_CATSDB-PERNR.

I_FINTAB-APDAT = I_CATSDB-APDAT.

I_FINTAB-LSTAR = I_CATSDB-LSTAR.

SELECT SINGLE * FROM CSLT WHERE LSTAR = I_CATSDB-LSTAR.

IF SY-SUBRC = 0.

I_FINTAB-LTEXT = CSLT-LTEXT.

ENDIF.

I_FINTAB-CATSHOURS = I_CATSDB-CATSHOURS.

I_FINTAB-BEGUZ = I_CATSDB-BEGUZ.

I_FINTAB-ENDUZ = I_CATSDB-ENDUZ.

I_FINTAB-WORKDATE = I_CATSDB-WORKDATE.

SELECT SINGLE * FROM PA0002 WHERE PERNR = I_CATSDB-PERNR.

IF SY-SUBRC = 0.

I_FINTAB-PBHRPAYROLLNO = PA0002-PBHRPAYROLLNO.

I_FINTAB-PBHRPAYROLLSYS = PA0002-PBHRPAYROLLSYS.

I_FINTAB-PBHRPAYROLLINS = PA0002-PBHRPAYROLLINS.

I_FINTAB-NACHN = PA0002-NACHN.

I_FINTAB-VORNA = PA0002-VORNA.

ENDIF.

APPEND I_FINTAB.

CLEAR I_FINTAB.

ENDLOOP.

***********************BUILD CONTROL RECORD***************************

  • FILL CONTROL RECORD INFORMATION

CONTROL_RECORD_OUT-MESTYP = C_MESTYP.

CONTROL_RECORD_OUT-IDOCTP = C_CATS_REPORT_IDOC_TYPE.

CONTROL_RECORD_OUT-RCVPOR = C_RCVPOR.

CONTROL_RECORD_OUT-RCVPRN = C_RCVPRN.

CONTROL_RECORD_OUT-RCVPRT = C_RCVPRT.

CONTROL_RECORD_OUT-SNDPOR = C_SNDPOR.

CONTROL_RECORD_OUT-SNDPRN = C_SNDPRN.

CONTROL_RECORD_OUT-SNDPRT = C_SNDPRT.

***********************BUILD DATA RECORDS**************************

*--


CATSHEADER--


*FILL THE CATSHEADER INFORMATION

LOOP AT I_FINTAB.

FS_CATSHEADER_DATA-EMPLOYEENUMBER = I_FINTAB-PERNR.

FS_CATSHEADER1_DATA-DATE_OF_APPROVAL = I_FINTAB-APDAT.

FS_CATSEXTENDED_DATA-LSTAR = I_FINTAB-LSTAR.

FS_CATSEXTENDED_DATA-LTEXT = I_FINTAB-LTEXT.

FS_CATSHEADER_DATA-CATSHOURS = I_FINTAB-CATSHOURS.

FS_CATSHEADER_DATA-STARTTIME = I_FINTAB-BEGUZ.

FS_CATSHEADER_DATA-ENDTIME = I_FINTAB-ENDUZ.

FS_CATSEXTENDED_DATA-ZPBHRPAYROLLNO = I_FINTAB-PBHRPAYROLLNO.

FS_CATSEXTENDED_DATA-ZPBHRPAYROLLSYS = I_FINTAB-PBHRPAYROLLSYS.

FS_CATSEXTENDED_DATA-ZPBHRPAYROLLINS = I_FINTAB-PBHRPAYROLLINS.

FS_CATSHEADER_DATA-WORKDATE = I_FINTAB-WORKDATE.

*FILL THE ADMINISTRATIVE SECTION OF THE DATA RECORD

IT_EDIDD-SEGNAM = C_HEADER_SEGMENT.

IT_EDIDD-SDATA = FS_CATSHEADER_DATA.

*APPEND THE CATS HEADER DATA TO THE IDOC DATA

APPEND IT_EDIDD.

CLEAR IT_EDIDD.

IT_EDIDD-SEGNAM = C_EXTENDED_SEGMENT.

IT_EDIDD-SDATA = FS_CATSEXTENDED_DATA.

APPEND IT_EDIDD.

CLEAR IT_EDIDD.

ENDLOOP.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

EXPORTING

MASTER_IDOC_CONTROL = CONTROL_RECORD_OUT

TABLES

COMMUNICATION_IDOC_CONTROL = IT_COMM_IDOCS

MASTER_IDOC_DATA = IT_EDIDD

EXCEPTIONS

ERROR_IN_IDOC_CONTROL = 1

ERROR_WRITING_IDOC_STATUS = 2

ERROR_IN_IDOC_DATA = 3

SENDING_LOGICAL_SYSTEM_UNKNOWN = 4

OTHERS = 5.

if sy-subrc = 0.

commit work.

loop at IT_COMM_IDOCS into wA_EDidc where docnum <> space.

message I186(Z001) with wA_edidc-docnum.

exit.

endloop.

else.

message I187(Z001).

endif.

ENDFUNCTION.

PLEASE SUGGEST

THANKS IN ADVANCE

KUMAR

Former Member
0 Kudos

Hi,

This could be due to the custom developed segments.

Check whether you have released the segment using WE31.

This would solve your issue.

Let me know if you are getting the same error message again.

Thank you.

Regards,

Karun.M