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

Replace SY-UNAME when calling a Transaction

The following function module creates an invoice automatically:

CALL FUNCTION 'CREATE_DELIV' IN BACKGROUND TASK

EXPORTING

i_order = vbak-vbeln.

Inside this FM CREATE_DELIV, VF01 transaction is called.

CALL TRANSACTION 'VF01' USING bdcdata

MODE 'N'

UPDATE 'S'

MESSAGES INTO itab_msg.

Upon creation of the billing document (VBRK), the ERNAM / "Created By" field in VBRK is defaulted to the sy-uname. How do I code the program so that the creator of the billing document (VBRK-ERNAM) would be "DEF_USER" and not sy-uname?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jun 17, 2008 at 04:04 AM

    Hi...

    u can make use of the update statement... after calling VF01, as

    UPDATE VBRK SET: ernam = 'DEF_USER'

    WHERE vbeln = wf_vbeln.

    wf_vbeln should contain the invoice doc number...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 04:45 AM

    Hi

    Try USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)

    This user exit is only called when the billing document is created. It is used to provide the header and the item of the new billing document with deviating or additional data.Try chnaging the user name in VBRK here.

    Regards

    Saket Sharma

    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.