Help in defaulting a value in a program

I have a program called MV45AZZA, and I got the following requirement
In MV45AFZZ we need to default VBAP-BWTAR = RH while new items are added in transaction VA01 and VA02, if sales org = 5090, order type = ZSBK and MBEW-BWTTY = 1 for the VBAP-MATNR. Once defaulted user should be able to change it to new value in VA01 and VA02, in that case system should not overwrite it with default value.
Sales order functionality needs to be changed to account for Sbank sales updating to repair profit center.
any help in coding is highly appreciated. i know little ABAP and I would appreciate if somebody can help in adding the code.Please highlight the code you added
Please check the Program below.
Thanks
SP
*TABLES: zue003, tvarv.
*DATA: werks LIKE vbap-werks.
Start of DEVK923935.
Global Definition
INCLUDE  zsdi_mv45afzz_top.
      FORM ZZEXAMPLE                                                *
      text......................................                    *
*FORM ZZEXAMPLE.
*ENDFORM.
*eject
      FORM USEREXIT_DELETE_DOCUMENT                                 *
      This userexit can be used to delete data in additional tables *
      when a sales document is deleted.                             *
     This form is called in dialog at the end of form BELEG_LOESCHEN*
     just before form BELEG_SICHERN is performed to delete the      *
     datas on the database.                                         *
FORM userexit_delete_document.
ENDFORM.
*eject
      FORM USEREXIT_FIELD_MODIFICATION                              *
      This userexit can be used to modify the attributes of         *
      screen fields.                                                *
      This form is processed for each field in the screen.          *
      The use of the fields screen-group1 to screen-group4 is:      *
      Screen-group1: Automatic modification contolles by transaction*
                     MFAW.                                          *
      Screen-group2: Contents 'LOO' for steploop-fields.            *
      Screen-group3: Used for modififaction, which are dependent on *
                     control tables or other fix information.       *
      Screen-group4: Unused                                         *
      For field mofifications, which are dependent on the document  *
      status, you can use the status field in the workareas         *
      XVBAP for item status and XVBUK for header status.            *
      This form is called from module FELDAUSWAHL.                  *
FORM userexit_field_modification.
  DATA: zvbtyp LIKE vbfa-vbtyp_n,
        zvbeln LIKE vbfa-vbeln.
CASE SCREEN-GROUP3.
  WHEN '900'.
    IF VBAK-VBTYP NE 'A'.
      SCREEN-ACTIVE = 0.
    ENDIF.
ENDCASE.
CASE SCREEN-NAME.
  WHEN 'VBAK-VBELN'.
    SCREEN-ACTIVE = 0.
ENDCASE.
  IF vbap-pstyv = 'IRLA'.
   CHECK sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
    IF sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
      SELECT SINGLE vbtyp_n INTO zvbtyp FROM vbfa
             WHERE vbelv = xvbap-vbeln AND posnv = vbap-posnr.
     CHECK sy-subrc <> 0.
      IF sy-subrc <> 0.
        CASE screen-group2.
          WHEN 'LOO'.
            IF screen-name = 'VBAP-WERKS'.
              screen-input = 1.
            ENDIF.
        ENDCASE.
      ENDIF.
    ENDIF.
  ENDIF.
Make Reject Reason modifiable when document category is 'RETURNS'
06/10/02  
Modified by Ak for check on subsequent credit memo
This opens up the field - reason for rejection - for change even after
the material has been received into the system on the returns delivery
but before the Returns Credit Memo has been issued.
Changed field to be modified from Reason for Rejection to Item
Category on the line item for which no credit to be given.
select single * from vbfa where vbelv = vbak-vbeln and
                                 vbtyp_n = 'O'.
select a Returns Credit Memo document from VBFA that has NOT been
cancelled. if the selection is successful, credit has been issued and
the field should stay locked. however, if selection is unsuccessful
and since no credit has been issued, the field for item category
must be available for changing, if need be.
check: vbak-vbtyp = 'H'.
  IF vbak-vbtyp = 'H'.
    IF sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
      SELECT SINGLE vbrk~vbeln INTO zvbeln
        FROM vbfa INNER JOIN vbrk ON vbfavbeln = vbrkvbeln
          WHERE vbfavbelv = vbak-vbeln AND vbfaposnv = vbap-posnr
            AND vbfavbtyp_n = 'O' AND vbrkfksto NE 'X'.
      CHECK sy-subrc NE 0.
      CASE screen-group2.
        WHEN 'LOO'.
          IF screen-name = 'VBAP-PSTYV'.
            screen-input = 1.
          ENDIF.
      ENDCASE.
    ENDIF.
  ENDIF.
  INCLUDE zue_sd_0029.
**If no invoice is created then make PSTYV ready for input for item
**category IRIN.
  INCLUDE zue_sd_0031.
ENDFORM.
*eject
      FORM USEREXIT_MOVE_FIELD_TO_VBAK                              *
      This userexit can be used to move some fields into the sales  *
      dokument header workaerea VBAK.                               *
      SVBAK-TABIX = 0:  Create header                               *
      SVBAK-TABIX > 0:  Change header                               *
      This form is called at the end of form VBAK_FUELLEN.          *
FORM userexit_move_field_to_vbak.
vbak-zzfield = xxxx-zzfield2.
**Ernesto EDIT for UE DEMO 10/16/2002
SELECT single * INTO TABLE i_tvarv FROM tvarv WHERE name =
*ZKS_KSEASORG'.
Start of DEVK923935.
Initialization Section
  INCLUDE zsdi_mv45afzz_initialization.
