Skip to Content

NAST~CMFPNR has no value, I can't use it to fetch spool id from table CMFP

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'


tab_xnast = li_nast[].

call function 'RV_MESSAGES_UPDATE'


msg_no_update_task = lc_x

msg_objky = ls_nast-objky.

call function 'RV_MESSAGES_REFRESH'.



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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    May 03, 2017 at 02:25 PM


    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,

    Add comment
    10|10000 characters needed characters exceeded