Beruflich Dokumente
Kultur Dokumente
While debugging the standard SAP program, we have to decide at which place we would need to write
our own code. There we need to check whether enhancement can be implemented.
Requirement: In Sales Order (VA01 & VA02), we have to pick the Material Description from Custom
Table.
While debugging it is found that the code needs to be written in the
FORM USEREXIT_MOVE_FIELD_TO_VBAP. Now click on Enhance button as shown below.
Now Right click on """"""""""""" and select Enhancement Implementation -> Create.
Select Code.
Now click on Create button in the above screen. Another Screen appears as shown below:
In the above screen, click on Create Composite Implementation and the following Screen appears.
In the below Screen, Select the Enhancement Implementation which we have created now and click
on Continue button.
Now here we can write our own code as shown below:
Code:
IF VBAK-AUART EQ 'ZCO1'.
SELECT SINGLE TENDERID FROM ZBOQ_HEADER INTO VAR_TENDERID WHERE WERKS E
Q VBAP-WERKS AND TYPE EQ '3'.
IF SY-SUBRC NE 0.
ENDIF.
ELSEIF VBAK-AUART EQ 'ZER1'.
SELECT SINGLE TENDERID FROM ZBOQ_HEADER INTO VAR_TENDERID WHERE WERKS E
Q VBAP-WERKS AND TYPE EQ '2'.
IF SY-SUBRC NE 0.
ENDIF.
ENDIF.
SELECT SINGLE MAKTX FROM ZBOQ_ITEM INTO VAR_MAKTX WHERE TENDERID EQ VAR_T
ENDERID.
IF SY-SUBRC NE 0.
ENDIF.
VAR_LENGTH = STRLEN( VAR_MAKTX ).
IF VAR_LENGTH LE 40.
VAR_ARKTX = VAR_MAKTX(VAR_LENGTH).
ELSE.
VAR_ARKTX = VAR_MAKTX(40).
ENDIF.
IF VAR_ARKTX IS NOT INITIAL.
VBAP-ARKTX = VAR_ARKTX.
ENDIF.
ENDIF.
ENDENHANCEMENT.
OUTPUT :