End of DEVK923935.
**{   INSERT         SNDK900075                                        1
Change user exit according to Online Documentation to
copy ship-to info to sale doc header (VBAK)
*CODE BELOW*REPLACED WITH zue_sd_0017***********
IF vbak-kvgr1 IS INITIAL AND
    vbak-kvgr2 IS INITIAL AND
    vbak-kvgr3 IS INITIAL AND
    vbak-kvgr4 IS INITIAL AND
    vbak-kvgr5 IS INITIAL.
   SELECT SINGLE vkgrp vkbur kvgr1 kvgr2 kvgr3 kvgr4 kvgr5
   FROM knvv  INTO (vbak-vkgrp, vbak-vkbur, vbak-kvgr1, vbak-kvgr2,
                                vbak-kvgr3, vbak-kvgr4, vbak-kvgr5)
   WHERE kunnr = kuwev-kunnr AND
         vkorg = vbak-vkorg AND
         vtweg = vbak-vtweg AND
         spart = vbak-spart.
ENDIF.
*CODE ABOVE*REPLACED WITH zue_sd_0017***********
  INCLUDE zue_sd_0017.
*CODE BELOW*REPLACED WITH zue_sd_0017***********
IF svbak-tabix = 0.
   SELECT SINGLE vsbed  FROM knvv INTO vbak-vsbed
*WHERE kunnr = kuwev-kunnr AND
     vkorg = vbak-vkorg AND
     vtweg = vbak-vtweg AND
     spart = vbak-spart.
ENDIF.
*CODE ABOVE*REPLACED WITH zue_sd_0017***********
Start of DEVK915182
**Ernesto EDIT for UE DEMO 10/15/2002.
READ TABLE i_tvarv WITH KEY name = 'ZKS_KSEASORG'.
IF sy-subrc = 0.
   IF vbak-vkorg =  i_tvarv-low.
  IF vbak-vkorg IN i_zsd01_vkorg.
    IF sy-tcode EQ 'VA01'.
      IF sy-dynnr EQ '4021'.
        IF sy-ucomm NE 'SICH'.
          l_pop_type = 'X'.
          INCLUDE zue_sd_0027.
         PERFORM partner_validation USING 'X'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
end-of DEVK915182
Project : KSEA - Sales Force Expansion of 1st Jan 2003
Include for KSEA  Sales Org 5010 only for PopUp Windows " 12/23/2002
  INCLUDE zsd_salesforce_expnsn_hdr." Include 1 of 4
*/ Description        : KSE Modification to remove the billing block for
*/                      returns/credits/debits if sales Org is 5090.
*ORIGINAL CODE
*if vbak-vkorg = '5090' and vbak-vbtyp ca 'HKL'.
*vbak-faksk = ' '.
*endif.
  IF sy-tcode = 'VA01'.
    IF vbak-vkorg IN i_zsd09_vkorg.
      IF vbak-vbtyp IN i_zsd09_vbtyp.
        vbak-faksk = ' '.
      ENDIF.
    ENDIF.
  ENDIF.
BREAK-POINT.
INCLUDE zue_sd_0039.
ENDFORM.
*eject
      FORM USEREXIT_MOVE_FIELD_TO_VBAP                              *
      This userexit can be used to move some fields into the sales  *
      dokument item workaerea VBAP                                  *
      SVBAP-TABIX = 0:  Create item                                 *
      SVBAP-TABIX > 0:  Change item                                 *
      This form is called at the end of form VBAP_FUELLEN.          *
FORM userexit_move_field_to_vbap.
VBAP-zzfield = xxxx-zzfield2.
*{   INSERT         SNDK900164                                        1
Item Category Determination
  DATA: zzbukrs LIKE tvko-bukrs,
        zzmtpos LIKE mvke-mtpos.
  DATA: BEGIN OF zzwerks OCCURS 0,
          werks LIKE marc-werks,
        END OF zzwerks.
  DATA: zdoccat LIKE tvak-vbklt,
        zvmsta LIKE mvke-vmsta,
        zspvbc LIKE tvms-spvbc,
        zvmstb LIKE tvmst-vmstb.
  DATA: z_xvbap LIKE xvbap,
        yp1 LIKE t001k-bwkey,
        z_uepos_bukrs LIKE t001k-bukrs.
  IF i_zsd01_vkorg[] IS INITIAL.
If the initialization was not performed in the Fill VBAK,
reload data
    INCLUDE zsdi_mv45afzz_initialization.
  ENDIF.
  SELECT SINGLE bukrs
    INTO zzbukrs
    FROM tvko
   WHERE vkorg = vbak-vkorg.
  SELECT w~werks
    INTO TABLE zzwerks
    FROM t001w AS w JOIN t001k AS k
      ON wbwkey = kbwkey
   WHERE k~bukrs = zzbukrs.
  SELECT SINGLE mtpos INTO zzmtpos
    FROM mvke
   WHERE matnr = vbap-matnr
     AND vkorg = vbak-vkorg
     AND vtweg = vbak-vtweg.
Export Plant - inport in ZXQSMU07
  EXPORT zz_plant = vbap-werks TO MEMORY ID  'ZZPLANT'.   " KN05
check vbap-pstyv = 'TAN' or vbap-pstyv = 'TANN'.
removed the CHECK statement and replaced by IF-ENDIF.
inserted by arvind r kulkarni for TAN, TANN switching
  IF vbap-pstyv = 'TAN' OR vbap-pstyv = 'TANN'
  OR vbap-pstyv = 'REN'                                     " KN02
  OR vbap-pstyv = 'RENN' .                                  " KN02
    READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
   check sy-subrc ne 0.
    IF sy-subrc NE 0.
      IF vbap-pstyv = 'TAN'.
        vbap-pstyv = 'ZAN'.
      ELSEIF vbap-pstyv = 'REN'.                            " KN02
        vbap-pstyv = 'YREN'.                                " KN02
      ELSEIF vbap-pstyv = 'RENN'.                           " KN02
        vbap-pstyv = 'YRNN'.                                " KN02
      ELSEIF vbap-pstyv = 'TANN'.
        vbap-pstyv = 'ZANN'.
      ENDIF.
    ENDIF.
  ENDIF.
  INCLUDE zue_sd_0014.
Begin insert for check for discontinued material in repair orders
LOGIC: For IRAT item categories, check if the material status field *
       blank or populated.                                          *
       If populated, get the value of the D-Chain specific status   *
       and issue warning/error message with the associated text     *
       from config the D-Chain specific material status.            *
       Included YRAT to this logic (YRAT is free IRAT); 11/22/2002. *
  IF vbap-pstyv = 'IRAT' OR vbap-pstyv = 'YRAT'.
    CLEAR: zvmsta, zvmstb, zspvbc.
    SELECT SINGLE vmsta INTO zvmsta FROM mvke WHERE
            matnr = vbap-matnr AND vkorg = vbak-vkorg
            AND vtweg = vbak-vtweg.
   CHECK: NOT zvmsta IS INITIAL.
    IF NOT zvmsta IS INITIAL.
      SELECT SINGLE spvbc INTO zspvbc FROM tvms WHERE
              vmsta = zvmsta.
      SELECT SINGLE vmstb INTO zvmstb FROM tvmst WHERE
              spras = sy-langu AND vmsta = zvmsta.
      CASE zspvbc.
        WHEN 'A'.
          MESSAGE ID 'V1' TYPE 'W' NUMBER '028' WITH zvmsta zvmstb.
        WHEN 'B'.
          MESSAGE ID 'V1' TYPE 'E' NUMBER '028' WITH zvmsta zvmstb.
      ENDCASE.
    ENDIF.
  ENDIF.
End insert for check for discontinued material in repair orders
  INCLUDE zue_sd_0004.
  INCLUDE zue_sd_0005.
end of DEVK923935.
****************END OF TEST SOURCE CODE******************
Begin Insert to assign material entered for TRADE material
Ak; 11/08/2002.
For trade material, the system will now mandate entry of higher level
item number and based on this, the system will bring in specialty,
material number (into material entered) and profit centre from this
higher level item into the line item for material TRADE.
Added MVGR2 & 3 to pass onto TRADE material; 11/12/2002 - Arvind.
Added material a/c assignment grp to trade-in material.
Added ZTRD item category to this logic.  - Arvind 11/18/2002.
  INCLUDE zzsdprc01.
  INCLUDE zue_sd_0028.
End Insert to assign material entered for TRADE material
********************End of DIP Profile change************************
Get custom group data from MVKE (Sales Data for Material) by Material
when order type is 'RAS' (Repairs/Service)
and populate line item's Additional data A
  INCLUDE zue_sd_0006.
  INCLUDE zue_sd_0001.
include ZUE_SD_0032.
  INCLUDE zue_sd_0002.
Get similar data (as above) from Servicable Material
  INCLUDE zue_sd_0003.
*}   INSERT
Determine Delivery Priority from SH Partner
11/02/2001
  SELECT SINGLE lprio
  FROM knvv
  INTO vbap-lprio
  WHERE kunnr = kuwev-kunnr AND
        vkorg = vbak-vkorg AND
        vtweg = vbak-vtweg AND
        spart = vbak-spart.
Determine Delivery Priority for Order Type RAS
  INCLUDE zsd_check_pstyv_werks.
To re-determine Matwa if the replacement item is changed afterwards
Niranjan 05/10/05 and ECLARKE
INCLUDE zue_sd_0021.
Mod for all sales organizations
Determination of Profit Center
06/24/03
  INCLUDE zue_sd_0007.
End PRCTR Determination for KSI's document
KSI modification
Code to enter the actual part number of the item being repaired,
rather than "REPAIR"
09/18/02  GM
  DATA: intercoflag TYPE c.
  PERFORM zz_determine_cross_comp USING vbak-vkorg
                                        vbap-werks
                                        intercoflag.
  IF intercoflag = 'Y'
    AND
    ( vbap-pstyv = 'IRIN' OR vbap-pstyv = 'ZRIN' ).
    SELECT SINGLE matwa INTO vbap-matwa FROM vbap
    WHERE vbeln = vbap-vbeln AND posnr = vbap-uepos.
    IF sy-subrc NE 0.
      MESSAGE e006(z1) WITH vbap-uepos.
    ENDIF.
  ENDIF.
End material look up modification GM 9/17/02
KSI modification
DP90 Only:
Remove Billing Block from IRIN items and moved them to the header
10/06/02 CNG
11/18/2002     Tr-DEVK917363
Added Sales Orgs 5040 & 5060
KSI modification
06/10/2003   CNG  CN01
If IRIN, clear billing block at item level
  IF sy-tcode = 'DP90'.
  IF vbap-werks = '7000' AND vbak-vkorg = '5010' AND"            SM01-
    vbap-pstyv = 'IRIN'."                                        SM01-
    IF vbap-werks = '7000' AND"                                    SM01+
       ( vbak-vkorg IN i_zsd01_vkorg OR"                    SM01+
         vbak-vkorg = '5040' OR"                                   SM01+
Removed >>
        vbak-vkorg = '5060' )"              SM01+                CN01-
     AND vbap-pstyv = 'IRIN'."              SM01+                CN01-
    vbak-faksk = '02'.
Removed <<
Inserted - check and block for line item IRIN only
         vbak-vkorg = '5060' )."                                   SM01+
      vbak-faksk = '02'.
     IF vbap-pstyv = 'IRIN'."                                      CN01+
        CLEAR vbap-faksp.
Inserted - check and block for line item IRIN only
      ENDIF.
    ENDIF.
  ENDIF.
KSI modification
Routine to populate VBAP-ZZEDATU and VBAP-ZZVDATU on change and
creation of order
02/10/03 CNG
  PERFORM check_custom_dates.
KSE Modification to create return item automatically**
Copied from Niranjan's routine tested in SND210  Date 04/05/03
  INCLUDE zue_sd_0008.
User Exit for Service Processing - Clear Results
Analysis Key in sales order item for non-KSE service
items.  DEVK927084       W. Miller 05/12/2003
Changed to validate by plant instead of sales org.
06/30/03    BEGIN>>>
if not vbak-vkorg = '5090' and vbap-bedae = 'SE'.
*Added 5000 for  KSEM Prjct 02-09-2006 EC
  IF NOT ( vbap-werks = '9000' OR vbap-werks = '5000' )
  AND ( vbap-bedae = 'SE' OR VBAP-BEDAE = 'SERA' ).
06/30/03    END  <<<<
    CLEAR vbap-abgrs.
  ENDIF.
End of DEVK924084
*/ Author             :  w/ Trimb.
*/ Date               : 10/07/2003   ---> Repair No : DEVK930002
*/ Description        : KSE Modification For plant 9000, to check the
*/                      material is 'Non-R' for RAS order type
*/                      and is 'R' for ZREX and ZWAR order types.
*Added lines below for -  There is a user exit which exists that does
*not allow materials that do not begin with an "R" to be posted into
*plant 9000 if they are attached to a ZWAR order type.  KSE/KSEA would
*like to modify this exit to allow materials with profit centers
*5090-03003 and 5090-04003 to be posted.
*ECLARKE/Niranjan 07-29-2004
*________________________n 07-29-2004__________________
  DATA: flag_dexe.
  TABLES: zzue027.
  CLEAR: flag_dexe.
  SELECT SINGLE werks auart prctr INTO (zzue027-werks, zzue027-auart,
  zzue027-prctr) FROM zzue027 WHERE werks = vbap-werks AND auart =
  vbak-auart AND prctr = vbap-prctr.
  IF sy-subrc = 0.
    flag_dexe = 'X'.
  ENDIF.
*________________________ 07-29-2004__________________
  IF flag_dexe IS INITIAL. " 07-29-2004
    IF vbap-werks IN i_zsd09_werks.
   IF ( vbak-auart IN i_zsd02_auart AND vbap-pstyv IN i_zsd04_pstyv AND
             vbap-matwa(1) = 'R' ) OR ( vbak-auart IN i_zsd02_auart AND
                  vbap-pstyv IN i_zsd03_pstyv AND vbap-matnr(1) = 'R' ).
        IF vbap-matwa(1) = 'R'.
          MESSAGE e001(zkse) WITH vbap-matwa vbap-posnr vbak-auart
            vbap-pstyv.
        ENDIF.
        IF vbap-matnr(1) = 'R'.
          MESSAGE e001(zkse) WITH vbap-matnr vbap-posnr vbak-auart
          vbap-pstyv.
        ENDIF.
      ELSEIF ( vbak-auart IN i_zsd03_auart AND vbap-pstyv IN
  i_zsd04_pstyv AND vbap-matwa(1) <> 'R' ) OR ( vbak-auart IN
i_zsd03_auart AND vbap-pstyv IN i_zsd03_pstyv AND vbap-matnr(1) <> 'R' )
  OR ( vbak-auart IN i_zsd04_auart AND vbap-pstyv IN i_zsd04_pstyv AND
vbap-matwa(1) <> 'R' ) OR ( vbak-auart IN i_zsd04_auart AND vbap-pstyv
  IN i_zsd03_pstyv AND vbap-matnr(1) <> 'R' ).
        IF vbap-matwa(1) <> 'R'.
          MESSAGE e001(zkse) WITH vbap-matwa vbap-posnr vbak-auart
          vbap-pstyv.
        ENDIF.
        IF vbap-matnr(1) <> 'R'.
          MESSAGE e001(zkse) WITH vbap-matnr vbap-posnr vbak-auart
          vbap-pstyv.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
  INCLUDE zue_sd_0015.
include zue_sd_0019
Enhancement to populate Storage Location for sales order 5090
and plant 9000. But any companies can use it as long as entries are
maintained in table zsd_default_sloc
Niranjan  02/11/04
DEVK933987 - MV45AFZZ - MPitisci 4/12/2004
   DEVK933989 - ZUE_SD_0019  include
   DEVK933998 - ZSD_DEFAULT_SLOC table
  INCLUDE zue_sd_0019.
