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

[AFS] Cannot print report

$
0
0
Hi,

I have been trying to use AFS to print a report but it just doesn't seem to work.
Here is the code:

Code:

function print.material.shortages()
{
        string        session.code(13)
        domain        tdcrm.emsg        error.msg

        error.msg = ""
        session.code = PRINT.MATERIAL.SHORTAGES.SESSION
        |stpapi.put.field(session.code, "grid.f", "")
        |stpapi.put.field(session.code, "grid.t", "ZZZZZZZZZ")
        stpapi.put.field(session.code, "pdno.f", str$(production.order))
        stpapi.put.field(session.code, "pdno.t", str$(production.order))
        |stpapi.put.field(session.code, "date.f", "")
        |stpapi.put.field(session.code, "date.t", "01/19/2038")
        |stpapi.put.field(session.code, "plid.f", "")
        |stpapi.put.field(session.code, "plid.t", "ZZZZZZZZZ")
        |stpapi.put.field(session.code, "sfpl.f", "")
        |stpapi.put.field(session.code, "sfpl.t", "ZZZZZZZZZ")
        stpapi.set.report(session.code, "rtisfc041911000", "D", error.msg)
        if not isspace(error.msg) then
                error.msg = "Cannot set report Material Shortages: " & error.msg
                message(error.msg)
        endif
        |stpapi.form.command(session.code, 5, "exec.cont.process", error.msg)
        stpapi.print.report(session.code, error.msg)
        if not isspace(error.msg) then
                error.msg = "Cannot print report Material Shortages: " & error.msg
                message(error.msg)
        endif
        message("Print Report!")
        stpapi.end.session(session.code)
}

The session is "tisfc0419m000".

What I have tested/tried:
- production.order really has correct value
- stpapi.put.field to all the fields in the session
- stpapi.put.field to the only field I want to change
- stpapi.form.command with "exec.cont.process"
- stpapi.print.report

*** stpapi.print.report gives "Command Disabled" error while other methods give no errors but none of them actually print the report.

Please help.

Regards,
Thana

Viewing all articles
Browse latest Browse all 4216

Trending Articles



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