Invoice details are not updating in XKOMFK table in vf02

Hello Experts,
I am facing an issue in vf02, invoice details in table XKOMFK are not getting updated becuase of which my user exit is not fuctioning correctly.
Please advice how the table XKOMFK will be updated in vf02.
Thank You,
Nusrat Jahan

Hi,
Check this . You need to write code for "i_callback_user_command"
* Form  f_user_command1                                                *
* This form will handle the user command from fm REUSE                 *
form f_user_command1 using p_ucomm type sy-ucomm
                     rs_selfield type  slis_selfield.
  data p_ref1 type ref to cl_gui_alv_grid.
  call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    importing
      e_grid = p_ref1.
  call method p_ref1->check_changed_data.
  case p_ucomm.
    when '&DATA_SAVE'.
       " Write your code for save
  endcase.
  rs_selfield-refresh = c_x.             " Grid refresh
endform.                                 " F_user_command1

Similar Messages

  • Automatic payment program (F110) document are not update in PAYR table

    Hi all,
    I have make payment in F110 (automatic payment) to customer 
    But it is not update in PAYR table
    Please guide me what I have to do for documents update in PAYR table
    Thanks and Regards,
    Prudhvi

    Hi,
    It is possible to enter multiple documents.
    You can enter a list of single documents or in intervals.
    Enter the document number in ascending order.
    Ex:
    Individual documents.
    10001,10003,10011
    If the documents are in a sequence you can enter the Interval like this
    (10001,10011)
    Hope it helps you
    Regards
    Andrew
    Edited by: Andrew J on May 28, 2009 4:26 PM

  • Excise details are not updating in MIGO

    hai, i am working with CIN,,i raised a Purchase Order and all the taxes maintained are updating in Invoice tab of PO...
    whn i am tryimg to enter GR ,
    the excise Invoice and excise item tabs are displaying but the excise values(BED,AED )are not updating frm PO..
    can anyone help me

    Hi,
    1) check whether u have mantained the Default condiition types in CIN settings.
    Path SPRO->Log Gen->Tax on goods movt->india->maintain Excise defaults.
    2)Check the JMX1,JEX1,JHX2 condition maintained as 100% in FV11
    regards,
    sujit

  • When inserting 2 column details in a single table using Stored Procedure.Only 2 Column details getting inserted.1column details are not getting into the table.Please see the below script and help me to change.

    Line 390 Under the (Insert into SALES_TRADEIN Table)
    I need to insert (TradeIn_1_VIN) Values If there is no values in (TradeIn_1_VIN) then i have to insert (TradeIn_2_VIN) values to the (SALES_TRADEIN) Table.
    After i run then below script only (TradeIn_2_VIN) values are get inserted in the table. (TradeIn_1_VIN) are not getting loaded in to the table.
    I think there is the problem from Line No (404 to 414) Please help me change those particular lines to insert (TradeIn_1_VIN) Values also.If there is no details then (TradeIn_2_VIN) need to be inserted.
    -- =============================================
    -- Stored Procedure for Flatfile_Sales
    -- =============================================
    USE [IconicMarketing]
    ---==========Sales_Cursor
    --USE [IconicMarketing]
    --GO
    DECLARE
    @FileType
    varchar(50),
    @ACDealerID
    varchar(50),
    @ClientDealerID
    varchar(50),
    @DMSType
    varchar(50),
    @DealNumber
    varchar(50),
    @CustomerNumber
    varchar(50),
    @CustomerName
    varchar(50),
    @CustomerFirstName
    varchar(50),
    @CustomerLastName
    varchar(50),
    @CustomerAddress
    varchar(50),
    @CustomerCity
    varchar(50),
    @CustomerState
    varchar(50),
    @CustomerZip
    varchar(50),
    @CustomerCounty
    varchar(50),
    @CustomerHomePhone
    varchar(50),
    @CustomerWorkPhone
    varchar(50),
    @CustomerCellPhone
    varchar(50),
    @CustomerPagerPhone
    varchar(50),
    @CustomerEmail
    varchar(50),
    @CustomerBirthDate
    varchar(50),
    @MailBlock
    varchar(50),
    @CoBuyerName
    varchar(50),
    @CoBuyerFirstName
    varchar(50),
    @CoBuyerLastName
    varchar(50),
    @CoBuyerAddress
    varchar(50),
    @CoBuyerCity
    varchar(50),
    @CoBuyerState
    varchar(50),
    @CoBuyerZip
    varchar(50),
    @CoBuyerCounty
    varchar(50),
    @CoBuyerHomePhone
    varchar(50),
    @CoBuyerWorkPhone
    varchar(50),
    @CoBuyerBirthDate
    varchar(50),
    @Salesman_1_Number
    varchar(50),
    @Salesman_1_Name
    varchar(50),
    @Salesman_2_Number
    varchar(50),
    @Salesman_2_Name
    varchar(50),
    @ClosingManagerName
    varchar(50),
    @ClosingManagerNumber
    varchar(50),
    @F_AND_I_ManagerNumber
    varchar(50),
    @F_AND_I_ManagerName
    varchar(50),
    @SalesManagerNumber
    varchar(50),
    @SalesManagerName
    varchar(50),
    @EntryDate
    varchar(50),
    @DealBookDate
    varchar(50),
    @VehicleYear
    varchar(50),
    @VehicleMake
    varchar(50),
    @VehicleModel
    varchar(50),
    @VehicleStockNumber
    varchar(50),
    @VehicleVIN
    varchar(50),
    @VehicleExteriorColor
    varchar(50),
    @VehicleInteriorColor
    varchar(50),
    @VehicleMileage
    varchar(50),
    @VehicleType
    varchar(50),
    @InServiceDate
    varchar(50),
    @HoldBackAmount
    varchar(50),
    @DealType
    varchar(50),
    @SaleType
    varchar(50),
    @BankCode
    varchar(50),
    @BankName
    varchar(50),
    @SalesmanCommission
    varchar(50),
    @GrossProfitSale
    varchar(50),
    @FinanceReserve
    varchar(50),
    @CreditLifePremium
    varchar(50),
    @CreditLifeCommision
    varchar(50),
    @TotalInsuranceReserve
    varchar(50),
    @BalloonAmount
    varchar(50),
    @CashPrice
    varchar(50),
    @AmountFinanced
    varchar(50),
    @TotalOfPayments
    varchar(50),
    @MSRP varchar(50),
    @DownPayment
    varchar(50),
    @SecurityDesposit
    varchar(50),
    @Rebate
    varchar(50),
    @Term varchar(50),
    @RetailPayment
    varchar(50),
    @PaymentType
    varchar(50),
    @RetailFirstPayDate
    varchar(50),
    @LeaseFirstPayDate
    varchar(50),
    @DayToFirstPayment
    varchar(50),
    @LeaseAnnualMiles
    varchar(50),
    @MileageRate
    varchar(50),
    @APRRate
    varchar(50),
    @ResidualAmount
    varchar(50),
    @LicenseFee
    varchar(50),
    @RegistrationFee
    varchar(50),
    @TotalTax
    varchar(50),
    @ExtendedWarrantyName
    varchar(50),
    @ExtendedWarrantyTerm
    varchar(50),
    @ExtendedWarrantyLimitMiles
    varchar(50),
    @ExtendedWarrantyDollar
    varchar(50),
    @ExtendedWarrantyProfit
    varchar(50),
    @FrontGross
    varchar(50),
    @BackGross
    varchar(50),
    @TradeIn_1_VIN
    varchar(50),
    @TradeIn_2_VIN
    varchar(50),
    @TradeIn_1_Make
    varchar(50),
    @TradeIn_2_Make
    varchar(50),
    @TradeIn_1_Model
    varchar(50),
    @TradeIn_2_Model
    varchar(50),
    @TradeIn_1_ExteriorColor
    varchar(50),
    @TradeIn_2_ExteriorColor
    varchar(50),
    @TradeIn_1_Year
    varchar(50),
    @TradeIn_2_Year
    varchar(50),
    @TradeIn_1_Mileage
    varchar(50),
    @TradeIn_2_Mileage
    varchar(50),
    @TradeIn_1_Gross
    varchar(50),
    @TradeIn_2_Gross
    varchar(50),
    @TradeIn_1_Payoff
    varchar(50),
    @TradeIn_2_Payoff
    varchar(50),
    @TradeIn_1_ACV
    varchar(50),
    @TradeIn_2_ACV
    varchar(50),
    @Fee_1_Name
    varchar(50),
    @Fee_1_Fee
    varchar(50),
    @Fee_1_Commission
    varchar(50),
    @Fee_2_Name
    varchar(50),
    @Fee_2_Fee
    varchar(50),
    @Fee_2_Commission
    varchar(50),
    @Fee_3_Name
    varchar(50),
    @Fee_3_Fee
    varchar(50),
    @Fee_3_Commission
    varchar(50),
    @Fee_4_Name
    varchar(50),
    @Fee_4_Fee
    varchar(50),
    @Fee_4_Commission
    varchar(50),
    @Fee_5_Name
    varchar(50),
    @Fee_5_Fee
    varchar(50),
    @Fee_5_Commission
    varchar(50),
    @Fee_6_Name
    varchar(50),
    @Fee_6_Fee
    varchar(50),
    @Fee_6_Commission
    varchar(50),
    @Fee_7_Name
    varchar(50),
    @Fee_7_Fee
    varchar(50),
    @Fee_7_Commission
    varchar(50),
    @Fee_8_Name
    varchar(50),
    @Fee_8_Fee
    varchar(50),
    @Fee_8_Commission
    varchar(50),
    @Fee_9_Name
    varchar(50),
    @Fee_9_Fee
    varchar(50),
    @Fee_9_Commission
    varchar(50),
    @Fee_10_Name
    varchar(50),
    @Fee_10_Fee
    varchar(50),
    @Fee_10_Commission
    varchar(50),
    @ContractDate
    varchar(50),
    @InsuranceName
    varchar(50),
    @InsuranceAgentName
    varchar(50),
    @InsuranceAddress
    varchar(50),
    @InsuranceCity
    varchar(50),
    @InsuranceState
    varchar(50),
    @InsuranceZip
    varchar(50),
    @InsurancePhone
    varchar(50),
    @InsurancePolicyNumber
    varchar(50),
    @InsuranceEffectiveDate
    varchar(50),
    @InsuranceExpirationDate
    varchar(50),
    @InsuranceCompensationDeduction
    varchar(50),
    @TradeIn_1_InteriorColor
    varchar(50),
    @TradeIn_2_InteriorColor
    varchar(50),
    @PhoneBlock
    varchar(50),
    @LicensePlateNumber
    varchar(50),
    @Cost varchar(50),
    @InvoiceAmount
    varchar(50),
    @FinanceCharge
    varchar(50),
    @TotalPickupPayment
    varchar(50),
    @TotalAccessories
    varchar(50),
    @TotalDriveOffAmount
    varchar(50),
    @EmailBlock
    varchar(50),
    @ModelDescriptionOfCarSold
    varchar(50),
    @VehicleClassification
    varchar(50),
    @ModelNumberOfCarSold
    varchar(50),
    @GAPPremium
    varchar(50),
    @LastInstallmentDate
    varchar(50),
    @CashDeposit
    varchar(50),
    @AHPremium
    varchar(50),
    @LeaseRate
    varchar(50),
    @DealerSelect
    varchar(50),
    @LeasePayment
    varchar(50),
    @LeaseNetCapCost
    varchar(50),
    @LeaseTotalCapReduction
    varchar(50),
    @DealStatus
    varchar(50),
    @CustomerSuffix
    varchar(50),
    @CustomerSalutation
    varchar(50),
    @CustomerAddress2
    varchar(50),
    @CustomerMiddleName
    varchar(50),
    @GlobalOptOut
    varchar(50),
    @LeaseTerm
    varchar(50),
    @ExtendedWarrantyFlag
    varchar(50),
    @Salesman_3_Number
    varchar(50),
    @Salesman_3_Name
    varchar(50),
    @Salesman_4_Number
    varchar(50),
    @Salesman_4_Name
    varchar(50),
    @Salesman_5_Number
    varchar(50),
    @Salesman_5_Name
    varchar(50),
    @Salesman_6_Number
    varchar(50),
    @Salesman_6_Name
    varchar(50),
    @APRRate2
    varchar(50),
    @APRRate3
    varchar(50),
    @APRRate4
    varchar(50),
    @Term2
    varchar(50),
    @SecurityDeposit2
    varchar(50),
    @DownPayment2
    varchar(50),
    @TotalOfPayments2
    varchar(50),
    @BasePayment
    varchar(50),
    @JournalSaleAmount
    varchar(50),
    @IndividualBusinessFlag
    varchar(50),
    @InventoryDate
    varchar(50),
    @StatusDate
    varchar(50),
    @ListPrice
    varchar(50),
    @NetTradeAmount
    varchar(50),
    @TrimLevel
    varchar(50),
    @SubTrimLevel
    varchar(50),
    @BodyDescription
    varchar(50),
    @BodyDoorCount
    varchar(50),
    @TransmissionDesc
    varchar(50),
    @EngineDesc
    varchar(50),
    @TypeCode
    varchar(50),
    @SLCT2
    varchar(50),
    @DealDateOffset
    varchar(50),
    @AccountingDate
    varchar(50),
    @CoBuyerCustNum
    varchar(50),
    @CoBuyerCell
    varchar(50),
    @CoBuyerEmail
    varchar(50),
    @CoBuyerSalutation
    varchar(50),
    @CoBuyerPhoneBlock
    varchar(50),
    @CoBuyerMailBlock
    varchar(50),
    @CoBuyerEmailBlock
    varchar(50),
    @RealBookDate
    varchar(50),
    @CoBuyerMiddleName
    varchar(50),
    @CoBuyerCountry
    varchar(50),
    @CoBuyerAddress2
    varchar(50),
    @CoBuyerOptOut
    varchar(50),
    @CoBuyerOccupation
    varchar(50),
    @CoBuyerEmployer
    varchar(50),
    @Country
    varchar(50),
    @Occupation
    varchar(50),
    @Employer
    varchar(50),
    @Salesman2Commission
    varchar(50),
    @BankAddress
    varchar(50),
    @BankCity
    varchar(50),
    @BankState
    varchar(50),
    @BankZip
    varchar(50),
    @LeaseEstimatedMiles
    varchar(50),
    @AFTReserve
    varchar(50),
    @CreditLifePrem
    varchar(50),
    @CreditLifeRes
    varchar(50),
    @AHRes
    varchar(50),
    @Language
    varchar(50),
    @BuyRate
    varchar(50),
    @DMVAmount
    varchar(50),
    @Weight
    varchar(50),
    @StateDMVTotFee
    varchar(50),
    @ROSNumber
    varchar(50),
    @Incentives
    varchar(50),
    @CASS_STD_LINE1
    varchar(50),
    @CASS_STD_LINE2
    varchar(50),
    @CASS_STD_CITY
    varchar(50),
    @CASS_STD_STATE
    varchar(50),
    @CASS_STD_ZIP
    varchar(50),
    @CASS_STD_ZIP4
    varchar(50),
    @CASS_STD_DPBC
    varchar(50),
    @CASS_STD_CHKDGT
    varchar(50),
    @CASS_STD_CART
    varchar(50),
    @CASS_STD_LOT
    varchar(50),
    @CASS_STD_LOTORD
    varchar(50),
    @CASS_STD_URB
    varchar(50),
    @CASS_STD_FIPS
    varchar(50),
    @CASS_STD_EWS
    varchar(50),
    @CASS_STD_LACS
    varchar(50),
    @CASS_STD_ZIPMOV
    varchar(50),
    @CASS_STD_Z4LOM
    varchar(50),
    @CASS_STD_NDIAPT
    varchar(50),
    @CASS_STD_NDIRR
    varchar(50),
    @CASS_STD_LACSRT
    varchar(50),
    @CASS_STD_ERROR_CD
    varchar(50),
    @NCOA_AC_ID
    varchar(50),
    @NCOA_COA_ADDSRC
    varchar(50),
    @NCOA_COA_MATCH
    varchar(50),
    @NCOA_COA_MOVTYP
    varchar(50),
    @NCOA_COA_DATE
    varchar(50),
    @NCOA_COA_DELCD
    varchar(50),
    @NCOA_COA_RTYPE
    varchar(50),
    @NCOA_COA_RTNCD
    varchar(50),
    @NCOA_COA_LINE1
    varchar(50),
    @NCOA_COA_LINE2
    varchar(50),
    @NCOA_COA_CITY
    varchar(50),
    @NCOA_COA_STATE
    varchar(50),
    @NCOA_COA_ZIP
    varchar(50),
    @NCOA_COA_ZIP4
    varchar(50),
    @NCOA_COA_DPBC
    varchar(50),
    @NCOA_COA_CHKDGT
    varchar(50),
    @NCOA_COA_CART
    varchar(50),
    @NCOA_COA_LOT
    varchar(50),
    @NCOA_COA_LOTORD
    varchar(50),
    @NCOA_COA_URB
    varchar(50),
    @NCOA_COA_Z4LOM
    varchar(50),
    @NCOA_COA_ACTION
    varchar(50),
    @NCOA_COA_QNAME
    varchar(50),
    @NCOA_DPV_AA
    varchar(50),
    @NCOA_DPV_A1
    varchar(50),
    @NCOA_DPV_BB
    varchar(50),
    @NCOA_DPV_CC
    varchar(50),
    @NCOA_DPV_M1
    varchar(50),
    @NCOA_DPV_M3
    varchar(50),
    @NCOA_DPV_N1
    varchar(50),
    @NCOA_DPV_P1
    varchar(50),
    @NCOA_DPV_P3
    varchar(50),
    @NCOA_DPV_RR
    varchar(50),
    @NCOA_DPV_R1
    varchar(50),
    @NCOA_DPV_STATUS
    varchar(50),
    @NCOA_DPV_F1
    varchar(50),
    @NCOA_DPV_G1
    varchar(50),
    @NCOA_DPV_U1
    varchar(50),
    @myerror
    varchar(500),
    @SalesID
    int,
    @errornumber int,
                @errorseverity varchar(500),
                @errorstate int,
                @errorprocedure varchar(500),
                @errorline varchar(50),
                @errormessage varchar(1000);
    DECLARE Sales_Cursor CURSOR FOR 
    SELECT * from FLATFILE_SALES;
    OPEN Sales_Cursor;
     :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    WHILE @@FETCH_STATUS = 0
    BEGIN
    PRINT @VehicleVIN    ;
    --===============================================================================
    -- ****************** insert into Sales Table ***********
    BEGIN TRY
        INSERT INTO Sales 
    IconicDealerID,
    DealNumber,
    CustomerNumber,
    DMSType,
    ContractDate
    VALUES (@ClientDealerID,@DealNumber,@CustomerNumber,@DMSType,@ContractDate);
    END TRY
    BEGIN CATCH
         SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
           :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    @errornumber ,
                @errorseverity ,
                @errorstate,
                @errorprocedure,
                @errorline,
                @errormessage);
    END CATCH
    PRINT @errornumber;
    PRINT @errorseverity;
    PRINT @errorprocedure;
    PRINT @errorline;
    PRINT @errormessage;
    PRINT @errorstate;
    set @myerror = @@ERROR;
        -- This PRINT statement prints 'Error = 0' because
        -- @@ERROR is reset in the IF statement above.
        PRINT N'Error = ' + @myerror;
    set @SalesID = scope_identity();
    PRINT @SalesID;
    --================================================================================
    --Insert into SALES_TRADEIN Table
    BEGIN TRY
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when  @TradeIn_1_VIN is not null then @TradeIn_2_VIN end,
    case when  @TradeIn_1_Make is not null  then @TradeIn_2_Make end,
    case when  @TradeIn_1_Model is not null  then @TradeIn_2_Model end,
    case when  @TradeIn_1_ExteriorColor is not null  then @TradeIn_2_ExteriorColor end,
    case when @TradeIn_1_Year is not null  then @TradeIn_2_Year end,
    case when  @TradeIn_1_Mileage is not null  then @TradeIn_2_Mileage end,
    case when @TradeIn_1_Gross is not null  then @TradeIn_2_Gross end,
    case when @TradeIn_1_Payoff is not null  then @TradeIn_2_Payoff end,
    case when @TradeIn_1_ACV is not null  then @TradeIn_2_ACV end,
    case when  @TradeIn_1_InteriorColor is not null  then @TradeIn_2_InteriorColor end
    END TRY
    BEGIN CATCH
    SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
          :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    END CATCH

    This is what I've understood from your question. You want to replace @TradeIn_2_VIN value if @TradeIn_1_VIN
    is NULL, else the value of @TradeIn_1_VIN.
    If this is the requirement then, your CASE statement is missing ELSE part. You can re-write this as below
    case when  @TradeIn_1_VIN is null then @TradeIn_2_VIN
    ELSE @TradeIn_1_VIN end,
    or simply you can replace the CASE statement with the below
    COALESCE function,
    COALESCE(@TradeIn_1_VIN, @TradeIn_2_VIN),
    Krishnakumar S

  • BLAORD, Payment term details are not updated automatically in ME31K

    Hi,
    Thru FM IDOC_INPUT_BLAORD, am posting contracts (IDOC type: BLAORD03). I am only passing terms of payment through E1EDK01-ZTERM. I am assuming that relevant data for the payment term will be picked up from configuration. I am not passing these values through the idoc.
    ZBD1T     Cash (Prompt Payment) Discount Days
    ZBD2T     Cash (Prompt Payment) Discount Days
    ZBD3T     Cash (Prompt Payment) Discount Days
    ZBD1P     Cash Discount Percentage 1
    ZBD2P     Cash Discount Percentage 2
    But these fileds are populated with zeros (initial values) in ME31K, please suggest any note?
    Thanks.

    Hi Julie,
    Thanks for your reply..
    Here the issue is, the user using Baseline date for two specific purpose.
    1.Due day calculation-auditing purpose
    2.Agning report
    For due day calculation they recently enable the option "payment term from invoice in -OBA3".Due to active the function,system copy the payment term and baseline date from invoice to residual item.it means the residual item having baseline data as invoice date not posting date.
    But for aging report purpose it has to be update posting date.
    now user want to meet these both requirement .How can it possible .Please suggest.
    Thank you
    Regards
    Dharma

  • When inserting 3 column details in a single table using Stored Procedure.Only 1 Column details getting inserted.Other 2 Column details are not getting into the table.Please see the below script and help me to change.

    From the Parent Table i need to insert rows which are all under this column {(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN) } into SALES_TRADEIN Table .
    I have used the below Query,
    But it reads only (TradeIn _1_Vin) Column in the SALES_TRADEIN table rest 2 records got skipped..
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when @TradeIn_1_VIN is null then @TradeIn_2_VIN else @TradeIn_1_VIN end,
    case when @TradeIn_1_Make is null then @TradeIn_2_Make else @TradeIn_1_Make end,
    case when @TradeIn_1_Model is null then @TradeIn_2_Model else @TradeIn_1_Model end,
    case when @TradeIn_1_ExteriorColor is null then @TradeIn_2_ExteriorColor else @TradeIn_1_ExteriorColor end,
    case when @TradeIn_1_Year is null then @TradeIn_2_Year else @TradeIn_1_Year end,
    case when @TradeIn_1_Mileage is null then @TradeIn_2_Mileage else @TradeIn_1_Mileage end,
    case when @TradeIn_1_Gross is null then @TradeIn_2_Gross else @TradeIn_1_Gross end,
    case when @TradeIn_1_Payoff is null then @TradeIn_2_Payoff else @TradeIn_1_Payoff end,
    case when @TradeIn_1_ACV is null then @TradeIn_2_ACV else @TradeIn_1_ACV end,
    case when @TradeIn_1_InteriorColor is null then @TradeIn_2_InteriorColor else @TradeIn_1_InteriorColor end
    END TRY
    Actually my problem is
     If  [(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN)] these 3 columns have details i need all the 3 columns  details need to be read to SALES_TRADEIN table.
    Suppose if we have data only in [(TradeIn_1_VIN),(TradeIn_2_VIN)] then these column details need to loaded in the SALES_TRADEIN table.
    If any columns are blank no problem it can move next process.
    Please help me change those particular lines to insert all the 3 records  (TradeIn_1_VIN) (TradeIn_2_VIN) (TradeIn_3_VIN) in to the table.

    From SQL2008 on, besides INSERT-SELECT, and INSERT-EXEC, the INSERT-VALUES form of the insert command is improved. It can insert multiple rows like this:
    INSERT INTO my_table(MyColA, MyColB)
    VALUES
    (1, 1),
    (2, 2),
      (3, 3)
    You could also use that in SELECTs, like this:
    SELECT *
    FROM
    (    VALUES (1,2), (3,4)
    ) t(a, b)

  • Rows are not updating  in the table..

    I have a 2 EO objects and VO query which gets the data from 2 tables, now when i try to save a new row only primary key gets saved, can any one give me the solution for this

    Also just check if you query contains external join of EOs, in that case you may get into issues!
    --Mukul                                                                                                                                                                                                                                                   

  • Not updated in the table  RBKP

    Hi,
    I have created an append on the tables RBKP_V and RBKP.
    I am parking a vendor invoice in transaction MIR7.
    I'm using the BADI BADI_FDCB_SUBBAS04 to enhance MIR7 transaction. I have followed the BADI documentation.
    When I click on 'Save as completed' button :
    The customer fields are  not  updated in the table RBKP.
    Whats the solution ?
    Best Regards,
    Ramesh.S

    Hi, In my opinion, some of Custom fields should move to corresponding field in user exit to update to table.
    Example . you have add a field that zzabb into vbak , you should add code like move struct-zzabb to xvbak-zzabb.
    **"struct" is from screen field you be inputed

  • Excise Tables are not updating

    Hi,
    I have a issue in Depot sale. I created a GR against a PO. Then I posted a Excise invoice. But the excise tables are not updating.
    Why it so? Plz explain.......
    Thanks & Regards
    Saeed

    Hi,
    While doing the GR through T Code MIGO ( Good Receipt + Purchase Order) > Tick on "Item Ok" & Enter > and see one more additional menu will appear > Excise Invoice >Is there two options 1) No Excise Entry 2) Create RG23D Entry.
    If you need to update Excise detail through MIGO you can select "Create RG23D Entry" or if you not require to update Excise entry through MIGO you can select "No Excise Entry" & after generating the GR document you can proceed for Excise updation through T Code J1IG.
    Hope that you are understood.
    Thanks & Regds,
    Rajesh Kolhe

  • Unable to proceed in change document are not updating in CDHD, CDPOS tables

    Hi all,
    This is a question related to Change document.
    I created one custom Change document object ‘ZBUDGETS’.
    As I am trying to place a trigger on FMIT (Total Funds Management) table I created a Change document object ‘ZBUDGETS’.
    I included some of the authorized fields from FMIT table on which we placed the trigger.
    And of course all those fields are change document enabled in the data element level. I generation of the update program was completed. And I got the function module zbudgets_write_document along with some include programs and structure.
    Everything is fine, But i am unable to get this change document generated information to these tables are CDHDR and CDPOS.
    the problem is when I make any expenditure like PO Posting, it will be logging in the FMIT table and the respective fields also updating. With this the Change document object should trigger and it should send the record in CDHDR and CDPOS tables. This is not happening. If the records are getting updated in the CDHDR and CDPOS tables I can use those include programs and function modules in my program to retrieve the changes in FMIT table.
    Since I am unable to proceed further since the documents are not updating in CDHDR and CDPOS tables.
    Prabhakar

    CDHDR and CDPOS will not be populated with entries only by creating the change document object.Change documents will be written to CDHDR and CDPOS tables only if the function zbudgets_write_document is called in the transaction which updates FMIT.
    You need to find an use exit in the transaction updating FMIT and call the function zbudgets_write_document in that exit.
    Refer the below link http://help.sap.com/saphelp_47x200/helpdata/en/2a/fa01b6493111d182b70000e829fbfe/content.htm
    -Kiran
    *Please reward useful answers

  • File-to-rfc ..database tables are not updating??

    hi xi friends..
    in my file -to-rfc scenario.. without BPM ..
    in sxmb_moni..it is showing successfull.. database tables in sap not updating..
    my source structure..
    workorders 1..1
    ..order 1..unbounded
    ...id
    ...operation 1..unbounded
    .....id
    .....closingdate
    .....status
    .....comment
    my target is Zbapi_alm_conf_create..
    Zbapi_alm_conf_create
    ...Zdetail_return 1..1
    .....item 0..unbounded
    ...Ztimetickets
    .....item 0..unbounded
    .......orderid
    .......operation
    .......fin_conf
    .......con_text
    .......exec_fin_date
    in message mapping:
    MM_file_to_zrfc
    i changed the occurance of target to unbounded..
    message mapping like this..
    my source structure..
    workorders 1..1 
    ..order 1..unbounded   --------->Zrfc 0..unbouned
    ...id                  --------->Ztimetickets-item-order
    ...operation 1..unbounded ------>Ztimetickets-item 0..unbounded
    .....id                ---------->Ztimeticktes-item-operation
    .....closingdate       ----------->Ztimeticktes-item-exec_fin_date
    .....status            ----------->Ztimetickets-item-fin_conf
    .....comment           ------------>Ztimeticktes-item-conf_text
    and also in  interfacemapping ,changed the target occurance to unbounded.
    and in ID ,interface determination using enhanced i selected interface mapping with occurance unbounded..
    in sxmb_moni it is showing success..
    in adapter monetering( receiver).
    <i>Receiver channel 'cc_sap_work' for party '', service 'SAP_ERP__DEV' (internal name 'RfcClient[cc_sap_work]')
    Client data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=400, jco.client.passwd=****, jco.webas.ignore_jdsr_error=1, jco.client.user=aar, jco.client.sysnr=10, jco.client.ashost=53.247.192.84}
    Repository data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=400, jco.client.passwd=****, jco.webas.ignore_jdsr_error=1, jco.client.user=thotv, jco.client.sysnr=10, jco.client.ashost=53.247.192.84}
    Current pool size: 0, maximum pool size : 1
    Channel History
    - OK: 2006-12-31 14:19:47 CET: Message processed for interface ZBAPI_ALM_CONF_CREATE
    - OK: 2006-12-31 14:18:50 CET: Message processed for interface ZBAPI_ALM_CONF_CREATE</i>
    but the database tables are not updating..if i execute ZBAPI_ALM_CONF_CREATE manually in SAP ..tables are updating...
    please guide me...
    thanks in advance...
    regards
    Ram

    Hi..
    my mappis is like this..
    message                   message
    .message1                         message1       
    ..workorders 1..1 
    ..order 1..unbounded   -
    >Zrfc 0..unbouned
    ...id                  -
    >Ztimetickets-item-order
    ...operation 1..unbounded -
    >Ztimetickets-item 0..unbounded
    .....id                -
    >Ztimeticktes-item-operation
    .....closingdate       -
    >Ztimeticktes-item-exec_fin_date
    .....status            -
    >Ztimetickets-item-fin_conf
    .....comment           -
    >Ztimeticktes-item-conf_text
    i didnt mapped message at root..is this necessary to mapp messages??
    please tell me
    regards
    ram

  • HR Tables are not updated due to compression error

    We have a custom program that program used to copy data from Production system to other QA systems. The program uses the FM
    Table_decompress to decompress the file downloaded from Production and update the HR tables like PA* series in QA.
    While uploading the those tables from the file it updates half of the tables  and other tables are
    not updated as FM Table_decompress produces a exception saying "Compression error". what would be the problem here?
    Edited by: Ganesh Kumar on Feb 2, 2011 10:14 AM
    Edited by: Ganesh Kumar on Feb 2, 2011 10:25 AM

    I have provided some information below that may help.
    Step 1. Update the device using VZ Access manager. Instruction below:
    http://support.vzw.com/clc/devices/knowledge_base.html?id=14636
    Step 2. Unplug the device (if tethered), restart the computer, and try another USB port (if applicable).
    Step 4. Deleting and recreating dial-up connections.
    http://support.vzw.com/clc/devices/knowledge_base.html?id=23830
    Step 5. Try to connect.
    Step 6. (If Step 5. Fails) Disconnect, unplug the device, completely uninstall the current version of VZ Access Manager, and restart  the computer.
    Step 7. Download VZ Access Manager from our website www.vzam.net
    -On the main page, select Supported Devices on the left hand side.
    -Under the Data Devices like for Verizon Wireless USB 760 (second from the bottom of the row)
    -Select the link under the Windows 7 column for the Verizon Wireless USB 760
    -Click Download Now and Save to the desktop
    Step 7. Install VZ Access manager using the downloaded file
    -Follow the step up instructions
    -Plug in the device when prompted
    -Try to connect
    I hope this helps.

  • Folio number not updated in the table RG23D

    Hi all,
    Folio number not updated in the table RG23D when I create depot excise invoice using batch program J_1IJCHK. Can any one help me by providing rootcause and solution.
    Thanks in advance.
    Regards
    Balaji

    See can i know in which version u r working,Because if u r in 4.6c there will be some problem.Some patches will be there.
    Try this program i have send and assign excise duty
    REPORT YJ_1IJCHK MESSAGE-ID 8I.
    TABLES :  J_1IEXCHDR,                  "excise header
              J_1IEXCDTL,                  "excise detail
              J_1IRG23D ,                  "RG23D register
              J_1IWRKCUS,                  "Plant level customisation
              J_1IREGSET,                  "register set customisation
              J_1IEXCDEF,                  "Tax default information
              VBFA,                        "sales document flow
              LIKP,                        "delivery header
              LIPS,                        "delivery detail
              T005,                        "country information
              KUAGV,                       "sold-to-party information
              KUWEV,                       "ship-to-party information
              KNA1,                        "customer master
              VBPA,                        "sales document partner
              TVKO,                        "sales organisation to company co
              VBUK,                        "delivery information
              MAKT,                        "material description
              T001.                        "company code
    selection-screen begin of block delivery_details no intervals.
    PARAMETERS: FCODE    TYPE C,
                DELIVERY LIKE LIPS-VBELN,
                EXCGROUP LIKE J_1IEXCHDR-EXGRP,
                SERGROUP LIKE J_1IEXCHDR-SRGRP.
    TYPES : BEGIN OF RG23D.
            INCLUDE STRUCTURE J_1IRG23D.
    TYPES:  MENGR LIKE J_1IEXCDTL-MENGR,           "remaining quantity
            MENGA LIKE J_1IEXCDTL-MENGA,           "quantity actually rec
            ADDBED LIKE J_1IEXCDTL-ADDBED,
            ADDSED LIKE J_1IEXCDTL-ADDSED,
            ADDAED LIKE J_1IEXCDTL-ADDAED,
            END OF RG23D.
    DATA : BEGIN OF J1IJ300,
            BUKRS   LIKE TVKO-BUKRS,
            WERKS   LIKE LIPS-WERKS,
            REGID   LIKE J_1IREGSET-J_1IREGID,
            WAERS   LIKE T001-WAERS,
            SHIPFROM_IND TYPE C,                          " Added 10/12/1998
            RG23D_SERIALNO TYPE C,                        " Added 10/12/1998
         END OF J1IJ300.
    DATA :  TRNTYP(4)   TYPE C,
            CONDT-NAME(3) TYPE C,
            TOTAL_LRG23D   LIKE LIPS-LFIMG,
            ALLOC_LRG23D   LIKE LIPS-LFIMG,
            SHIPFROM_IND   LIKE J_1IEXCHDR-STATUS,
            RG23D_SERIALNO LIKE J_1IEXCHDR-STATUS.
    DATA : BEGIN OF XLIPS OCCURS 10,
    internal table to store the delivery item information
             VBELN LIKE LIPS-VBELN,
             POSNR LIKE LIPS-POSNR,
             MATNR LIKE LIPS-MATNR,
             MAKTX LIKE MAKT-MAKTX,
             WERKS LIKE LIPS-WERKS,
             LGORT LIKE LIPS-LGORT,
             CHARG LIKE LIPS-CHARG,
             LFIMG LIKE LIPS-LFIMG,
             MEINS LIKE LIPS-MEINS,
             BED   LIKE J_1IRG23D-EXBED,
             SED   LIKE J_1IRG23D-EXSED,
             AED   LIKE J_1IRG23D-EXAED,
             CUR   LIKE J_1IRG23D-EXCUR,
             SELFLAG TYPE C ,              "T=excise invoice selected
             INDEX LIKE SY-TABIX,          "index in the table
             FLG TYPE C.                   "item selection
    DATA : END OF XLIPS.
    DATA : CRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
    contains all rg23d entries for the document
    DATA : LRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
    contains item rg23d entries
    DATA : BEGIN OF Z_1IRG23D OCCURS 30.
    stores the data to be updated
            INCLUDE STRUCTURE J_1IRG23D.
    DATA : END OF Z_1IRG23D.
    DATA : BEGIN OF EXCINV OCCURS 30.
    factory inovoics selected for item
            INCLUDE STRUCTURE J_1IEXCDTL.
    DATA : END OF EXCINV.
    DATA : BEGIN OF ASSIGNED_EXCINV OCCURS 30.
            INCLUDE STRUCTURE J_1IEXCDTL.
    DATA : END OF ASSIGNED_EXCINV.
    DATA : A_INDEX LIKE SYST-TABIX.
    DATA : BEGIN OF LOCK_TABLE OCCURS 10,
    table containing plant-material combination and status of the lock
              WERKS  LIKE J_1IEXCDTL-WERKS,
              MATNR  LIKE J_1IEXCDTL-MATNR,
              STATUS TYPE C,                   "LOCKED/UNLOCKED
           END OF LOCK_TABLE.
    DATA : BEGIN OF LOCKTAB OCCURS 0,
               TRNTYP LIKE J_1IEXCDTL-TRNTYP,
               DOCNO  LIKE J_1IEXCDTL-DOCNO,
               DOCYR LIKE  J_1IEXCDTL-DOCYR,
               ZEILE LIKE  J_1IEXCDTL-ZEILE,
            END OF LOCKTAB.
    DATA :
          CRG23D-CTR  TYPE I,              "Line count of crg23d table
          SHIPFROM    LIKE J_1IRG23D-SHIPFROM,
          FOLIO       LIKE J_1IRG23D-FOLIO,
          SERIALNO    LIKE J_1IRG23D-SERIALNO,
          DEPEXNUM    LIKE J_1IRG23D-DEPEXNUM,
          DEPEXYEAR   LIKE J_1IRG23D-DEPEXYEAR.
    CONSTANTS :
       BED       LIKE CONDT-NAME VALUE 'BED',
       AED       LIKE CONDT-NAME VALUE 'AED',
       SED       LIKE CONDT-NAME VALUE 'SED',
       CES       LIKE CONDT-NAME VALUE 'CES',
       LOCKED    TYPE C          VALUE '1',
       UNLOCKED  TYPE C          VALUE '2'.
    AT SELECTION-SCREEN.
       PERFORM CHECK_VBELN_INPUT.
    IF     FCODE = 'S'.
           PERFORM DELIVERY_START_USER_EXIT.
           PERFORM READ_DELIVERY_HEADER.
           PERFORM GET_COMP_CODE.
           PERFORM READ_CUSTOMISATION.
           PERFORM GET_ITEM_INFO.
           PERFORM LOCKING.
           PERFORM RG23D_SELECTION.
           PERFORM SAVE_DOCUMENT.
           MESSAGE I000 WITH 'Selection Complete for Delivery ' DELIVERY.
    ELSEIF FCODE = 'V'.
           PERFORM GET_COMP_CODE.
           PERFORM READ_CUSTOMISATION.
           PERFORM GET_ITEM_INFO.
           PERFORM LOCKING.
           PERFORM UPDATE_DOCUMENT.
           MESSAGE I000 WITH 'Verfiy/Post Complete for Delivery ' DELIVERY.
    ENDIF.
    FORM CHECK_VBELN_INPUT.
    Validate Function Code
       IF NOT ( FCODE = 'S' OR FCODE = 'V' ).
         MESSAGE E000 WITH 'Valid Functions are S/V - Select/Verify Post'.
       ENDIF.
      IF DELIVERY IS INITIAL.
         MESSAGE E000 WITH 'Delivery number cannot be initial'.
      ENDIF.
    check if goods issue done for the delivery
        SELECT SINGLE WBSTK INTO VBUK-WBSTK
            FROM  VBUK
            WHERE VBELN = DELIVERY.
        IF  SY-SUBRC = 0.
            IF VBUK-WBSTK <> 'C' AND FCODE = 'V'.
               MESSAGE W339 WITH DELIVERY.
            ENDIF.
        ELSE.
               MESSAGE E000 WITH 'Invalid Delivery'.
        ENDIF.
    if in select mode check if excise invoice already selected for delive
        SELECT SINGLE * FROM J_1IRG23D
            WHERE VBELN = DELIVERY.
        IF     FCODE = 'S'.
               IF SY-SUBRC = 0.
                  MESSAGE E325 WITH DELIVERY.
               ENDIF.
        ELSEIF FCODE = 'V'.
               IF     SY-SUBRC NE 0.
                      MESSAGE E000 WITH 'Selection not over for ' DELIVERY.
               ELSEIF J_1IRG23D-STATUS = 'P'.
                      MESSAGE E000 WITH 'Record Already Posted '.
               ENDIF.
        ENDIF.
      CLEAR J_1IRG23D.
    ENDFORM.                    " CHECK_VBELN_INPUT
    FORM READ_DELIVERY_HEADER.
      SELECT SINGLE * FROM LIKP
        WHERE VBELN = DELIVERY.
    get the sold-to-party
      CLEAR: KUAGV, KUWEV.
      SELECT SINGLE KUNNR NAME1 LAND1
              FROM KNA1 INTO (KUAGV-KUNNR,KUAGV-NAME1,KUAGV-LAND1)
         WHERE KUNNR = LIKP-KUNAG.
    get the ship-to-party
      SELECT SINGLE KUNNR LAND1 NAME1
              FROM KNA1 INTO (KUWEV-KUNNR,KUWEV-LAND1,KUWEV-NAME1)
          WHERE KUNNR = LIKP-KUNNR.
    ENDFORM.                    " READ_DELIVERY_HEADER
    FORM GET_COMP_CODE.
    get the company code of the document from the sales organisation
      CLEAR TVKO-BUKRS.
      SELECT SINGLE BUKRS FROM TVKO INTO TVKO-BUKRS
        WHERE VKORG = LIKP-VKORG.
      J1IJ300-BUKRS = TVKO-BUKRS.
      SELECT SINGLE WAERS FROM T001 INTO J1IJ300-WAERS
        WHERE BUKRS = J1IJ300-BUKRS.
    ENDFORM.                    " GET_COMP_CODE
    FORM READ_CUSTOMISATION.
      SELECT SINGLE WERKS INTO J1IJ300-WERKS
           FROM   LIPS
           WHERE  VBELN = DELIVERY.
    Plant level customisation
      SELECT SINGLE * FROM  J_1IWRKCUS
             WHERE  J_1IWERKS   = J1IJ300-WERKS .
      IF SY-SUBRC <> 0.
        MESSAGE E303 WITH 'plant' J1IJ300-WERKS 'J_1IWRKCUS'.
      ENDIF.
      IF J_1IWRKCUS-J_1IDEPOT IS INITIAL.
    plant is defined as factory
        MESSAGE E322 WITH J1IJ300-WERKS.
      ENDIF.
      J1IJ300-REGID = J_1IWRKCUS-J_1IREGID.
      TRNTYP = 'DLDO'.
      SELECT SINGLE * FROM J_1IREGSET
           WHERE J_1IREGID = J1IJ300-REGID.
      IF SY-SUBRC <> 0.
        MESSAGE E303 WITH 'Register id' J1IJ300-REGID 'J_1IREGSET'.
      ENDIF.
    ENDFORM.                    " READ_CUSTOMISATION
    *&      Form  GET_ITEM_INFO
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GET_ITEM_INFO.
      REFRESH : CRG23D, LRG23D, EXCINV, XLIPS.
      PERFORM READ_DELIVERY_ITEM.
    ENDFORM.                    " GET_ITEM_INFO
    *&      Form  READ_DELIVERY_ITEM
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM READ_DELIVERY_ITEM.
      DATA : CNT LIKE SY-TABIX.
      CLEAR CNT.
      REFRESH XLIPS.
      SELECT * FROM LIPS
         WHERE VBELN = DELIVERY.
    read the delivery item
    perform plant checking only if in create mode
          IF LIPS-WERKS <> J1IJ300-WERKS.
    plant is different from that of the first item
            SELECT SINGLE J_1IREGID INTO J_1IWRKCUS-J_1IREGID
                 FROM   J_1IWRKCUS
                 WHERE  J_1IWERKS = LIPS-WERKS.
            IF SY-SUBRC <> 0.
              MESSAGE E303 WITH 'plant' LIPS-WERKS 'J_1IWRKCUS'.
            ENDIF.
            IF J_1IWRKCUS-J_1IREGID <> J1IJ300-REGID.
    register id of the two plants are different
              MESSAGE E338 WITH DELIVERY.
            ENDIF.
          ENDIF.
        CLEAR XLIPS.
    store the item details
        XLIPS-VBELN = LIPS-VBELN.
        XLIPS-POSNR = LIPS-POSNR.
        XLIPS-MATNR = LIPS-MATNR.
        PERFORM GET_MATERIAL_DESC
              USING XLIPS-MATNR
                    XLIPS-MAKTX.
       XLIPS-WERKS = LIPS-WERKS.
       XLIPS-LGORT = LIPS-LGORT.
       XLIPS-CHARG = LIPS-CHARG.
       XLIPS-LFIMG = LIPS-LFIMG.
       XLIPS-MEINS = LIPS-VRKME.                           "changed 2.3.98
       CLEAR : XLIPS-BED, XLIPS-SED, XLIPS-AED.
       XLIPS-CUR = J1IJ300-BUKRS.
       CNT = CNT + 1.
       XLIPS-INDEX = CNT.
       XLIPS-SELFLAG = 'F'.
       APPEND XLIPS.
    ENDSELECT.
    ENDFORM.                    " READ_DELIVERY_ITEM
    *&      Form  GET_MATERIAL_DESC
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GET_MATERIAL_DESC USING MATNR MAKTX.
      SELECT SINGLE MAKTX FROM  MAKT INTO MAKTX
             WHERE  MATNR       = MATNR
             AND    SPRAS       = 'E'            .
    ENDFORM.                               " GET_MATERIAL_DESC
    *&      Form  LOCKING
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM LOCKING.
    REFRESH LOCK_TABLE.
    LOOP AT XLIPS.
      LOCK_TABLE-WERKS  = XLIPS-WERKS.
      LOCK_TABLE-MATNR  = XLIPS-MATNR.
      LOCK_TABLE-STATUS = UNLOCKED.
      COLLECT LOCK_TABLE.
    ENDLOOP.
    PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING LOCKED.
      SELECT TRNTYP DOCNO DOCYR ZEILE INTO
          (LOCKTAB-TRNTYP,
          LOCKTAB-DOCNO,LOCKTAB-DOCYR,
          LOCKTAB-ZEILE)
                              FROM   J_1IEXCDTL
                          WHERE TRNTYP = 'GRPO'
                          AND  WERKS = XLIPS-WERKS
                          AND  LGORT = XLIPS-LGORT
                          AND  MATNR = XLIPS-MATNR
                          AND  CHARG = XLIPS-CHARG.
        APPEND LOCKTAB.
      ENDSELECT.
    *share lock for all excise invoices
      LOOP AT LOCKTAB.
        CALL FUNCTION 'ENQUEUE_EJ_1IEXDTL'
             EXPORTING
                  MODE_J_1IEXCDTL = 'S'
                  MANDT           = SY-MANDT
                  TRNTYP          = LOCKTAB-TRNTYP
                  DOCYR           = LOCKTAB-DOCYR
                  DOCNO           = LOCKTAB-DOCNO
                  ZEILE           = LOCKTAB-ZEILE
             EXCEPTIONS
                  FOREIGN_LOCK    = 1
                  SYSTEM_FAILURE  = 2
                  OTHERS          = 3.
      ENDLOOP.
    ENDFORM.                    " LOCKING
    *&      Form  LOCK_UNLOCK_PLANT_MATERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM LOCK_UNLOCK_PLANT_MATERIAL USING ACTION.
      DATA: __UNAME  LIKE SY-UNAME,
            __OBJECT LIKE DD25V-VIEWNAME.
      DATA : BEGIN OF LOCK_STRUCT,
               GRANNAME(10)   VALUE 'J1IJ',
               ENQMODE        VALUE 'E',
               MANDT          LIKE  SY-MANDT,
               WERKS          LIKE  J_1IEXCDTL-WERKS,
               MATNR          LIKE  J_1IEXCDTL-MATNR,
            END OF LOCK_STRUCT.
      LOCK_STRUCT-MANDT = SY-MANDT.
      LOOP AT LOCK_TABLE WHERE STATUS <> ACTION.
    perform the locking/unlocking operation only for the items for which
    it is not already done
        LOCK_STRUCT-WERKS = LOCK_TABLE-WERKS.
        LOCK_STRUCT-MATNR = LOCK_TABLE-MATNR.
       CALL 'C_ENQUEUE'
         ID 'OPCODE'           FIELD ACTION
         ID 'ENQOBJ'           FIELD 'J_1IJ'
         ID '01'               FIELD LOCK_STRUCT
         ID 'COLLISION_UNAME'  FIELD __UNAME
         ID 'COLLISION_OBJECT' FIELD __OBJECT.
       CASE SY-SUBRC.
         WHEN 0.
           LOCK_TABLE-STATUS = ACTION.
           MODIFY LOCK_TABLE.
         WHEN 2.
           MESSAGE E341 WITH LOCK_TABLE-WERKS LOCK_TABLE-MATNR  __UNAME.
         WHEN OTHERS.
           IF ACTION = LOCKED.
             MESSAGE E342 WITH 'locking'
                               LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
           ELSE.
             MESSAGE E342 WITH 'unlocking'
                               LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
           ENDIF.
       ENDCASE.
      ENDLOOP.
    ENDFORM.                    " LOCK_UNLOCK_PLANT_MATERIAL
    *&      Form  RG23D_SELECTION
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM RG23D_SELECTION.
    REFRESH CRG23D.
    REFRESH ASSIGNED_EXCINV.
    LOOP AT XLIPS.
    *write: / xlips-vbeln,xlips-posnr,xlips-matnr, xlips-meins, xlips-lfimg.
    REFRESH EXCINV.
    CALL FUNCTION 'J_1I6_SELECT_EXCISE_INVOICE_DE'
         EXPORTING
             BUKRS        = J1IJ300-BUKRS
             CHARG        = XLIPS-CHARG
             WERKS        = XLIPS-WERKS
             EXGRP        = EXCGROUP
             MATNR        = XLIPS-MATNR
             QTY_CHECK    = 'X'
             MULTI        = 'X'
             NO_DAY_CHECK = 'X'
             SHIPFROM     = SHIPFROM
             LGORT        = XLIPS-LGORT
         TABLES
              EXC_TAB     = EXCINV
         EXCEPTIONS
              OTHERS       = 1.
         TOTAL_LRG23D = 0.
         ALLOC_LRG23D = 0.
         SORT EXCINV BY DOCYR DOCNO .
         LOOP AT ASSIGNED_EXCINV.
            READ TABLE EXCINV WITH KEY DOCYR = ASSIGNED_EXCINV-DOCYR
                                     DOCNO = ASSIGNED_EXCINV-DOCNO
                                     ZEILE = ASSIGNED_EXCINV-ZEILE
                                     BINARY SEARCH.
            IF SY-SUBRC = 0.
               A_INDEX = SY-TABIX.
               EXCINV-MENGR = EXCINV-MENGR - ASSIGNED_EXCINV-MENGR.
               MODIFY EXCINV INDEX A_INDEX .
            ENDIF.
         ENDLOOP.
         DELETE EXCINV WHERE MENGR = 0.
    total_lrg23d = total balance quantity in the selected excise invoices
    alloc_lrg23d = Quantity allocated to a delivery line item,
    Allocation continues till
      - We have balance quantity in excise invoice selection
      - Till total delivery quantity is allocated
        LOOP AT EXCINV.
      To Force the same shipfrom for all the excise invoices
      Shipfrom Ind can be determined in the start user-exit
        IF  J1IJ300-SHIPFROM_IND = 'Y'.
            IF  XLIPS-INDEX = 1 AND SY-TABIX = 1.
                SHIPFROM = EXCINV-SHIPFROM.
            ENDIF.
            IF SHIPFROM NE EXCINV-SHIPFROM.
               EXCINV-RIND3 = 'X'.
               MODIFY EXCINV.
               CONTINUE.
            ENDIF.
        ENDIF.
      Allocation
        IF XLIPS-LFIMG NE ALLOC_LRG23D.
            TOTAL_LRG23D = TOTAL_LRG23D + EXCINV-MENGR.
            IF XLIPS-LFIMG > TOTAL_LRG23D.
               ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
            ELSE.
               EXCINV-MENGR = XLIPS-LFIMG - ALLOC_LRG23D.
               ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
            ENDIF.
        ELSE.
               EXCINV-RIND3 = 'X'.
         ENDIF.
         MODIFY EXCINV.
         ENDLOOP.
         DELETE EXCINV WHERE RIND3 = 'X'.
         LOOP AT EXCINV.
            MOVE-CORRESPONDING EXCINV TO ASSIGNED_EXCINV.
            APPEND ASSIGNED_EXCINV.
            CLEAR ASSIGNED_EXCINV.
         ENDLOOP.
         IF TOTAL_LRG23D < XLIPS-LFIMG.
            MESSAGE E000 WITH 'Not enough balance in RG23D ......'.
        ENDIF.
    Collect all allocated excise invoices to crg23d table
      LOOP AT EXCINV.
        PERFORM FILL_CRG23D.
        APPEND CRG23D.
      ENDLOOP.
    ENDLOOP.
    ENDFORM.                    " RG23D_SELECTION
    *&      Form  SAVE_DOCUMENT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM SAVE_DOCUMENT.
          PERFORM PREPARE_RG23D_DATA.
    Generate RG23D serial number and Excise Invoice Serial Number
       IF J1IJ300-RG23D_SERIALNO = 'Y'.
       PERFORM GENERATE_RG23D_SERIAL ON COMMIT.
       ENDIF.
       PERFORM GENERATE_EXCISE_INV_SERIAL ON COMMIT.
         CALL FUNCTION 'J_1I7_USEREXIT_DEPOT_BEF_SAVE'
              TABLES
                   RG23D   = Z_1IRG23D
              EXCEPTIONS
                   OTHERS  = 1.
         PERFORM UPDATE_RG23D ON COMMIT.
         PERFORM UPDATE_EXCDTL ON COMMIT.
         COMMIT WORK.
        PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING UNLOCKED.
         PERFORM UNLOCKING.
         MESSAGE S333 WITH DELIVERY.
    ENDFORM.                    " SAVE_DOCUMENT
    *&      Form  PREPARE_RG23D_DATA
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM PREPARE_RG23D_DATA.
      REFRESH Z_1IRG23D.
      LOOP AT CRG23D WHERE MENGE <> 0.
        CLEAR Z_1IRG23D.
        Z_1IRG23D = CRG23D.
        Z_1IRG23D-USNAM = SY-UNAME.
        Z_1IRG23D-CPUDT = SY-DATUM.
        Z_1IRG23D-EXGRP    = EXCGROUP.
        Z_1IRG23D-SRGRP    = SERGROUP.
        APPEND Z_1IRG23D.
        IF CRG23D-ADDAED <> 0 OR CRG23D-ADDSED <> 0 OR CRG23D-ADDAED <> 0 .
    additional excise is applicable
    make quantity zero for A certificate entries
          CLEAR : Z_1IRG23D-MENGE.
    get all the A certificates for the excise document item
          SELECT * FROM J_1IEXCDTL
    TODO : add the transaction type to the selection procedure
                 WHERE RDOC1    = CRG23D-DOCNO
                 AND   RYEAR1   = CRG23D-DOCYR
                 AND   RITEM1   = CRG23D-ZEILE
                 AND   RIND1    = 'G'.
    get the A certificate number
            SELECT SINGLE
                   EXNUM EXYEAR INTO (Z_1IRG23D-EXNUM, Z_1IRG23D-EXYEAR)
                   FROM  J_1IEXCHDR
                   WHERE  TRNTYP = J_1IEXCDTL-TRNTYP
                   AND    DOCYR  = J_1IEXCDTL-DOCYR
                   AND    DOCNO  = J_1IEXCDTL-DOCNO.
            Z_1IRG23D-TRNTYP = J_1IEXCDTL-TRNTYP.
            Z_1IRG23D-DOCYR  = J_1IEXCDTL-DOCYR.
            Z_1IRG23D-DOCNO  = J_1IEXCDTL-DOCNO.
            Z_1IRG23D-ZEILE  = J_1IEXCDTL-ZEILE.
            Z_1IRG23D-EXBED  = ( J_1IEXCDTL-EXBED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-EXSED  = ( J_1IEXCDTL-EXSED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-EXAED  = ( J_1IEXCDTL-EXAED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-RG23ASER = J_1IEXCDTL-RG23ASER.
            Z_1IRG23D-RG23CSER = J_1IEXCDTL-RG23CSER.
            Z_1IRG23D-RGPLASER = J_1IEXCDTL-RGPLASER.
            APPEND Z_1IRG23D.
          ENDSELECT.
        ENDIF.
    ENDLOOP.
    ENDFORM.                    " PREPARE_RG23D_DATA
    *&      Form  UPDATE_RG23D
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_RG23D.
    *update the rg23d register
      INSERT J_1IRG23D FROM TABLE Z_1IRG23D ACCEPTING DUPLICATE KEYS.
      IF SY-SUBRC <> 0.
        MESSAGE A308 WITH 'J_1IRG23D'.
      ENDIF.
    ENDFORM.                    " UPDATE_RG23D
    *&      Form  UPDATE_EXCDTL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_EXCDTL.
      LOOP AT CRG23D WHERE MENGE <> 0.
    update the remaining quantity in the excise invoice item tables
        UPDATE J_1IEXCDTL
           SET      MENGR   = MENGR - CRG23D-MENGE
                    AENAM   = SY-UNAME
                    AEDAT   = SY-DATUM
           WHERE    TRNTYP  = 'GRPO'
             AND    DOCYR   = CRG23D-DOCYR
             AND    DOCNO   = CRG23D-DOCNO
             AND    ZEILE   = CRG23D-ZEILE.
        IF SY-SUBRC <> 0.
          MESSAGE A308 WITH 'J_1IRG23D'.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " UPDATE_EXCDTL
    *&      Form  FILL_CRG23D
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM FILL_CRG23D.
      CRG23D-TRNTYP   = EXCINV-TRNTYP.
      CRG23D-DOCYR    = EXCINV-DOCYR.
      CRG23D-DOCNO    = EXCINV-DOCNO.
      CRG23D-ZEILE    = EXCINV-ZEILE.
      CRG23D-VBELN    = XLIPS-VBELN.
      CRG23D-POSNR    = XLIPS-POSNR.
      CRG23D-EXNUM    = EXCINV-EXNUM.
      CRG23D-EXYEAR   = EXCINV-EXYEAR.
      CRG23D-LIFNR    = EXCINV-LIFNR.
      CRG23D-MATNR    = EXCINV-MATNR.
      CRG23D-MAKTX    = EXCINV-MAKTX.
      CRG23D-CHAPID   = EXCINV-CHAPID.
      CRG23D-MEINS    = EXCINV-MENGR_UOM.
      CRG23D-WERKS    = EXCINV-WERKS.
      CRG23D-EXCUR    = EXCINV-EXCUR.
      CRG23D-RG23ASER = EXCINV-RG23ASER.
      CRG23D-RG23CSER = EXCINV-RG23CSER.
      CRG23D-RGPLASER = EXCINV-RGPLASER.
      CRG23D-MENGR    = EXCINV-MENGR.
      CRG23D-MENGA    = EXCINV-MENGA.
      CRG23D-MENGE    = EXCINV-MENGR.            " Move the allocated Qty
      CRG23D-EXBED    = ( EXCINV-EXBED  * CRG23D-MENGE ) / EXCINV-MENGA.
      CRG23D-EXSED    = ( EXCINV-EXSED  * CRG23D-MENGE ) / EXCINV-MENGA.
      CRG23D-EXAED    = ( EXCINV-EXAED  * CRG23D-MENGE ) / EXCINV-MENGA.
    ENDFORM.                    " FILL_CRG23D
    *&      Form  UPDATE_DOCUMENT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_DOCUMENT.
    LOOP AT XLIPS.
      UPDATE J_1IRG23D SET STATUS = 'P'
      WHERE  VBELN       = XLIPS-VBELN
      AND    POSNR       = XLIPS-POSNR.
    ENDLOOP.
    COMMIT WORK.
    ENDFORM.                    " UPDATE_DOCUMENT
    *&      Form  DELIVERY_START_USER_EXIT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM DELIVERY_START_USER_EXIT.
    CALL FUNCTION 'J_1I7_USEREXIT_EXGRP_DETERM'
         EXPORTING
              EXCGRP         = EXCGROUP
            MBLNR          =
            MJAHR          =
            VENDOR         =
              VBELN          = DELIVERY
         IMPORTING
              EXCGRP         = EXCGROUP
              SHIPFROM_IND   = J1IJ300-SHIPFROM_IND
              RG23D_SERIALNO = J1IJ300-RG23D_SERIALNO
         EXCEPTIONS
              OTHERS         = 1.
    CALL FUNCTION 'J_1I7_USEREXIT_SERGRP_DETERM'
         EXPORTING
              SRGRP          = SERGROUP
            MBLNR          =
            MJAHR          =
              VBELN          = DELIVERY
         IMPORTING
              SRGRP          = SERGROUP
         EXCEPTIONS
              OTHERS         = 1.
    ENDFORM.                    " DELIVERY_START_USER_EXIT
    *&      Form  GENERATE_RG23D_SERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GENERATE_RG23D_SERIAL.
      LOOP AT Z_1IRG23D WHERE MENGE <> 0.
      CLEAR: FOLIO, SERIALNO.
      SELECT MAX( FOLIO ) MAX( SERIALNO )
      INTO   (Z_1IRG23D-FOLIO, Z_1IRG23D-SERIALNO)
      FROM   J_1IRG23D
      WHERE  TRNTYP = Z_1IRG23D-TRNTYP
      AND    DOCNO  = Z_1IRG23D-DOCNO
      AND    DOCYR  = Z_1IRG23D-DOCYR
      AND    ZEILE  = Z_1IRG23D-ZEILE.
      MODIFY Z_1IRG23D.
      ENDLOOP.
    ENDFORM.                    " GENERATE_RG23D_SERIAL
    *&      Form  GENERATE_EXCISE_INV_SERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GENERATE_EXCISE_INV_SERIAL.
      CLEAR: DEPEXNUM, DEPEXYEAR.
    CALL FUNCTION 'J_1I6_DETERMINE_EXC_YEAR'
         EXPORTING
              I_BUKRS      = J1IJ300-BUKRS
         IMPORTING
              EXCISE_YEAR  = DEPEXYEAR
         EXCEPTIONS
              MISS_COMPANY = 1
              OTHERS       = 2.
      IF SY-SUBRC NE 0.
        MESSAGE E526 WITH 'Company ' J1IJ300-BUKRS.
      ENDIF.
      CALL FUNCTION 'NUMBER_GET_NEXT'
           EXPORTING
                NR_RANGE_NR             = '01'
                OBJECT                  = 'J_1IDEPINV'
                QUANTITY                = '1'
                SUBOBJECT               = SERGROUP
                TOYEAR                  = DEPEXYEAR
           IMPORTING
                NUMBER                  = DEPEXNUM
           EXCEPTIONS
                INTERVAL_NOT_FOUND      = 1
                NUMBER_RANGE_NOT_INTERN = 2
                OBJECT_NOT_FOUND        = 3
                QUANTITY_IS_0           = 4
                QUANTITY_IS_NOT_1       = 5
                INTERVAL_OVERFLOW       = 6
                OTHERS                  = 7.
      CASE SY-SUBRC.
        WHEN 0.
        WHEN 1.
          MESSAGE A336 WITH 'internal document' ': Interval not found'
                            '. Number object : J_1IDEPINV'.
        WHEN 3.
          MESSAGE A336 WITH 'internal document' ': Object not found'
                            '. Number object : J_1IDEPINV'.
        WHEN OTHERS.
          MESSAGE A336 WITH 'internal document'
                            '. Number object : J_1IDEPINV'.
      ENDCASE.
    Update Depot Excise Invoice Year and Number in the table
      LOOP AT Z_1IRG23D.
        Z_1IRG23D-SERIALNO  = Z_1IRG23D-SERIALNO + 1.
        Z_1IRG23D-DEPEXYEAR = DEPEXYEAR.
        Z_1IRG23D-DEPEXNUM  = DEPEXNUM.
        MODIFY Z_1IRG23D.
      ENDLOOP.
    ENDFORM.                    " GENERATE_EXCISE_INV_SERIAL
    *&      Form  UNLOCKING
          text
    -->  p1        text
    <--  p2        text
    FORM UNLOCKING.
      LOOP AT LOCKTAB.
        CALL FUNCTION 'DEQUEUE_EJ_1IEXDTL'
             EXPORTING
                  MODE_J_1IEXCDTL = 'S'
                  MANDT           = SY-MANDT
                  TRNTYP          = LOCKTAB-TRNTYP
                  DOCYR           = LOCKTAB-DOCYR
                  DOCNO           = LOCKTAB-DOCNO
                  ZEILE           = LOCKTAB-ZEILE.
      ENDLOOP.
    ENDFORM.                    " UNLOCKING

  • Excise Base amount not updated in J_1iexcdtl table -reg

    Dear Gurus,
    We have used SAP Ecc 5.0 Patch level 21. In patch level 20, SAP admit without delivery , can do commercial billing and excise billing in foreground. After batch update SAP not support excise invoice creation in foreground. It support only background. We have 2 senario. 1 is capex sales . ie. without material stock we have raise the comm.billing and excise billing. 2 is supplimentary billing. both the senario now getting effected because of no delivery. Asper SAP advise we have setting for background process excise invoice creation. Excise invoice created. but excise base amount not updated in j_1iexcdtl table. Using J_1I7_USEREXIT_CALC_EXC_BASE user exit we are trying to update the same. For single material it works fine. But more than one material for the first material's base amount is updated in all materials. for your reference i have mentioned the codding . SAP advise it is possible to update excise base amount. But not possible to do. pl.adivse if any correct or guide to solve it.
    FUNCTION J_1I7_USEREXIT_CALC_EXC_BASE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(EXCITM_BASE) TYPE  KOMV-KAWRT
    *"     VALUE(POSNR) TYPE  VBRP-POSNR
    *"  EXPORTING
    *"     VALUE(EXCITM_BASE) TYPE  KOMV-KAWRT
    *"  TABLES
    *"      KONV STRUCTURE  KONV
    *{   INSERT         RDSK925285                                        1
    TABLES : KONV.
    data :   W_INDEX LIKE SY-TABIX.
    DATA :ITAB LIKE TABLE OF KONV WITH HEADER LINE.
    DATA :ITAB1 LIKE TABLE OF KOmV WITH HEADER LINE.
    ITAB1[] = KONV[].
    DATA : BEGIN OF I_TAB OCCURS 0,
           KAWRT LIKE KONV-KAWRT,
           POSNR LIKE VBRP-POSNR,
           END OF I_TAB.
    LOOP AT ITAB1.
    READ TABLE ITAB1 WITH KEY KSCHL = 'JMOD' KPOSN = ITAB1-KPOSN.
    IF SY-SUBRC EQ 0.
        EXCITM_BASE = ITAB1-KAWRT.
        POSNR = ITAB1-KPOSN.
    ENDIF.
    ENDLOOP.
    *}   INSERT
    ENDFUNCTION.
    Thanks & Regards
    R.Udayakumar

    solved with the same user exit

  • Excise values are not updating in factory sales

    Dear SCN's,
    I'm facing an issue while doing factory sales, while creating sales order and billing I'm using J1IIN for excise invoice and then updating in J1I5 transaction but the values are not updating in table J_2IRG1BAL. Can anyone suggest what to do in order to get the values updated in table.
    Thanks & Regards,
    Kumar

    The following note explains how you need to update J_2IRG1BAL table.
    Note 951955 - CIN: General clarifications for RG1 goods
    Have a look at this.
    G. Lakshmipathi

Maybe you are looking for