To give hard error for D-CHin status 07 for items catgories other
than trade.
04/10/05
  INCLUDE zue_sd_0034.
Checks if the storage location value is changed and checks to see if
the storage location correlates to the P3 Partner function rules
08/05/2005
  INCLUDE zue_sd_0036.
  INCLUDE zue_sd_0013.
ENDFORM.
*eject
      FORM USEREXIT_MOVE_FIELD_TO_VBEP                              *
      This userexit can be used to move some fields into the sales  *
      dokument schedule line workaerea VBEP                         *
      SVBEP-TABIX = 0:  Create schedule line                        *
      SVBEP-TABIX > 0:  Change schedule line                        *
      This form is called at the end of form VBEP_FUELLEN.          *
FORM userexit_move_field_to_vbep.
  DATA: intercoflag TYPE c.
VBEP-zzfield = xxxx-zzfield2.
Assign 'ZP' to Schedule line Category for Acct Assignment Grp =
Chui 10/23/2001
  DATA: zzbukrs LIKE tvko-bukrs,
        zzmtpos LIKE mvke-mtpos.
  DATA: z_vbelv LIKE vbfa-vbelv,"                                KN03
        z_auart LIKE vbak-auart,"                                KN03
        z_vbtyp LIKE vbak-vbtyp,"                                KN03
        z_ettyp LIKE vbep-ettyp,"                                KN03
        z_pstyv LIKE vbap-pstyv,"                                KN04
        z_posnr LIKE vbap-posnr."                                KN04
  DATA: BEGIN OF zzwerks OCCURS 0,
          werks LIKE marc-werks,
        END OF zzwerks.
  IF vbak-vbtyp CN 'AB'. "ECLARKE 01-26-04
    SELECT SINGLE bukrs
      INTO zzbukrs
      FROM tvko
     WHERE vkorg = vbak-vkorg.
    SELECT w~werks
      INTO TABLE zzwerks
      FROM t001w AS w JOIN t001k AS k
        ON wbwkey = kbwkey
     WHERE k~bukrs = zzbukrs.
    SELECT SINGLE mtpos INTO zzmtpos
      FROM mvke
     WHERE matnr = vbap-matnr
       AND vkorg = vbak-vkorg
       AND vtweg = vbak-vtweg.
*lines added for valuated customer-returns project by msn
110903. It will set required schedule line category YR on specific
item categories if the document created is of type RE with reference
document being an invoice of type F2
*ECLARKE & MILIND NAND. 11-11-2003.
*Schedule Line Category - Valuate Customer Returns Stock
INCLUDE zue_sd_0010.
    CASE vbap-pstyv.
      WHEN  'ZRPN'.
        EXIT.
      WHEN 'TAN' OR 'TANN'.
        IF vbkd-ktgrd = '01'.            " Added 6/5/02
          IF vbep-ettyp = 'CN'.
            vbep-ettyp = 'ZA'.
          ELSE.
            vbep-ettyp = 'ZP'.
          ENDIF.
        ENDIF.
**Ernesto EDIT for UE DEMO 10/15/2002
***************TEST FUNCTION MODULE FOR USER EXIT MAINT.******
**ADDED  A CASE STATEMENT BELOW.
CALL FUNCTION 'Z_UE_SD_GET_SCHEDULE_LINE_CAT'
      EXPORTING
           pstyv  = vbap-pstyv
           ktgrd  = vbkd-ktgrd
           ettyp2 = vbep-ettyp
      IMPORTING
           ettyp  = vbep-ettyp.
****************END OF TEST SOURCE CODE******************
        READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
     check sy-subrc ne 0.
        IF sy-subrc NE 0.
Change inserted by Arvind R Kulkarni; 07/22/2002
TAN -> ZAN; TANN => ZANN
       vbap-pstyv = 'ZAN'.
          IF vbap-pstyv = 'TAN'.
            vbap-pstyv = 'ZAN'.
          ELSEIF vbap-pstyv = 'TANN'.
            vbap-pstyv = 'ZANN'.
          ENDIF.
end of change
        ENDIF.
*ADDED CASE HERE FOR TEST FOR SYNTAX CHECK 10/15/2002
*CASE vbap-pstyv.
      WHEN 'ZAN'.
        READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
        CHECK sy-subrc EQ 0.
        vbap-pstyv = 'TAN'.
      WHEN 'ZANN'.
        READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
        CHECK sy-subrc EQ 0.
        vbap-pstyv = 'TANN'.
      WHEN 'ZTAN'.
        IF vbkd-ktgrd = '01'.            " Added 6/5/02
          IF vbep-ettyp = 'CN'.
            vbep-ettyp = 'ZA'.
          ELSE.
            vbep-ettyp = 'ZP'.
          ENDIF.
        ENDIF.
        READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
     check sy-subrc ne 0.
        IF sy-subrc NE 0.
          IF vbep-ettyp = 'CN'.
            vbep-ettyp = 'ZA'.
          ELSE.
            vbep-ettyp = 'ZP'.
          ENDIF.
        ENDIF.
03/23/2005 KN03 Set Schedule Line default to ZF order type ZFD,
item cat ZTAN, sales org 5060, 5070, and 5071
        IF vbak-auart EQ 'ZFD' AND
        ( vbak-vkorg = '5060' OR vbak-vkorg = '5070'
         OR vbak-vkorg = '5071' ).
          vbep-ettyp = 'ZF'.
        ENDIF.
Begin of insertion for IRAT processing
Arvind R Kulkarni; Dated: 07/17/2002.
Changed to include YRAT; ; 11/22/2002
      WHEN 'IRAT' OR 'YRAT'.
        IF vbak-auart NE 'ZWAR'.
the sales order is NOT a ZWAR
          READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
          IF sy-subrc NE 0.
the transaction IS intercompany
            IF vbep-ettyp = 'CN'.
              vbep-ettyp = 'YN'.
            ELSE.
              vbep-ettyp = 'YL'.
            ENDIF.
          ELSE.
the transaction IS NOT intercompany
            IF vbep-ettyp = 'CN'.
              vbep-ettyp = 'ZN'.
            ELSE.
              vbep-ettyp = 'ZL'.
            ENDIF.
          ENDIF.
          IF vbkd-ktgrd = '01'.
sale is to an affiliate in local sales org
            IF vbep-ettyp = 'CN'.
              vbep-ettyp = 'YN'.
            ELSE.
              vbep-ettyp = 'YL'.
            ENDIF.
          ENDIF.
        ELSE.
the sales order IS a ZWAR
          READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
          IF sy-subrc NE 0.
the transaction IS intercompany
            IF vbep-ettyp = 'CN'.
              vbep-ettyp = 'ZA'.
            ELSE.
              vbep-ettyp = 'ZP'.
            ENDIF.
     ELSE.
the transaction IS NOT intercompany
NOTHING NEEDS TO BE DONE FOR ZWAR DOMESTIC
STD SCHED LINE CATEGORIES TO BE MAINTAINED.
       IF VBEP-ETTYP = 'CN'.
         VBEP-ETTYP = 'ZN'.
       ELSE.
         VBEP-ETTYP = 'ZL'.
       ENDIF.
     ENDIF.
     IF VBKD-KTGRD = '01'.
sale is to an affiliate in local sales org
            IF vbep-ettyp = 'CN'.
              vbep-ettyp = 'ZA'.
            ELSE.
              vbep-ettyp = 'ZP'.
            ENDIF.
          ENDIF.
        ENDIF.
End of insertion for IRAT processing
      WHEN 'IRRS' OR 'IRRE' OR 'IRLA' OR 'IRLB' OR 'KBN' OR 'TAQ'
KSI Modification    04/22/03
Exclude check for item category 'YKW'
        OR 'YTAN' OR 'ZKLN' OR 'KAN'  OR 'ZTAQ'
        OR 'YKW' OR 'IRRP'  OR 'ZKBC' OR 'ZKBN' OR 'ZKAN' OR 'KLN'.
      or  'ZKEN' OR 'ZKEC' or ZREK OR 'KEN'.
        EXIT.
      WHEN 'ZTR1' OR 'ZRBB' OR 'ZREB' OR 'ZREC' OR 'ZREF' OR 'ZREN'
Removed ZRTN to validate plant 9000
        OR 'ZRFF' OR 'ZRNB' OR 'ZRNN' OR 'REN' OR 'RENN'
        OR 'ZLN' OR 'IRAL' OR 'ZTR0' OR 'KLN'.
        EXIT.
03/23/2005 KN03 set default sched line for KE & ZKE
      WHEN 'KEN' OR 'ZKEG' OR 'ZKEN' OR 'ZKEC'.
        IF vbak-vkorg EQ '5070'.
          vbep-ettyp = 'Z0'.
        ENDIF.
      WHEN 'ZREK'.
        INCLUDE zue_sd_0033.
        IF vbap-werks = '9000'.                    " KN04
          IF vbkd-ktgrd = '01'.                    " KN04
            IF  z_auart = 'ZFD ' and z_pstyv = 'KLN '.    " KN04
              vbep-ettyp = 'YK'.                   " KN04
            ENDIF.
          ENDIF.
        ENDIF.
KSE Modification    04/10/03
For Item Cate 'ZRTN'
Assign 'YQ' to Schedule line cat, if cross-company
'YU' if not.
      WHEN 'ZRTN'.

