Picking material description from custom table in the SAP Sales Order (VA01 and VA02) using enhancement framework

...Previous

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.

Then click on Continue button (Green tick). 

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:

ENHANCEMENT 315  ZSD_EI_BOQDESC.    "active version
*  Modification Done By : Sajid Shaik.
*  Date                 : 08.06.2009
*  Requirement Given by : Avinash Gyale
*  Requirement          : Material Description should be fetched from BOQ based on the Plant and Boq Type 'Erection or Civil'.
*                       : This should work only for Order type ZCO1 - Civil & Order type ZER1 - Erection

  
DATA : VAR_ARKTX    TYPE VBAP-ARKTX,
         VAR_MAKTX    
TYPE ZBOQ_ITEM-MAKTX,
         VAR_TENDERID 
TYPE ZBOQ_ITEM-TENDERID,
         VAR_LENGTH   
TYPE INT4.

IF ( SY-TCODE EQ 'VA01' OR SY-TCODE EQ 'VA02' ) AND ( VBAK-AUART EQ 'ZCO1' OR VBAK-AUART EQ 'ZER1' ) AND VBAP-WERKS IS NOT INITIAL.
  
CLEAR : VAR_ARKTX,VAR_MAKTX,VAR_TENDERID .

  
IF VBAK-AUART EQ 'ZCO1'.
    
SELECT SINGLE TENDERID FROM ZBOQ_HEADER INTO VAR_TENDERID WHERE WERKS EQ 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 EQ 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_TENDERID.
     
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. 

Then Save and Activate it. 

OUTPUT :

Before Enhancement Implementation

After Enhancement Implementation

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image