Quantcast
Channel: Baanboard.com
Viewing all articles
Browse latest Browse all 4216

Program Script for Journal Voucher Entries

$
0
0
Hi,

I'm having a program script/session to handle multiline data entries (into journal voucher/tfgld115m000) from a text file.
The GL account used is a Project Cost Account. In the middle of the entry process, the system auto prompt a session Material Costs (tppc2511m000).
How do I communicate or handle this session within my program script? Or an option for me to kill the session using a script?
Currently, I need to close the session (tppc2511m000) manually so that my program can continue to end the process.

--quote of program script
Code:

function long insert.journal.line()
{
        long ret, retval1, retval2, retval3, retval4, retval5, retval6, retval7
        domain tcmcs.str132 errmess, error.code, error.msg
               

        stpapi.put.field( "tfgld1101m100", "tfgld101.year", str$(main.year))
        stpapi.put.field( "tfgld1101m100", "tfgld101.btno", str$(main.btno))
        stpapi.put.field( "tfgld1101m100", "tfgld101.ttyp", main.ttyp)
        ret = stpapi.find("tfgld1101m100", error.msg)
        if ret = 1 then 
                ret = stpapi.mark("tfgld1101m100", error.msg) 
                if ret = 1 then
                        stpapi.handle.subproc("tfgld1101m100","tfgld1115m000", "add" ) 
                        stpapi.form.command("tfgld1101m100", 5, "enter.transactions",error.msg)
                        ret = stpapi.change.view ("tfgld1115m000")
                        .....

                        ret = stpapi.insert("tfgld1115m000", true, error.msg)       
                        |(Material Costs prompted at this line. Need to close the session so that program able to process the next step.)
                        .....
                       
                                if not ret then 
                                        ...
                                else
                                        ...
                                endif
                               
                        stpapi.get.field( "tfgld1115m000", "tfgld102.docn", temp.docn )
                       
                else
                                stpapi.end.session ("tfgld1115m000")
                                stpapi.end.session ("tfgld1101m100")
                endif
        else
                stpapi.end.session ("tfgld1115m000")
                stpapi.end.session ("tfgld1101m100")
        endif       
                stpapi.end.session ("tfgld1115m000")
                stpapi.end.session ("tfgld1101m100")
               
        return(0)
}

Please help.

Thank you.

Attached Images
File Type: jpg erp-journal-vouchers.JPG (140.1 KB)

Viewing all articles
Browse latest Browse all 4216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>