Hi,
Step 1) Create a include ZSD_DEFAULT_BWTAR and add the following code
DATA: S_MBEW TYPE MBEW.
Check for create and change.
IF T180-TRTYP = 'H' OR T180-TRTYP = 'V'.
IF VBAK-VKORG = '5090' AND VBAK-AUART = 'ZSBK'.
SELECT SINGLE * FROM MBEW
INTO S_MBEW
WHERE MATNR = VBAP-MATNR
AND BWKEY = VBAP-WERKS.
IF SY-SUBRC = 0 AND S_MBEW-BWTTY = '1'.
Check if it is for line item creation.
WHen the changes the value this will not trigger.
IF SVBAP-TABIX = 0.
VBAP-BWTAR = 'RH'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
STEP 2)
Add the include to the subroutine USEREXIT_FIELD_TO_VBAP. The include statement is marked in bold.
*TABLES: zue003, tvarv.
*DATA: werks LIKE vbap-werks.
Start of DEVK923935.
Global Definition
INCLUDE zsdi_mv45afzz_top.
FORM ZZEXAMPLE *
text...................................... *
*FORM ZZEXAMPLE.
*ENDFORM.
*eject
FORM USEREXIT_DELETE_DOCUMENT *
This userexit can be used to delete data in additional tables *
when a sales document is deleted. *
This form is called in dialog at the end of form BELEG_LOESCHEN*
just before form BELEG_SICHERN is performed to delete the *
datas on the database. *
FORM userexit_delete_document.
ENDFORM.
*eject
FORM USEREXIT_FIELD_MODIFICATION *
This userexit can be used to modify the attributes of *
screen fields. *
This form is processed for each field in the screen. *
The use of the fields screen-group1 to screen-group4 is: *
Screen-group1: Automatic modification contolles by transaction*
MFAW. *
Screen-group2: Contents 'LOO' for steploop-fields. *
Screen-group3: Used for modififaction, which are dependent on *
control tables or other fix information. *
Screen-group4: Unused *
For field mofifications, which are dependent on the document *
status, you can use the status field in the workareas *
XVBAP for item status and XVBUK for header status. *
This form is called from module FELDAUSWAHL. *
FORM userexit_field_modification.
DATA: zvbtyp LIKE vbfa-vbtyp_n,
zvbeln LIKE vbfa-vbeln.
CASE SCREEN-GROUP3.
WHEN '900'.
IF VBAK-VBTYP NE 'A'.
SCREEN-ACTIVE = 0.
ENDIF.
ENDCASE.
CASE SCREEN-NAME.
WHEN 'VBAK-VBELN'.
SCREEN-ACTIVE = 0.
ENDCASE.
IF vbap-pstyv = 'IRLA'.
CHECK sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
IF sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
SELECT SINGLE vbtyp_n INTO zvbtyp FROM vbfa
WHERE vbelv = xvbap-vbeln AND posnv = vbap-posnr.
CHECK sy-subrc <> 0.
IF sy-subrc <> 0.
CASE screen-group2.
WHEN 'LOO'.
IF screen-name = 'VBAP-WERKS'.
screen-input = 1.
ENDIF.
ENDCASE.
ENDIF.
ENDIF.
ENDIF.
Make Reject Reason modifiable when document category is 'RETURNS'
06/10/02
Modified by Ak for check on subsequent credit memo
This opens up the field - reason for rejection - for change even after
the material has been received into the system on the returns delivery
but before the Returns Credit Memo has been issued.
Changed field to be modified from Reason for Rejection to Item
Category on the line item for which no credit to be given.
select single * from vbfa where vbelv = vbak-vbeln and
vbtyp_n = 'O'.
select a Returns Credit Memo document from VBFA that has NOT been
cancelled. if the selection is successful, credit has been issued and
the field should stay locked. however, if selection is unsuccessful
and since no credit has been issued, the field for item category
must be available for changing, if need be.
check: vbak-vbtyp = 'H'.
IF vbak-vbtyp = 'H'.
IF sy-tcode = 'VA01' OR sy-tcode = 'VA02'.
SELECT SINGLE vbrk~vbeln INTO zvbeln
FROM vbfa INNER JOIN vbrk ON vbfavbeln = vbrkvbeln
WHERE vbfavbelv = vbak-vbeln AND vbfaposnv = vbap-posnr
AND vbfavbtyp_n = 'O' AND vbrkfksto NE 'X'.
CHECK sy-subrc NE 0.
CASE screen-group2.
WHEN 'LOO'.
IF screen-name = 'VBAP-PSTYV'.
screen-input = 1.
ENDIF.
ENDCASE.
ENDIF.
ENDIF.
INCLUDE zue_sd_0029.
**If no invoice is created then make PSTYV ready for input for item
**category IRIN.
INCLUDE zue_sd_0031.
ENDFORM.
*eject
FORM USEREXIT_MOVE_FIELD_TO_VBAK *
This userexit can be used to move some fields into the sales *
dokument header workaerea VBAK. *
SVBAK-TABIX = 0: Create header *
SVBAK-TABIX > 0: Change header *
This form is called at the end of form VBAK_FUELLEN. *
FORM userexit_move_field_to_vbak.
vbak-zzfield = xxxx-zzfield2.
**Ernesto EDIT for UE DEMO 10/16/2002
SELECT single * INTO TABLE i_tvarv FROM tvarv WHERE name =
*ZKS_KSEASORG'.
Start of DEVK923935.
Initialization Section
INCLUDE zsdi_mv45afzz_initialization.
End of DEVK923935.
**{ INSERT SNDK900075 1
Change user exit according to Online Documentation to
copy ship-to info to sale doc header (VBAK)
*CODE BELOW*REPLACED WITH zue_sd_0017***********
IF vbak-kvgr1 IS INITIAL AND
vbak-kvgr2 IS INITIAL AND
vbak-kvgr3 IS INITIAL AND
vbak-kvgr4 IS INITIAL AND
vbak-kvgr5 IS INITIAL.
SELECT SINGLE vkgrp vkbur kvgr1 kvgr2 kvgr3 kvgr4 kvgr5
FROM knvv INTO (vbak-vkgrp, vbak-vkbur, vbak-kvgr1, vbak-kvgr2,
vbak-kvgr3, vbak-kvgr4, vbak-kvgr5)
WHERE kunnr = kuwev-kunnr AND
vkorg = vbak-vkorg AND
vtweg = vbak-vtweg AND
spart = vbak-spart.
ENDIF.
*CODE ABOVE*REPLACED WITH zue_sd_0017***********
INCLUDE zue_sd_0017.
*CODE BELOW*REPLACED WITH zue_sd_0017***********
IF svbak-tabix = 0.
SELECT SINGLE vsbed FROM knvv INTO vbak-vsbed
*WHERE kunnr = kuwev-kunnr AND
vkorg = vbak-vkorg AND
vtweg = vbak-vtweg AND
spart = vbak-spart.
ENDIF.
*CODE ABOVE*REPLACED WITH zue_sd_0017***********
Start of DEVK915182
**Ernesto EDIT for UE DEMO 10/15/2002.
READ TABLE i_tvarv WITH KEY name = 'ZKS_KSEASORG'.
IF sy-subrc = 0.
IF vbak-vkorg = i_tvarv-low.
IF vbak-vkorg IN i_zsd01_vkorg.
IF sy-tcode EQ 'VA01'.
IF sy-dynnr EQ '4021'.
IF sy-ucomm NE 'SICH'.
l_pop_type = 'X'.
INCLUDE zue_sd_0027.
PERFORM partner_validation USING 'X'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
end-of DEVK915182
Project : KSEA - Sales Force Expansion of 1st Jan 2003
Include for KSEA Sales Org 5010 only for PopUp Windows " 12/23/2002
INCLUDE zsd_salesforce_expnsn_hdr." Include 1 of 4
*/ Description : KSE Modification to remove the billing block for
*/ returns/credits/debits if sales Org is 5090.
*ORIGINAL CODE
*if vbak-vkorg = '5090' and vbak-vbtyp ca 'HKL'.
*vbak-faksk = ' '.
*endif.
IF sy-tcode = 'VA01'.
IF vbak-vkorg IN i_zsd09_vkorg.
IF vbak-vbtyp IN i_zsd09_vbtyp.
vbak-faksk = ' '.
ENDIF.
ENDIF.
ENDIF.
BREAK-POINT.
INCLUDE zue_sd_0039.
ENDFORM.
*eject
FORM USEREXIT_MOVE_FIELD_TO_VBAP *
This userexit can be used to move some fields into the sales *
dokument item workaerea VBAP *
SVBAP-TABIX = 0: Create item *
SVBAP-TABIX > 0: Change item *
This form is called at the end of form VBAP_FUELLEN. *
FORM userexit_move_field_to_vbap.
VBAP-zzfield = xxxx-zzfield2.
*{ INSERT SNDK900164 1
Item Category Determination
DATA: zzbukrs LIKE tvko-bukrs,
zzmtpos LIKE mvke-mtpos.
DATA: BEGIN OF zzwerks OCCURS 0,
werks LIKE marc-werks,
END OF zzwerks.
DATA: zdoccat LIKE tvak-vbklt,
zvmsta LIKE mvke-vmsta,
zspvbc LIKE tvms-spvbc,
zvmstb LIKE tvmst-vmstb.
DATA: z_xvbap LIKE xvbap,
yp1 LIKE t001k-bwkey,
z_uepos_bukrs LIKE t001k-bukrs.
IF i_zsd01_vkorg[] IS INITIAL.
If the initialization was not performed in the Fill VBAK,
reload data
INCLUDE zsdi_mv45afzz_initialization.
ENDIF.
SELECT SINGLE bukrs
INTO zzbukrs
FROM tvko
WHERE vkorg = vbak-vkorg.
SELECT w~werks
INTO TABLE zzwerks
FROM t001w AS w JOIN t001k AS k
ON wbwkey = kbwkey
WHERE k~bukrs = zzbukrs.
SELECT SINGLE mtpos INTO zzmtpos
FROM mvke
WHERE matnr = vbap-matnr
AND vkorg = vbak-vkorg
AND vtweg = vbak-vtweg.
Export Plant - inport in ZXQSMU07
EXPORT zz_plant = vbap-werks TO MEMORY ID 'ZZPLANT'. " KN05
check vbap-pstyv = 'TAN' or vbap-pstyv = 'TANN'.
removed the CHECK statement and replaced by IF-ENDIF.
inserted by arvind r kulkarni for TAN, TANN switching
IF vbap-pstyv = 'TAN' OR vbap-pstyv = 'TANN'
OR vbap-pstyv = 'REN' " KN02
OR vbap-pstyv = 'RENN' . " KN02
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
check sy-subrc ne 0.
IF sy-subrc NE 0.
IF vbap-pstyv = 'TAN'.
vbap-pstyv = 'ZAN'.
ELSEIF vbap-pstyv = 'REN'. " KN02
vbap-pstyv = 'YREN'. " KN02
ELSEIF vbap-pstyv = 'RENN'. " KN02
vbap-pstyv = 'YRNN'. " KN02
ELSEIF vbap-pstyv = 'TANN'.
vbap-pstyv = 'ZANN'.
ENDIF.
ENDIF.
ENDIF.
INCLUDE zue_sd_0014.
Begin insert for check for discontinued material in repair orders
LOGIC: For IRAT item categories, check if the material status field *
blank or populated. *
If populated, get the value of the D-Chain specific status *
and issue warning/error message with the associated text *
from config the D-Chain specific material status. *
Included YRAT to this logic (YRAT is free IRAT); 11/22/2002. *
IF vbap-pstyv = 'IRAT' OR vbap-pstyv = 'YRAT'.
CLEAR: zvmsta, zvmstb, zspvbc.
SELECT SINGLE vmsta INTO zvmsta FROM mvke WHERE
matnr = vbap-matnr AND vkorg = vbak-vkorg
AND vtweg = vbak-vtweg.
CHECK: NOT zvmsta IS INITIAL.
IF NOT zvmsta IS INITIAL.
SELECT SINGLE spvbc INTO zspvbc FROM tvms WHERE
vmsta = zvmsta.
SELECT SINGLE vmstb INTO zvmstb FROM tvmst WHERE
spras = sy-langu AND vmsta = zvmsta.
CASE zspvbc.
WHEN 'A'.
MESSAGE ID 'V1' TYPE 'W' NUMBER '028' WITH zvmsta zvmstb.
WHEN 'B'.
MESSAGE ID 'V1' TYPE 'E' NUMBER '028' WITH zvmsta zvmstb.
ENDCASE.
ENDIF.
ENDIF.
End insert for check for discontinued material in repair orders
INCLUDE zue_sd_0004.
INCLUDE zue_sd_0005.
end of DEVK923935.
****************END OF TEST SOURCE CODE******************
Begin Insert to assign material entered for TRADE material
Ak; 11/08/2002.
For trade material, the system will now mandate entry of higher level
item number and based on this, the system will bring in specialty,
material number (into material entered) and profit centre from this
higher level item into the line item for material TRADE.
Added MVGR2 & 3 to pass onto TRADE material; 11/12/2002 - Arvind.
Added material a/c assignment grp to trade-in material.
Added ZTRD item category to this logic. - Arvind 11/18/2002.
INCLUDE zzsdprc01.
INCLUDE zue_sd_0028.
End Insert to assign material entered for TRADE material
********************End of DIP Profile change************************
Get custom group data from MVKE (Sales Data for Material) by Material
when order type is 'RAS' (Repairs/Service)
and populate line item's Additional data A
INCLUDE zue_sd_0006.
INCLUDE zue_sd_0001.
include ZUE_SD_0032.
INCLUDE zue_sd_0002.
Get similar data (as above) from Servicable Material
INCLUDE zue_sd_0003.
*} INSERT
Determine Delivery Priority from SH Partner
11/02/2001
SELECT SINGLE lprio
FROM knvv
INTO vbap-lprio
WHERE kunnr = kuwev-kunnr AND
vkorg = vbak-vkorg AND
vtweg = vbak-vtweg AND
spart = vbak-spart.
Determine Delivery Priority for Order Type RAS
INCLUDE zsd_check_pstyv_werks.
To re-determine Matwa if the replacement item is changed afterwards
Niranjan 05/10/05 and ECLARKE
INCLUDE zue_sd_0021.
Mod for all sales organizations
Determination of Profit Center
06/24/03
INCLUDE zue_sd_0007.
End PRCTR Determination for KSI's document
KSI modification
Code to enter the actual part number of the item being repaired,
rather than "REPAIR"
09/18/02 GM
DATA: intercoflag TYPE c.
PERFORM zz_determine_cross_comp USING vbak-vkorg
vbap-werks
intercoflag.
IF intercoflag = 'Y'
AND
( vbap-pstyv = 'IRIN' OR vbap-pstyv = 'ZRIN' ).
SELECT SINGLE matwa INTO vbap-matwa FROM vbap
WHERE vbeln = vbap-vbeln AND posnr = vbap-uepos.
IF sy-subrc NE 0.
MESSAGE e006(z1) WITH vbap-uepos.
ENDIF.
ENDIF.
End material look up modification GM 9/17/02
KSI modification
DP90 Only:
Remove Billing Block from IRIN items and moved them to the header
10/06/02 CNG
11/18/2002 Tr-DEVK917363
Added Sales Orgs 5040 & 5060
KSI modification
06/10/2003 CNG CN01
If IRIN, clear billing block at item level
IF sy-tcode = 'DP90'.
IF vbap-werks = '7000' AND vbak-vkorg = '5010' AND" SM01-
vbap-pstyv = 'IRIN'." SM01-
IF vbap-werks = '7000' AND" SM01+
( vbak-vkorg IN i_zsd01_vkorg OR" SM01+
vbak-vkorg = '5040' OR" SM01+
Removed >>
vbak-vkorg = '5060' )" SM01+ CN01-
AND vbap-pstyv = 'IRIN'." SM01+ CN01-
vbak-faksk = '02'.
Removed <<
Inserted - check and block for line item IRIN only
vbak-vkorg = '5060' )." SM01+
vbak-faksk = '02'.
IF vbap-pstyv = 'IRIN'." CN01+
CLEAR vbap-faksp.
Inserted - check and block for line item IRIN only
ENDIF.
ENDIF.
ENDIF.
KSI modification
Routine to populate VBAP-ZZEDATU and VBAP-ZZVDATU on change and
creation of order
02/10/03 CNG
PERFORM check_custom_dates.
KSE Modification to create return item automatically**
Copied from Niranjan's routine tested in SND210 Date 04/05/03
INCLUDE zue_sd_0008.
User Exit for Service Processing - Clear Results
Analysis Key in sales order item for non-KSE service
items. DEVK927084 W. Miller 05/12/2003
Changed to validate by plant instead of sales org.
06/30/03 BEGIN>>>
if not vbak-vkorg = '5090' and vbap-bedae = 'SE'.
*Added 5000 for KSEM Prjct 02-09-2006 EC
IF NOT ( vbap-werks = '9000' OR vbap-werks = '5000' )
AND ( vbap-bedae = 'SE' OR VBAP-BEDAE = 'SERA' ).
06/30/03 END <<<<
CLEAR vbap-abgrs.
ENDIF.
End of DEVK924084
*/ Author : w/ Trimb.
*/ Date : 10/07/2003 ---> Repair No : DEVK930002
*/ Description : KSE Modification For plant 9000, to check the
*/ material is 'Non-R' for RAS order type
*/ and is 'R' for ZREX and ZWAR order types.
*Added lines below for - There is a user exit which exists that does
*not allow materials that do not begin with an "R" to be posted into
*plant 9000 if they are attached to a ZWAR order type. KSE/KSEA would
*like to modify this exit to allow materials with profit centers
*5090-03003 and 5090-04003 to be posted.
*ECLARKE/Niranjan 07-29-2004
*________________________n 07-29-2004__________________
DATA: flag_dexe.
TABLES: zzue027.
CLEAR: flag_dexe.
SELECT SINGLE werks auart prctr INTO (zzue027-werks, zzue027-auart,
zzue027-prctr) FROM zzue027 WHERE werks = vbap-werks AND auart =
vbak-auart AND prctr = vbap-prctr.
IF sy-subrc = 0.
flag_dexe = 'X'.
ENDIF.
*________________________ 07-29-2004__________________
IF flag_dexe IS INITIAL. " 07-29-2004
IF vbap-werks IN i_zsd09_werks.
IF ( vbak-auart IN i_zsd02_auart AND vbap-pstyv IN i_zsd04_pstyv AND
vbap-matwa(1) = 'R' ) OR ( vbak-auart IN i_zsd02_auart AND
vbap-pstyv IN i_zsd03_pstyv AND vbap-matnr(1) = 'R' ).
IF vbap-matwa(1) = 'R'.
MESSAGE e001(zkse) WITH vbap-matwa vbap-posnr vbak-auart
vbap-pstyv.
ENDIF.
IF vbap-matnr(1) = 'R'.
MESSAGE e001(zkse) WITH vbap-matnr vbap-posnr vbak-auart
vbap-pstyv.
ENDIF.
ELSEIF ( vbak-auart IN i_zsd03_auart AND vbap-pstyv IN
i_zsd04_pstyv AND vbap-matwa(1) <> 'R' ) OR ( vbak-auart IN
i_zsd03_auart AND vbap-pstyv IN i_zsd03_pstyv AND vbap-matnr(1) <> 'R' )
OR ( vbak-auart IN i_zsd04_auart AND vbap-pstyv IN i_zsd04_pstyv AND
vbap-matwa(1) <> 'R' ) OR ( vbak-auart IN i_zsd04_auart AND vbap-pstyv
IN i_zsd03_pstyv AND vbap-matnr(1) <> 'R' ).
IF vbap-matwa(1) <> 'R'.
MESSAGE e001(zkse) WITH vbap-matwa vbap-posnr vbak-auart
vbap-pstyv.
ENDIF.
IF vbap-matnr(1) <> 'R'.
MESSAGE e001(zkse) WITH vbap-matnr vbap-posnr vbak-auart
vbap-pstyv.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
INCLUDE zue_sd_0015.
include zue_sd_0019
Enhancement to populate Storage Location for sales order 5090
and plant 9000. But any companies can use it as long as entries are
maintained in table zsd_default_sloc
Niranjan 02/11/04
DEVK933987 - MV45AFZZ - MPitisci 4/12/2004
DEVK933989 - ZUE_SD_0019 include
DEVK933998 - ZSD_DEFAULT_SLOC table
INCLUDE zue_sd_0019.
To give hard error for D-CHin status 07 for items catgories other
than trade.
04/10/05
INCLUDE zue_sd_0034.
Checks if the storage location value is changed and checks to see if
the storage location correlates to the P3 Partner function rules
08/05/2005
INCLUDE zue_sd_0036.
INCLUDE zue_sd_0013.
<b>**************New code********
INCLUDE ZSD_DEFAULT_BWTAR.
********************************</b>
ENDFORM.
*eject
FORM USEREXIT_MOVE_FIELD_TO_VBEP *
This userexit can be used to move some fields into the sales *
dokument schedule line workaerea VBEP *
SVBEP-TABIX = 0: Create schedule line *
SVBEP-TABIX > 0: Change schedule line *
This form is called at the end of form VBEP_FUELLEN. *
FORM userexit_move_field_to_vbep.
DATA: intercoflag TYPE c.
VBEP-zzfield = xxxx-zzfield2.
Assign 'ZP' to Schedule line Category for Acct Assignment Grp =
Chui 10/23/2001
DATA: zzbukrs LIKE tvko-bukrs,
zzmtpos LIKE mvke-mtpos.
DATA: z_vbelv LIKE vbfa-vbelv," KN03
z_auart LIKE vbak-auart," KN03
z_vbtyp LIKE vbak-vbtyp," KN03
z_ettyp LIKE vbep-ettyp," KN03
z_pstyv LIKE vbap-pstyv," KN04
z_posnr LIKE vbap-posnr." KN04
DATA: BEGIN OF zzwerks OCCURS 0,
werks LIKE marc-werks,
END OF zzwerks.
IF vbak-vbtyp CN 'AB'. "ECLARKE 01-26-04
SELECT SINGLE bukrs
INTO zzbukrs
FROM tvko
WHERE vkorg = vbak-vkorg.
SELECT w~werks
INTO TABLE zzwerks
FROM t001w AS w JOIN t001k AS k
ON wbwkey = kbwkey
WHERE k~bukrs = zzbukrs.
SELECT SINGLE mtpos INTO zzmtpos
FROM mvke
WHERE matnr = vbap-matnr
AND vkorg = vbak-vkorg
AND vtweg = vbak-vtweg.
*lines added for valuated customer-returns project by msn
110903. It will set required schedule line category YR on specific
item categories if the document created is of type RE with reference
document being an invoice of type F2
*ECLARKE & MILIND NAND. 11-11-2003.
*Schedule Line Category - Valuate Customer Returns Stock
INCLUDE zue_sd_0010.
CASE vbap-pstyv.
WHEN 'ZRPN'.
EXIT.
WHEN 'TAN' OR 'TANN'.
IF vbkd-ktgrd = '01'. " Added 6/5/02
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ENDIF.
**Ernesto EDIT for UE DEMO 10/15/2002
***************TEST FUNCTION MODULE FOR USER EXIT MAINT.******
**ADDED A CASE STATEMENT BELOW.
CALL FUNCTION 'Z_UE_SD_GET_SCHEDULE_LINE_CAT'
EXPORTING
pstyv = vbap-pstyv
ktgrd = vbkd-ktgrd
ettyp2 = vbep-ettyp
IMPORTING
ettyp = vbep-ettyp.
****************END OF TEST SOURCE CODE******************
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
check sy-subrc ne 0.
IF sy-subrc NE 0.
Change inserted by Arvind R Kulkarni; 07/22/2002
TAN -> ZAN; TANN => ZANN
vbap-pstyv = 'ZAN'.
IF vbap-pstyv = 'TAN'.
vbap-pstyv = 'ZAN'.
ELSEIF vbap-pstyv = 'TANN'.
vbap-pstyv = 'ZANN'.
ENDIF.
end of change
ENDIF.
*ADDED CASE HERE FOR TEST FOR SYNTAX CHECK 10/15/2002
*CASE vbap-pstyv.
WHEN 'ZAN'.
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
CHECK sy-subrc EQ 0.
vbap-pstyv = 'TAN'.
WHEN 'ZANN'.
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
CHECK sy-subrc EQ 0.
vbap-pstyv = 'TANN'.
WHEN 'ZTAN'.
IF vbkd-ktgrd = '01'. " Added 6/5/02
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ENDIF.
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
check sy-subrc ne 0.
IF sy-subrc NE 0.
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ENDIF.
03/23/2005 KN03 Set Schedule Line default to ZF order type ZFD,
item cat ZTAN, sales org 5060, 5070, and 5071
IF vbak-auart EQ 'ZFD' AND
( vbak-vkorg = '5060' OR vbak-vkorg = '5070'
OR vbak-vkorg = '5071' ).
vbep-ettyp = 'ZF'.
ENDIF.
Begin of insertion for IRAT processing
Arvind R Kulkarni; Dated: 07/17/2002.
Changed to include YRAT; ; 11/22/2002
WHEN 'IRAT' OR 'YRAT'.
IF vbak-auart NE 'ZWAR'.
the sales order is NOT a ZWAR
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
IF sy-subrc NE 0.
the transaction IS intercompany
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'YN'.
ELSE.
vbep-ettyp = 'YL'.
ENDIF.
ELSE.
the transaction IS NOT intercompany
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZN'.
ELSE.
vbep-ettyp = 'ZL'.
ENDIF.
ENDIF.
IF vbkd-ktgrd = '01'.
sale is to an affiliate in local sales org
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'YN'.
ELSE.
vbep-ettyp = 'YL'.
ENDIF.
ENDIF.
ELSE.
the sales order IS a ZWAR
READ TABLE zzwerks WITH TABLE KEY werks = vbap-werks.
IF sy-subrc NE 0.
the transaction IS intercompany
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ELSE.
the transaction IS NOT intercompany
NOTHING NEEDS TO BE DONE FOR ZWAR DOMESTIC
STD SCHED LINE CATEGORIES TO BE MAINTAINED.
IF VBEP-ETTYP = 'CN'.
VBEP-ETTYP = 'ZN'.
ELSE.
VBEP-ETTYP = 'ZL'.
ENDIF.
ENDIF.
IF VBKD-KTGRD = '01'.
sale is to an affiliate in local sales org
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ENDIF.
ENDIF.
End of insertion for IRAT processing
WHEN 'IRRS' OR 'IRRE' OR 'IRLA' OR 'IRLB' OR 'KBN' OR 'TAQ'
KSI Modification 04/22/03
Exclude check for item category 'YKW'
OR 'YTAN' OR 'ZKLN' OR 'KAN' OR 'ZTAQ'
OR 'YKW' OR 'IRRP' OR 'ZKBC' OR 'ZKBN' OR 'ZKAN' OR 'KLN'.
or 'ZKEN' OR 'ZKEC' or ZREK OR 'KEN'.
EXIT.
WHEN 'ZTR1' OR 'ZRBB' OR 'ZREB' OR 'ZREC' OR 'ZREF' OR 'ZREN'
Removed ZRTN to validate plant 9000
OR 'ZRFF' OR 'ZRNB' OR 'ZRNN' OR 'REN' OR 'RENN'
OR 'ZLN' OR 'IRAL' OR 'ZTR0' OR 'KLN'.
EXIT.
03/23/2005 KN03 set default sched line for KE & ZKE
WHEN 'KEN' OR 'ZKEG' OR 'ZKEN' OR 'ZKEC'.
IF vbak-vkorg EQ '5070'.
vbep-ettyp = 'Z0'.
ENDIF.
WHEN 'ZREK'.
INCLUDE zue_sd_0033.
IF vbap-werks = '9000'. " KN04
IF vbkd-ktgrd = '01'. " KN04
IF z_auart = 'ZFD ' and z_pstyv = 'KLN '. " KN04
vbep-ettyp = 'YK'. " KN04
ENDIF.
ENDIF.
ENDIF.
KSE Modification 04/10/03
For Item Cate 'ZRTN'
Assign 'YQ' to Schedule line cat, if cross-company
'YU' if not.
WHEN 'ZRTN'.
KN03 for KSI set default schedule line for order type ZREK
INCLUDE zue_sd_0033.
IF svbep-tabix IS INITIAL.
IF vbap-werks = '9000'.
IF vbkd-ktgrd = '01'. " KN04
IF z_auart = 'ZFD' and z_pstyv = 'KLN '. " KN04
vbep-ettyp = 'YK'. " KN04
ELSE. " KN04
vbep-ettyp = 'YQ'.
ENDIF.
ELSE.
vbep-ettyp = 'YU'.
ENDIF.
ENDIF.
ENDIF.
KN03 for KSI set default schedule line for order type ZREK
INCLUDE zue_sd_0033.
WHEN OTHERS.
IF vbkd-ktgrd = '01'.
IF vbep-ettyp = 'CN'.
vbep-ettyp = 'ZA'.
ELSE.
vbep-ettyp = 'ZP'.
ENDIF.
ENDIF.
ENDCASE.
endif.
Redetermine Movement Type
PERFORM tvep_select(sapmv45a) USING vbep-ettyp
charx
sy-subrc.
vbep-bwart = tvep-bwart.
ENDIF.
KSE Mod
User Exit for Repair Replacement
Export VBEP-ETTYP, imported by RV64A950
04/18/03
EXPORT i_ettyp = vbep-ettyp TO MEMORY ID 'ZZSCHEDULE'.
**lines added for valuated customer-returns project by msn
110903. It will set required schedule line category YR on specific
item categories if the document created is of type RE with reference
document being an invoice of type F2
**. 11-11-2003.
**Schedule Line Category - Valuate Customer Returns Stock
BREAK-POINT.
INCLUDE zue_sd_0010.
*KSEA Modification to default item creation date for the IRAT
*line item schedule line. SAP Note 23281
04/01/04
INCLUDE zue_sd_0020.
ENDFORM.
*eject
FORM USEREXIT_MOVE_FIELD_TO_VBKD *
This userexit can be used to move some fields into the sales *
dokument business data workaerea VBKD *
SVBKD-TABIX = 0: Create data *
SVBKD-TABIX > 0: Change data *
This form is called at the end of form VBKD_FUELLEN. *
FORM userexit_move_field_to_vbkd.
VBKD-zzfield = xxxx-zzfield2.
Get Customer group, Price group and Price list type *
by Ship-to party
10/04/2001
DATA: yp1 LIKE t001k-bwkey,
z_uepos_bukrs LIKE t001k-bukrs.
*Request by Customer Service - Marian Favors 11-08-2004
TABLES: zzue030. "ECLARKE 11-08-2004
SELECT SINGLE tcode INTO zzue030-tcode FROM zzue030
WHERE tcode = sy-tcode. "ECLARKE 11-08-2004
IF sy-subrc = 0. "ECLARKE 11-08-2004
Removed check for customer group as this was required by Steve Ludewig
IF " vbkd-kdgrp IS INITIAL AND "Arvind Kulkarni; 08/05/2002.
vbkd-konda IS INITIAL AND
vbkd-pltyp IS INITIAL.
SELECT SINGLE kdgrp konda pltyp bzirk
INTO (vbkd-kdgrp, vbkd-konda, vbkd-pltyp, vbkd-bzirk)
FROM knvv
WHERE kunnr = kuwev-kunnr
AND vkorg = vbak-vkorg
AND vtweg = vbak-vtweg
AND spart = vbak-spart.
ENDIF.
ENDIF. "ECLARKE 11-08-2004
Redetermine Schedule line Category if Acct Assignment Grp is changed
to
Chui 10/23/2001
IF svbkd-tabix > 0 AND sy-dynnr = '4311'.
IF vbkd-ktgrd = '01' AND vbep-ettyp <> 'ZP'.
PERFORM userexit_move_field_to_vbep.
ENDIF.
ENDIF.
INCLUDE zzsdprc01.
To make the value of the field VBAK-ZUONR same as VBKD-BSTKD
05/04/04
vbak-zuonr = vbkd-bstkd.
ENDFORM.
*eject
FORM USEREXIT_NUMBER_RANGE *
This userexit can be used to determine the numberranges for *
the internal document number. *
US_RANGE_INTERN - internal number range *
This form is called from form BELEG_SICHERN *
FORM userexit_number_range USING us_range_intern.
Example: Numer range from TVAK like in standard
US_RANGE_INTERN = TVAK-NUMKI.
ENDFORM.
*eject
FORM USEREXIT_PRICING_PREPARE_TKOMK *
This userexit can be used to move additional fields into the *
communication table which is used for pricing: *
TKOMK for header fields *
This form is called from form PREISFINDUNG_VORBEREITEN. *
FORM userexit_pricing_prepare_tkomk.
TKOMK-zzfield = xxxx-zzfield2.
*{ INSERT SNDK900075 1
tkomk-aland = t001-land1.
*} INSERT
Fill Zip code with Ship-to party's
tkomk-post_code1 = kuwev-pstlz.
ENDFORM.
*eject
FORM USEREXIT_PRICING_PREPARE_TKOMP *
This userexit can be used to move additional fields into the *
communication table which is used for pricing: *
TKOMP for item fields *
This form is called from form PREISFINDUNG_VORBEREITEN. *
FORM userexit_pricing_prepare_tkomp.
TKOMP-zzfield = x

