In the order, the partner selection dialog box for sales employees displays the wrong names, or the document is incomplete because the address is missing.
Furthermore, error message VP250 'HR master record does not exist' is displayed in sales documents and in the customer master if the sales contact is not authorized to display HR master data.
In addition, the private address and not the business address is displayed in sales documents.
Infotype 0006 in HR has not been maintained or the sales contact is not authorized to display address data of the sales employees. Both cases were not covered by the program.
SolutionProgram change in the following programs:
1. LV05ETOP und LVADRTOP:
TABLES: P0001, T001W. "<-- new line
2. LV05EFAD:
Change WHEN 'PE' branch as follows:
WHEN 'PE'.
PERFORM READ_INFOTYPE(SAPFP50P)
USING VTCOM-PERNR '0001' SPACE SPACE SPACE
SY-DATUM SY-DATUM '1' 'NOP' P0001.
IF SY-SUBRC = 4.
Personalnummer nicht da
IF VTCOM-MSGKZ NE 'U'.
MESSAGE E250 WITH VTCOM-PERNR RAISING NO_PERNR.
ENDIF.
ELSE.
IF T001W-WERKS NE P0001-WERKS.
SELECT SINGLE * FROM T001W WHERE WERKS = P0001-WERKS.
ENDIF.
IF T001W-WERKS = P0001-WERKS.
MOVE-CORRESPONDING T001W TO LKUPAV.
LKUPAV-NAME3 = T001W-NAME1.
LKUPAV-NAME4 = T001W-NAME2.
ENDIF.
LKUPAV-NAME_LIST = P0001-ENAME.
LKUPAV-NAME1 = P0001-ENAME.
* keine Berechtigung zur Anzeige
* RAISE NO_AUTHORIZATION.
ENDIF.
RP-READ-INFOTYPE VTCOM-PERNR 0002 P0002 SY-DATUM SY-DATUM.
LOOP AT P0002.
MOVE-CORRESPONDING P0002 TO LKUPAV.
LKUPAV-SPRAS = P0002-SPRSL.
SELECT SINGLE * FROM T522T WHERE SPRSL = SY-LANGU
AND ANRED = P0002-ANRED.
LKUPAV-ANRED = T522T-ATEXT.
EXIT.
ENDLOOP.
WHEN OTHERS.
IF TPAR-NRART(1) = 'Y' OR TPAR-NRART(1) = 'Z'.
CALL FUNCTION 'RV_PARTNER_EXIT'
3. LVADRU01:
Change WHEN 'PE' branch as follows:
WHEN 'PE'.
PERFORM READ_INFOTYPE(SAPFP50P)
USING VBPA-PERNR '0001' SPACE SPACE SPACE
SY-DATUM SY-DATUM '1' 'NOP' P0001.
IF SY-SUBRC = 4.
IF MESSAGE = 'X'.
* Personalnummer nicht da
MESSAGE E250 WITH VBPA-PERNR.
ENDIF.
ELSE.
IF T001W-WERKS NE P0001-WERKS.
SELECT SINGLE * FROM T001W WHERE WERKS = P0001-WERKS.
ENDIF.
IF T001W-WERKS = P0001-WERKS.
MOVE-CORRESPONDING T001W TO VBADR.
VBADR-NAME3 = T001W-NAME1.
VBADR-NAME4 = T001W-NAME2.
ENDIF.
VBADR-NAME_LIST = P0001-ENAME.
VBADR-NAME1 = P0001-ENAME.
* keine Berechtigung zur Anzeige
* RAISE NO_AUTHORIZATION.
ENDIF.
RP-READ-INFOTYPE VBPA-PERNR 0002 P0002 SY-DATUM SY-DATUM.
* RP-READ-INFOTYPE VTCOM-PERNR 0006 P0006 SY-DATUM SY-DATUM.
LOOP AT P0002.
MOVE-CORRESPONDING P0002 TO VBADR.
VBADR-SPRAS = P0002-SPRSL.
SELECT SINGLE * FROM T522T WHERE SPRSL = SY-LANGU
AND ANRED = P0002-ANRED.
VBADR-ANRED = T522T-ATEXT.
VBADR-PARGE = P0002-GESCH.
EXIT.
ENDLOOP.
ENDCASE.
ENDIF.
SUBRC_PRIVATADRESSE = 0.
No comments:
Post a Comment