Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RSNAST0D: printing a message by z-program problem

former_member1161170
Participant
0 Likes
4,590

To print by message, I tried to use directly the CALL FUNCTION (WFMC_MESSAGES_SELECT, WFMC_MESSAGES_PROCESS, ...) but it didn't work.

So I'm trying to use the standard program RSNAST0D.

If I call it by SE38, it works fine with my example. If I call by my z-program it doesn't work.

If I stop the program in debug at the first instruction (CALL FUNCTION 'WFMC_MESSAGES_SELECT') in two sessions with both the two cases (called directly by SE38 and called by my z-program) I can see the same parameters values in both sessions.

But only one of them gets the spool.

This is the code of the SUBMIT, but I think it is not important: I'm sure that the parameters values are identical, as it was called directly:

    wa_selection-selname = 'S_KAPPL'.
    wa_selection-kind    = 'S'.
    wa_selection-sign    = 'I'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = 'V2'.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'S_NACHA'.
    wa_selection-kind    = 'S'.
    wa_selection-sign    = 'I'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = '1'.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'S_KSCHL'.
    wa_selection-kind    = 'S'.
    wa_selection-sign    = 'I'.
    wa_selection-option  = 'EQ'.
    IF f_type = 'PKL'.
      wa_selection-low =  'ZLD2'.
    ELSEIF f_type = 'RIR'.
      wa_selection-low =  'ZRIR'.
    ELSEIF f_type = 'RID'.
      wa_selection-low =  'ZRID'.
    ELSEIF f_type = 'DDT'.
      wa_selection-low =  'ZLDF'.
    ENDIF.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'S_OBJKY'.
    wa_selection-kind    = 'S'.
    wa_selection-sign    = 'I'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = wa_zmspool-vbeln.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'P_MODE'.
    wa_selection-kind    = 'P'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = f_vermo.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'P_DIALOG'.
    wa_selection-kind    = 'P'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = ' '.
    APPEND wa_selection TO it_selection.
    wa_selection-selname = 'P_GRID'.
    wa_selection-kind    = 'P'.
    wa_selection-option  = 'EQ'.
    wa_selection-low     = ' '.
    APPEND wa_selection TO it_selection.

   SUBMIT RSNAST0D WITH SELECTION-TABLE it_selection AND RETURN.


1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
3,043

In the spool request you should see a field (checkbox?) labeled something like 'Closed, not possible to add to'. If this is not set then the same output for the same printer and same user will continue to be added to an existing open spool request. I've ran into this several times with different output, so usually if I don't see a new spool I just increase the date range in SP01 and usually find an old one.

7 REPLIES 7
Read only

Former Member
0 Likes
3,043

You could have your program schedule it as an immediate background job.  That's what we do.  Not sure why your method isn't working.  I'd expect it to.

Neal

Read only

0 Likes
3,043

Thank you for the fast answer.

No. My program doesn't run (and must not run) in background.

Furthermore, my program doesn't get the spool by RSNAST0D, but it get a new correct record in table NAST.

Read only

0 Likes
3,043

But what I'm suggesting is that you change your program so that it creates RSNAST0D as a background job.  Is there a reason not to do that?

Neal

Read only

0 Likes
3,043

My program needs the spool to make the pdf, so it isn't nice to make it waiting for the spool.

Meanwhile i found the real problem (but not the solution): RSNAST0D always get the spool pages, but it add them on a only spool number (3-4 days old).

So I have an old spool with 140 pages, which contains all my tests!

Why did it work so?

Read only

0 Likes
3,043

I remember controls somewhere which specify that the report should create a new spool (or not).  I'll try to remember where they are.  Perhaps in the meantime, someone will name that spot first...

Neal

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
3,044

In the spool request you should see a field (checkbox?) labeled something like 'Closed, not possible to add to'. If this is not set then the same output for the same printer and same user will continue to be added to an existing open spool request. I've ran into this several times with different output, so usually if I don't see a new spool I just increase the date range in SP01 and usually find an old one.

Read only

0 Likes
3,043

I found it.

"OPEN_FORM" is the right point: there si a paremeter "OPTIONS".

The right way is this one:

https://scn.sap.com/thread/1596051

Thanks to all.