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

How to get VBELN in run time

I have developped a custom driver program and a smartfor layout for sales order confirmation. And configured the program and layout against a output type.

I go to VA02 >Type an order number >

Choose 'Issue output to' from Sales document menu. Then I will select the output type and press print preview button.

In this case my custom driver program is called. My question is during this run time how do I get the VBELN for the current document that I have entered? Based on this VBELN, I am going to fetch the required data.

Regds

Rajesh

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Nov 29, 2005 at 04:46 PM

    Rajesh,

    Check the Parameter Id <b>AUN</b>.

    I think, this will hold the VBELN.

    Thanks

    Kam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 29, 2005 at 04:47 PM

    I believe it should be coming in thru NAST as the object key? In our custom print programs for sales documents, there is entry routine in the program which is defined in config. The subroutine is called and NAST is avaiable during runtime, the OBJKY is the field with the sales document number in it.

    tables:
            nast,                          "Messages
            *nast.                         "Messages
           
    
    
    form entry using return_code us_screen.
    
      clear retcode.
      xscreen = us_screen.
    
    * Retrieve misc data.
      select single vbpa~vbeln vbpa~kunnr adrc~name1 adrc~street adrc~city1
                    adrc~region adrc~post_code1 adrc~tel_number
                    adrc~fax_number
                       into corresponding fields of formdata
                          from vbpa
                            inner join adrc
                               on  vbpa~adrnr = adrc~addrnumber
                                  where vbpa~vbeln = <b>nast-objky</b>                                and vbpa~parvw = 'AG'
                                    and adrc~date_to = '99991231'.
    
    
    endform.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2005 at 04:56 PM

    Declaration part

    Data: V_COLLECT(85) value '(Prog name)tablename-fiend name'. "

    Data: V_PROCTR(85) value '(Prog name)tablename-fiend name'.

    FIELD-SYMBOLS: <FS_COLLECT> TYPE ANY,

    <FS_PROCTR> TYPE ANY.

    This is the Code, write this where you want that value

    ASSIGN (V_COLLECT) TO <FS_COLLECT>.

    ASSIGN (V_PROCTR) TO <FS_PROCTR>.

    here FS_COLLECT will contain the value of the Field

    try this and let me know if you fail..

    Thanks

    Sudheer

    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.