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

BDC messages ?

Hi experts,

After Successfully uploading data in given Transaction i want to show at-last.

" This ...material has been Uploaded".

or

if its Fail... then

" This ....Not loaded ".

Who to do that..?

**********Point is assured********

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Dec 03, 2007 at 06:00 AM

    Hi,

    Refr this code

    **routine for bdcdata with tcode

    FORM bdc_transaction USING tcode.

    CLEAR messtab[].

    CALL TRANSACTION tcode USING bdcdata

    MODE 'N'

    UPDATE 'A'

    MESSAGES INTO messtab.

    • capturing the error record

    LOOP AT messtab WHERE msgtyp = 'E'.

    ADD 1 TO v_error.

    READ TABLE it_record1 WITH KEY ematn = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'MATERIAL NO Error'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY evart = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'DOC. TYPE Error'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY lifnr = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'VENDOR NO Error'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY vedat = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'DOC. DATE'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY ekorg = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'PUR.ORGANIZATION Error'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY lgort = messtab-msgv2 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'STORAGE LOCATION Error'.

    APPEND it_error.

    ELSE.

    flag = 1.

    ENDIF.

    IF flag = 1 .

    READ TABLE it_record1 WITH KEY werks = messtab-msgv1.

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'PLANT Error'.

    APPEND it_error.

    ENDIF.

    ENDIF.

    READ TABLE it_record1 WITH KEY ekgrp = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'PUR. GROUP Error'.

    APPEND it_error.

    ENDIF.

    READ TABLE it_record1 WITH KEY ktmng = messtab-msgv1 .

    IF sy-subrc = 0.

    MOVE-CORRESPONDING it_record1 TO it_error.

    it_error-error = 'QUANTITY Error'.

    APPEND it_error.

    ENDIF.

    CLEAR it_error.

    ENDLOOP.

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 05:57 AM

    check the sy-subrc.

    if sy-subrc = 0. then successful message

    otherwise failure message

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 06:01 AM

    No dear,

    i want to show 'Summary ' or Acknowledgemet that CJ01 transaction successfully uploaded... with so and so project....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 06:03 AM

    Hi

    AFTER bdc_close CHECK FOR sy-subrc IF ITS 0 THEN DISPLAY A MESSAGE SESSION CREATED SUCCESSFULLY

    <b>REWARD IF USEFULL</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 06:06 AM

    Hi jim

    Use the std structure BDCMSGCOLL to store the messages. The messages can be populated using the Function Module, 'FORMAT_MESSAGE' to format the messages.e below code for ref...

    CALL TRANSACTION 'MM01' USING IT_BDCDATA MODE 'N' UPDATE 'S'

    MESSAGES INTO IT_MESSAGES.

    all messages wiull come into it_messages and display them like:

    if sy-subrc NE 0.

    FORM ERROR_MESSAGES.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = SY-MSGID

    LANG = '-D'

    IMPORTING

    MSG = V_MESG

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2.

    LOOP AT IT_MESSAGES WHERE MSGTYP = 'E'.

    WRITE : / V_MESG.

    CLEAR IT_MESSAGES.

    ENDLOOP.

    Else

    message zx001 ' data upload is succuss'.

    endif.

    <b>

    reward is usefull</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 11:21 AM

    thanks to all experts. p

    point has been given

    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.