Skip to Content
author's profile photo
Former Member

bdcmsgcoll

I am updating single record thro crmd_order transaction ...

service ticket is generated by system ...

i need to get the service ticket number as information message ..

help me pls with lil code n logic ... u 'll b highly rewarded..

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 06:09 AM

    CALL TRANSACTION 'CRMD_ORDER' USING IT_BDCDATA MODE 'N'

    messages into messtab.

    READ TABLE MESSTAB WITH KEY MSGTYP = 'S'.

    IF SY-SUBRC = 0.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = MESSTAB-MSGID

    LANG = MESSTAB-MSGSPRA

    NO = MESSTAB-MSGNR

    V1 = MESSTAB-MSGV1

    V2 = MESSTAB-MSGV2

    V3 = MESSTAB-MSGV3

    V4 = MESSTAB-MSGV4

    IMPORTING

    MSG = L_MSTRING

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi..

      Note : After call transaction it will always the Store the messages in thos table.

      Try this way .. using break-points.

      CALL TRANSACTION 'CRMD_ORDER' USING IT_BDCDATA MODE 'N'

      messages into messtab.

      IF SY-SUBRC = 0.

      BREAK-POINT.

      READ TABLE MESSTAB WITH KEY MSGTYP = 'S'.

      IF SY-SUBRC = 0.

      CALL FUNCTION 'FORMAT_MESSAGE'

      EXPORTING

      ID = MESSTAB-MSGID

      LANG = MESSTAB-MSGSPRA

      NO = MESSTAB-MSGNR

      V1 = MESSTAB-MSGV1

      V2 = MESSTAB-MSGV2

      V3 = MESSTAB-MSGV3

      V4 = MESSTAB-MSGV4

      IMPORTING

      MSG = L_MSTRING

      EXCEPTIONS

      NOT_FOUND = 1

      OTHERS = 2

      .

      ENDIF.

      ELSE.

      BREAK-POINT.

      ENDIF.

      REWARD IF HELPFUL.

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 04:54 AM

    I believe you are using CALL TRANSACTION to update data. In this you must be getting all messages to an internal table.

    Read last record of internal table and format the same using fm FORMAT_MESSAGE. If message type is 'S', then display associated message as information message.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 29, 2007 at 05:06 AM

    Hi..

    Try this Logic.

    Loop at itab.

    Perform Mapping.

    Call transaction '<tcode>'

    using it_bdcdata

    mode 'N'

    Message into it_bdcmsgcoll.

    if sy-subrc = 0.

    Describe table it_bdcmsgcoll.

    Read table it_bdcmsgcoll into wa_bdcmsgcoll index sy-tfill. "Last record

    MESSAGE ID wa_bdcmsgcoll-MSGID

    TYPE 'I'

    NUMBER wa_bdcmsgcoll-MSGNR

    WITH wa_bdcmsgcoll-MSGV1

    wa_bdcmsgcoll-MSGV2

    wa_bdcmsgcoll-MSGV3

    wa_bdcmsgcoll-MSGV4.

    Endif.

    Reward if Helpful.

    Refresh it_bdcmsgcoll .

    Refresh it_bdcdata .

    Endloop.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 05:20 AM

    Thanks for the responce guys ...

    But the problem is whn i try to debug the it_bdcmsgcoll i am not getting any data ..

    any suggestions plz

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 07:04 AM

    HEY I 'M NOT GETTIN THE SERVICE TICK NUM ..

    IN MSGV1 I 'M GETTING SOME FIELD NAME...

    Add comment
    10|10000 characters needed characters exceeded