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

how to return FI document number from SAP..?

Hi Gurus,

I have scenario here where in I have written a BDC program for transaction FV50L to park an FI document and then later made it is a function module.The FM is able to park the document from within SAP.. as i tested it...but i as it is a RFC enabled module it will be called from outside SAP...now how can i return the document number generated after parking to the non sap system...

I am using CALL TRANSACTION and transferring messages into a table of type BDCMSGCOLL..

Can any of u gurus provide me detail insight into this how it can be done....code samples will be helpful as i am still in a learning phase of ABAP...

<b><REMOVED BY MODERATOR></b>

Cheers:

Sam

Message was edited by:

Alvaro Tejada Galindo

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 Sep 12, 2007 at 07:27 PM

    Hi,

    You can pass the values in the FM interafce after reading the data from the BDCMSGCOLL table?

    Cheers

    VJ

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 12, 2007 at 07:39 PM

    Hi,

    Please try something like this to send message to BDCMSGCOLL while using CALL TRANSACTION.

    ...
    
    CALL TRANSACTION 'FV50L' USING IT_BDCDATA
                             MODE  C_MODE
                             UPDATE C_UDPATE
                             MESSAGES INTO IT_BDCMSGCOLL.
    
    LOOP AT IT_BDCMSGCOLL.
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          ID                   = IT_BDCMSGCOLL-MSGID
          LANG                 = IT_BDCMSGCOLL-MSGSPRA
          NO                   = IT_BDCMSGCOLL-MSGNR
          V1                   = IT_BDCMSGCOLL-MSGV1
          V2                   = IT_BDCMSGCOLL-MSGV2
          V3                   = IT_BDCMSGCOLL-MSGV3
          V4                   = IT_BDCMSGCOLL-MSGV4
        IMPORTING
          MSG                =  G_MSGTXT
        EXCEPTIONS
          NOT_FOUND          = 8.
    
    *Accumulate messages 
      ...
    
    ENDLOOP.
    
    *Now you can pass accumulate G_MSGTXT to your RFC FM.
    ...
    

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Well, It's up to you how you're going to handle it. But as I said in my original post, you can just return the original message table in the tables parameter (and the return code in an exporting parameter).

      Then if the requirements for handling the messages change at a later date, you just change the calling program.

      Rob

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.