on 02-15-2017 3:03 AM
How can I find the link between a Sales Order and the Spool Requests it produces?
Requirement: The user want to batch output the sales orders when the output type is such as "ZTYP" and download them to PDF files respectively.
At present, I create the spool id first using :
ls_nast-mandt = sy-mandt.
ls_nast-kappl = lc_kappl. "Application
ls_nast-objky = ls_print-vbeln.
ls_nast-kschl = p_kschl. "Message type ls_
nast-spras = sy-langu.
ls_nast-parnr = ls_print-kunnr. "Partner
ls_nast-parvw = lc_parvw. "Partner Role
ls_nast-nacha = '1'. "Transm. Medium
ls_nast-vsztp = lc_4. "Date/Time
ls_nast-manue = lc_x.
ls_nast-ldest = lc_locg. "Logical destination
ls_nast-dimme = lc_x. "Print immed.
ls_nast-anzal = 1. "Number of messages
ls_nast-tdarmod = 3. "Print and archive delivery
append ls_nast TO li_nast.
call function 'RV_MESSAGES_INSERT'
tables
tab_xnast = li_nast[].
call function 'RV_MESSAGES_UPDATE'
exporting
msg_no_update_task = lc_x
msg_objky = ls_nast-objky.
call function 'RV_MESSAGES_REFRESH'.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = lc_x.
But, after execution, the nast-cmfpnr (number) has no value.
And then use NAST~CMFPNR to fetch spool id from table CMFP.
Just use tables NAST and CMFP and link CMFP~NR = NAST~CMFPNR. Filter Nast Selection as much as possible and CMFP with APLID ARBGB MSGTY and MSGNR.
Because the nast-cmfpnr (number) has no value.Then I can not select the spool id from CMFP.
I wonder why the nast-cmfpnr has no value? How should i do?
Thank you for your kindly help.
Hello,
It looks like it is not SAP standard to maintain this.
You have to copy the Printing program and add in call function: CALL FUNCTION LF_FM_NAME
also the parameter job_output_info.
With this details you have to go to the form PROTOCOL_UPDATE and insert the spool number got into the SYST-MSGV1 variable.
Like this it will go into NAST-CMFPNR field.
You can test in debugger first to be sure it is correct.
Have a nice day,
Cata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.