|
|
November 25 creation of authorization object based on user and plant Reply from Luis Martins on 12/14/2006 2:07 PM Hi Venki, To create an authorization object: 1) Execute transaction SU21 2) Double-click an Object Class to select a class that should contain your new auth object 3) Click on CREATE (F5) 4) (If creating custom field) - Click the 'Field Maintenance' button --> Click on CREATE (Shift+F1) 5) Enter the Name for the New Authorization field and the corresponding Data Element and SAVE 6) Confirm the Change Request data for the new Authorization Field 7) Go back two screens (F3-->F3) 8) Enter the Authorization field name and document the object: 9) SAVE and ACTIVATE the documentation 10) Save the new Authorization Object 11) Confirm the change request data for the Authorization Object and EXIT SU21 12) Finally, the SAP_ALL profile must be re-generated You may not need steps 4, 5 and 6 for restrictions at plant code level. For that, just use the existing WERKS field or data element WERKS_D. To lookup existing authorization fields, use transaction SU20. I'm sure there's more help in http://help.sap.com. You'll need the background info available there. November 20 FUNCTION RSPO_OUTPUT_SPOOL_REQUEST. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(COPIES) LIKE TSP02-PJCOPIES DEFAULT 0 *" VALUE(DEVICE) LIKE TSP03-PADEST DEFAULT '*' *" VALUE(DIVISION) LIKE TSP02-PJDIVISION DEFAULT '*' *" VALUE(ENDPAGE) LIKE TSP02-PJENDPAGE DEFAULT 0 *" VALUE(PRIO) LIKE TSP02-PJPRIO DEFAULT 0 *" VALUE(RECEIVER) LIKE TSP02-PJRECEIVER DEFAULT '*' *" VALUE(REQEST_TITLE) LIKE TSP01-RQTITLE DEFAULT '*' *" VALUE(SPOOL_REQUEST_ID) LIKE TSP01-RQIDENT *" VALUE(STARTPAGE) LIKE TSP02-PJSTRTPAGE DEFAULT 0 *" VALUE(TELELAN) LIKE ITCPP-TDTELELAND DEFAULT '*' *" VALUE(TELENUM) LIKE TSKPA-TELNR DEFAULT '*' *" VALUE(POSNAME) LIKE TSP02-PJPOSNAME OPTIONAL *" VALUE(ACTTIME) LIKE TSP02-PJACTTIME OPTIONAL *" TABLES *" ATTRIBUTES STRUCTURE RSPOATTR OPTIONAL *" EXCEPTIONS *" ARCHIVE_DEST_INVALID *" ARCHIVE_DEST_NOT_FOUND *" ARCHIVE_DEST_NO_RIGHT *" CANNOT_ARCHIVE *" CHANGE_ARCHDEST_NO_RIGHT *" CHANGE_COPIES_NO_RIGHT *" CHANGE_DEST_NO_RIGHT *" CHANGE_DEVTYPE_NO_RIGHT *" CHANGE_PRIO_NO_RIGHT *" CHANGE_TELENUM_NO_RIGHT *" CHANGE_TITLE_NO_RIGHT *" DEST_INVALID *" DEST_NOT_FOUND *" DEST_NO_RIGHT *" INTERNAL_PROBLEM *" INVALID_FAX_ATTRIBUTE *" INVALID_PARAMETERS *" NON_OWNER_NO_RIGHT *" NO_LAYOUT *" NO_SPOOL_REQUEST *" OUT_AGAIN_NO_RIGHT *" SPOOLER_PROBLEM *"---------------------------------------------------------------------- *********************************************************************** * * (c) SAP Aktiengesellschaft * Systeme, Anwendungen und Produkte in der Datenverarbeitung * *---------------------------------------------------------------------- * Autor: Ma.Mittelstein * Reviewer: ?? *********************************************************************** * @(#)lspoou22.abi %I% SAP %E% *-HISTORY------------------------- *-1.1 * 21.07.1994 mit First release. *-END-HISTORY--------------------*/ " No longer IMPORT parameters: " DATA: ARCHDEST LIKE TSP03-PADEST VALUE '* ' , ARCHIVE VALUE ' ' . TABLES: RSPOCHECK "Parameterpruefung . DATA: FCODE(4) VALUE 'FPRI' , BEGIN OF ORIG_REQ. INCLUDE STRUCTURE TSP01. DATA: RQIDENTEXT LIKE TSP0E-RQIDENTEXT , RQARCHDAT1 LIKE TSP0E-RQARCHDAT1 , RQARCHDAT2 LIKE TSP0E-RQARCHDAT2 , DEVTYPE LIKE TSP03-PATYPE , IS_FAX_OR_TELETEX , END OF ORIG_REQ , BEGIN OF WANTED. INCLUDE STRUCTURE TSP01. DATA: RQIDENTEXT LIKE TSP0E-RQIDENTEXT , RQARCHDAT1 LIKE TSP0E-RQARCHDAT1 , RQARCHDAT2 LIKE TSP0E-RQARCHDAT2 , DEVTYPE LIKE TSP03-PATYPE , IS_FAX_OR_TELETEX , END OF WANTED , IDENT(10) , ANSWER_300 , STATUS LIKE SY-SUBRC , DONT_MOD_RQDEST VALUE ' ' , DONT_MOD_RQCOPIES VALUE ' ' , DONT_MOD_RQPRIO VALUE ' ' "never set? , DONT_MOD_RQRECEIVER VALUE ' ' , DONT_MOD_RQDIVISION VALUE ' ' , DONT_MOD_RQTITLE VALUE ' ' , DONT_MOD_RQPAPER VALUE ' ' , DONT_MOD_RQARCHDEST VALUE ' ' , DONT_MOD_RQTELELAN VALUE ' ' , DONT_MOD_RQTELENUM VALUE ' ' , DONT_MOD_RQTELENUME VALUE ' ' , DONT_MOD_DEVTYPE VALUE ' ' . * (1a) Find the spool request, * CLEAR ORIG_REQ. SELECT SINGLE * FROM TSP01 WHERE RQIDENT = SPOOL_REQUEST_ID. IF SY-SUBRC >< 0. MESSAGE ID 'PO' TYPE 'E' NUMBER 106 WITH SPOOL_REQUEST_ID RAISING NO_SPOOL_REQUEST. ENDIF. MOVE-CORRESPONDING TSP01 TO ORIG_REQ. ". IF TSP01-RQARCHTYPE = '3' AND TSP01-RQARCHSTAT <= '1'. ". MESSAGE S314. "Wird nach ausdruck archiviert. ". ENDIF. ". IF TSP01-RQARCHTYPE = '2' AND TSP01-RQARCHSTAT <= '1'. ". MESSAGE I315. "Der Auftrag soll nur archiviert werden ". ENDIF. * (1b) and the extension record for the spool request, * UNPACK ORIG_REQ-RQIDENT TO IDENT. SELECT SINGLE * FROM TSP0E WHERE RQIDENT = IDENT AND RQIDENTEXT = '0'. IF SY-SUBRC <> 0. " ELSE. ORIG_REQ-RQIDENTEXT = TSP0E-RQIDENTEXT. ORIG_REQ-RQARCHDAT1 = TSP0E-RQARCHDAT1. ORIG_REQ-RQARCHDAT2 = TSP0E-RQARCHDAT2. ENDIF. * (1c) and some info about output device. * SELECT SINGLE * FROM TSP03C WHERE PADEST = ORIG_REQ-RQDEST. SELECT SINGLE * FROM TSP03 WHERE PADEST = ORIG_REQ-RQDEST. IF SY-SUBRC >< 0. ORIG_REQ-DEVTYPE = 'bad'. ELSE. ORIG_REQ-DEVTYPE = TSP03-PATYPE. IF TSP03C-PAARCHIVER = 'F' OR TSP03C-PAARCHIVER = 'T'. ORIG_REQ-IS_FAX_OR_TELETEX = 'X'. ENDIF. ENDIF. CLEAR WANTED. MOVE-CORRESPONDING ORIG_REQ TO WANTED. * (2) If this spool request is protected, look what is (not) allowed. * * if orig_req-rqauth <> ' '. * (2a) caller must be the owner or needs BASE permission. * * if orig_req-rqowner <> sy-uname or orig_req-rqclient <> sy-mandt. * authority-check object 'S_SPO_ACT' * id 'SPOACTION' field 'BASE' * id 'SPOAUTH' field orig_req-rqauth. DATA: SPOOLREQ LIKE TSP01. MOVE-CORRESPONDING ORIG_REQ TO SPOOLREQ. PERFORM CHECK_JOB_PERMISSION USING SPOOLREQ 'BASE'. IF SY-SUBRC <> 0. MESSAGE ID 'PO' TYPE 'E' NUMBER 358 RAISING NON_OWNER_NO_RIGHT. ENDIF. * endif. * (2b) Allowed to redirect? * * authority-check object 'S_SPO_ACT' * id 'SPOACTION' field 'REDI' * id 'SPOAUTH' field orig_req-rqauth. PERFORM CHECK_JOB_PERMISSION USING SPOOLREQ 'REDI'. IF SY-SUBRC <> 0. DONT_MOD_RQDEST = 'X'. ENDIF. * (2c) Allowed to change attributes? * * authority-check object 'S_SPO_ACT' * id 'SPOACTION' field 'ATTR' * id 'SPOAUTH' field orig_req-rqauth. PERFORM CHECK_JOB_PERMISSION USING SPOOLREQ 'ATTR'. IF SY-SUBRC <> 0. DONT_MOD_RQCOPIES = 'X'. DONT_MOD_RQRECEIVER = 'X'. DONT_MOD_RQDIVISION = 'X'. DONT_MOD_RQTITLE = 'X'. DONT_MOD_RQPAPER = 'X'. DONT_MOD_RQARCHDEST = 'X'. DONT_MOD_DEVTYPE = 'X'. ENDIF. * endif. * (3) Look at status of spool request * IF TSP01-RQARCHSTAT = '4'. " Archvierung war fehlgeschlagen ! "?? MESSAGE W324. "Archivierung fehlgeschlagen ENDIF. IF TSP01-RQARCHSTAT = '4'. " Fine. ELSEIF TSP01-RQARCHTYPE = '2' AND TSP01-RQARCHSTAT <= '1'. "#EC PORTABLE " Fine. ELSE. "Cannot archive ! IF ARCHIVE = 'X'. MESSAGE ID 'PO' TYPE 'E' NUMBER 232 RAISING CANNOT_ARCHIVE. ENDIF. ENDIF. IF TSP01-RQARCHTYPE = '1'. DONT_MOD_RQARCHDEST = 'X'. ENDIF. * (4) Does the caller want to override some of the attributes? * (1st group) * IF DEVICE >< '*' AND DEVICE >< WANTED-RQDEST. IF DONT_MOD_RQDEST >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 233 WITH WANTED-RQDEST DEVICE RAISING CHANGE_DEST_NO_RIGHT. ELSE. WANTED-RQDEST = DEVICE. ENDIF. ENDIF. IF COPIES >< 0 AND COPIES >< WANTED-RQCOPIES. IF DONT_MOD_RQCOPIES >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 234 RAISING CHANGE_COPIES_NO_RIGHT. ELSE. WANTED-RQCOPIES = COPIES. ENDIF. ENDIF. IF PRIO >< 0 AND PRIO >< WANTED-RQPRIO. IF DONT_MOD_RQPRIO >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 235 RAISING CHANGE_PRIO_NO_RIGHT. ELSE. WANTED-RQPRIO = PRIO. ENDIF. ENDIF. IF RECEIVER >< '*' AND RECEIVER >< WANTED-RQRECEIVER. IF DONT_MOD_RQRECEIVER >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 236 RAISING CHANGE_TITLE_NO_RIGHT. ELSE. WANTED-RQRECEIVER = RECEIVER. ENDIF. ENDIF. IF REQEST_TITLE >< '*' AND REQEST_TITLE >< WANTED-RQTITLE. IF DONT_MOD_RQTITLE >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 236 RAISING CHANGE_TITLE_NO_RIGHT. ELSE. WANTED-RQTITLE = REQEST_TITLE. ENDIF. ENDIF. IF DIVISION >< '*' AND DIVISION >< WANTED-RQDIVISION. IF DONT_MOD_RQDIVISION >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 236 RAISING CHANGE_TITLE_NO_RIGHT. ELSE. WANTED-RQDIVISION = DIVISION. ENDIF. ENDIF. IF ARCHDEST >< '*' AND ARCHDEST >< WANTED-RQARCHDEST. IF DONT_MOD_RQARCHDEST >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 237 RAISING CHANGE_ARCHDEST_NO_RIGHT. ELSE. CALL FUNCTION 'RSPO_CHECK_ARCHIVE_PERMISSION' CHANGING DEST = ARCHDEST EXCEPTIONS NO_SUCH_DEVICE = 1 NO_PERMISSION = 2 NO_ARCHIVER = 3. IF SY-SUBRC NE 0. MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO WITH SY-MSGV1 RAISING CHANGE_ARCHDEST_NO_RIGHT. ENDIF. WANTED-RQARCHDEST = ARCHDEST. ENDIF. ENDIF. * (5) Is this an additional print out, and has user permission * to print more than once? * * if wanted-rqpjreq > 0 and wanted-rqauth <> ' '. IF WANTED-RQPJREQ > 0. MOVE-CORRESPONDING WANTED TO SPOOLREQ. PERFORM CHECK_JOB_PERMISSION USING SPOOLREQ 'REPR'. * authority-check object 'S_SPO_ACT' * id 'SPOACTION' field 'REPR' * id 'SPOAUTH' field wanted-rqauth. ELSE. PERFORM CHECK_JOB_PERMISSION USING SPOOLREQ 'PRNT'. ENDIF. IF SY-SUBRC <> 0. " Keine Berechtigung MESSAGE ID 'PO' TYPE 'E' NUMBER 320 RAISING OUT_AGAIN_NO_RIGHT. ENDIF. * (6) Look at output device: * CALL FUNCTION 'RSPO_CHECK_DEVICE_PERMISSION' EXPORTING DEST = WANTED-RQDEST EXCEPTIONS NO_SUCH_DEVICE = 1 NO_PERMISSION = 2 OTHERS = 3. CASE SY-SUBRC. WHEN '1'. MESSAGE ID 'PO' TYPE 'E' NUMBER 238 WITH WANTED-RQDEST RAISING DEST_NOT_FOUND. WHEN '2' OR '3'. " Keine Berechtigung für Gerät. MESSAGE ID 'PO' TYPE 'E' NUMBER 240 WITH WANTED-RQDEST RAISING DEST_NO_RIGHT. ENDCASE. WANTED-DEVTYPE = TSP03-PATYPE. IF TSP03C-PAARCHIVER <> 'F' AND TSP03C-PAARCHIVER <> 'T'. " Kein Telefax ausgeben WANTED-IS_FAX_OR_TELETEX = ' '. ELSE. WANTED-IS_FAX_OR_TELETEX = 'X'. ENDIF. ". DATA: HEX TYPE X. ". MOVE TSP03-PAMSG TO PRTMSG_300. ". MOVE TSP03-PASTATUS TO HEX. ". IF HEX O 2. ". MOVE 'gesperrt'(046) TO STATUS_300. ". ELSEIF HEX O 4. ". MOVE 'nicht aktiv'(047) TO STATUS_300. ". ELSEIF HEX O 16. ". MOVE 'fehlerhaft'(048) TO STATUS_300. ". ELSE. ". CLEAR STATUS_300. ". ENDIF. * (6c) Valid destination? * CLEAR RSPOCHECK. MOVE-CORRESPONDING WANTED TO RSPOCHECK. MOVE 'G' TO RSPOCHECK-RQ1DISPO. "Geraeterecht pruefen "archiv-ID ?? " CALL FUNCTION 'RSPO_CHECK_DESTINATION' EXPORTING PRINT_PARAMETER = RSPOCHECK EXCEPTIONS ARCHIVE_DEST_INVALID = 11 ARCHIVE_DEST_NOT_FOUND = 12 ARCHIVE_DEST_NO_RIGHT = 13 DEST_INVALID = 14 DEST_NOT_FOUND = 15 DEST_NO_RIGHT = 16 INVALID_PARAMETERS = 17 OTHERS = 10 . IF SY-SUBRC >< 0. CASE SY-SUBRC. WHEN 10. MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 RAISING INVALID_PARAMETERS. WHEN 11. MESSAGE ID 'PO' TYPE 'E' NUMBER 351 WITH WANTED-RQARCHDEST RAISING ARCHIVE_DEST_INVALID. WHEN 12. MESSAGE ID 'PO' TYPE 'E' NUMBER 351 WITH WANTED-RQARCHDEST RAISING ARCHIVE_DEST_NOT_FOUND. WHEN 13. MESSAGE ID 'PO' TYPE 'E' NUMBER 351 WITH WANTED-RQARCHDEST RAISING ARCHIVE_DEST_NO_RIGHT. WHEN 14. MESSAGE ID 'PO' TYPE 'E' NUMBER 238 WITH WANTED-RQDEST RAISING DEST_INVALID. WHEN 15. MESSAGE ID 'PO' TYPE 'E' NUMBER 238 WITH WANTED-RQDEST RAISING DEST_NOT_FOUND. WHEN 16. MESSAGE ID 'PO' TYPE 'E' NUMBER 352 WITH WANTED-RQDEST RAISING DEST_NO_RIGHT. WHEN 17. MESSAGE ID 'PO' TYPE 'E' NUMBER 231 WITH 0 0 'INVALID_PARAMETERS' 'CD_' RAISING INVALID_PARAMETERS. WHEN OTHERS. MESSAGE ID 'PO' TYPE 'E' NUMBER 231 WITH 0 0 'INTERNAL_PROBLEM' 'OSR' RAISING INTERNAL_PROBLEM. ENDCASE. ENDIF. * (6d) Does the wanted layout match to the output devive? * CALL FUNCTION 'RSPO_TEST_LAYOUT' EXPORTING DEVICE = WANTED-RQDEST LAYOUT = WANTED-RQPAPER IMPORTING ANSWER = ANSWER_300. IF ANSWER_300 = ' '. " Hmmm. Existiert nicht. MESSAGE ID 'PO' TYPE 'E' NUMBER 304 WITH WANTED-RQDEST WANTED-RQPAPER RAISING NO_LAYOUT. ENDIF. * (6e) Changing device to one of different type? * IF ORIG_REQ-RQDEST >< WANTED-RQDEST. " Not the original output device. IF ORIG_REQ-DEVTYPE >< WANTED-DEVTYPE. * Benötigt Attribut-Rechte IF DONT_MOD_DEVTYPE <> ' '. " Keine Berechtigung MESSAGE ID 'PO' TYPE 'E' NUMBER 322 RAISING CHANGE_DEVTYPE_NO_RIGHT. ENDIF. ENDIF. ENDIF. * (7) Does the caller want to override some of the attributes? * (2nd group) * IF TELENUM >< '*' AND TELENUM >< WANTED-RQTELENUM. IF DONT_MOD_RQTELENUM >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 239 RAISING CHANGE_TELENUM_NO_RIGHT. ELSEIF WANTED-IS_FAX_OR_TELETEX = ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 226 WITH WANTED-RQDEST RAISING INVALID_FAX_ATTRIBUTE. ELSE. WANTED-RQTELENUM = TELENUM. ENDIF. ENDIF. IF TELELAN >< '*' AND TELELAN >< WANTED-RQTELELAN. IF DONT_MOD_RQTELELAN >< ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 239 RAISING CHANGE_TELENUM_NO_RIGHT. ELSEIF WANTED-IS_FAX_OR_TELETEX = ' '. MESSAGE ID 'PO' TYPE 'E' NUMBER 226 WITH WANTED-RQDEST RAISING INVALID_FAX_ATTRIBUTE. ELSE. WANTED-RQTELELAN = TELELAN. ENDIF. ENDIF. IF WANTED-IS_FAX_OR_TELETEX <> ' '. IF ORIG_REQ-RQDEST <> WANTED-RQDEST OR ORIG_REQ-RQTELELAN <> WANTED-RQTELELAN OR ORIG_REQ-RQTELENUM <> WANTED-RQTELENUM. CALL FUNCTION 'SK_DEST_TO_NUMBER' EXPORTING COUNTRY = WANTED-RQTELELAN NUMBER = WANTED-RQTELENUM DESTINATION = WANTED-RQDEST SERVICE = 'TELEFAX' "?? EXTERN = 'X' IMPORTING DNUMBER = WANTED-RQTELENUME EXCEPTIONS COUNTRY_NOT_CONFIGURED = 1 SERVER_NOT_FOUND = 2 SERVICE_NOT_SUPPORTED = 3 WRONG_SERVICE_FOR_DEST = 4. CASE SY-SUBRC. WHEN 0. " OK. WHEN 1. MESSAGE ID 'PO' TYPE 'E' NUMBER 261 WITH WANTED-RQTELELAN RAISING INVALID_FAX_ATTRIBUTE. WHEN 2. MESSAGE ID 'PO' TYPE 'E' NUMBER 262 WITH WANTED-RQDEST RAISING INVALID_FAX_ATTRIBUTE. WHEN 3. MESSAGE ID 'PO' TYPE 'E' NUMBER 263 RAISING INVALID_FAX_ATTRIBUTE. WHEN 4. MESSAGE ID 'PO' TYPE 'E' NUMBER 228 WITH WANTED-RQDEST RAISING INVALID_FAX_ATTRIBUTE. ENDCASE. ENDIF. ENDIF. if not posname is initial. wanted-rqposname = posname. endif. * (8) Action ! * IF ARCHIVE = 'X'. "?? Not yet implemented. * -====- Starte Archvierung CALL 'RSPOAEPJ' ID 'ID' FIELD IDENT ID 'DEST' FIELD WANTED-RQDEST ID 'ARCHDEST' FIELD WANTED-RQARCHDEST ID 'ARCHIVE' FIELD 'X' ID 'COPY' FIELD WANTED-RQCOPIES ID 'PRIO' FIELD WANTED-RQPRIO ID 'TITLE' FIELD WANTED-RQTITLE ID 'RECEIVER' FIELD WANTED-RQRECEIVER ID 'DIVISION' FIELD WANTED-RQDIVISION " 'TELENUM' " 'STARTPAGE' " 'ENDPAGE' ID 'RC' FIELD RC ID 'ERRMSG' FIELD ERRMSG. MOVE SY-SUBRC TO STATUS. ELSE. " print or fax * -====- Starte Faxauftrag * -====- Drucken if acttime is initial. CALL 'RSPOAEPJ' ID 'ID' FIELD IDENT ID 'DEST' FIELD WANTED-RQDEST " 'ARCHDEST' " 'ARCHIVE' ID 'COPY' FIELD WANTED-RQCOPIES ID 'PRIO' FIELD WANTED-RQPRIO ID 'TITLE' FIELD WANTED-RQTITLE ID 'RECEIVER' FIELD WANTED-RQRECEIVER ID 'DIVISION' FIELD WANTED-RQDIVISION ID 'TELENUM' FIELD WANTED-RQTELENUME ID 'STARTPAGE' FIELD STARTPAGE ID 'ENDPAGE' FIELD ENDPAGE ID 'POSNAME' field WANTED-RQPOSNAME ID 'ATTRIBUTES' field attributes[] ID 'RC' FIELD RC ID 'ERRMSG' FIELD ERRMSG. MOVE SY-SUBRC TO STATUS. else. CALL 'RSPOAEPJ' ID 'ID' FIELD IDENT ID 'DEST' FIELD WANTED-RQDEST " 'ARCHDEST' " 'ARCHIVE' ID 'COPY' FIELD WANTED-RQCOPIES ID 'PRIO' FIELD WANTED-RQPRIO ID 'TITLE' FIELD WANTED-RQTITLE ID 'RECEIVER' FIELD WANTED-RQRECEIVER ID 'DIVISION' FIELD WANTED-RQDIVISION ID 'TELENUM' FIELD WANTED-RQTELENUME ID 'STARTPAGE' FIELD STARTPAGE ID 'ENDPAGE' FIELD ENDPAGE ID 'POSNAME' field WANTED-RQPOSNAME ID 'ACTTIME' field ACTTIME ID 'ATTRIBUTES' field attributes[] ID 'RC' FIELD RC ID 'ERRMSG' FIELD ERRMSG. MOVE SY-SUBRC TO STATUS. endif. ENDIF. IF STATUS NE 0. ". PERFORM SHOW_RSPO_ERROR_MESSAGE(RSPOSP01) USING 'EPJ' STATUS ". RC ERRMSG. MESSAGE ID 'PO' TYPE 'E' NUMBER 231 WITH STATUS RC ERRMSG 'EPJ' RAISING SPOOLER_PROBLEM. ENDIF. ENDFUNCTION. FORM CHECK_JOB_PERMISSION USING SPOOLREQ LIKE TSP01 ACCESS. CALL FUNCTION 'RSPO_CHECK_JOB_PERMISSION' EXPORTING ACCESS = ACCESS SPOOLREQ = SPOOLREQ EXCEPTIONS NO_PERMISSION = 2 OTHERS = 3. ENDFORM. REPORT RSTXPDF4. * * read OTF spooljob and convert to PDF, write into new spooljob * parameters: spoolno like tsp01-rqident, dstdevic like tsp03-padest. constants: c_pdfcnv_pdfdst_spooljob type c value 'S', c_pdfcnv_otfsrc_spooljob type c value 'S'. data: otf like itcoo occurs 1, pdf like tline occurs 1. data: cur_system_lang like sy-langu, otf_pagecount type i, toolarge, pdf_bytecount type i, arcindex like toa_dara, pdf_spoolid like tsp01-rqident, subrc like sy-subrc, pdf_file type xstring. cur_system_lang = SY-LANGU. * select device for PDF spooljob if dstdevic = space. perform spo_get_defdevice(SAPLSTXW) using dstdevic. endif. * convert to PDF pdf_bytecount = 0. perform pdfcnv_convertotf(SAPLSTXW) tables otf PDF using C_PDFCNV_OTFSRC_SPOOLJOB arcindex 0 spoolno C_PDFCNV_PDFDST_SPOOLJOB dstdevic pdf_spoolid pdf_bytecount pdf_file space. subrc = sy-subrc. set locale language cur_system_lang. IF pdf_bytecount < 0 or subrc <> 0. perform msg_v1(SAPLSTXW) using 'E' 'Fehler bei PDF-Konvertierung von Spoolauftrag $'(003) spoolno. else. perform msg_v1(SAPLSTXW) using 'S' 'Spoolauftrag $ mit PDF-Daten wurde erzeugt'(004) pdf_spoolid. endif. November 19 25.05.2009 Page 1 of 3 SAP Note 193554 - Stock/valuation data of previous periods Note Language: English Version: 5 Validity: Valid Since 29.01.2001 Summary Symptom As of Release 4.5, stock and valuation fields that refer to the previous period or those dating back even farther, are not stored in those tables in which the current stock data is stored (MBEW, MARD, MCHB, and so on) but in so-called history tables (MBEWH, MARDH, MCHBH, and so on.). (Also compare release note for period closing as of Release 4.5) These history tables can have one entry per period. The values of such an entry refer to the end of the period. For the current period, there are no entries in the history tables. An entry is not written in this history table for every period. If stock-relevant or valuation-relevant data change, the system might generate an entry in the history table. Furthermore, the fields LFMON ('Current Period (Booking period)') and LFGJA ('Fiscal Year of the Current Period') in the stock tables are no longer automatically set to the current period by the period closing program. The period is only transferred to the new period during the first movement. At the same time, the relevant history entries are also generated. Example: Material 4711 has a stock of 10 pieces at the end of period 01 In period 02, a goods receipt of 5 pieces occurs. Now, an entry is added in the history table for period 01 with a stock of 10 pieces. Simultaneously, the current stock is increased to 15 pieces and the 'Current Period' field (LFMON) is set to 02. In period 02, an additional goods receipt occurs with 2 pieces. The history table is not affected by this operation since an entry already exists for period 01. The current stock is increased to 17 pieces. In period 04, a goods issue of 4 pieces occurs. Now, the system adds an entry for period 03 with a stock of 17 pieces in the history table. Simultaneously, the current stock is decreased to 13 pieces and the 'Current Period' field (LFMON) is changed from 02 to 04. Since no goods movement has occurred in period 03, there is no entry for period 02 in the history table. Thus, the following applies: 1. The stock in the stock table describes the situation since the last goods movement which changed this segment. The period of this movement appears in the fields LFMON and LFGJA. All stocks for periods which are earlier than the periods given in the fields LFMON and LFGJA relate to the current stocks and can be found in the stock tables. 2. If for a previous period n, no entry exists in the history table, then the values of this period correspond to the values of the period n+1. Since the 2nd rule can be used recursively, under consideration of the two above rules the values can be determined for any periods of that period in which Release 4.5 or a higher release were implemented. Please note: Since the history tables are not created retroactively, the history entries only exist in their completed form from the time from which users work with the new period closing program. The periods for which the period closing program has run for the first time with history records are listed in the table MARV for every company code in the fields GJA_40C and 25.05.2009 Page 2 of 3 SAP Note 193554 - Stock/valuation data of previous periods MON_40C. For technical reasons it is possible that there are also entries in the history tables with an older period. Nevertheless, these entries are not available without gaps for all stocks. This algorithm is also implemented in function modules MBEW_EXTEND, MARD_EXTEND and so on. These function modules are used in the standard SAP programs in order to determine the values of the previous period and to extend tables with the reference structure MBEW, MARD and so on correspondingly. If you have your own programs which use the prior-period values from the tables MARD, MBEW etc., you should call up the relevant EXTEND component after reading the data from the table. This then returns the data as though no change had taken place in the previous logic. You can then remove the prior-period values from the known fields. Additional key words MBEWH, MARDH, MCHBH, stock information, previous period stock, previous month stock Cause and prerequisites The error occurs by new data design of the stock data and the valuation data in the material, batch and special stock tables. Solution See above text. Source code corrections Header Data Release Status: Released for Customer Released on: 06.05.2003 13:57:44 Original Lang.: German Priority: Recommendations/additional info Category: Consulting Main Component: LO-MD-MM Material Master Valid Releases Software Component Release From Release To Release and Subsequent SAP_APPL 45 45A 45B SAP_APPL 46 46A 46B SAP_APPL 46C 46C 46C Related Notes 25.05.2009 Page 3 of 3 SAP Note 193554 - Stock/valuation data of previous periods Number Short Text 550263 SD_VBAK: check for stock of previous period 415349 Usage of modules XXXX_EXTEND for previous period values November 16 abap中的弹出窗口函数 POPUP_TO_CONFIRM_WITH_MESSAGE 会话框确实处理步骤; 用识别正文POPUP_TO_SELECT_MONTH 日历:弹出 POPUP_TO_CONFIRM 标准对话弹出消息 POPUP_TO_CONFIRM_STEP 会话框确实任何处理步骤 (CONFIRM, POPUP) SPO3 用于输入数据的对话框 POPUP_TO_GET_ONE_VALUE Pop-up window, in order to confirm use POPUP_TO_GET_VALUE POPUP for requesting a value 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lhx20/archive/2008/05/15/2447107.aspx
|
|
|
|