Sunteți pe pagina 1din 7

Business scenario (AS is) In program ZASG1SDI0603001 (Insert Order Progress Information), Various texts are currently being

read and written using functional modules (READ_TEXT & SAVE_TEXT) into SAP. Program is using this functionality for the below purposes. Texts Read or write Z014 Z001 Z021 Z015 Z016 Z015 Z027 Z018 Z022 - Item Number - Shipment Mode Code Allocate B/O Category Confirmation Branch Number Goods Issue Instruction Branch Confirmation Branch Number Max. Branch Number B/O Release Branch Numb Allocate B/O Date Order-Item Order-Header - Order-Item - Order-Item - Delivery-Item - Delivery-Item - Order-Item - elivery-Item Order-Item

Proposed Solution: The same is proposed to be moved to a separate screen (In Additional data area of Sales order and Adding Custom tab into delivery header & item respectively) with respective ZZ fields. A separate screen and structure of ZZ fields will be created for this purpose and appended to sales order header and line item and delivery header and line item, screens and tables (VBAK, VBAP, LIKP or LIPS). Else Add-on tables may be created to store such ZZ fields data in SAP. For Sales Orders, SAP has provided user-exit screens (Screen no. 8309 - Header Level/Screen no. 8459 - Item Level) where we can add the new Z fields. Here the we can maintain the entries (which are presently maintained using Text Ids) and when the document is saved, the entries will get saved into the standard tables (VBAK/VBAP). (To be) These text fields can be replaced by adding user defined fields (for all required Text Ids) to the SAP standard sales order. It can be either at Header level or Item level. As per the requirement, we need to add those fields / table control into the standard SAP screens. So the user entries will be saved into the standard tables upon saving the sales document. For this purpose SAP has provided user-exit screens (Screen no. 8309 - Header Level/Screen no. 8459 - Item Level) where we can add the new fields / table control. Here the end user can make entries and when the document is saved, the entries will get saved into the standard tables (VBAK/VBAP). Since this is a user-exit screen provided by SAP. We need to have the access key to implement the changes.

Appending the structure with required fields to VBAP table Go to SE11 and display the table VBAP. Append a new structure ZZADDVBAP with all the fields need to be added into this standard VBAP table (Here BO Date and Item number Z014 & Z022) and activate the table. New structure will be appended into the table.

Adding the new field/s to the sub screen of the user-exit screen Go to the screen painter and display the sub screen 8459. Display the layout of the screen and add the new field that has to be added.

Finding the Exit Screens from the Program SAPMV45A Go to Transaction SE80, Display the program SAPMV45A (program for sales order). We can see the user-exits screens (sub screen) provided by standard SAP. Here we will see how to add new fields into VBAP (Sales order item table and Sales Order Item additional data B tab). Refer the user-exits provided to add code to handle PBO and PAI of the exit screens.

Adding code (In PBO and PAI Modules) Add one module to set the field attributes in run time at PBO and a module at PAI for the validation. Write code the PBO module (Module filed_attribute) to set the field attribute. For example, in display mode the field should be input disabled. (This will be at include 'MV45AOZZ') Now write the code for validation in the PAI module (Module filed_validate) to set the field validations. For example, if the field is left empty raise an error message. (This will be at include 'MV45AIZZ') (if required) Activate the screen. Now the required new field is added into the user exit screen. So the exit is implemented and activated.

Sample Code Written PBO Code (Setting Field Attributes) *{ INSERT IDSK900063 1 *&---------------------------------------------------------------------* *& Module FIELD_ATTRIBUTE OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* module field_attribute output. if sy-tcode = 'VA03'. loop at screen. if screen-name = 'VBAP-ZZBODATE' or screen-name = 'VBAP-ZZITEM'. screen-input = 0. modify screen. endif. endloop. endif. endmodule. *} INSERT " FIELD_ATTRIBUTE OUTPUT

Testing Go to VA01 create a sales order. Go to Item - More details - Additional data B tab. Enter the newly added counted quantity value. Save the sales order Go SE16N, check the VBAP table entry for the created Order. Refer the detailed display. Go to the change mode (VA02) of the Order. And change the counted quantity, save the document. Check the table entry again. In detailed display the value is updated. In Display Mode (VA03) the field will be disabled.

S-ar putea să vă placă și