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

syntax error for endloop

Former Member
0 Likes
2,009

hi all,

i am getting syntax error ,while i am doing bdc recording, error is "=..."expected after "endloop"

regards,

lvk

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,817
data: begin of jtab OCCURS 0,

include, structure, bdcdata.
data: end of jtab.

Should be like this:

data: begin of jtab OCCURS 0,

include structure bdcdata.
data: end of jtab.

Regards,

16 REPLIES 16
Read only

Former Member
0 Likes
1,817

HI,

send code in forum.

Regards,

Naresh

Read only

0 Likes
1,817

hi naresh,


report ZERRMP
       no standard page heading line-size 255.

*include bdcrecx1.
*
*start-of-selection.
*
*perform open_group.

tables:lfa1.
data: begin of itab OCCURS 0,
        lifnr type lfa1-lifnr,
        land1 type lfa1-land1,
        name1 type lfa1-name1,
     end of itab.


data: begin of jtab OCCURS 0,

     include, structure, bdcdata.
data: end of jtab.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = 'c:\zses.txt '
    FILETYPE                      = 'ASC'
*   HAS_FIELD_SEPARATOR           = ' '
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   VIRUS_SCAN_PROFILE            =
*   NO_AUTH_CHECK                 = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  TABLES
    DATA_TAB                      = itab.
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION 'BDC_OPEN_GROUP'
 EXPORTING
*   CLIENT                    = SY-MANDT
*   DEST                      = FILLER8
    GROUP                     = 'vses'
   HOLDDATE                  = sy-datum
   KEEP                      = 'x'
   USER                      = sy-uname
*   RECORD                    = FILLER1
*   PROG                      = SY-CPROG
*   DCPFM                     = '%'
*   DATFM                     = '%'
* IMPORTING
*   QID                       =
* EXCEPTIONS
*   CLIENT_INVALID            = 1
*   DESTINATION_INVALID       = 2
*   GROUP_INVALID             = 3
*   GROUP_IS_LOCKED           = 4
*   HOLDDATE_INVALID          = 5
*   INTERNAL_ERROR            = 6
*   QUEUE_ERROR               = 7
*   RUNNING                   = 8
*   SYSTEM_LOCK_ERROR         = 9
*   USER_INVALID              = 10
*   OTHERS                    = 11
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at itab.
refresh jtab.
perform sub1 using 'zsm_mps' '100'.
perform sub2 using :'lfa1-lifnr' itab-lifnr,
                    'lfa1-land1' itab-land1,
                    'lfa1-name1' itab-name1.
CALL FUNCTION 'BDC_INSERT'
 EXPORTING
   TCODE                  = 'zsm_mps'
*   POST_LOCAL             = NOVBLOCAL
*   PRINTING               = NOPRINT
*   SIMUBATCH              = ' '
*   CTUPARAMS              = ' '
  TABLES
    DYNPROTAB              = jtab
    endloop     
CALL FUNCTION 'BDC_CLOSE_GROUP'
*     EXCEPTIONS
*       NOT_OPEN          = 1
*       QUEUE_ERROR       = 2
*       OTHERS            = 3
form sub1 using a b.
    clear jtab.
    jtab-program=a.
    jtab-dynpro=b.
    jtab-dynbegin='x'.
    append jtab.
endform.
form sub2 using c d.
    clear jtab.
    jtab-fnam=c.
    jtab-fval=d.
    append jtab.
endform.
              .
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

* EXCEPTIONS
*   INTERNAL_ERROR         = 1
*   NOT_OPEN               = 2
*   QUEUE_ERROR            = 3
*   TCODE_INVALID          = 4
*   PRINTING_INVALID       = 5
*   POSTING_INVALID        = 6
*   OTHERS                 = 7
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


*perform bdc_dynpro      using 'ZSM_MP' '0100'.
*perform bdc_field       using 'BDC_OKCODE'
*                              '=SUBMIT'.
*perform bdc_field       using 'BDC_CURSOR'
*                              'LFA1-NAME1'.
*perform bdc_field       using 'LFA1-LIFNR'
*                              '789'.
*perform bdc_field       using 'LFA1-LAND1'
*                              'IN'.
*perform bdc_field       using 'LFA1-NAME1'
*                              'err'.
*perform bdc_dynpro      using 'ZSM_MP' '0100'.
*perform bdc_field       using 'BDC_OKCODE'
*                              '=EXIT'.
*perform bdc_field       using 'BDC_CURSOR'
*                              'LFA1-LIFNR'.
*perform bdc_field       using 'LFA1-LIFNR'
*                              '789'.
*perform bdc_field       using 'LFA1-LAND1'
*                              'IN'.
*perform bdc_field       using 'LFA1-NAME1'
*                              'err'.
*perform bdc_transaction using 'ZSM_MPS'.
*
*perform close_group.

Code Formatted by: Alvaro Tejada Galindo on Dec 23, 2008 10:18 AM

Read only

0 Likes
1,817
TABLES
DYNPROTAB = jtab
endloop

Should be like this,

TABLES
DYNPROTAB = jtab. "you are missing '.' here
endloop. "you are missing '.' here

Regards,

Read only

0 Likes
1,817

hi chandra,

i am getting one more error like

form sub1 using a b.

clear jtab.

jtab-program=a.

jtab-dynpro=b.

jtab-dynbegin='x'.

append jtab.

endform.

Read only

0 Likes
1,817

hi,

can be paste the error message...

Read only

0 Likes
1,817

statement before "form..." not concluded(period missing)

Read only

0 Likes
1,817

hi,

missing perion ..

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS

NOT_OPEN = 1

QUEUE_ERROR = 2

OTHERS = 3. Add period at end

Read only

0 Likes
1,817

Dear,

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS 
NOT_OPEN = 1 
QUEUE_ERROR = 2 
OTHERS = 3.  "Add '.' here 

Regards

Read only

0 Likes
1,817

i am getting another error like statement "jtab_program=a"is not defined check your spelling

Read only

0 Likes
1,817
jtab_program = a  " give space 
jtab-dynpro = b." give space
jtab-dynbegin = 'x'." give space
Read only

0 Likes
1,817

hi chandra,

i am getting another error like the data object "jtab" does't have a component called "program"

regards

Read only

Former Member
0 Likes
1,817

hi,

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'zsm_mps'

POST_LOCAL = NOVBLOCAL

PRINTING = NOPRINT

SIMUBATCH = ' '

CTUPARAMS = ' '

TABLES

DYNPROTAB = jtab. Add '.' at end

endloop. Add '.' at end

Read only

Former Member
0 Likes
1,817

Hi

I think u missed ( . ) period afte ENDLOOP.

Regards

Sachin

Read only

Former Member
0 Likes
1,818
data: begin of jtab OCCURS 0,

include, structure, bdcdata.
data: end of jtab.

Should be like this:

data: begin of jtab OCCURS 0,

include structure bdcdata.
data: end of jtab.

Regards,

Read only

0 Likes
1,817

hi chandra,

again it is giving another like unable to interpret "structure".possible cause of error. incorrect spelling error or comma error

regards,

Read only

GauthamV
Active Contributor
0 Likes
1,817

use this.



data: begin of jtab OCCURS 0.
 include structure bdcdata.
data: end of jtab.