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

bdc calltransaction

hai

iam doing bdc. here the screen values

material:tvs

industry sector:m

material type:coupns

material description:tata

base uint of measure:ea

genaral item category:ehe

here iam giving genaral item caegory is wrong

if i save the data its should display the general item cagory is wrong..

here i think i have to use bdcmsgcall

here help the code how to write bdcmsgcall.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Mar 25, 2006 at 03:36 PM

    Yes, you can get the messages back from the BDC using the MESSAGES into messtab extension.

    
    call transaction 'MM01' using bdcdata
                            messages into messtab.
    
    
    
    

    You can then loop at messtab and write out the messages.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 25, 2006 at 03:41 PM

    Hi Franklin,

    First off declare an internal table say t_messtab of structure BDCMSGCOLL.

    Then use the MESSAGES into t_messtab option in your CALL TRANSACTION statement like Rich mentioned above.

    At the end of CALL TRANSACTION the itanb t_messtab will be filled with system messages if any.. then

    data:W_ERR_MSG(132).      "Error message text
      loop at T_MESStaB.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            ID        = T_MESSAGETAB-MSGID
            LANG      = 'E'
            NO        = T_MESSAGETAB-MSGNR
            V1        = T_MESSAGETAB-MSGV1
            V2        = T_MESSAGETAB-MSGV2
            V3        = T_MESSAGETAB-MSGV3
            V4        = T_MESSAGETAB-MSGV4
          IMPORTING
            MSG       = W_ERR_MSG
          EXCEPTIONS
            NOT_FOUND = 1
            OTHERS    = 2.
        IF SY-SUBRC EQ 0.
      write:/ w_err_msg. 
        ENDIF.
     

    Regards,

    Suresh Datti

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 25, 2006 at 04:01 PM

    Hi Franklin,

    You can code something like this

    data: i_msgtab like bdcmsgcoll occurs 0 with header line.
    
    ...
    
    clear i_msgtab.
    refresh i_msgtab.
    call transaction 'MM01' using    bdcdata
                            mode     p_mode
                            messages into i_msgtab.
    
    
    
    if sy-subrc <> 0.
    *Process and display error messages
      loop at i_msgtab.
        clear t100.
        select single * from t100 
        where sprsl = i_msgtab- msgspra 
          and arbgb = i_msgtab-msgid   
          and msgnr = i_msgtab-msgnr.
            
        perform process_message using t100-text.
      
      endloop.
    endif.
    
    
    
    *&---------------------------------------------------------------------*
    *&      Form  process_message
    *&---------------------------------------------------------------------*
    *       Process and display error message into control status report
    *----------------------------------------------------------------------*
    *      -->P_MESSAGE  Message text
    *----------------------------------------------------------------------*
    form process_message using p_message.
      data: l_message(480).
    
      if sy-subrc = 0.
        l_message = p_message.
        if l_message cs '&1'.
          replace '&1' with i_msgtab-msgv1 into l_message.
          replace '&2' with i_msgtab-msgv2 into l_message.
          replace '&3' with i_msgtab-msgv3 into l_message.
          replace '&4' with i_msgtab-msgv4 into l_message.
        else.
          replace '&' with i_msgtab-msgv1 into l_message.
          replace '&' with i_msgtab-msgv2 into l_message.
          replace '&' with i_msgtab-msgv3 into l_message.
          replace '&' with i_msgtab-msgv4 into l_message.
        endif.
        condense l_message.
        write: /2 i_msgtab-msgtyp, l_message(250).
      else.
        write: /2 i_msgtab.
      endif.
    
    endform.                    " process_message

    Hope this will help

    Regards,

    Ferry Lianto

    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.