Skip to Content
author's profile photo Former Member
Former Member

error while bdc session

Hello Guru g,

I am learning BDC session transaction . I open SHDB done recording for MM01, done editing in code but when i checked it i am getting error message

( The FORM "BDC_DYNPRO" doesnot exist). Please go through the coding part and please tell me why i am getting this error message & what can i do to correct it.

report ZMMO12013_S

no standard page heading line-size 255.

*include bdcrecx1.

*

*start-of-selection.

*

*perform open_group.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MBRSH LIKE MARA-MBRSH,

MTART LIKE MARA-MTART,

MAKTX LIKE MAKT-MAKTX,

MEINS LIKE MARA-MEINS,

END OF ITAB.

DATA : BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'UPLOAD'

EXPORTING

* CODEPAGE = ' '

FILENAME = ' '

FILETYPE = 'DAT'

* ITEM = ' '

* FILEMASK_MASK = ' '

* FILEMASK_TEXT = ' '

* FILETYPE_NO_CHANGE = ' '

* FILEMASK_ALL = ' '

* FILETYPE_NO_SHOW = ' '

* LINE_EXIT = ' '

* USER_FORM = ' '

* USER_PROG = ' '

* SILENT = 'S'

* IMPORTING

* FILESIZE =

* CANCEL =

* ACT_FILENAME =

* ACT_FILETYPE =

TABLES

DATA_TAB = ITAB

* EXCEPTIONS

* CONVERSION_ERROR = 1

* INVALID_TABLE_WIDTH = 2

* INVALID_TYPE = 3

* NO_BATCH = 4

* UNKNOWN_ERROR = 5

* GUI_REFUSE_FILETRANSFER = 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.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

* CLIENT = SY-MANDT

* DEST = FILLER8

GROUP = 'MM012013_S'

* HOLDDATE = FILLER8

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 BDCDATA.

PERFORM MAPPING.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'MM01'

* POST_LOCAL = NOVBLOCAL

* PRINTING = NOPRINT

* SIMUBATCH = ' '

* CTUPARAMS = ' '

TABLES

DYNPROTAB = BDCDATA

* 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.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

* EXCEPTIONS

* NOT_OPEN = 1

* QUEUE_ERROR = 2

* OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

FORM MAPPING.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MATNR'

ITAB-MATNR.

perform bdc_field using 'RMMG1-MBRSH'

ITAB-MBRSH.

perform bdc_field using 'RMMG1-MTART'

ITAB-MTART.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'MAKT-MAKTX'

ITAB-MAKTX.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

ITAB-MEINS.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

*perform bdc_transaction using 'MM01'.

*perform close_group.

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2013 at 07:13 AM

    Hi Happy,

    at the end of your code, add this:

    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = PROGRAM.
    BDCDATA-DYNPRO = DYNPRO.
    BDCDATA-DYNBEGIN = 'X'.
    APPEND BDCDATA.
    ENDFORM.

    *----------------------------------------------------------------------*
    * Insert field *
    *----------------------------------------------------------------------*
    FORM BDC_FIELD USING FNAM FVAL.
    * IF FVAL <> NODATA.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
    * ENDIF.
    ENDFORM.

    if you add this above code then Dont use include bdcrecx1.....if you go to the bdcrecx1 program then at the last part you found the above code.....

    dont use upload..its obsolete...use GUI_UPLOAD.

    Hope your problem will be solved.....if not then let me know.....

    Thanks

    Sabyasachi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 19, 2013 at 08:26 PM

    You commented insertion of include bdcrecx1, this include contains a part of the selection-screen, some data definitions and forms. Uncomment the include line. You may have to comment some lines in your code like bdcdata definition.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2013 at 07:52 PM

    Hi Happy,

    It this your complete code??

    You are getting the error when checking the syntax for the program(CTRL + F2).

    Please check the below link. It might be helpful

    http://wiki.sdn.sap.com/wiki/display/Snippets/BDC+Program+to+Upload+Material+Master+Data+%28MM01%29

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.