Skip to Content

How do I write a script for VA01 that calls VF01 with SD document number that was created

Hi Personas experts,

I have been working on VA01 flavor to create credit/debit memos. Once user has entered all the necessary information I tried to add a script button that would do the following:

1) Save the reference document that the memo request was based on so it can be displayed at the end

2) saves the sd credit memo request (VA01) and save the document number so it can be displayed at the end

3) creates the billing document (VF01) - and saves the document number so it can be displayed at the end

However once I try to run the script the page becomes unresponsive. Can you give me some guidance please.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Feb 17, 2017 at 03:58 PM
    here is my script
    //save reference document
    var refDoc =
    //press save to create memo request document
    //save memo request document
    var memoReq =
    session.utils.put("memoReq", memoReq);
    //go to VF01 to create billing document
    session.findById("wnd[0]/tbar[0]/okcd").text =
    //press save to process memo request which should already
    be on the screen
    //save billing document
    var billingDoc = session.findById("wnd[0]/sbar").getMessageParameter(0);
    session.utils.put("billingDoc", billingDoc);
    //go back to va01
    session.findById("wnd[0]/tbar[0]/okcd").text =
    //fill in text boxes in status box
    = session.utils.put("refDoc");
    = session.utils.put("memoReq");
    = sesssion.utils.put("billingDoc");
    Add comment
    10|10000 characters needed characters exceeded