Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

ERROR WHILE BDC SESSION TRANSACTION

$
0
0

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.


Viewing all articles
Browse latest Browse all 8332

Trending Articles