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

error message "message is not defined in EN and work area"

Hi,

I am not sure if someone else has already posed this question in the forum. I tried to search the forum as well did a google search but was very less effective.

In my BDC program, i have added "call function 'MESSAGE_PREPARE'" and as a result i am getting an error message "message is not defined in EN and work area". I am not sure what i am supposed to do regarding this !!

my call transation statement is giving some error and the records are not saved and i want to figure out what it is ?? i want to know the message id and its description !!

Would appreciate your help..find my code attached..

thanks

-


&----


*& Report ZBDC_BUDGET_UPLOAD

*&

&----


*&

*&

&----


REPORT ZBDC_BUDGET_UPLOAD MESSAGE-ID ZI.

types: begin of tdata,

rec(150) type c,

end of tdata,

begin of tmtgp,

costcent LIKE CCSS-KOSTL,

costelem LIKE CCSS-KSTAR,

fisyear LIKE CCSS-GJAHR,

jan(10),

feb(10),

mar(10),

apr(10),

may(10),

jun(10),

jul(10),

aug(10),

sep(10),

oct(10),

nov(10),

dec(10),

end of tmtgp.

data: idata type table of tdata with header line.

data: imtgp type table of tmtgp with header line.

data: counter type i value is initial.

Data : fieldval(10) type c.

data: bdcmess type table of bdcmsgcoll with header line.

data: message(100) type c.

selection-screen begin of block b1 with frame title text-001.

parameters: p_file type localfile default 'C:\budget_data_csv.csv'.

selection-screen end of block b1.

include zbdcrecx1.

at selection-screen on value-request for p_file.

call function 'KD_GET_FILENAME_ON_F4'

exporting static = 'X'

changing file_name = p_file.

start-of-selection.

perform upload_data.

break-point.

  • perform bdc_transaction using 'KP06'.

call transaction 'KP06' using imtgp

mode 'N'

update 'S'

messages into messtab.

clear message.

call function 'MESSAGE_PREPARE'

exporting

language = sy-langu

msg_id = bdcmess-msgid

msg_no = bdcmess-msgnr

msg_var1 = bdcmess-msgv1(50)

msg_var2 = bdcmess-msgv2(50)

msg_var3 = bdcmess-msgv3(50)

msg_var4 = bdcmess-msgv4(50)

importing

msg_text = message.

loop at bdcmess.

write:/ 'msgid:', at 20 bdcmess-msgid,

/ 'msg1:', at 20 bdcmess-msgv1,

/ 'msg2:', at 20 bdcmess-msgv2,

/ 'msg3:', at 20 bdcmess-msgv3,

/ 'msg4:', at 20 bdcmess-msgv4,

/ 'Message over'.

endloop.

*perform close_group.

*endloop.

form upload_data.

data: filename type string.

clear idata.

refresh idata.

filename = p_file.

break-point.

call function 'GUI_UPLOAD'

exporting filename = filename

filetype = 'ASC'

tables data_tab = idata

exceptions file_open_error = 1

file_read_error = 2

no_authority = 6

others = 17.

check sy-subrc = 0.

break-point.

loop at idata.

clear imtgp.

split idata at ',' into imtgp-costcent imtgp-costelem imtgp-fisyear

imtgp-jan imtgp-feb imtgp-mar imtgp-apr imtgp-may imtgp-jun imtgp-jul

imtgp-aug imtgp-sep imtgp-oct imtgp-nov imtgp-dec.

append imtgp.

endloop.

endform.

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Posted on Dec 12, 2005 at 09:23 PM

    You going to have to read the table in some way before call the MESSAGE_PREPARE function module.

    
    
      
    
    * perform bdc_transaction using 'KP06'.
    
    call transaction 'KP06' using imtgp
    mode 'N'
    update 'S'
    messages into <b>bdcmess</b>.
    
    
    <b>loop at bdcmess.</b>
    
    clear message.
    call function 'MESSAGE_PREPARE'
    exporting
    language = sy-langu
    msg_id = bdcmess-msgid
    msg_no = bdcmess-msgnr
    msg_var1 = bdcmess-msgv1(50)
    msg_var2 = bdcmess-msgv2(50)
    msg_var3 = bdcmess-msgv3(50)
    msg_var4 = bdcmess-msgv4(50)
    importing
    msg_text = message.
    
    
    write:/ 'msgid:', at 20 bdcmess-msgid,
    / 'msg1:', at 20 bdcmess-msgv1,
    / 'msg2:', at 20 bdcmess-msgv2,
    / 'msg3:', at 20 bdcmess-msgv3,
    / 'msg4:', at 20 bdcmess-msgv4,
    <b>/ message,</b> 
    / 'Message over'.
    
    
    
    endloop.
     
     
    
    
    
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks a lot Rich...it works now.. It was really silly on my part not to change messtab to bdcmess in call function !! I am sorry..

      Could you please give me an idea or direct me to some resources which can say what possible issues lie in call transaction during bdc ...

      i am getting the following message

      12/12/2005 BDC for Budget Data Upload 1

      -


      msgid: 00

      msg1:

      msg2:

      msg3:

      msg4:

      Start screen does not exist in batch input data

      Message over

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2005 at 09:33 PM

    Hi, please check for the messages in the table T100. If you can get the value of message Number in the debugging mode, you can check in the table whether the no. has a record in the table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2005 at 09:36 PM

    Hi,

    you are doing the Loop after the Function module <b>'MESSAGE_PREPARE'</b>, so you won't get the values of the messages table <b>MESSTAB</b>, if you want to available the values of internal table <b>MESSTAB</b>, you need to loop this table before calling the Function module <b>'MESSAGE_PREPARE'</b>, so that the header will be filled and the header values of the Internal table will be passed to the Function module.

    Hope you get the Answer

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2005 at 09:39 PM

    I think you need to:

      CALL TRANSACTION 'KP06' USING imtgp
      MODE 'N'
      UPDATE 'S'
      MESSAGES INTO messtab.
    
      LOOP AT messtab.
        CLEAR message.
        CALL FUNCTION 'MESSAGE_PREPARE'
             EXPORTING
                  language = sy-langu
                  msg_id   = messtab-msgid
                  msg_no   = messtab-msgnr
                  msg_var1 = messtab-msgv1(50)
                  msg_var2 = messtab-msgv2(50)
                  msg_var3 = messtab-msgv3(50)
                  msg_var4 = messtab-msgv4(50)
             IMPORTING
                  msg_text = message.
    
        WRITE: /001 message.
      ENDLOOP.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2005 at 09:42 PM

    Hi

    I think the work area (bdcmess-msgid) of your BDC message table is space, so the fm MESSAGE_PREPARE can't find the message class in T100.

    messtab is a table so you have to do a loop to read itse values.

    Max

    Message was edited by: max bianchi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2005 at 09:46 PM

    Hi,

    in your report you are not calling any Screen and not passing any ok_code

    you need to call the Program name of the T.code and the Screen No and the begin = 'X'

    like if your Internale table is IT_BDCDATA like structure BDCDATA then see this code

    it_bdcdata-program = 'program'.

    it_bdcdata-dynpro = 'Screen No'.

    it_bdcdata-dynbegin = 'X'

    APPEND it_bdcdata

    then pass all the fields and values for this screen to Internal table IT_BDCDATA

    it_bdcdata-fnam = 'Field name'.

    it_bdcdata-fval = 'Field Value'.

    APPEND it_bdcdata

    at the last use the OK_code, i mean pass the ok code.. then your first screen will be completed, do the same thing untill you get the last screen or press the SAVE button...

    Regards

    Sudheer

    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.