Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Wed Oct 29, 2008 5:03 pm Post subject:
Вот такая программка поможет:
Code:
TYPE-POOLS : TPIT.
DATA : WA_BSEG TYPE BSEG,
W_MESSAGE TYPE T100-TEXT.
DATA : IT_ERRTAB TYPE TPIT_T_ERRDOC WITH HEADER LINE,
IT_FLDTAB TYPE TPIT_T_FNAME WITH HEADER LINE,
IT_BUZTAB TYPE TPIT_T_BUZTAB WITH HEADER LINE.
PARAMETERS: PA_BUKRS TYPE BUKRS OBLIGATORY,
PA_BELNR TYPE BELNR_D OBLIGATORY,
PA_GJAHR TYPE GJAHR OBLIGATORY,
PA_BUZEI TYPE BUZEI OBLIGATORY,
PA_ZLSPR TYPE DZLSPR OBLIGATORY.
START-OF-SELECTION.
* Add field to update
IT_FLDTAB-FNAME = 'ZLSPR'.
APPEND IT_FLDTAB.
* Set value
WA_BSEG-ZLSPR = PA_ZLSPR.
* Get item for update
SELECT SINGLE BUKRS BELNR GJAHR BUZEI KOART UMSKZ BSCHL MWART MWSKZ
FROM BSEG
INTO CORRESPONDING FIELDS OF IT_BUZTAB
WHERE BELNR = PA_BELNR
AND BUKRS = PA_BUKRS
AND GJAHR = PA_GJAHR
AND BUZEI = PA_BUZEI.
IF SY-SUBRC = 0.
APPEND IT_BUZTAB.
CLEAR IT_BUZTAB.
ENDIF.
*&---------------------------------------------------------------------*
*& Form generate_message
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM GENERATE_MESSAGE .
CLEAR W_MESSAGE.
READ TABLE IT_ERRTAB INDEX 1.
IF SY-SUBRC = 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_ERRTAB-ERR-MSGID
LANG = SY-LANGU
NO = IT_ERRTAB-ERR-MSGNR
V1 = IT_ERRTAB-ERR-MSGV1
V2 = IT_ERRTAB-ERR-MSGV2
V3 = IT_ERRTAB-ERR-MSGV3
V4 = IT_ERRTAB-ERR-MSGV4
IMPORTING
MSG = W_MESSAGE
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.