on 03-02-2009 6:00 PM
Hi All,
I have created a smartform to print the POs created through ME21n. I have changed the config to use this smartform when a PO is changed/created. Everything is working fine. All I need is the spool number for each of the PO this is being printed. Can you please let me know how I can achieve this through the FM for smartform?
I AM USING 4.6C.
This is how I am using the function module
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL
OUTPUT_OPTIONS = OUTPUT
USER_SETTINGS = ' '
EKKO = L_DOC-XEKKO
PEKKO = L_DOC-XPEKKO
DRUVO = L_DRUVO
IMPORTING
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
EKPO = L_DOC-XEKPO
PEKPO = L_DOC-XPEKPO
XAEND = IT_XAEND
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
All your inputs are greatly appreciated.
Thanks!
Sandeep
HI,
Chek the system fields SY-SPONO.
Or
Check the JOB_OUTPUT_INFO-SPOOLIDS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
JOB_OUTPUT_OPTIONS is of type SSFCRESOP, which does not have a SPOOLIDS field/table.
I knwo that the function module SSF_CLOSE returns the spool id in a table. But, I am not sure how to use SSF_OPEN and SSF_CLOSE. Can you please throw some light on how I can use these to get the spool numbers?
This is what I have right now.
JOB_OUTPUT_OPTIONS-TDDEST = ITCPO-TDDEST.
JOB_OUTPUT_OPTIONS-TDNEWID = 'X'.
L_FORMNAME = TNAPR-FONAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = TNAPR-SFORM
FORMNAME = L_FORMNAME
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL
OUTPUT_OPTIONS = OUTPUT
USER_SETTINGS = ' '
EKKO = L_DOC-XEKKO
PEKKO = L_DOC-XPEKKO
DRUVO = L_DRUVO
IMPORTING
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
EKPO = L_DOC-XEKPO
PEKPO = L_DOC-XPEKPO
XAEND = IT_XAEND
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
SELECT RQIDENT RQOWNER RQCRETIME FROM TSP01 INTO TABLE IT_TSP01
WHERE RQOWNER = SY-UNAME.
IF SY-SUBRC = 0.
SORT IT_TSP01 BY RQCRETIME DESCENDING.
READ TABLE IT_TSP01 INDEX 1.
SPOOLID = IT_TSP01-RQIDENT.
PERFORM PROTOCOL_UPDATE USING '320' SPOOLID SPACE SPACE SPACE.
ENDIF.
ENDIF.
The SELECT part is wrong, I need to replace this code to get the correct spool numbers.
Thanks in advance.
Sandeep
HI try this way..
CALL FUNCTION FM_NAME
EXPORTING
CONTROL_PARAMETERS = CONTROL
OUTPUT_OPTIONS = OUTPUT
USER_SETTINGS = ' '
EKKO = L_DOC-XEKKO
PEKKO = L_DOC-XPEKKO
DRUVO = L_DRUVO
IMPORTING
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO " Add this parameter
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
EKPO = L_DOC-XEKPO
PEKPO = L_DOC-XPEKPO
XAEND = IT_XAEND
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
" You can find the spool request as follows
JOB_OUTPUT_INFO-SPOOLIDS
hello,
check if is there parameter JOB_OUTPUT_INFO in your function module...
here are spool numbers....
regards,darek
Edited by: dariusz sobczak on Mar 2, 2009 7:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.