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

i want to capture the contract no.

Hi,

I am working on BDC for contract creation using transaction ME31k. Now my porblem is when a contract is created using BDC i want to capture the contract number in my program. From where i can get this information.

Thanks in advance.

Regards,

Vijay.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2009 at 03:49 AM

    Hi Vijay,

    U can code like below,

    CALL TRANSACTION 'ME31K' USING IT_BDCDATA

    OPTIONS FROM it_ctu_params

    MESSAGES INTO IT_MESSTAB.

    then pass the values of it_messtab to FM below.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = IT_MESSTAB-MSGID

    LANG = SY-LANGU

    NO = IT_MESSTAB-MSGNR

    V1 = IT_MESSTAB-MSGV1

    V2 = IT_MESSTAB-MSGV2

    V3 = IT_MESSTAB-MSGV3

    V4 = IT_MESSTAB-MSGV4

    IMPORTING

    MSG = P_MESSAGE

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2.

    here u will get the message processing the call transaction.

    usually the contract no will available in IT_MESSTAB-MSGV2.

    Hope it helps!!

    let me know if u still find diffuculty!!

    Regards,

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2009 at 02:22 AM

    Hi Vijay,

    You can get the contract number in the BDC message itab after you execute your BDC using calling transaction. The message table is refer to BDCMSGCOLL.

    Best Regards,

    Victor.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You can get it from MSGV1 field inside the bdcmsgcoll table.

      Try to create 1 contract number and put a break point in the call transaction.

      See the bdcmsgcoll table and i believe you can see the contract number there.

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.