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

Problem with BDC

report ZMMM_REC no standard page heading line-size 255.

types declaration............................................

types : begin of t_mat,

matnr(20),

desc(50),

uom(5),

end of t_mat.

internal table and workarea declaration........................

data : i_mat type table of t_mat.

data : wa_mat type t_mat.

include bdcrecx1.

start-of-selection.

moving the flat file content to internal table...................

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'BDCDATA1'

FILETYPE = 'DAT'

TABLES

data_tab = i_mat " Name of internal table with data.

perform open_group.

loop at i_mat into wa_mat.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MATNR'

wa_mat-matnr.

perform bdc_field using 'RMMG1-MBRSH'

'P'.

perform bdc_field using 'RMMG1-MTART'

'ZOH'.

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'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

wa_mat-desc.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

wa_mat-uom.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_transaction using 'MM01'.

refresh bdcdata.

endloop.

Perform close_group.

The above code is working without errors.The flat file content is

GKMATERIAL1 GKMATERIALS M

GKMATERIAL2 GKMATERIALS M

GKMATERIAL3 GKMATERIALS M

The problem is that these 3 records are not adding to MARA.I checked with Number of entries.There is no change in it after the above program execution.I debugged and find out that data is passint to wa- fields correctly.Am i missing something called BDC_INSERT?Why the data is not getting into MARA database.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2008 at 03:02 PM

    PROGRAM is seems to be correct. check the overview of session by using sm35, select session name and click on analysis. if it shows material zmaterial1 has created, then def. that material will be in Mara table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 09:00 AM

    hi Gopi,

    Add the following code after this statement ok then ur problem is resolved ok.

    perform bdc_transaction using 'MM01'.

    CALL FUNCTION 'BDC_INSERT'

    EXPORTING

    tcode = 'MM01'

    • POST_LOCAL = NOVBLOCAL

    • PRINTING = NOPRINT

    • SIMUBATCH = ' '

    • CTUPARAMS = ' '

    TABLES

    dynprotab = gt_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.

    Reward points if helpful.

    Kiran Kumar.G.A

    Have a Nice Day..

    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.