Similar Messages

  • Changing default control values in LV application?

    Can anyone help me?
    Is it possible to change default control values in LV program
    programmatically?
    Sergey Yakovlev, Berlin,
    [email protected]

    Its quite complex (in my opinion) to do so programically , but using a set of invoke nodes, you can get it done ('Make this value default'). Look at the attached for info (its a large link name, so you may have to copy and paste in your browser).
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&2C14132F826F839F8625683A000B0B99&cat=DB5863CD70417B07862567930070A058
    I've been simply using config.txt files of read and write to set values.

  • Default multiple values in custom search help

    Hi All,
    I created a custom search help for the vendor. The fields in the search help are LIFNR (Vendor) and KTOKK (Account Group).
    I would like to be able to set three default values for the account group. That is, when the user clicks on the dropdown to display the search help, I would like to have three values populated in the KTOKK field. Is this possible?
    Any help would be appreciated.
    Thanks!

    Hi,
    I am not sure abt default values, but if you are using this search help in any report than you can set hot keys in your search help and using hot keys, you can set some default filter values in you report's parameter.
    you can set variant in your report where parameter is having values like :: =,<hotkey>,<sel1>,<sel2>
    here <hotkey> : wht you have assingned in search help.
           <sel1>    : one of those default values you want to display.
           <sel2>    : one of those default values you want to display for the second field.
    hope it helps,
    Regards,
    Sagar

  • How to set default values in dialog programming

    hi gurus
    can anyone suggest me
    how to set default values in dialog programming
    thanks&regards
    kals.

    it's a bit dirty but I usually just place it in the PBO with a flag for control. It's simple and not too costly i think.
    MODULE preRender OUTPUT.
      DATA first_time TYPE flag VALUE 'X'.
      IF first_time EQ 'X'.
    *   put your initialization code here
        CLEAR first_time.
      ENDIF.
    ENDMODULE.
    -MiR

  • How to make the LV front panel controls the current value through the program is set as the default value when the next time you open?

    How to make the LV front panel controls the current value through the programis set as the default value when the next time you open?
    1110340051 

    Try this: Re: How to make a VI remember the latest control value?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Default cell values for column not properly saved in uir file in labwindows 2009 (9.1.0 427)?

    I've run into a strange problem with the table control.  Basically, even though I set default cell values for a particular column as numeric, when I try to add items to the list it tries to add them as strings, and returns an error message that it is expecting *char instead of int.  Furthermore, when I open the uir file that contains the table in question in 2010, it appears as if the default cell values for that column are still set as strings, even though in 2009 when I open the uir file it shows as numbers.  I tried converting the uir to C code, and sure enough the C code indicated that the column still is a string type.
    I've gone ahead and made a small project to show the issue.  If you open this project in labwindows 2009 and click on the table in the table_bug.uir, and edit default cell values for column 1, you will see that the cell settings have type as numeric and data type as int.  When you run the project, however, it will fail with an error message saying that it is looking for a *char.  When this same project is loaded into labwindows 2010, clicking on the table in table_bug.uir and edit default cell values (column 1) shows the type as string.  When I change this to numeric (and change numeric attribute to int), this runs fine in 2010.  I tried simply changing the uir in 2010, and then using it in 2009, but 2009 complains that the uir is from a newer version (understandable).  If there is any workaround that would let me continue to use 2009 for the time that would be great.
    Any help would be greatly appreciated.
    thanks,
    Alex Corwin
    Solved!
    Go to Solution.
    Attachments:
    table_bug.zip ‏324 KB

    I opened the UIR in 2009 (but I have 2009 SP1) and it still showed that the default value for the first column was a string. I didn't have any problems changing it to a numeric int, and then building and running the project without error.
    Here are a few things you can try:
    1) Change the default value to a string. OK out of the dialog, re-enter the dialog, and change it back to Numeric int. Resave and see if the problem has gone away.
    2) You said you get a ".UIR is from a newer version" error when opening the 2010 UIR in 2009. Does the UIR still open if you click okay? Often times this will work just fine. Assuming you don't have any problems with this, make a minor change to the UIR in 2009, such as moving the table to the left, and then back to the right and then re-save. See if your program works now.
    Kevin B.
    National Instruments

  • Urgent..getting default & changed values in ALV editable....have ur point.s

    Hi all,
    I m using interactive ALV grid with 1 column editable with some default values, When i m clicking on SAVE button, only the values which are changed by the user in that column are coming in the internal table, & the default values are automatically deleted by the following code....
    But my requirement is to save all the default & changed values of the ALV column....
    <b>Help me out & have ur points.</b>
    DATA ref1 TYPE REF TO cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    importing
                   e_grid                           = ref1
    CALL METHOD ref1->check_changed_data
    IMPORTING
       e_valid   =
    CHANGING
       c_refresh = 'X'

    Pradeep,
    When ur doing the CHECK_CHANGED_DATA, u ll get the edited values inside this callback sub -routine only. so here u trap the values those are changed ( thats after editing).
    Once the control goes back to the original program ( calling prog ) , u ll end up with ur old data ( before editing).
    you ll have to handle that explictly in your code, or shift to OO alv grid like this -
    REPORT ZSKC_GRID.
    TABLES : EQUI.
    DATA   : BEGIN OF T_EQUI OCCURS 0,
              EQUNR TYPE EQUI-EQUNR,
              AENAM TYPE EQUI-AENAM,
             END   OF T_EQUI.
    DATA : T_FCAT  TYPE LVC_T_FCAT,
           G_FCODE TYPE SY-UCOMM.
    DATA : G_GRID TYPE REF TO CL_GUI_ALV_GRID.
    SELECT-OPTIONS: S_EQUNR FOR EQUI-EQUNR.
    START-OF-SELECTION.
    * get data.
      PERFORM SUB_GET_DATA.
    * Populate catalog.
      PERFORM SUB_BUILD_CATALOG CHANGING T_FCAT.
    * Display the grid.
      PERFORM SUB_SHOW_GRID.
      CALL SCREEN 9001.
    *&      Form  SUB_GET_DATA
    *       Get data
    FORM SUB_GET_DATA .
      SELECT EQUNR AENAM
      FROM   EQUI
      INTO   TABLE T_EQUI
      WHERE  EQUNR IN S_EQUNR.
      IF SY-SUBRC NE 0.
    *  Give some message if needed
      ENDIF.
    ENDFORM.                    " SUB_GET_DATA
    *&      Form  SUB_BUILD_CATALOG
    *       text
    *      <--P_T_FCAT  text
    FORM SUB_BUILD_CATALOG  CHANGING PT_FCAT TYPE LVC_T_FCAT.
      DATA : WA_CAT TYPE LVC_S_FCAT.
      CLEAR WA_CAT.
      WA_CAT-FIELDNAME = 'EQUNR'.
      WA_CAT-TABNAME   = 'T_EQUI'.
      WA_CAT-REF_FIELD = 'EQUNR'.
      WA_CAT-REF_TABLE = 'EQUI'.
      APPEND WA_CAT TO PT_FCAT.
      CLEAR WA_CAT.
      WA_CAT-FIELDNAME = 'AENAM'.
      WA_CAT-TABNAME   = 'T_EQUI'.
      WA_CAT-REF_FIELD = 'AENAM'.
      WA_CAT-REF_TABLE = 'EQUI'.
      WA_CAT-EDIT      = 'X'.
      APPEND WA_CAT TO PT_FCAT.
    ENDFORM.                    " SUB_BUILD_CATALOG
    *&      Form  SUB_SHOW_GRID
    *       Show grid
    FORM SUB_SHOW_GRID .
    * create the Grid Object.
      CREATE OBJECT G_GRID
        EXPORTING
           I_PARENT          = CL_GUI_CONTAINER=>SCREEN0
        EXCEPTIONS
          ERROR_CNTL_CREATE = 1
          ERROR_CNTL_INIT   = 2
          ERROR_CNTL_LINK   = 3
          ERROR_DP_CREATE   = 4
          OTHERS            = 5.
      CHECK SY-SUBRC EQ 0.
    * Display contents,
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        CHANGING
          IT_OUTTAB                     = t_equi[]
          IT_FIELDCATALOG               = t_fcat
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          others                        = 4.
    ENDFORM.                    " SUB_SHOW_GRID
    *&      Module  STATUS_9001  OUTPUT
    *       text
    MODULE STATUS_9001 OUTPUT.
       SET PF-STATUS 'PF_9001'.
       SET TITLEBAR 'TITLE_9001'.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
    *       text
    MODULE USER_COMMAND_9001 INPUT.
      CASE G_FCODE.
        WHEN 'BACK' OR 'CANC' OR 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'HAVE'.
    *    After editing everything user presses this button.
         PERFORM SUB_GET_EDITED_DATA.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Form  SUB_GET_EDITED_DATA
    *       Read the ALV grid and get current internal table.
    FORM SUB_GET_EDITED_DATA .
    DATA : T_OLD_DATA LIKE T_EQUI OCCURS 0.
    * hold the old values if u need them.
      t_old_data[] = t_equi[].
    * This will update the global internal table.
      CALL METHOD G_GRID->CHECK_CHANGED_DATA.
    * Now t_equi have changed here. u have the old data in the T_OLD_DATA.
      BREAK-POINT.
    ENDFORM.                    " SUB_GET_EDITED_DATA
    Create a blank screen called 9001. and Pf-staus has a buton with fcode "HAVE". ( alongwith BACK canc exit).

  • Problem when defaulting a value to the field

    Hi CRM Experts,
    I am new to CRM, i am facing a problem when defaulting a value to the field in the Tcode 'SOLMAN_WORKCENTER' (Solution Manager Server).
    when i am defaulting it is displaying fine in the view( Redefined the getter method there i passed the value), i set a break point in the getter method when i am executing the getter method i am unable to get the defaulted value in the importing parameter value, but i am getting the value here when i used to type manually in the filed, i cant understand why it is behaving like that? please can any body help in this regard...
    Thanks in advance
    Hari..

    There are other ways to get the string-value of an enum (format into string with a %s formatter for instance).
    But I have no idea what you are seeing.
    However I would not use the enum to string technique chose you have, just add the enum to the 'file' VI as an input.
    And the =0 comparison you have is useless, add the enum to the case structure as the selector.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Crystal Reports 9 and SQL Server 2005 default parameter values

    We're using Crystal Reports 9 and upgraded from SQL Server 2000 to SQL Server 2005.
    I'm noticing a very weird problem which I wonder if anyone else has experienced (and hopefully found a resolution for). It appears that in using Crystal with SQL Server 2005 stored procedures, if we have default parameter values in the stored procedures, the default parameter values get completely ignored if you pass in a NULL value from Crystal!
    For example, if you have a stored procedure that begins like this:
    ALTER          Procedure [dbo].[StoredProcedure]
    @Param1 VarChar(200) = '',
    @Param2 VarChar(200) = ''
    AS ...
    both @Param1 and @Param2 have a default value of an empty string, and therefore should become empty strings if nothing (NULL values) gets passed in for them.
    But, like I said, what I'm finding is that with Crystal calling the stored procedure with NULL @Param1 and @Param2 values, they never become empty strings, but rather remain as NULLs.
    This was never a problem with SQL 2000.
    Very perplexing. Anyone else every experience this?
    Thank you.

    Please ignore my earlier post -- answered my own question.
    NULL parameter values do not get replaced by default values in SQL -- that is normal behavior in both SQL 2000 and SQL 2005. Just goes to show, that no many how many years programming experience you have, you can still get tripped up sometimes : (

  • How to Change the default Search value for Field Role?

    HI,
    I went through numerous threads on how to default the search value , but does not help for my issue. Hence im posting this new thread. Please provide your suggestions on how to achieve this.
    For the Ship-to party field (in item detail )  on webui when i do a F4 help i get the pop up with various search criteria and  for the field Role the default value is "Ship-to party".  which is visible. we need to change this default value to Prospect which is available in drop down.
    The attribute is STRUCT.ROLE  and view BP_HEAD_SEARCH/SearchHelp . The method GET_DQUERY_VALUEHELPS  from the context node class is called to fill the value help for this attribute, but i dont understand how the ship-to party is filled as default. There is no code in this method to default the value.
    The generic GET_V_S_STRUCT method also does not default the Ship-to party on this field.
    I want to understand how this Ship-to party is filled by default and how can i change this to prospect..
    Many Thanks,
    Shaik

    We had a same requirement of defaulting Sales org and division in search criteria for a specific value.
    this can be doen by redefining "DO_PREPARE_OUTPUT" method in IMPL class for the respective view.
    See the code:
    METHOD do_prepare_output.
    *CALL METHOD SUPER->DO_PREPARE_OUTPUT
    **  EXPORTING
    **    iv_first_time = ABAP_FALSE
      DATA:
        lr_qs TYPE REF TO cl_crm_bol_dquery_service.
    * Get current query object
      lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).
      IF iv_first_time = abap_true.
        lr_qs->clear_selection_param_values( ).
        lr_qs->delete_empty_selection_params( ).
    *   if l_sales_orgs is initial.
        CALL METHOD lr_qs->insert_selection_param
          EXPORTING
            iv_index     = '1'
            iv_attr_name = 'SALES_ORG'
            iv_sign      = ' '
            iv_option    = 'EQ'
            iv_low       = 'O 50000514'.
    *   endif.
    *   if l_dist_chan is initial.
        CALL METHOD lr_qs->insert_selection_param
          EXPORTING
            iv_index     = '2'
            iv_attr_name = 'DISTR_CHAN'
            iv_sign      = ' '
            iv_option    = 'EQ'
            iv_low       = '01'.
    * endif.
    Hope this will help..
    THanks & Regards,
    Amit

  • How can I set bind parameter as Default Display Value in JHeadstart

    Hi,
    I am using -
    JDeveloper Studio Edition Version 10.1.3.1.0.3984
    JHeadstart Release 10.1.3.1.26
    Can anybody help me for the following:
    I am using a super class of ViewObjectImpl where I am definning a bind parameter (Student ID) using login userid:
    if ("p_std_id".equals(bindParam[0])) {
    sLog.debug("executeQueryForCollection: found bind param p_std_id, setting value to " + studentNumber_from_LDAP);
    bindParam[1] = studentNumber_from_LDAP;
    Then I defined p_std_id in Bind Variables tab in VO Editor and used that in Where clause in the SQL Statement tab.
    This is working fine.
    Now what I want to do is:
    I want to put the value of p_std_id as Default Display Value for a field.
    Can anybody let me know how I can put the value of p_std_id in JHeadstart Application Definition?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hi Jan and Steven,
    Thanks for your reply.
    I need to show the default value in the table layout.
    Steven, could you please give some more hints about EL Expression?
    To obtain the value of p_std_id now and pass it on as bind param, I am using a class extending ViewObjectImpl. Inside that class I am using the following method:
    I'd appreciate if you could help for the EL Expression.
    Thanks
    protected void executeQueryForCollection(Object Object, Object[] bindParams,
    int i) {
    String userId = ((ApplicationModuleImpl)getApplicationModule()).getUserPrincipalName();
    try{
    getLdapInfo(userId);
    catch(Exception e) {
    sLog.debug("executeQueryForCollection: Userid = " + userId);
    if (bindParams != null)
    for (int j = 0; j < bindParams.length; j++)
    Object[] bindParam = (Object[])bindParams[j];
    if ("p_user_id".equals(bindParam[0])) {
    sLog.debug("executeQueryForCollection: found bind param p_user_id, setting value to " + userId);
    bindParam[1] = userId;
    if ("p_emp_id".equals(bindParam[0])) {
    sLog.debug("executeQueryForCollection: found bind param p_emp_id, setting value to " + employeeNumber_from_LDAP);
    bindParam[1] = employeeNumber_from_LDAP;
    if ("p_std_id".equals(bindParam[0])) {
    sLog.debug("executeQueryForCollection: found bind param p_std_id, setting value to " + studentNumber_from_LDAP);
    bindParam[1] = studentNumber_from_LDAP;
    super.executeQueryForCollection(Object, bindParams, i);
    Thanks
    Syed

  • Set Default Save Location for All Programs

    What I need is a program that will set the default save folder (in all programs) to the same folder the current file came from.
    If I do a "Save As" I want the folder in the Save dialog box to always be the folder the file is in.
    This was brain-dead easy in OS 9 (General Control Panel, Save Location, Folder That is Set by the Application).
    I cannot find a help file, a preference pane, an add-on program, anything to allow this.
    If anyone can help me, I'd appreciate it.

    Hi,
    Not sure if this is what you want but you might want to look at it
    http://www.stclairsoft.com/DefaultFolderX/

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • Default property values

    Is there any way of setting system wide default property values in Windows XP? For example, I want to set the extensions directories to point to a common jar directory for all java programs I run on my computer. Or I want to set the JDBC driver properties for all programs. Any easy way of doing this?

    Use some wrapper script?

  • Unable to default a value in LOV in Expense Allocations page of iExpenses

    Hi friends,
    I am trying to default a value in a Lov (Which is a one of the segments in KFF).
    This Lov is in a HGrid region of "expense allocations page" of iExpenses.
    But i am unable to default that.
    I am using the below code.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OADBTransaction dbTran = am.getOADBTransaction();
    OAApplicationModule am1 = pageContext.getRootApplicationModule();
    dbTran.writeDiagnostics(this,"tnv AM, AM1 : "+am+", "+am1, 2);
    // AllocationsHeaderVO
    OAViewObject vo = (OAViewObject)am.findViewObject("AllocationsHeaderVO");// AllocationsHeaderVO
    dbTran.writeDiagnostics(this,"tnv AllocationsHeaderVO : "+vo,2);
    Row row = vo.getCurrentRow();
    dbTran.writeDiagnostics(this,"tnv AllocationsHeaderVO row: "+row,2);
    String arr[]= row.getAttributeNames();
    Object arrVal[] = row.getAttributeValues();
    for (int i = 0; i <arr.length ; i++)
    try
    dbTran.writeDiagnostics(this,"tnv arr[i] : "+arr,2);
    dbTran.writeDiagnostics(this,"tnv arrVal[i] : "+arrVal[i].toString(),2);
    }catch(Exception e)
    dbTran.writeDiagnostics(this,"tnv null Exp arrVal[i] : "+i,2);
    OAMessageLovInputBean busAreaSeg2 = (OAMessageLovInputBean)webBean.findChildRecursive("KffSEGMENT2");
    OAMessageStyledTextBean busAreaSeg2Desc = (OAMessageStyledTextBean)webBean.findChildRecursive("KffSEGMENT2Desc");
    busAreaSeg2.setText("100"); // A -- I am able to default this value, but user is having no option to change the value, if i go with this.
    busAreaSeg2.setText(pageContext, "100"); // B -- Unable to default with this....
    busAreaSeg2.setValue(pageContext, "100"); // C -- Unable to default with this...
    Could somebody please help me out, in defaulting this.
    Thanks in advance,
    Naresh

    Hi Guys,
    I am trying to Default Task LOV field based on the Project selected in Project LOV field, But i am not able to get the handle for Task LOV field in iExpenses of ExpenseAllocationDetailPG.
    Please provide me some hint to achieve the same.
    Thanks in advance.
    Regards,
    Naren.

Maybe you are looking for

  • Help With Migration From Exchange 2007 To Exchange 2013

    We have an Exchange 2007 Server with Service Pack 3 and Rollup 12 applied.  I installed a new Exchange 2013 Server and then immediately applied CU3. I am following this Technet article: http://blogs.technet.com/b/meamcs/archive/2013/07/25/part-1-step

  • How to  code  REAL java

    Whats the best way to right real java code? i did my class, i wrote log in applications and games, but i want to start real stuff like antivirus, or a good aplication that does something were do i start

  • Activate a flash object in the browser

    I'm using a flash object in my html and I would like to avoid the annoying click every time a flash object should be activated. I know there is a way by using a 3th party program or script (swobject or something like that) but isn't there a Adobe Dre

  • Fonts and JSP

    I need to add a different font on a JSP page. The font is installed but not sure how to access it... Can I use awt? Not sure how to proceed. Any help would be appreciated. Thanks.

  • Microtek i800 compatability with snow leopard

    I installed snow leopard 10.6.6 yesterday. Now I can't use my scanner. It's a Microtek i800. When I try to open the program the initial graphic appears on my screen, then a box asking me to use color sync. I click okay, and then nothing happens. When